Add Butterfly Leaf Spawn Config (#67)

Added `butterfly.entities.disable.leaf.spawns` config to Lepidopterology.cfg.

When set to _True_, it will stop any butterfly from spontaneously spawning from Forestry's leaves [_False_ by default].

Pregnant butterflies remain unaffected for fans of the hobby.
This commit is contained in:
DrParadox7 authored and GitHub committed 2024-03-26 18:14:34 -07:00
1 parent 0f24a4e043
commit dde3514dce
2 files changed
+7 -1

No files matched your search

@@ -60,6 +60,7 @@ public class PluginLepidopterology extends ForestryPlugin {
public static int spawnConstraint = 100; public static int spawnConstraint = 100;
public static int entityConstraint = 1000; public static int entityConstraint = 1000;
private static boolean allowPollination = true; private static boolean allowPollination = true;
public static boolean disableButterflyLeafSpawns = false;
public static ItemRegistryLepidopterology items; public static ItemRegistryLepidopterology items;
public static BlockRegistryLepidopterology blocks; public static BlockRegistryLepidopterology blocks;
@@ -112,7 +113,8 @@ public class PluginLepidopterology extends ForestryPlugin {
blocks.lepidopterology.init(); blocks.lepidopterology.init();
TreeManager.treeRoot.registerLeafTickHandler(new ButterflySpawner()); if (!PluginLepidopterology.disableButterflyLeafSpawns)
TreeManager.treeRoot.registerLeafTickHandler(new ButterflySpawner());
RecipeSorter.register( RecipeSorter.register(
"forestry:lepidopterologymating", "forestry:lepidopterologymating",
@@ -127,6 +129,8 @@ public class PluginLepidopterology extends ForestryPlugin {
spawnConstraint = config.getIntLocalized("butterfly.entities", "spawn.limit", spawnConstraint, 0, 500); spawnConstraint = config.getIntLocalized("butterfly.entities", "spawn.limit", spawnConstraint, 0, 500);
entityConstraint = config.getIntLocalized("butterfly.entities", "maximum", entityConstraint, 0, 5000); entityConstraint = config.getIntLocalized("butterfly.entities", "maximum", entityConstraint, 0, 5000);
allowPollination = config.getBooleanLocalized("butterfly.entities", "pollination", allowPollination); allowPollination = config.getBooleanLocalized("butterfly.entities", "pollination", allowPollination);
disableButterflyLeafSpawns = config
.getBooleanLocalized("butterfly.entities", "disable.leaf.spawns", disableButterflyLeafSpawns);
config.save(); config.save();
} }
@@ -1684,6 +1684,8 @@ for.config.butterfly.entities.maximum=Butterfly Maximum
for.config.butterfly.entities.maximum.comment=New butterflies will stay in item form and will not take flight once this limit is reached. for.config.butterfly.entities.maximum.comment=New butterflies will stay in item form and will not take flight once this limit is reached.
for.config.butterfly.entities.pollination=Butterfly Pollination for.config.butterfly.entities.pollination=Butterfly Pollination
for.config.butterfly.entities.pollination.comment=Allow butterflies to pollinate leaves. for.config.butterfly.entities.pollination.comment=Allow butterflies to pollinate leaves.
for.config.butterfly.entities.disable.leaf.spawns=Disable Butterfly Leaf Spawns
for.config.butterfly.entities.disable.leaf.spawns.comment=Prevent random butterflies from autonomously spawning from Forestry leaves.
for.config.backpacks.item.stacks.format=Add itemStacks for the %s's backpack here in the format 'modid:name:meta'. For wildcard metadata the format is 'modid:name'. for.config.backpacks.item.stacks.format=Add itemStacks for the %s's backpack here in the format 'modid:name:meta'. For wildcard metadata the format is 'modid:name'.
for.config.backpacks.ore.dict.format=Add ore dictionary names for the %s's backpack here in the format 'oreDictName'. for.config.backpacks.ore.dict.format=Add ore dictionary names for the %s's backpack here in the format 'oreDictName'.