======
- Fixed WorldType to allow custom WorldTypes in world creation GUI.
- Deprecated client WorldType.getSeaLevel() and renamed it with the more accurate name of getMinimumSpawnHeight.
- Changed related reference WorldProvider.

Server
======
- Fixed WorldType to allow custom WorldTypes
- Added methods to WorldType giving it the exact abilities of client WorldType
- Adjusted WorldProvider so that it relies on WorldType the same way it does on client.
This commit is contained in:
Scott Killen committed 2012-06-16 23:31:17 -04:00
1 parent aec5bbb50f
commit efc8d1bb37
4 files changed
+79 -12

No files matched your search

@@ -27,7 +27,7 @@
public int func_46066_g()
{
- return this.field_46067_b == WorldType.field_48636_c ? 4 : 64;
+ return this.field_46067_b.getSeaLevel(field_4216_a);
+ return this.field_46067_b.getMinimumSpawnHeight(field_4216_a);
}
public boolean func_46064_i()
@@ -10,16 +10,22 @@
public class WorldType
{
public static final WorldType[] field_48637_a = new WorldType[16];
@@ -11,6 +15,8 @@
@@ -11,17 +15,26 @@
private boolean field_48633_g;
private boolean field_48638_h;
+ private BiomeGenBase[] biomesForWorldType;
- private WorldType(int p_i1080_1_, String p_i1080_2_)
+ protected BiomeGenBase[] biomesForWorldType;
+
private WorldType(int p_i1080_1_, String p_i1080_2_)
+ protected WorldType(int p_i1080_1_, String p_i1080_2_)
{
this(p_i1080_1_, p_i1080_2_, 0);
@@ -22,6 +28,13 @@
}
- private WorldType(int p_i1081_1_, String p_i1081_2_, int p_i1081_3_)
+ protected WorldType(int p_i1081_1_, String p_i1081_2_, int p_i1081_3_)
{
this.field_46139_c = p_i1081_2_;
this.field_48632_f = p_i1081_3_;
this.field_48633_g = true;
field_48637_a[p_i1081_1_] = this;
@@ -33,7 +39,7 @@
}
public String func_48628_a()
@@ -78,4 +91,52 @@
@@ -78,4 +91,60 @@
return null;
}
@@ -48,8 +54,16 @@
+ return this == field_48636_c ? new ChunkProviderFlat(var1, var1.func_22138_q(), var1.func_22144_v().func_35917_r()) : new ChunkProviderGenerate(var1, var1.func_22138_q(), var1.func_22144_v().func_35917_r());
+ }
+
+ /**
+ * @deprecated Use {@link #getMinimumSpawnHeight(World)} instead
+ */
+ public int getSeaLevel(World var1)
+ {
+ return getMinimumSpawnHeight(var1);
+ }
+
+ public int getMinimumSpawnHeight(World world)
+ {
+ return this == field_48636_c ? 4 : 64;
+ }
+
@@ -0,0 +1,32 @@
--- ../src-base/minecraft_server/net/minecraft/src/WorldProvider.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src-work/minecraft_server/net/minecraft/src/WorldProvider.java 0000-00-00 00:00:00.000000000 -0000
@@ -32,19 +32,12 @@
protected void func_4090_a()
{
- if (this.field_4302_a.func_22081_n().func_46069_q() == WorldType.field_48458_c)
- {
- this.field_4301_b = new WorldChunkManagerHell(BiomeGenBase.field_35520_c, 0.5F, 0.5F);
- }
- else
- {
- this.field_4301_b = new WorldChunkManager(this.field_4302_a);
- }
+ this.field_4301_b = this.field_4302_a.func_22081_n().func_46069_q().getChunkManager(field_4302_a);
}
public IChunkProvider func_4087_c()
{
- return (IChunkProvider)(this.field_46120_b == WorldType.field_48458_c ? new ChunkProviderFlat(this.field_4302_a, this.field_4302_a.func_22079_j(), this.field_4302_a.func_22081_n().func_35499_o()) : new ChunkProviderGenerate(this.field_4302_a, this.field_4302_a.func_22079_j(), this.field_4302_a.func_22081_n().func_35499_o()));
+ return this.field_46120_b.getChunkGenerator(this.field_4302_a);
}
public boolean func_4092_a(int p_4092_1_, int p_4092_2_)
@@ -96,6 +89,6 @@
public int func_46119_e()
{
- return this.field_46120_b == WorldType.field_48458_c ? 4 : 64;
+ return this.field_46120_b.getMinimumSpawnHeight(field_4302_a);
}
}
@@ -10,16 +10,22 @@
public class WorldType
{
public static final WorldType[] field_48459_a = new WorldType[16];
@@ -11,6 +15,8 @@
@@ -11,17 +15,28 @@
private boolean field_48455_g;
private boolean field_48460_h;
+ private BiomeGenBase[] biomesForWorldType;
- private WorldType(int p_i1025_1_, String p_i1025_2_)
+ protected BiomeGenBase[] biomesForWorldType;
+
private WorldType(int p_i1025_1_, String p_i1025_2_)
+ protected WorldType(int p_i1025_1_, String p_i1025_2_)
{
this(p_i1025_1_, p_i1025_2_, 0);
@@ -22,6 +28,15 @@
}
- private WorldType(int p_i1026_1_, String p_i1026_2_, int p_i1026_3_)
+ protected WorldType(int p_i1026_1_, String p_i1026_2_, int p_i1026_3_)
{
this.field_46052_c = p_i1026_2_;
this.field_48454_f = p_i1026_3_;
this.field_48455_g = true;
field_48459_a[p_i1026_1_] = this;
@@ -35,11 +41,26 @@
}
public String func_48449_a()
@@ -68,4 +83,26 @@
@@ -68,4 +83,41 @@
return null;
}
+
+
+ public WorldChunkManager getChunkManager(World world)
+ {
+ return this == field_48458_c ? new WorldChunkManagerHell(BiomeGenBase.field_35520_c, 0.5F, 0.5F) : new WorldChunkManager(world);
+ }
+
+ public IChunkProvider getChunkGenerator(World var1)
+ {
+ return this == field_48458_c ? new ChunkProviderFlat(var1, var1.func_22079_j(), var1.func_22081_n().func_35499_o()) : new ChunkProviderGenerate(var1, var1.func_22079_j(), var1.func_22081_n().func_35499_o());
+ }
+
+ public int getMinimumSpawnHeight(World world)
+ {
+ return this == field_48458_c ? 4 : 64;
+ }
+
+ public BiomeGenBase[] getBiomesForWorldType() {
+ return biomesForWorldType;
+ }