From 1ac17e5d569571683e2cd270b408ade1dba11272 Mon Sep 17 00:00:00 2001 From: bconlon Date: Fri, 25 Dec 2020 21:50:13 -0800 Subject: [PATCH] Backport seasonal config. --- src/main/java/com/gildedgames/the_aether/AetherConfig.java | 7 ++++++- .../the_aether/world/biome/AetherBiomeDecorator.java | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gildedgames/the_aether/AetherConfig.java b/src/main/java/com/gildedgames/the_aether/AetherConfig.java index c17af8b..788da7e 100644 --- a/src/main/java/com/gildedgames/the_aether/AetherConfig.java +++ b/src/main/java/com/gildedgames/the_aether/AetherConfig.java @@ -11,7 +11,7 @@ public class AetherConfig { private static int max_life_shards; - private static boolean christmas_content, tallgrass; + private static boolean christmas_content, tallgrass, seasonal_christmas; private static int aether_biome_id, aether_dimension_id; @@ -49,6 +49,7 @@ public class AetherConfig { config.load(); christmas_content = config.get("Aether World Generation", "Christmas Content", false).getBoolean(false); + seasonal_christmas = config.get("Aether World Generation", "Spawns Holiday Trees during December and January automatically. Christmas Content overrides this.", true).getBoolean(true); tallgrass = config.get("Aether World Generation", "Enable Tall Grass", false).getBoolean(false); aether_dimension_id = config.get("World Identification", "Aether Dimension ID", 4).getInt(4); @@ -177,4 +178,8 @@ public class AetherConfig { { return disable_eternal_day; } + + public static boolean allowSeasonalChristmas() { + return seasonal_christmas; + } } \ No newline at end of file diff --git a/src/main/java/com/gildedgames/the_aether/world/biome/AetherBiomeDecorator.java b/src/main/java/com/gildedgames/the_aether/world/biome/AetherBiomeDecorator.java index 7368c36..8271127 100644 --- a/src/main/java/com/gildedgames/the_aether/world/biome/AetherBiomeDecorator.java +++ b/src/main/java/com/gildedgames/the_aether/world/biome/AetherBiomeDecorator.java @@ -1,5 +1,6 @@ package com.gildedgames.the_aether.world.biome; +import java.util.Calendar; import java.util.Random; import com.gildedgames.the_aether.AetherConfig; @@ -97,8 +98,8 @@ public class AetherBiomeDecorator extends BiomeDecorator { this.getTree().generate(this.world, this.rand, x, y, z); } - - if (AetherConfig.shouldLoadHolidayContent()) { + if ((AetherConfig.shouldLoadHolidayContent()) || (AetherConfig.allowSeasonalChristmas() && + (Calendar.getInstance().get(Calendar.MONTH) + 1 == 12 || Calendar.getInstance().get(Calendar.MONTH) + 1 == 1))) { if (this.shouldSpawn(15)) { int x = this.chunk_X + 8; int z = this.chunk_Z + 8;