From 86b231ea7727cb95a9ecf750eeb6a160b6103700 Mon Sep 17 00:00:00 2001 From: LexManos Date: Tue, 27 Jun 2017 14:04:51 -0700 Subject: [PATCH] Fix BiomeDictionary not collecting correctly. --- .../minecraftforge/common/BiomeDictionary.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraftforge/common/BiomeDictionary.java b/src/main/java/net/minecraftforge/common/BiomeDictionary.java index 08ad93efce..d94a72758b 100644 --- a/src/main/java/net/minecraftforge/common/BiomeDictionary.java +++ b/src/main/java/net/minecraftforge/common/BiomeDictionary.java @@ -20,6 +20,7 @@ package net.minecraftforge.common; import java.util.*; +import java.util.stream.Collectors; import javax.annotation.Nonnull; @@ -36,6 +37,8 @@ import com.google.common.collect.ImmutableList; public class BiomeDictionary { + private static final boolean DEBUG = false; + public static final class Type { @@ -173,6 +176,7 @@ public class BiomeDictionary Preconditions.checkArgument(ForgeRegistries.BIOMES.containsValue(biome), "Cannot add types to unregistered biome %s", biome); Collection supertypes = listSupertypes(types); + Collections.addAll(supertypes, types); for (Type type : supertypes) { @@ -389,7 +393,7 @@ public class BiomeDictionary for (Type sType : Type.byName.values()) { - if (type.subTypes.contains(type) && supertypes.add(sType)) + if (sType.subTypes.contains(type) && supertypes.add(sType)) next.add(sType); } } @@ -461,5 +465,17 @@ public class BiomeDictionary addTypes(Biomes.MUTATED_MESA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE); addTypes(Biomes.MUTATED_MESA_ROCK, HOT, DRY, SPARSE, HILLS, RARE ); addTypes(Biomes.MUTATED_MESA_CLEAR_ROCK, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE); + + + if (DEBUG) + { + FMLLog.log.debug("BiomeDictionary:"); + for (Type type : Type.byName.values()) + { + StringBuilder buf = new StringBuilder(); + buf.append(" ").append(type.name).append(": ").append(type.biomes.stream().map(Biome::getBiomeName).collect(Collectors.joining(", "))); + FMLLog.log.debug(buf.toString()); + } + } } }