mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-05 04:49:10 +01:00
parent
3ca3de90b2
commit
418920ffdf
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue