From 2bee77774086cc5ddf0948212710c6310d8bb2a0 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 25 Sep 2012 18:54:46 -0400 Subject: [PATCH] Fix random shuffling when manipulating biomes by using a LinkedHashSet to preserve iteration order. Closes #111 --- .../common/net/minecraft/src/WorldType.java.patch | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fml/patches/common/net/minecraft/src/WorldType.java.patch b/fml/patches/common/net/minecraft/src/WorldType.java.patch index b02c446ce8..71467a16ad 100644 --- a/fml/patches/common/net/minecraft/src/WorldType.java.patch +++ b/fml/patches/common/net/minecraft/src/WorldType.java.patch @@ -45,11 +45,11 @@ } public String func_77127_a() -@@ -89,4 +109,63 @@ +@@ -89,4 +109,61 @@ return null; } -+ ++ + public WorldChunkManager getChunkManager(World world) + { + return this == field_77138_c ? new WorldChunkManagerHell(BiomeGenBase.field_76772_c, 0.5F, 0.5F) : new WorldChunkManager(world); @@ -86,16 +86,14 @@ + + public void addNewBiome(BiomeGenBase biome) + { -+ Set newBiomesForWorld = Sets.newIdentityHashSet(); -+ newBiomesForWorld.addAll(Arrays.asList(biomesForWorldType)); ++ Set newBiomesForWorld = Sets.newLinkedHashSet(Arrays.asList(biomesForWorldType)); + newBiomesForWorld.add(biome); + biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]); + } + + public void removeBiome(BiomeGenBase biome) + { -+ Set newBiomesForWorld = Sets.newIdentityHashSet(); -+ newBiomesForWorld.addAll(Arrays.asList(biomesForWorldType)); ++ Set newBiomesForWorld = Sets.newLinkedHashSet(Arrays.asList(biomesForWorldType)); + newBiomesForWorld.remove(biome); + biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]); + }