3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00
Paper/nms-patches/DimensionManager.patch

61 Zeilen
2.7 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 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) {
@@ -54,7 +58,7 @@
}
public String toString() {
- return a(this).toString();
+ return this.e + "(" + a(getType()) + ")"; // CraftBukkit
}
@Nullable
@@ -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
}