diff options
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/entity/monster/Husk.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower/net/minecraft/world/entity/monster/Husk.java.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/entity/monster/Husk.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/entity/monster/Husk.java.patch new file mode 100644 index 0000000000..d48c4adfd2 --- /dev/null +++ b/patch-remap/mache-vineflower/net/minecraft/world/entity/monster/Husk.java.patch @@ -0,0 +1,63 @@ +--- a/net/minecraft/world/entity/monster/Husk.java ++++ b/net/minecraft/world/entity/monster/Husk.java +@@ -10,20 +10,22 @@ + 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; + import net.minecraft.world.level.ServerLevelAccessor; + import org.joml.Vector3f; + + public class Husk extends Zombie { ++ + public Husk(EntityType<? extends Husk> entityType, Level level) { + super(entityType, level); + } + +- public static boolean checkHuskSpawnRules(EntityType<Husk> husk, ServerLevelAccessor level, MobSpawnType spawnType, BlockPos pos, RandomSource random) { +- return checkMonsterSpawnRules(husk, level, spawnType, pos, random) && (MobSpawnType.isSpawner(spawnType) || level.canSeeSky(pos)); ++ 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 +@@ -54,9 +56,11 @@ + @Override + public boolean doHurtTarget(Entity entity) { + boolean flag = super.doHurtTarget(entity); ++ + if (flag && this.getMainHandItem().isEmpty() && entity instanceof LivingEntity) { +- float effectiveDifficulty = this.level().getCurrentDifficultyAt(this.blockPosition()).getEffectiveDifficulty(); +- ((LivingEntity)entity).addEffect(new MobEffectInstance(MobEffects.HUNGER, 140 * (int)effectiveDifficulty), this); ++ float f = this.level().getCurrentDifficultyAt(this.blockPosition()).getEffectiveDifficulty(); ++ ++ ((LivingEntity) entity).addEffect(new MobEffectInstance(MobEffects.HUNGER, 140 * (int) f), this, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit + } + + return flag; +@@ -71,8 +75,9 @@ + protected void doUnderWaterConversion() { + this.convertToZombieType(EntityType.ZOMBIE); + if (!this.isSilent()) { +- this.level().levelEvent(null, 1041, this.blockPosition(), 0); ++ this.level().levelEvent((Player) null, 1041, this.blockPosition(), 0); + } ++ + } + + @Override +@@ -81,7 +86,7 @@ + } + + @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); + } + } |