mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 19:58:34 +01:00
parent
8770ac6cd7
commit
d7379b7e71
1 changed files with 2 additions and 2 deletions
|
@ -37,7 +37,7 @@ public class BlockAnimalGenerator extends BlockContainerImpl implements IVisuali
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onLivingUpdate(LivingEvent.LivingUpdateEvent event) {
|
public void onLivingUpdate(LivingEvent.LivingUpdateEvent event) {
|
||||||
var entity = event.getEntityLiving();
|
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;
|
return;
|
||||||
var data = entity.getPersistentData();
|
var data = entity.getPersistentData();
|
||||||
var timeAlive = data.getInt(NaturesAura.MOD_ID + ":time_alive");
|
var timeAlive = data.getInt(NaturesAura.MOD_ID + ":time_alive");
|
||||||
|
@ -47,7 +47,7 @@ public class BlockAnimalGenerator extends BlockContainerImpl implements IVisuali
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onEntityDeath(LivingDeathEvent event) {
|
public void onEntityDeath(LivingDeathEvent event) {
|
||||||
var entity = event.getEntityLiving();
|
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;
|
return;
|
||||||
var pos = entity.blockPosition();
|
var pos = entity.blockPosition();
|
||||||
Helper.getBlockEntitiesInArea(entity.level, pos, 5, tile -> {
|
Helper.getBlockEntitiesInArea(entity.level, pos, 5, tile -> {
|
||||||
|
|
Loading…
Reference in a new issue