2019-01-17 02:02:56 +00:00
|
|
|
From 66ebfa5f368dcb5c0fc6c7861bd1fa4133d5a27e Mon Sep 17 00:00:00 2001
|
2018-09-25 14:53:52 +00: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
|
2019-01-17 02:02:56 +00:00
|
|
|
index 18bc27ee66..4dabd31d96 100644
|
2018-09-25 14:53:52 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2018-12-13 01:41:11 +00:00
|
|
|
@@ -973,7 +973,7 @@ public final class CraftServer implements Server {
|
2018-09-25 14:53:52 +00:00
|
|
|
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;
|
|
|
|
--
|
2019-01-01 03:15:55 +00:00
|
|
|
2.20.1
|
2018-09-25 14:53:52 +00:00
|
|
|
|