Throw exception on world create while being ticked
There are no plans to support creating worlds while worlds are being ticked themselvess.
This commit is contained in:
@ -919,6 +919,11 @@ public final class CraftServer implements Server {
|
||||
return new ArrayList<World>(this.worlds.values());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTickingWorlds() {
|
||||
return console.isIteratingOverLevels;
|
||||
}
|
||||
|
||||
public DedicatedPlayerList getHandle() {
|
||||
return this.playerList;
|
||||
}
|
||||
@ -1182,6 +1187,7 @@ public final class CraftServer implements Server {
|
||||
@Override
|
||||
public World createWorld(WorldCreator creator) {
|
||||
Preconditions.checkState(this.console.getAllLevels().iterator().hasNext(), "Cannot create additional worlds on STARTUP");
|
||||
//Preconditions.checkState(!this.console.isIteratingOverLevels, "Cannot create a world while worlds are being ticked"); // Paper - Cat - Temp disable. We'll see how this goes.
|
||||
Preconditions.checkArgument(creator != null, "WorldCreator cannot be null");
|
||||
|
||||
String name = creator.name();
|
||||
@ -1358,6 +1364,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public boolean unloadWorld(World world, boolean save) {
|
||||
//Preconditions.checkState(!this.console.isIteratingOverLevels, "Cannot unload a world while worlds are being ticked"); // Paper - Cat - Temp disable. We'll see how this goes.
|
||||
if (world == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user