mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-26 10:57:47 +01:00
Prevent re-use of internal world dimension IDs. This fixes BUKKIT-448. Thanks to snowleo for the PR.
This commit is contained in:
parent
b0f29b1755
commit
28fcbec3b1
@ -540,6 +540,16 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
int dimension = 10 + console.worlds.size();
|
||||
boolean used = false;
|
||||
do {
|
||||
for (WorldServer server : console.worlds) {
|
||||
used = server.dimension == dimension;
|
||||
if (used) {
|
||||
dimension++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while(used);
|
||||
boolean hardcore = false;
|
||||
WorldServer internal = new WorldServer(console, new ServerNBTManager(getWorldContainer(), name, true), name, dimension, new WorldSettings(creator.seed(), getDefaultGameMode().getValue(), true, hardcore, type), creator.environment(), generator);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user