mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-18 22:03:51 -07:00
@@ -35,15 +35,15 @@
|
||||
}
|
||||
|
||||
public void a(int i, int j, int k, boolean flag, boolean flag1, DimensionManager dimensionmanager) {
|
||||
@@ -47,7 +66,31 @@
|
||||
|
||||
@@ -48,7 +67,30 @@
|
||||
@Override
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
- this.map = DimensionManager.a(nbttagcompound.getInt("dimension"));
|
||||
int i = nbttagcompound.getInt("dimension");
|
||||
- DimensionManager dimensionmanager = DimensionManager.a(i);
|
||||
+ // CraftBukkit start
|
||||
+ int dimension = nbttagcompound.getInt("dimension");
|
||||
+ DimensionManager dimensionmanager = null;
|
||||
+
|
||||
+ if (dimension >= CraftWorld.CUSTOM_DIMENSION_OFFSET) {
|
||||
+ if (i >= CraftWorld.CUSTOM_DIMENSION_OFFSET) {
|
||||
+ long least = nbttagcompound.getLong("UUIDLeast");
|
||||
+ long most = nbttagcompound.getLong("UUIDMost");
|
||||
+
|
||||
@@ -55,20 +55,19 @@
|
||||
+ if (world == null) {
|
||||
+ /* All Maps which do not have their valid world loaded are set to a dimension which hopefully won't be reached.
|
||||
+ This is to prevent them being corrupted with the wrong map data. */
|
||||
+ this.map = new DimensionManager(127, null, null, null, false, DimensionManager.OVERWORLD);
|
||||
+ dimensionmanager = new DimensionManager(127, null, null, null, false, DimensionManager.OVERWORLD);
|
||||
+ } else {
|
||||
+ this.map = world.getHandle().getWorldProvider().getDimensionManager();
|
||||
+ dimensionmanager = world.getHandle().getWorldProvider().getDimensionManager();
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ this.map = DimensionManager.a(dimension);
|
||||
+ dimensionmanager = DimensionManager.a(i);
|
||||
+ }
|
||||
+
|
||||
+ // CraftBukkit end
|
||||
this.centerX = nbttagcompound.getInt("xCenter");
|
||||
this.centerZ = nbttagcompound.getInt("zCenter");
|
||||
this.scale = (byte) MathHelper.clamp(nbttagcompound.getByte("scale"), 0, 4);
|
||||
@@ -81,6 +124,25 @@
|
||||
|
||||
if (dimensionmanager == null) {
|
||||
throw new IllegalArgumentException("Invalid map dimension: " + i);
|
||||
@@ -88,6 +130,25 @@
|
||||
|
||||
@Override
|
||||
public NBTTagCompound b(NBTTagCompound nbttagcompound) {
|
||||
@@ -94,7 +93,7 @@
|
||||
nbttagcompound.setInt("dimension", this.map.getDimensionID());
|
||||
nbttagcompound.setInt("xCenter", this.centerX);
|
||||
nbttagcompound.setInt("zCenter", this.centerZ);
|
||||
@@ -372,12 +434,25 @@
|
||||
@@ -379,12 +440,25 @@
|
||||
|
||||
@Nullable
|
||||
public Packet<?> a(ItemStack itemstack) {
|
||||
|
Reference in New Issue
Block a user