48 lines
1.7 KiB
Diff
48 lines
1.7 KiB
Diff
--- a/net/minecraft/world/WorldType.java
|
|
+++ b/net/minecraft/world/WorldType.java
|
|
@@ -4,7 +4,7 @@
|
|
import net.minecraftforge.api.distmarker.Dist;
|
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
|
|
-public class WorldType {
|
|
+public class WorldType implements net.minecraftforge.common.extensions.IForgeWorldType {
|
|
public static WorldType[] field_77139_a = new WorldType[16];
|
|
public static final WorldType field_77137_b = (new WorldType(0, "default", 1)).func_77129_f();
|
|
public static final WorldType field_77138_c = (new WorldType(1, "flat")).func_205392_a(true);
|
|
@@ -23,6 +23,10 @@
|
|
private boolean field_151361_l;
|
|
private boolean field_205395_p;
|
|
|
|
+ public WorldType(String name) {
|
|
+ this(getNextID(), name);
|
|
+ }
|
|
+
|
|
private WorldType(int p_i1959_1_, String p_i1959_2_) {
|
|
this(p_i1959_1_, p_i1959_2_, p_i1959_2_, 0);
|
|
}
|
|
@@ -32,6 +36,7 @@
|
|
}
|
|
|
|
private WorldType(int p_i49778_1_, String p_i49778_2_, String p_i49778_3_, int p_i49778_4_) {
|
|
+ if (p_i49778_2_.length() > 16 && field_180272_g != null) throw new IllegalArgumentException("World type names must not be longer then 16: " + p_i49778_2_);
|
|
this.field_77133_f = p_i49778_2_;
|
|
this.field_211890_l = p_i49778_3_;
|
|
this.field_77134_g = p_i49778_4_;
|
|
@@ -40,6 +45,16 @@
|
|
field_77139_a[p_i49778_1_] = this;
|
|
}
|
|
|
|
+ private static int getNextID() {
|
|
+ for (int x = 0; x < field_77139_a.length; x++) {
|
|
+ if (field_77139_a[x] == null)
|
|
+ return x;
|
|
+ }
|
|
+ int old = field_77139_a.length;
|
|
+ field_77139_a = java.util.Arrays.copyOf(field_77139_a, old + 16);
|
|
+ return old;
|
|
+ }
|
|
+
|
|
public String func_211888_a() {
|
|
return this.field_77133_f;
|
|
}
|