2018-10-05 05:18:46 +02:00
|
|
|
From 5d31f8028750d115f3df2006f84a83146ac04bc9 Mon Sep 17 00:00:00 2001
|
2018-09-25 16:53:52 +02:00
|
|
|
From: Brokkonaut <hannos17@gmx.de>
|
|
|
|
Date: Tue, 25 Sep 2018 06:53:43 +0200
|
|
|
|
Subject: [PATCH] Avoid dimension id collisions
|
|
|
|
|
|
|
|
getDimensionId() returns the dimension id - 1. So without this patch
|
|
|
|
we would reuse an existing dimension id, if some other dimension was
|
|
|
|
unloaded before.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2018-09-27 04:35:42 +02:00
|
|
|
index 23663ede9f..cb2255a5d0 100644
|
2018-09-25 16:53:52 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
@@ -968,7 +968,7 @@ public final class CraftServer implements Server {
|
|
|
|
boolean used = false;
|
|
|
|
do {
|
|
|
|
for (WorldServer server : console.getWorlds()) {
|
|
|
|
- used = server.dimension.getDimensionID() == dimension;
|
|
|
|
+ used = server.dimension.getDimensionID() + 1 == dimension; // Paper - getDimensionID returns the dimension - 1, so we have to add 1
|
|
|
|
if (used) {
|
|
|
|
dimension++;
|
|
|
|
break;
|
|
|
|
--
|
2018-09-27 04:35:42 +02:00
|
|
|
2.19.0
|
2018-09-25 16:53:52 +02:00
|
|
|
|