testserver/Spigot-Server-Patches/0316-Avoid-dimension-id-col...

26 lines
1.2 KiB
Diff
Raw Normal View History

From 5e1bf74c8276c66d67df69c4482c4a11727b0c7f Mon Sep 17 00:00:00 2001
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
index 2e03556f2b..467583f1dc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2019-05-06 03:53:47 +00:00
@@ -971,7 +971,7 @@ public final class CraftServer implements Server {
boolean used = false;
do {
for (WorldServer server : console.getWorlds()) {
2019-05-14 02:20:58 +00:00
- used = server.getWorldProvider().getDimensionManager().getDimensionID() == dimension;
+ used = server.getWorldProvider().getDimensionManager().getDimensionID() + 1 == dimension; // Paper - getDimensionID returns the dimension - 1, so we have to add 1
if (used) {
dimension++;
break;
--
2019-05-05 11:32:20 +00:00
2.21.0