Paper/nms-patches/DimensionManager.patch
2019-12-11 09:00:00 +11:00

48 Zeilen
2.6 KiB
Diff

--- a/net/minecraft/server/DimensionManager.java
+++ b/net/minecraft/server/DimensionManager.java
@@ -8,9 +8,11 @@
public class DimensionManager implements MinecraftSerializable {
- public static final DimensionManager OVERWORLD = register("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true, GenLayerZoomVoronoiFixed.INSTANCE));
- public static final DimensionManager NETHER = register("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false, GenLayerZoomVoronoi.INSTANCE));
- public static final DimensionManager THE_END = register("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false, GenLayerZoomVoronoi.INSTANCE));
+ // CraftBukkit start
+ public static final DimensionManager OVERWORLD = register("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true, GenLayerZoomVoronoiFixed.INSTANCE, null));
+ public static final DimensionManager NETHER = register("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false, GenLayerZoomVoronoiFixed.INSTANCE, null));
+ public static final DimensionManager THE_END = register("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false, GenLayerZoomVoronoiFixed.INSTANCE, null));
+ // CraftBukkit end
private final int id;
private final String suffix;
public final String folder;
@@ -22,13 +24,15 @@
return (DimensionManager) IRegistry.a(IRegistry.DIMENSION_TYPE, dimensionmanager.id, s, dimensionmanager);
}
- public DimensionManager(int i, String s, String s1, BiFunction<World, DimensionManager, ? extends WorldProvider> bifunction, boolean flag, GenLayerZoomer genlayerzoomer) {
+ // CraftBukkit - add type
+ public DimensionManager(int i, String s, String s1, BiFunction<World, DimensionManager, ? extends WorldProvider> bifunction, boolean flag, GenLayerZoomer genlayerzoomer, DimensionManager type) {
this.id = i;
this.suffix = s;
this.folder = s1;
this.providerFactory = bifunction;
this.hasSkyLight = flag;
this.genLayerZoomer = genlayerzoomer;
+ this.type = type; // CraftBukkit
}
public static DimensionManager a(Dynamic<?> dynamic) {
@@ -86,4 +90,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
}