mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 19:34:09 +01:00
Prevent re-use of internal world dimension IDs. This fixes BUKKIT-448. Thanks to snowleo for the PR.
By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
127e32a023
commit
7f9357bd63
1 changed files with 10 additions and 0 deletions
|
@ -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 a new issue