2019-04-23 04:00:00 +02:00
--- a/net/minecraft/server/DimensionManager.java
+++ b/net/minecraft/server/DimensionManager.java
2019-05-14 02:00:00 +02:00
@@ -8,9 +8,11 @@
2019-05-12 03:15:48 +02:00
public class DimensionManager implements MinecraftSerializable {
2019-05-14 02:00:00 +02:00
- public static final DimensionManager OVERWORLD = register("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true));
- public static final DimensionManager NETHER = register("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false));
- public static final DimensionManager THE_END = register("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false));
2019-05-12 03:15:48 +02:00
+ // CraftBukkit start
2019-05-14 02:00:00 +02:00
+ public static final DimensionManager OVERWORLD = register("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true, null));
+ public static final DimensionManager NETHER = register("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false, null));
+ public static final DimensionManager THE_END = register("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false, null));
2019-05-12 03:15:48 +02:00
+ // CraftBukkit end
2019-05-14 02:00:00 +02:00
private final int id;
private final String suffix;
public final String folder;
@@ -21,12 +23,14 @@
return (DimensionManager) IRegistry.a(IRegistry.DIMENSION_TYPE, dimensionmanager.id, s, dimensionmanager);
2019-05-12 03:15:48 +02:00
}
- public DimensionManager(int i, String s, String s1, BiFunction<World, DimensionManager, ? extends WorldProvider> bifunction, boolean flag) {
+ // CraftBukkit - add type
+ public DimensionManager(int i, String s, String s1, BiFunction<World, DimensionManager, ? extends WorldProvider> bifunction, boolean flag, DimensionManager type) {
2019-05-14 02:00:00 +02:00
this.id = i;
this.suffix = s;
this.folder = s1;
this.providerFactory = bifunction;
this.hasSkyLight = flag;
2019-05-12 03:15:48 +02:00
+ this.type = type; // CraftBukkit
}
public static DimensionManager a(Dynamic<?> dynamic) {
@@ -80,4 +84,12 @@
public <T> T a(DynamicOps<T> dynamicops) {
return dynamicops.createString(IRegistry.DIMENSION_TYPE.getKey(this).toString());
}
+
+ // CraftBukkit start
+ private final DimensionManager type;
+
+ public DimensionManager getType() {
+ return (type == null) ? this : type;
+ }
+ // CraftBukkit end
}