fixed the disentangler of mortals not working

Closes #251
This commit is contained in:
Ell 2022-05-20 20:48:10 +02:00
parent 8770ac6cd7
commit d7379b7e71

View file

@ -37,7 +37,7 @@ public class BlockAnimalGenerator extends BlockContainerImpl implements IVisuali
@SubscribeEvent
public void onLivingUpdate(LivingEvent.LivingUpdateEvent event) {
var entity = event.getEntityLiving();
if (entity.level.isClientSide || entity.level.getGameTime() % 40 != 0 || !(entity instanceof Animal) || entity instanceof Mob || entity instanceof Npc)
if (entity.level.isClientSide || entity.level.getGameTime() % 40 != 0 || !(entity instanceof Animal) || entity instanceof Npc)
return;
var data = entity.getPersistentData();
var timeAlive = data.getInt(NaturesAura.MOD_ID + ":time_alive");
@ -47,7 +47,7 @@ public class BlockAnimalGenerator extends BlockContainerImpl implements IVisuali
@SubscribeEvent
public void onEntityDeath(LivingDeathEvent event) {
var entity = event.getEntityLiving();
if (entity.level.isClientSide || !(entity instanceof Animal) || entity instanceof Mob || entity instanceof Npc)
if (entity.level.isClientSide || !(entity instanceof Animal) || entity instanceof Npc)
return;
var pos = entity.blockPosition();
Helper.getBlockEntitiesInArea(entity.level, pos, 5, tile -> {