ForgePatch/patches_old/minecraft/net/minecraft/world/WorldType.java.patch

111 lines
4.4 KiB
Diff

--- ../src-base/minecraft/net/minecraft/world/WorldType.java
+++ ../src-work/minecraft/net/minecraft/world/WorldType.java
@@ -113,4 +114,145 @@
this.field_151361_l = true;
return this;
}
+
+ public net.minecraft.world.biome.BiomeProvider getBiomeProvider(World world)
+ {
+ if (this == field_77138_c)
+ {
+ net.minecraft.world.gen.FlatGeneratorInfo flatgeneratorinfo = net.minecraft.world.gen.FlatGeneratorInfo.func_82651_a(world.func_72912_H().func_82571_y());
+ return new net.minecraft.world.biome.BiomeProviderSingle(net.minecraft.world.biome.Biome.func_180276_a(flatgeneratorinfo.func_82648_a(), net.minecraft.init.Biomes.field_180279_ad));
+ }
+ else if (this == field_180272_g)
+ {
+ return new net.minecraft.world.biome.BiomeProviderSingle(net.minecraft.init.Biomes.field_76772_c);
+ }
+ else
+ {
+ return new net.minecraft.world.biome.BiomeProvider(world.func_72912_H());
+ }
+ }
+
+ public net.minecraft.world.gen.IChunkGenerator getChunkGenerator(World world, String generatorOptions)
+ {
+ if (this == field_77138_c) return new net.minecraft.world.gen.ChunkGeneratorFlat(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions);
+ if (this == field_180272_g) return new net.minecraft.world.gen.ChunkGeneratorDebug(world);
+ if (this == field_180271_f) return new net.minecraft.world.gen.ChunkGeneratorOverworld(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions);
+ return new net.minecraft.world.gen.ChunkGeneratorOverworld(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions);
+ }
+
+ public int getMinimumSpawnHeight(World world)
+ {
+ return this == field_77138_c ? 4 : world.func_181545_F() + 1;
+ }
+
+ public double getHorizon(World world)
+ {
+ return this == field_77138_c ? 0.0D : 63.0D;
+ }
+
+ public double voidFadeMagnitude()
+ {
+ return this == field_77138_c ? 1.0D : 0.03125D;
+ }
+
+ /*=================================================== FORGE START ======================================*/
+ private static int getNextID()
+ {
+ for (int x = 0; x < field_77139_a.length; x++)
+ {
+ if (field_77139_a[x] == null)
+ {
+ return x;
+ }
+ }
+
+ int oldLen = field_77139_a.length;
+ field_77139_a = java.util.Arrays.copyOf(field_77139_a, oldLen + 16);
+ return oldLen;
+ }
+
+ /**
+ * Creates a new world type, the ID is hidden and should not be referenced by modders.
+ * It will automatically expand the underlying workdType array if there are no IDs left.
+ * @param name
+ */
+ public WorldType(String name)
+ {
+ this(getNextID(), name);
+ }
+
+ /**
+ * Gets the spawn fuzz for players who join the world.
+ * Useful for void world types.
+ * @return Fuzz for entity initial spawn in blocks.
+ */
+ public int getSpawnFuzz(WorldServer world, net.minecraft.server.MinecraftServer server)
+ {
+ return Math.max(0, server.func_184108_a(world));
+ }+
+
+ /**
+ * Get the height to render the clouds for this world type
+ * @return The height to render clouds at
+ */
+ public float getCloudHeight()
+ {
+ return 128.0F;
+ }
+
+ /**
+ * Creates the GenLayerBiome used for generating the world with the specified ChunkProviderSettings JSON String
+ * *IF AND ONLY IF* this WorldType == WorldType.CUSTOMIZED.
+ *
+ *
+ * @param worldSeed The world seed
+ * @param parentLayer The parent layer to feed into any layer you return
+ * @param chunkSettings The ChunkGeneratorSettings constructed from the custom JSON
+ * @return A GenLayer that will return ints representing the Biomes to be generated, see GenLayerBiome
+ */
+ public net.minecraft.world.gen.layer.GenLayer getBiomeLayer(long worldSeed, net.minecraft.world.gen.layer.GenLayer parentLayer, net.minecraft.world.gen.ChunkGeneratorSettings chunkSettings)
+ {
+ net.minecraft.world.gen.layer.GenLayer ret = new net.minecraft.world.gen.layer.GenLayerBiome(200L, parentLayer, this, chunkSettings);
+ ret = net.minecraft.world.gen.layer.GenLayerZoom.func_75915_a(1000L, ret, 2);
+ ret = new net.minecraft.world.gen.layer.GenLayerBiomeEdge(1000L, ret);
+ return ret;
+ }
}