diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Husk.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Husk.java.patch | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Husk.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Husk.java.patch new file mode 100644 index 0000000000..8e2bdfbae2 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Husk.java.patch @@ -0,0 +1,102 @@ +--- a/net/minecraft/world/entity/monster/Husk.java ++++ b/net/minecraft/world/entity/monster/Husk.java +@@ -10,8 +10,8 @@ + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityDimensions; + import net.minecraft.world.entity.EntityType; ++import net.minecraft.world.entity.EnumMobSpawn; + import net.minecraft.world.entity.LivingEntity; +-import net.minecraft.world.entity.MobSpawnType; + import net.minecraft.world.entity.player.Player; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.level.Level; +@@ -20,66 +20,58 @@ + + public class Husk extends Zombie { + +- public Husk(EntityType<? extends Husk> entitytype, Level level) { +- super(entitytype, level); ++ public Husk(EntityType<? extends Husk> entityType, Level level) { ++ super(entityType, level); + } + +- public static boolean checkHuskSpawnRules(EntityType<Husk> entitytype, ServerLevelAccessor serverlevelaccessor, MobSpawnType mobspawntype, BlockPos blockpos, RandomSource randomsource) { +- return checkMonsterSpawnRules(entitytype, serverlevelaccessor, mobspawntype, blockpos, randomsource) && (MobSpawnType.isSpawner(mobspawntype) || serverlevelaccessor.canSeeSky(blockpos)); ++ public static boolean checkHuskSpawnRules(EntityType<Husk> husk, ServerLevelAccessor level, EnumMobSpawn spawnType, BlockPos pos, RandomSource random) { ++ return checkMonsterSpawnRules(husk, level, spawnType, pos, random) && (EnumMobSpawn.isSpawner(spawnType) || level.canSeeSky(pos)); + } + + @Override +- @Override + protected boolean isSunSensitive() { + return false; + } + + @Override +- @Override + protected SoundEvent getAmbientSound() { + return SoundEvents.HUSK_AMBIENT; + } + + @Override +- @Override +- protected SoundEvent getHurtSound(DamageSource damagesource) { ++ protected SoundEvent getHurtSound(DamageSource damageSource) { + return SoundEvents.HUSK_HURT; + } + + @Override +- @Override + protected SoundEvent getDeathSound() { + return SoundEvents.HUSK_DEATH; + } + + @Override +- @Override + protected SoundEvent getStepSound() { + return SoundEvents.HUSK_STEP; + } + + @Override +- @Override + public boolean doHurtTarget(Entity entity) { + boolean flag = super.doHurtTarget(entity); + + if (flag && this.getMainHandItem().isEmpty() && entity instanceof LivingEntity) { + float f = this.level().getCurrentDifficultyAt(this.blockPosition()).getEffectiveDifficulty(); + +- ((LivingEntity) entity).addEffect(new MobEffectInstance(MobEffects.HUNGER, 140 * (int) f), this); ++ ((LivingEntity) entity).addEffect(new MobEffectInstance(MobEffects.HUNGER, 140 * (int) f), this, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit + } + + return flag; + } + + @Override +- @Override + protected boolean convertsInWater() { + return true; + } + + @Override +- @Override + protected void doUnderWaterConversion() { + this.convertToZombieType(EntityType.ZOMBIE); + if (!this.isSilent()) { +@@ -89,14 +81,12 @@ + } + + @Override +- @Override + protected ItemStack getSkull() { + return ItemStack.EMPTY; + } + + @Override +- @Override +- protected Vector3f getPassengerAttachmentPoint(Entity entity, EntityDimensions entitydimensions, float f) { +- return new Vector3f(0.0F, entitydimensions.height + 0.125F * f, 0.0F); ++ protected Vector3f getPassengerAttachmentPoint(Entity entity, EntityDimensions entitysize, float f) { ++ return new Vector3f(0.0F, entitysize.height + 0.125F * f, 0.0F); + } + } |