diff --git a/src/main/java/pokecube/api/entity/CapabilityInhabitable.java b/src/main/java/pokecube/api/entity/CapabilityInhabitable.java index a82a6a56ea..520097d6e1 100644 --- a/src/main/java/pokecube/api/entity/CapabilityInhabitable.java +++ b/src/main/java/pokecube/api/entity/CapabilityInhabitable.java @@ -20,7 +20,6 @@ import net.minecraftforge.common.util.INBTSerializable; import net.minecraftforge.common.util.LazyOptional; import pokecube.api.blocks.IInhabitable; -import pokecube.api.utils.TagNames; public class CapabilityInhabitable { @@ -58,14 +57,14 @@ public void onExitHabitat(final Mob mob) { if (this.tile.getBlockPos() != null) this.wrapped.setPos(this.tile.getBlockPos()); this.getWrapped().onExitHabitat(mob); - mob.getPersistentData().putBoolean(TagNames.NOPOOF, true); + mob.setPersistenceRequired(); } @Override public boolean onEnterHabitat(final Mob mob) { if (this.tile.getBlockPos() != null) this.wrapped.setPos(this.tile.getBlockPos()); - mob.getPersistentData().putBoolean(TagNames.NOPOOF, true); + mob.setPersistenceRequired(); return this.getWrapped().onEnterHabitat(mob); } diff --git a/src/main/java/pokecube/core/ai/tasks/ants/nest/AntHabitat.java b/src/main/java/pokecube/core/ai/tasks/ants/nest/AntHabitat.java index 7a75218bc2..518417a7e6 100644 --- a/src/main/java/pokecube/core/ai/tasks/ants/nest/AntHabitat.java +++ b/src/main/java/pokecube/core/ai/tasks/ants/nest/AntHabitat.java @@ -694,7 +694,8 @@ public boolean onEnterHabitat(final Mob mob) this.ants.remove(mob.getUUID()); this.workers.get(AntTasks.getJob(mob)).remove(mob.getUUID()); - if (this.eggs.size() < Math.max(10, ants / 2)) + if (this.eggs.size() < Math.min(Math.max(PokecubeCore.getConfig().antNestMobNumber / 2, ants / 2), + PokecubeCore.getConfig().antNestMobNumber / 2)) { final IPokemob poke = PokemobCaps.getPokemobFor(mob); Optional room = this.getFreeEggRoom();