diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Witch.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Witch.java.patch | 265 |
1 files changed, 265 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Witch.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Witch.java.patch new file mode 100644 index 0000000000..adb4184435 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Witch.java.patch @@ -0,0 +1,265 @@ +--- a/net/minecraft/world/entity/monster/Witch.java ++++ b/net/minecraft/world/entity/monster/Witch.java +@@ -17,10 +17,10 @@ + import net.minecraft.world.effect.MobEffects; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityDimensions; ++import net.minecraft.world.entity.EntityPose; + import net.minecraft.world.entity.EntityType; + import net.minecraft.world.entity.EquipmentSlot; + import net.minecraft.world.entity.LivingEntity; +-import net.minecraft.world.entity.Pose; + import net.minecraft.world.entity.ai.attributes.AttributeInstance; + import net.minecraft.world.entity.ai.attributes.AttributeModifier; + import net.minecraft.world.entity.ai.attributes.AttributeSupplier; +@@ -55,16 +55,15 @@ + private NearestHealableRaiderTargetGoal<Raider> healRaidersGoal; + private NearestAttackableWitchTargetGoal<Player> attackPlayersGoal; + +- public Witch(EntityType<? extends Witch> entitytype, Level level) { +- super(entitytype, level); ++ public Witch(EntityType<? extends Witch> entityType, Level level) { ++ super(entityType, level); + } + + @Override +- @Override + protected void registerGoals() { + super.registerGoals(); +- this.healRaidersGoal = new NearestHealableRaiderTargetGoal<>(this, Raider.class, true, (livingentity) -> { +- return livingentity != null && this.hasActiveRaid() && livingentity.getType() != EntityType.WITCH; ++ this.healRaidersGoal = new NearestHealableRaiderTargetGoal<>(this, Raider.class, true, (entityliving) -> { ++ return entityliving != null && this.hasActiveRaid() && entityliving.getType() != EntityType.WITCH; + }); + this.attackPlayersGoal = new NearestAttackableWitchTargetGoal<>(this, Player.class, 10, true, false, (Predicate) null); + this.goalSelector.addGoal(1, new FloatGoal(this)); +@@ -78,32 +77,28 @@ + } + + @Override +- @Override + protected void defineSynchedData() { + super.defineSynchedData(); + this.getEntityData().define(Witch.DATA_USING_ITEM, false); + } + + @Override +- @Override + protected SoundEvent getAmbientSound() { + return SoundEvents.WITCH_AMBIENT; + } + + @Override +- @Override +- protected SoundEvent getHurtSound(DamageSource damagesource) { ++ protected SoundEvent getHurtSound(DamageSource damageSource) { + return SoundEvents.WITCH_HURT; + } + + @Override +- @Override + protected SoundEvent getDeathSound() { + return SoundEvents.WITCH_DEATH; + } + +- public void setUsingItem(boolean flag) { +- this.getEntityData().set(Witch.DATA_USING_ITEM, flag); ++ public void setUsingItem(boolean usingItem) { ++ this.getEntityData().set(Witch.DATA_USING_ITEM, usingItem); + } + + public boolean isDrinkingPotion() { +@@ -115,7 +110,6 @@ + } + + @Override +- @Override + public void aiStep() { + if (!this.level().isClientSide && this.isAlive()) { + this.healRaidersGoal.decrementCooldown(); +@@ -138,9 +132,9 @@ + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) { +- MobEffectInstance mobeffectinstance = (MobEffectInstance) iterator.next(); ++ MobEffectInstance mobeffect = (MobEffectInstance) iterator.next(); + +- this.addEffect(new MobEffectInstance(mobeffectinstance)); ++ this.addEffect(new MobEffectInstance(mobeffect), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit + } + } + } +@@ -149,30 +143,30 @@ + this.getAttribute(Attributes.MOVEMENT_SPEED).removeModifier(Witch.SPEED_MODIFIER_DRINKING.getId()); + } + } else { +- Potion potion = null; ++ Potion potionregistry = null; + + if (this.random.nextFloat() < 0.15F && this.isEyeInFluid(FluidTags.WATER) && !this.hasEffect(MobEffects.WATER_BREATHING)) { +- potion = Potions.WATER_BREATHING; ++ potionregistry = Potions.WATER_BREATHING; + } else if (this.random.nextFloat() < 0.15F && (this.isOnFire() || this.getLastDamageSource() != null && this.getLastDamageSource().is(DamageTypeTags.IS_FIRE)) && !this.hasEffect(MobEffects.FIRE_RESISTANCE)) { +- potion = Potions.FIRE_RESISTANCE; ++ potionregistry = Potions.FIRE_RESISTANCE; + } else if (this.random.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth()) { +- potion = Potions.HEALING; ++ potionregistry = Potions.HEALING; + } else if (this.random.nextFloat() < 0.5F && this.getTarget() != null && !this.hasEffect(MobEffects.MOVEMENT_SPEED) && this.getTarget().distanceToSqr((Entity) this) > 121.0D) { +- potion = Potions.SWIFTNESS; ++ potionregistry = Potions.SWIFTNESS; + } + +- if (potion != null) { +- this.setItemSlot(EquipmentSlot.MAINHAND, PotionUtils.setPotion(new ItemStack(Items.POTION), potion)); ++ if (potionregistry != null) { ++ this.setItemSlot(EquipmentSlot.MAINHAND, PotionUtils.setPotion(new ItemStack(Items.POTION), potionregistry)); + this.usingTime = this.getMainHandItem().getUseDuration(); + this.setUsingItem(true); + if (!this.isSilent()) { + this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.WITCH_DRINK, this.getSoundSource(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); + } + +- AttributeInstance attributeinstance = this.getAttribute(Attributes.MOVEMENT_SPEED); ++ AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); + +- attributeinstance.removeModifier(Witch.SPEED_MODIFIER_DRINKING.getId()); +- attributeinstance.addTransientModifier(Witch.SPEED_MODIFIER_DRINKING); ++ attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.getId()); ++ attributemodifiable.addTransientModifier(Witch.SPEED_MODIFIER_DRINKING); + } + } + +@@ -185,97 +179,89 @@ + } + + @Override +- @Override + public SoundEvent getCelebrateSound() { + return SoundEvents.WITCH_CELEBRATE; + } + + @Override +- @Override +- public void handleEntityEvent(byte b0) { +- if (b0 == 15) { ++ public void handleEntityEvent(byte id) { ++ if (id == 15) { + for (int i = 0; i < this.random.nextInt(35) + 10; ++i) { + this.level().addParticle(ParticleTypes.WITCH, this.getX() + this.random.nextGaussian() * 0.12999999523162842D, this.getBoundingBox().maxY + 0.5D + this.random.nextGaussian() * 0.12999999523162842D, this.getZ() + this.random.nextGaussian() * 0.12999999523162842D, 0.0D, 0.0D, 0.0D); + } + } else { +- super.handleEntityEvent(b0); ++ super.handleEntityEvent(id); + } + + } + + @Override +- @Override +- protected float getDamageAfterMagicAbsorb(DamageSource damagesource, float f) { +- f = super.getDamageAfterMagicAbsorb(damagesource, f); +- if (damagesource.getEntity() == this) { +- f = 0.0F; ++ protected float getDamageAfterMagicAbsorb(DamageSource source, float damage) { ++ damage = super.getDamageAfterMagicAbsorb(source, damage); ++ if (source.getEntity() == this) { ++ damage = 0.0F; + } + +- if (damagesource.is(DamageTypeTags.WITCH_RESISTANT_TO)) { +- f *= 0.15F; ++ if (source.is(DamageTypeTags.WITCH_RESISTANT_TO)) { ++ damage *= 0.15F; + } + +- return f; ++ return damage; + } + + @Override +- @Override +- public void performRangedAttack(LivingEntity livingentity, float f) { ++ public void performRangedAttack(LivingEntity target, float distanceFactor) { + if (!this.isDrinkingPotion()) { +- Vec3 vec3 = livingentity.getDeltaMovement(); +- double d0 = livingentity.getX() + vec3.x - this.getX(); +- double d1 = livingentity.getEyeY() - 1.100000023841858D - this.getY(); +- double d2 = livingentity.getZ() + vec3.z - this.getZ(); ++ Vec3 vec3d = target.getDeltaMovement(); ++ double d0 = target.getX() + vec3d.x - this.getX(); ++ double d1 = target.getEyeY() - 1.100000023841858D - this.getY(); ++ double d2 = target.getZ() + vec3d.z - this.getZ(); + double d3 = Math.sqrt(d0 * d0 + d2 * d2); +- Potion potion = Potions.HARMING; ++ Potion potionregistry = Potions.HARMING; + +- if (livingentity instanceof Raider) { +- if (livingentity.getHealth() <= 4.0F) { +- potion = Potions.HEALING; ++ if (target instanceof Raider) { ++ if (target.getHealth() <= 4.0F) { ++ potionregistry = Potions.HEALING; + } else { +- potion = Potions.REGENERATION; ++ potionregistry = Potions.REGENERATION; + } + + this.setTarget((LivingEntity) null); +- } else if (d3 >= 8.0D && !livingentity.hasEffect(MobEffects.MOVEMENT_SLOWDOWN)) { +- potion = Potions.SLOWNESS; +- } else if (livingentity.getHealth() >= 8.0F && !livingentity.hasEffect(MobEffects.POISON)) { +- potion = Potions.POISON; +- } else if (d3 <= 3.0D && !livingentity.hasEffect(MobEffects.WEAKNESS) && this.random.nextFloat() < 0.25F) { +- potion = Potions.WEAKNESS; ++ } else if (d3 >= 8.0D && !target.hasEffect(MobEffects.MOVEMENT_SLOWDOWN)) { ++ potionregistry = Potions.SLOWNESS; ++ } else if (target.getHealth() >= 8.0F && !target.hasEffect(MobEffects.POISON)) { ++ potionregistry = Potions.POISON; ++ } else if (d3 <= 3.0D && !target.hasEffect(MobEffects.WEAKNESS) && this.random.nextFloat() < 0.25F) { ++ potionregistry = Potions.WEAKNESS; + } + +- ThrownPotion thrownpotion = new ThrownPotion(this.level(), this); ++ ThrownPotion entitypotion = new ThrownPotion(this.level(), this); + +- thrownpotion.setItem(PotionUtils.setPotion(new ItemStack(Items.SPLASH_POTION), potion)); +- thrownpotion.setXRot(thrownpotion.getXRot() - -20.0F); +- thrownpotion.shoot(d0, d1 + d3 * 0.2D, d2, 0.75F, 8.0F); ++ entitypotion.setItem(PotionUtils.setPotion(new ItemStack(Items.SPLASH_POTION), potionregistry)); ++ entitypotion.setXRot(entitypotion.getXRot() - -20.0F); ++ entitypotion.shoot(d0, d1 + d3 * 0.2D, d2, 0.75F, 8.0F); + if (!this.isSilent()) { + this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.WITCH_THROW, this.getSoundSource(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); + } + +- this.level().addFreshEntity(thrownpotion); ++ this.level().addFreshEntity(entitypotion); + } + } + + @Override +- @Override +- protected float getStandingEyeHeight(Pose pose, EntityDimensions entitydimensions) { ++ protected float getStandingEyeHeight(EntityPose pose, EntityDimensions size) { + return 1.62F; + } + + @Override +- @Override +- protected Vector3f getPassengerAttachmentPoint(Entity entity, EntityDimensions entitydimensions, float f) { +- return new Vector3f(0.0F, entitydimensions.height + 0.3125F * f, 0.0F); ++ protected Vector3f getPassengerAttachmentPoint(Entity entity, EntityDimensions entitysize, float f) { ++ return new Vector3f(0.0F, entitysize.height + 0.3125F * f, 0.0F); + } + + @Override +- @Override +- public void applyRaidBuffs(int i, boolean flag) {} ++ public void applyRaidBuffs(int wave, boolean unusedFalse) {} + + @Override +- @Override + public boolean canBeLeader() { + return false; + } |