From 418920ffdfede865e392377f465c4d916893c4ac Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 13 Aug 2020 14:14:45 +0200 Subject: [PATCH] Only update entity age every 2 seconds Closes #135 --- .../de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java index 216fa2c3..dc2db99f 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java @@ -38,11 +38,11 @@ public class BlockAnimalGenerator extends BlockContainerImpl implements IVisuali @SubscribeEvent public void onLivingUpdate(LivingEvent.LivingUpdateEvent event) { LivingEntity entity = event.getEntityLiving(); - if (entity.world.isRemote || !(entity instanceof AnimalEntity) || entity instanceof IMob || entity instanceof INPC) + if (entity.world.isRemote || entity.world.getGameTime() % 40 != 0 || !(entity instanceof AnimalEntity) || entity instanceof IMob || entity instanceof INPC) return; CompoundNBT data = entity.getPersistentData(); int timeAlive = data.getInt(NaturesAura.MOD_ID + ":time_alive"); - data.putInt(NaturesAura.MOD_ID + ":time_alive", timeAlive + 1); + data.putInt(NaturesAura.MOD_ID + ":time_alive", timeAlive + 40); } @SubscribeEvent