diff --git a/src/main/java/forestry/lepidopterology/entities/AIButterflyPollinate.java b/src/main/java/forestry/lepidopterology/entities/AIButterflyPollinate.java index a477b404d..41b3ee151 100644 --- a/src/main/java/forestry/lepidopterology/entities/AIButterflyPollinate.java +++ b/src/main/java/forestry/lepidopterology/entities/AIButterflyPollinate.java @@ -14,6 +14,7 @@ import forestry.api.genetics.IPollinatable; import forestry.arboriculture.genetics.FakePollinatable; import forestry.arboriculture.genetics.ICheckPollinatable; import forestry.core.utils.GeneticsUtil; +import forestry.plugins.PluginLepidopterology; public class AIButterflyPollinate extends AIButterflyInteract { @@ -26,7 +27,7 @@ public class AIButterflyPollinate extends AIButterflyInteract { */ @Override protected boolean canInteract() { - if (entity.cooldownPollination > 0) { + if (entity.cooldownPollination > 0 || !PluginLepidopterology.isPollinationAllowed()) { return false; } diff --git a/src/main/java/forestry/plugins/PluginLepidopterology.java b/src/main/java/forestry/plugins/PluginLepidopterology.java index 1af79f387..d537f74f1 100755 --- a/src/main/java/forestry/plugins/PluginLepidopterology.java +++ b/src/main/java/forestry/plugins/PluginLepidopterology.java @@ -69,6 +69,7 @@ public class PluginLepidopterology extends ForestryPlugin { private Configuration config; public static int spawnConstraint = 100; public static int entityConstraint = 1000; + private static boolean allowPollination = true; public static IClassification geometridae; public static IClassification saturniidae; public static IClassification pieridae; @@ -110,6 +111,10 @@ public class PluginLepidopterology extends ForestryPlugin { property.comment = "determines the global butterfly entity count above which butterflies will stay in item form and will not take flight anymore."; entityConstraint = Integer.parseInt(property.value); + property = config.get("entities.pollination.allowed", CONFIG_CATEGORY, allowPollination); + property.comment = "determines whether butterflies can pollinate leaves."; + allowPollination = Boolean.parseBoolean(property.value); + config.save(); PluginCore.rootCommand.addChildCommand(new CommandButterfly()); @@ -324,4 +329,8 @@ public class PluginLepidopterology extends ForestryPlugin { public IGuiHandler getGuiHandler() { return new GuiHandlerLepidopterology(); } + + public static boolean isPollinationAllowed() { + return allowPollination; + } }