Skip to content

Commit

Permalink
Fixed mob crusher not killing babies, closes #877
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed Dec 5, 2020
1 parent 776cdb0 commit 088212b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -102,7 +103,8 @@ public int getState() {
@Override
public WorkAction work() {
if (hasEnergy(MobCrusherConfig.powerPerOperation)) {
List<MobEntity> 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<MobEntity> 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);
Expand Down

0 comments on commit 088212b

Please sign in to comment.