#19 apply butterfly spawn constraint to the creation of caterpillars too

This commit is contained in:
mezz committed 2015-02-04 01:23:33 -08:00
1 parent bf2da35086
commit 4d43e918f1
1 file changed
+5
@@ -13,6 +13,7 @@ package forestry.lepidopterology.entities;
import forestry.api.genetics.IPollinatable;
import forestry.api.lepidopterology.IButterflyNursery;
import forestry.core.utils.GeneticsUtil;
import forestry.plugins.PluginLepidopterology;
public class AIButterflyMate extends AIButterflyInteract {
@@ -33,6 +34,10 @@ public class AIButterflyMate extends AIButterflyInteract {
return false;
}
if (entity.worldObj.countEntities(EntityButterfly.class) > PluginLepidopterology.spawnConstraint) {
return false;
}
return GeneticsUtil.canNurse(entity.getButterfly(), entity.worldObj, rest.posX, rest.posY, rest.posZ);
}