From 088212b9f375c0935856de96020e85be2f3a832a Mon Sep 17 00:00:00 2001 From: Buuz135 Date: Sat, 5 Dec 2020 11:02:54 +0100 Subject: [PATCH] Fixed mob crusher not killing babies, closes #877 --- .../block/agriculturehusbandry/tile/MobCrusherTile.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/buuz135/industrial/block/agriculturehusbandry/tile/MobCrusherTile.java b/src/main/java/com/buuz135/industrial/block/agriculturehusbandry/tile/MobCrusherTile.java index 755d267ff..b8c32aec5 100644 --- a/src/main/java/com/buuz135/industrial/block/agriculturehusbandry/tile/MobCrusherTile.java +++ b/src/main/java/com/buuz135/industrial/block/agriculturehusbandry/tile/MobCrusherTile.java @@ -24,6 +24,7 @@ import net.minecraft.entity.MobEntity; import net.minecraft.entity.boss.WitherEntity; import net.minecraft.entity.item.ItemEntity; +import net.minecraft.entity.passive.AnimalEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.DyeColor; import net.minecraft.item.ItemStack; @@ -102,7 +103,8 @@ public int getState() { @Override public WorkAction work() { if (hasEnergy(MobCrusherConfig.powerPerOperation)) { - List mobs = this.world.getEntitiesWithinAABB(MobEntity.class, getWorkingArea().getBoundingBox()).stream().filter(mobEntity -> !mobEntity.isChild() && !mobEntity.isInvulnerable() && !(mobEntity instanceof WitherEntity && ((WitherEntity) mobEntity).getInvulTime() > 0)).collect(Collectors.toList()); + List mobs = this.world.getEntitiesWithinAABB(MobEntity.class, getWorkingArea().getBoundingBox()).stream().filter(mobEntity -> !(mobEntity instanceof AnimalEntity && + !mobEntity.isChild()) && !mobEntity.isInvulnerable() && !(mobEntity instanceof WitherEntity && ((WitherEntity) mobEntity).getInvulTime() > 0)).collect(Collectors.toList()); if (mobs.size() > 0) { MobEntity entity = mobs.get(0); FakePlayer player = IndustrialForegoing.getFakePlayer(this.world);