mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +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("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() {
|
||||
super(HEIRARCHICAL_JSON_ADAPTER, GamePaths.getConfigDirectory().resolve("unicopia.json"));
|
||||
}
|
||||
|
|
|
@ -62,18 +62,20 @@ public interface UEntities {
|
|||
FabricDefaultAttributeRegistry.register(TWITTERMITE, FairyEntity.createMobAttributes());
|
||||
FabricDefaultAttributeRegistry.register(AIR_BALLOON, FlyingEntity.createMobAttributes());
|
||||
|
||||
final Predicate<BiomeSelectionContext> butterflySpawnable = BiomeSelectors.foundInOverworld()
|
||||
.and(ctx -> ctx.getBiome().getPrecipitation() == Biome.Precipitation.RAIN);
|
||||
if (!Unicopia.getConfig().disableButterflySpawning.get()) {
|
||||
final Predicate<BiomeSelectionContext> butterflySpawnable = BiomeSelectors.foundInOverworld()
|
||||
.and(ctx -> ctx.getBiome().getPrecipitation() == Biome.Precipitation.RAIN);
|
||||
|
||||
BiomeModifications.addSpawn(butterflySpawnable.and(
|
||||
BiomeSelectors.tag(BiomeTags.IS_RIVER)
|
||||
.or(BiomeSelectors.tag(BiomeTags.IS_FOREST))
|
||||
.or(BiomeSelectors.tag(BiomeTags.IS_HILL))
|
||||
), SpawnGroup.AMBIENT, BUTTERFLY, 3, 3, 12);
|
||||
BiomeModifications.addSpawn(butterflySpawnable.and(
|
||||
BiomeSelectors.tag(BiomeTags.IS_JUNGLE)
|
||||
.or(BiomeSelectors.tag(BiomeTags.IS_MOUNTAIN))
|
||||
), SpawnGroup.AMBIENT, BUTTERFLY, 7, 5, 19);
|
||||
BiomeModifications.addSpawn(butterflySpawnable.and(
|
||||
BiomeSelectors.tag(BiomeTags.IS_RIVER)
|
||||
.or(BiomeSelectors.tag(BiomeTags.IS_FOREST))
|
||||
.or(BiomeSelectors.tag(BiomeTags.IS_HILL))
|
||||
), SpawnGroup.AMBIENT, BUTTERFLY, 3, 3, 12);
|
||||
BiomeModifications.addSpawn(butterflySpawnable.and(
|
||||
BiomeSelectors.tag(BiomeTags.IS_JUNGLE)
|
||||
.or(BiomeSelectors.tag(BiomeTags.IS_MOUNTAIN))
|
||||
), SpawnGroup.AMBIENT, BUTTERFLY, 7, 5, 19);
|
||||
}
|
||||
|
||||
UTradeOffers.bootstrap();
|
||||
EntityBehaviour.bootstrap();
|
||||
|
|
Loading…
Reference in a new issue