mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 18:45:09 +00:00
Fix random shuffling when manipulating biomes by using a LinkedHashSet to preserve iteration order. Closes #111
This commit is contained in:
1 parent
dd39ae540b
commit
efb1066a88
1 file changed
+4
-6
@@ -45,11 +45,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String func_77127_a()
|
public String func_77127_a()
|
||||||
@@ -89,4 +109,63 @@
|
@@ -89,4 +109,61 @@
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ public WorldChunkManager getChunkManager(World world)
|
+ public WorldChunkManager getChunkManager(World world)
|
||||||
+ {
|
+ {
|
||||||
+ return this == field_77138_c ? new WorldChunkManagerHell(BiomeGenBase.field_76772_c, 0.5F, 0.5F) : new WorldChunkManager(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)
|
+ public void addNewBiome(BiomeGenBase biome)
|
||||||
+ {
|
+ {
|
||||||
+ Set<BiomeGenBase> newBiomesForWorld = Sets.newIdentityHashSet();
|
+ Set<BiomeGenBase> newBiomesForWorld = Sets.newLinkedHashSet(Arrays.asList(biomesForWorldType));
|
||||||
+ newBiomesForWorld.addAll(Arrays.asList(biomesForWorldType));
|
|
||||||
+ newBiomesForWorld.add(biome);
|
+ newBiomesForWorld.add(biome);
|
||||||
+ biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]);
|
+ biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public void removeBiome(BiomeGenBase biome)
|
+ public void removeBiome(BiomeGenBase biome)
|
||||||
+ {
|
+ {
|
||||||
+ Set<BiomeGenBase> newBiomesForWorld = Sets.newIdentityHashSet();
|
+ Set<BiomeGenBase> newBiomesForWorld = Sets.newLinkedHashSet(Arrays.asList(biomesForWorldType));
|
||||||
+ newBiomesForWorld.addAll(Arrays.asList(biomesForWorldType));
|
|
||||||
+ newBiomesForWorld.remove(biome);
|
+ newBiomesForWorld.remove(biome);
|
||||||
+ biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]);
|
+ biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]);
|
||||||
+ }
|
+ }
|
||||||
|
|||||||
Reference in new issue
Block a user