PaperMC/nms-patches/DimensionManager.patch

52 lines
2.6 KiB
Diff

--- a/net/minecraft/server/DimensionManager.java
+++ b/net/minecraft/server/DimensionManager.java
@@ -8,25 +8,29 @@
public class DimensionManager implements MinecraftSerializable {
- public static final DimensionManager OVERWORLD = a("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true));
- public static final DimensionManager NETHER = a("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false));
- public static final DimensionManager THE_END = a("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false));
+ // CraftBukkit start
+ public static final DimensionManager OVERWORLD = a("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true, null));
+ public static final DimensionManager NETHER = a("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false, null));
+ public static final DimensionManager THE_END = a("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false, null));
+ // CraftBukkit end
private final int d;
private final String e;
- private final String f;
- private final BiFunction<World, DimensionManager, ? extends WorldProvider> g;
+ public final String f;
+ public final BiFunction<World, DimensionManager, ? extends WorldProvider> g;
private final boolean h;
- private static DimensionManager a(String s, DimensionManager dimensionmanager) {
+ public static DimensionManager a(String s, DimensionManager dimensionmanager) {
return (DimensionManager) IRegistry.a(IRegistry.DIMENSION_TYPE, dimensionmanager.d, s, dimensionmanager);
}
- 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) {
this.d = i;
this.e = s;
this.f = s1;
this.g = bifunction;
this.h = flag;
+ 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
}