From b8bbadd73ac194651c6d008864e48cb640365f00 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Mon, 9 Nov 2020 12:08:14 +1100 Subject: [PATCH] Fixed issues with the biome config file. Closes #1693 --- .../biomesoplenty/api/enums/BOPClimates.java | 2 +- .../common/biome/BiomeRegistry.java | 20 +++++++++---------- .../biomesoplenty/init/ModCompatibility.java | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/biomesoplenty/api/enums/BOPClimates.java b/src/main/java/biomesoplenty/api/enums/BOPClimates.java index 665c4e85d..f18966812 100644 --- a/src/main/java/biomesoplenty/api/enums/BOPClimates.java +++ b/src/main/java/biomesoplenty/api/enums/BOPClimates.java @@ -203,7 +203,7 @@ public enum BOPClimates { for (WeightedBiomeEntry entry : climate.landBiomes) { - System.out.println(climate.name()+" "+entry.biome.getRegistryName()+" "+entry.weight); + System.out.println(climate.name()+" "+entry.biome.location()+" "+entry.weight); } } } diff --git a/src/main/java/biomesoplenty/common/biome/BiomeRegistry.java b/src/main/java/biomesoplenty/common/biome/BiomeRegistry.java index a9d109859..deb78d562 100644 --- a/src/main/java/biomesoplenty/common/biome/BiomeRegistry.java +++ b/src/main/java/biomesoplenty/common/biome/BiomeRegistry.java @@ -184,7 +184,7 @@ public class BiomeRegistry for (DeferredRegistration registration : subBiomeRegistrations) { SubBiomeRegistrationData regData = registration.regData; - String biomeName = registration.regData.getChild().getRegistryName().toString(); + String biomeName = registration.regData.getChild().location().toString(); defaultSubBiomeEntries.put(biomeName, new BiomeConfigData.SubBiomeEntry(regData.getWeight(), regData.getRarity())); regDataMap.put(biomeName, registration.regData); } @@ -231,7 +231,7 @@ public class BiomeRegistry for (DeferredRegistration registration : biomeRegistrations) { SingleClimateRegistrationData regData = registration.regData; - String biomeName = regData.getBiome().getRegistryName().toString(); + String biomeName = regData.getBiome().location().toString(); defaultBiomeEntries.put(biomeName, new BiomeConfigData.ToggleableBiomeEntry(true)); } @@ -257,7 +257,7 @@ public class BiomeRegistry for (DeferredRegistration registration : biomeRegistrations) { SingleClimateRegistrationData regData = registration.regData; - String biomeName = regData.getBiome().getRegistryName().toString(); + String biomeName = regData.getBiome().location().toString(); if (revisedBiomeEntries.containsKey(biomeName)) { @@ -280,7 +280,7 @@ public class BiomeRegistry for (DeferredRegistration registration : biomeRegistrations) { SingleClimateRegistrationData regData = registration.regData; - String biomeName = registration.regData.getBiome().getRegistryName().toString(); + String biomeName = registration.regData.getBiome().location().toString(); defaultBiomeEntries.put(biomeName, new BiomeConfigData.WeightedBiomeEntry(regData.getWeight())); regDataMap.put(biomeName, registration.regData); } @@ -357,7 +357,7 @@ public class BiomeRegistry RegistryKey biome = ((SubBiomeRegistrationData)reg.regData).getChild(); if (children.contains(biome)) { - throw new RuntimeException(String.format("Sub biome %s cannot be added to multiple parents", biome.getRegistryName().toString())); + throw new RuntimeException(String.format("Sub biome %s cannot be added to multiple parents", biome.location().toString())); } children.add(biome); }); @@ -424,22 +424,22 @@ public class BiomeRegistry SUB_BIOME((SubBiomeRegistrationData data) -> { if (data.getWeight() == 0) { - BiomesOPlenty.logger.debug("Weights absent for sub biome" + data.getChild().getRegistryName().toString() + ", disabling..."); + BiomesOPlenty.logger.debug("Weights absent for sub biome" + data.getChild().location().toString() + ", disabling..."); return; } - String childName = data.getChild().getRegistryName().toString(); + String childName = data.getChild().location().toString(); BiomesOPlenty.logger.debug(String.format("Sub biome %s weight set to %d", childName, data.getWeight())); ModBiomes.subBiomes.put(BiomeUtil.getBiomeId(data.getParent()), new ModBiomes.WeightedSubBiome(data.getChild(), data.getRarity(), data.getWeight())); }), ISLAND_BIOME((SingleClimateRegistrationData data) -> { if (data.getWeight() == 0) { - BiomesOPlenty.logger.debug("Weights absent for island biome" + data.getBiome().getRegistryName().toString() + ", disabling..."); + BiomesOPlenty.logger.debug("Weights absent for island biome" + data.getBiome().location().toString() + ", disabling..."); return; } - String biomeName = data.getBiome().getRegistryName().toString(); + String biomeName = data.getBiome().location().toString(); BiomesOPlenty.logger.debug(String.format("Island biome %s weight set to %d for climate %s", biomeName, data.getWeight(), data.getClimate().name())); ModBiomes.islandBiomeIds.add(BiomeUtil.getBiomeId(data.getBiome())); data.getClimate().addIslandBiome(data.getWeight(), data.getBiome()); @@ -447,7 +447,7 @@ public class BiomeRegistry VANILLA_BIOME((SingleClimateRegistrationData data) -> { if (data.getWeight() == 0) { - BiomesOPlenty.logger.debug("Weights absent for vanilla biome" + data.getBiome().getRegistryName().toString() + ", disabling..."); + BiomesOPlenty.logger.debug("Weights absent for vanilla biome" + data.getBiome().location().toString() + ", disabling..."); return; } diff --git a/src/main/java/biomesoplenty/init/ModCompatibility.java b/src/main/java/biomesoplenty/init/ModCompatibility.java index 231fedd3c..94d8d0947 100644 --- a/src/main/java/biomesoplenty/init/ModCompatibility.java +++ b/src/main/java/biomesoplenty/init/ModCompatibility.java @@ -32,7 +32,7 @@ public class ModCompatibility // Removes vanilla entries by checking if the biome namespace is not "minecraft" // If a mod makes their biome with minecraft namespace, they need a bug report as that's a big no-no. List moddedBiomesInType = BiomeManager.getBiomes(type).stream() - .filter(biomeEntry -> !biomeEntry.getKey().getRegistryName().getNamespace().equals("minecraft")) + .filter(biomeEntry -> !biomeEntry.getKey().location().getNamespace().equals("minecraft")) .collect(Collectors.toList()); // calls remapBiomeToBoP on each modded biome and its weight.