From 78503cf1b7549edb18917394ae7ff0032dfc4401 Mon Sep 17 00:00:00 2001 From: dfsek Date: Sun, 17 Apr 2022 20:44:57 -0700 Subject: [PATCH] add jank warning for future me --- .../terra/fabric/generation/TerraBiomeSource.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platforms/fabric/src/main/java/com/dfsek/terra/fabric/generation/TerraBiomeSource.java b/platforms/fabric/src/main/java/com/dfsek/terra/fabric/generation/TerraBiomeSource.java index 1db0a7fb2..aeedae4f9 100644 --- a/platforms/fabric/src/main/java/com/dfsek/terra/fabric/generation/TerraBiomeSource.java +++ b/platforms/fabric/src/main/java/com/dfsek/terra/fabric/generation/TerraBiomeSource.java @@ -45,6 +45,16 @@ public class TerraBiomeSource extends BiomeSource { .getBiomes() .spliterator(), false) .map(b -> ((ProtoPlatformBiome) b.getPlatformBiome()).getDelegate())); + /* + A little (unfortunately, required) jank to watch out for: + + The first time this BiomeSource gets created it passes a list of one null value to the superconstructor. + This is because the biomes haven't yet been made at that point in time. Once the client creates the world, + Minecraft *re-instantiates* the chunk generator, this is after the biomes have been created so it's populated with + real values. + + This code can therefore break pretty easily with changes to Minecraft, unfortunately Mojang gives us no other option. + */ this.biomeRegistry = biomes; this.seed = seed; this.pack = pack;