mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-05 18:29:34 +01:00
Now caches the world properties before unloading the world in order to prevent NPE on unload then load. Really fixes #947.
This commit is contained in:
parent
e5537dd8f1
commit
cce1ccc967
@ -373,17 +373,6 @@ public class MVWorld implements MultiverseWorld {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* This prepares the MVWorld for unloading.
|
||||
*/
|
||||
public void tearDown() {
|
||||
try {
|
||||
this.props.tearDown();
|
||||
} catch (IllegalStateException e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes permissions.
|
||||
*/
|
||||
|
@ -297,7 +297,7 @@ public class WorldProperties extends SerializationConfig {
|
||||
/**
|
||||
* This prepares the MVWorld for unloading.
|
||||
*/
|
||||
public void tearDown() {
|
||||
public void cacheVirtualProperties() {
|
||||
try {
|
||||
this.buildVPropChanges();
|
||||
} catch (IllegalStateException e) {
|
||||
|
@ -311,12 +311,10 @@ public class WorldManager implements MVWorldManager {
|
||||
@Override
|
||||
public boolean unloadWorld(String name) {
|
||||
if (this.worlds.containsKey(name)) {
|
||||
this.worldsFromTheConfig.get(name).cacheVirtualProperties();
|
||||
if (this.unloadWorldFromBukkit(name, true)) {
|
||||
this.worlds.remove(name);
|
||||
Logging.info("World '%s' was unloaded from memory.", name);
|
||||
|
||||
this.worldsFromTheConfig.get(name).tearDown();
|
||||
|
||||
return true;
|
||||
} else {
|
||||
Logging.warning("World '%s' could not be unloaded. Is it a default world?", name);
|
||||
|
Loading…
Reference in New Issue
Block a user