Paper/nms-patches/DimensionManager.patch

48 lines
2.6 KiB
Diff
Raw Normal View History

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 @@
public class DimensionManager implements MinecraftSerializable {
2019-12-10 23:00:00 +01:00
- 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
2019-12-10 23:00:00 +01:00
+ 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
2019-05-14 02:00:00 +02:00
private final int id;
private final String suffix;
public final String folder;
2019-12-10 23:00:00 +01:00
@@ -22,13 +24,15 @@
2019-05-14 02:00:00 +02:00
return (DimensionManager) IRegistry.a(IRegistry.DIMENSION_TYPE, dimensionmanager.id, s, dimensionmanager);
}
2019-12-10 23:00:00 +01:00
- public DimensionManager(int i, String s, String s1, BiFunction<World, DimensionManager, ? extends WorldProvider> bifunction, boolean flag, GenLayerZoomer genlayerzoomer) {
+ // CraftBukkit - add type
2019-12-10 23:00:00 +01:00
+ public DimensionManager(int i, String s, String s1, BiFunction<World, DimensionManager, ? extends WorldProvider> bifunction, boolean flag, GenLayerZoomer genlayerzoomer, 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-12-10 23:00:00 +01:00
this.genLayerZoomer = genlayerzoomer;
+ this.type = type; // CraftBukkit
}
public static DimensionManager a(Dynamic<?> dynamic) {
2019-12-10 23:00:00 +01:00
@@ -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
}