mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-24 05:47:59 +01:00
Added config option to disable butterflies. #83
This commit is contained in:
parent
8eace74353
commit
477741ff49
2 changed files with 17 additions and 11 deletions
|
@ -30,6 +30,10 @@ public class Config extends com.minelittlepony.common.util.settings.Config {
|
||||||
.addComment("Disables this mod's built in fix for making sea plants waterlogged")
|
.addComment("Disables this mod's built in fix for making sea plants waterlogged")
|
||||||
.addComment("Turn this ON if you're using another mod that does something similar of if you encounter copatibility issues with other mods.");
|
.addComment("Turn this ON if you're using another mod that does something similar of if you encounter copatibility issues with other mods.");
|
||||||
|
|
||||||
|
public final Setting<Boolean> disableButterflySpawning = value("compatibility", "disableButterflySpawning", false)
|
||||||
|
.addComment("Removes butterflies from spawning in your world")
|
||||||
|
.addComment("Turn this ON if you have another mod that adds butterflies.");
|
||||||
|
|
||||||
public Config() {
|
public Config() {
|
||||||
super(HEIRARCHICAL_JSON_ADAPTER, GamePaths.getConfigDirectory().resolve("unicopia.json"));
|
super(HEIRARCHICAL_JSON_ADAPTER, GamePaths.getConfigDirectory().resolve("unicopia.json"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ public interface UEntities {
|
||||||
FabricDefaultAttributeRegistry.register(TWITTERMITE, FairyEntity.createMobAttributes());
|
FabricDefaultAttributeRegistry.register(TWITTERMITE, FairyEntity.createMobAttributes());
|
||||||
FabricDefaultAttributeRegistry.register(AIR_BALLOON, FlyingEntity.createMobAttributes());
|
FabricDefaultAttributeRegistry.register(AIR_BALLOON, FlyingEntity.createMobAttributes());
|
||||||
|
|
||||||
|
if (!Unicopia.getConfig().disableButterflySpawning.get()) {
|
||||||
final Predicate<BiomeSelectionContext> butterflySpawnable = BiomeSelectors.foundInOverworld()
|
final Predicate<BiomeSelectionContext> butterflySpawnable = BiomeSelectors.foundInOverworld()
|
||||||
.and(ctx -> ctx.getBiome().getPrecipitation() == Biome.Precipitation.RAIN);
|
.and(ctx -> ctx.getBiome().getPrecipitation() == Biome.Precipitation.RAIN);
|
||||||
|
|
||||||
|
@ -74,6 +75,7 @@ public interface UEntities {
|
||||||
BiomeSelectors.tag(BiomeTags.IS_JUNGLE)
|
BiomeSelectors.tag(BiomeTags.IS_JUNGLE)
|
||||||
.or(BiomeSelectors.tag(BiomeTags.IS_MOUNTAIN))
|
.or(BiomeSelectors.tag(BiomeTags.IS_MOUNTAIN))
|
||||||
), SpawnGroup.AMBIENT, BUTTERFLY, 7, 5, 19);
|
), SpawnGroup.AMBIENT, BUTTERFLY, 7, 5, 19);
|
||||||
|
}
|
||||||
|
|
||||||
UTradeOffers.bootstrap();
|
UTradeOffers.bootstrap();
|
||||||
EntityBehaviour.bootstrap();
|
EntityBehaviour.bootstrap();
|
||||||
|
|
Loading…
Reference in a new issue