mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
Loads unloaded world before deleting (#2431)
* Loads unload world before deleting Fixes issue where unloaded worlds can't be deleted. * Missing commit line smh
This commit is contained in:
parent
9fce6c54f6
commit
146075de69
@ -525,6 +525,13 @@ public class WorldManager implements MVWorldManager {
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteWorld(String name, boolean removeFromConfig, boolean deleteWorldFolder) {
|
||||
if (this.hasUnloadedWorld(name, false)) {
|
||||
// Attempt to load if unloaded so we can actually delete the world
|
||||
if (!this.doLoad(name)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
World world = this.plugin.getServer().getWorld(name);
|
||||
if (world == null) {
|
||||
// We can only delete loaded worlds
|
||||
@ -937,6 +944,9 @@ public class WorldManager implements MVWorldManager {
|
||||
return this.configWorlds;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean hasUnloadedWorld(String name, boolean includeLoaded) {
|
||||
if (getMVWorld(name) != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user