mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 12:32:23 +00:00
#19 apply butterfly spawn constraint to the creation of caterpillars too
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user