diff --git a/src/main/java/biomesoplenty/common/biome/BiomeConfigData.java b/src/main/java/biomesoplenty/common/biome/BiomeConfigData.java index 5e75e1d05..596dbf0bd 100644 --- a/src/main/java/biomesoplenty/common/biome/BiomeConfigData.java +++ b/src/main/java/biomesoplenty/common/biome/BiomeConfigData.java @@ -13,14 +13,15 @@ import com.google.common.collect.Maps; import com.google.gson.annotations.SerializedName; import java.util.Map; +import java.util.TreeMap; public class BiomeConfigData { @SerializedName("standard_weights") - public Map standardBiomeWeights = Maps.newHashMap(); + public TreeMap standardBiomeWeights = Maps.newTreeMap(); @SerializedName("sub_biome_weights") - public Map subBiomeEntries = Maps.newHashMap(); + public TreeMap subBiomeEntries = Maps.newTreeMap(); //@SerializedName("island_biome_weights") //public Map islandBiomeEntries = Maps.newHashMap(); diff --git a/src/main/java/biomesoplenty/common/biome/BiomeRegistry.java b/src/main/java/biomesoplenty/common/biome/BiomeRegistry.java index 6a1f6e69a..044fad3b8 100644 --- a/src/main/java/biomesoplenty/common/biome/BiomeRegistry.java +++ b/src/main/java/biomesoplenty/common/biome/BiomeRegistry.java @@ -24,16 +24,11 @@ import net.minecraftforge.common.BiomeManager; import net.minecraftforge.fml.loading.FMLPaths; import net.minecraftforge.registries.ForgeRegistries; import org.apache.commons.lang3.tuple.Pair; -import org.lwjgl.system.CallbackI; - import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.function.Consumer; public class BiomeRegistry @@ -60,7 +55,7 @@ public class BiomeRegistry public static void configureStandardBiomes() { List standardRegistrations = deferrances.get(RegistrationType.STANDARD_BIOME); - Map defaultEntries = Maps.newHashMap(); + TreeMap defaultEntries = Maps.newTreeMap(); Map regDataMap = Maps.newHashMap(); for (DeferredRegistration registration : standardRegistrations) @@ -77,11 +72,13 @@ public class BiomeRegistry } } + BiomesOPlenty.logger.info(defaultEntries.keySet()); + BiomeConfigData defaultConfigData = new BiomeConfigData(); defaultConfigData.standardBiomeWeights = defaultEntries; BiomeConfigData configData = getConfigData(defaultConfigData); - Map revisedStandardBiomeWeights = Maps.newHashMap(defaultEntries); + TreeMap revisedStandardBiomeWeights = Maps.newTreeMap(defaultEntries); // Merge the config file with the default values for (Map.Entry biomeEntry : configData.standardBiomeWeights.entrySet()) @@ -113,7 +110,7 @@ public class BiomeRegistry public static void configureSubBiomes() { List subBiomeRegistrations = deferrances.get(RegistrationType.SUB_BIOME); - Map defaultSubBiomeEntries = Maps.newHashMap(); + TreeMap defaultSubBiomeEntries = Maps.newTreeMap(); Map regDataMap = Maps.newHashMap(); for (DeferredRegistration registration : subBiomeRegistrations) @@ -128,7 +125,7 @@ public class BiomeRegistry defaultConfigData.subBiomeEntries = defaultSubBiomeEntries; BiomeConfigData configData = getConfigData(defaultConfigData); - Map revisedSubBiomeEntries = Maps.newHashMap(defaultSubBiomeEntries); + TreeMap revisedSubBiomeEntries = Maps.newTreeMap(defaultSubBiomeEntries); // Merge the config file with the default values for (Map.Entry biomeEntry : configData.subBiomeEntries.entrySet()) @@ -162,7 +159,7 @@ public class BiomeRegistry { // Island biomes are currently not configurable due to them being registered multiple times for different climates // List islandBiomeReistrations = deferrances.get(RegistrationType.ISLAND_BIOME); -// Map defaultIslandBiomeEntries = Maps.newHashMap(); +// Map defaultIslandBiomeEntries = Maps.newTreeMap(); // Map regDataMap = Maps.newHashMap(); // // for (DeferredRegistration registration : islandBiomeReistrations)