mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-23 11:51:55 +00:00
Don't try to use the worldHolder before it's initialised.
This commit is contained in:
parent
90730f63d5
commit
8960417d56
|
@ -76,6 +76,11 @@ public class WorldsHolder {
|
||||||
return mirrorsUser;
|
return mirrorsUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isWorldKnown(String name) {
|
||||||
|
|
||||||
|
return worldsData.containsKey(name.toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
public void resetWorldsHolder() {
|
public void resetWorldsHolder() {
|
||||||
|
|
||||||
worldsData = new HashMap<String, OverloadedWorldHolder>();
|
worldsData = new HashMap<String, OverloadedWorldHolder>();
|
||||||
|
@ -116,16 +121,16 @@ public class WorldsHolder {
|
||||||
GroupManager.logger.log(Level.FINE, "Checking data for " + world.getName() + ".");
|
GroupManager.logger.log(Level.FINE, "Checking data for " + world.getName() + ".");
|
||||||
if ((!worldsData.containsKey(world.getName().toLowerCase())) && ((!mirrorsGroup.containsKey(world.getName().toLowerCase())) || (!mirrorsUser.containsKey(world.getName().toLowerCase())))) {
|
if ((!worldsData.containsKey(world.getName().toLowerCase())) && ((!mirrorsGroup.containsKey(world.getName().toLowerCase())) || (!mirrorsUser.containsKey(world.getName().toLowerCase())))) {
|
||||||
|
|
||||||
if (plugin.getWorldsHolder().getWorldData("all_unnamed_worlds") != null) {
|
if (worldsData.containsKey("all_unnamed_worlds")) {
|
||||||
|
|
||||||
String usersMirror = plugin.getWorldsHolder().getMirrorsUser().get("all_unnamed_worlds");
|
String usersMirror = mirrorsUser.get("all_unnamed_worlds");
|
||||||
String groupsMirror = plugin.getWorldsHolder().getMirrorsGroup().get("all_unnamed_worlds");
|
String groupsMirror = mirrorsGroup.get("all_unnamed_worlds");
|
||||||
|
|
||||||
if (usersMirror != null)
|
if (usersMirror != null)
|
||||||
plugin.getWorldsHolder().getMirrorsUser().put(world.getName().toLowerCase(), usersMirror);
|
mirrorsUser.put(world.getName().toLowerCase(), usersMirror);
|
||||||
|
|
||||||
if (groupsMirror != null)
|
if (groupsMirror != null)
|
||||||
plugin.getWorldsHolder().getMirrorsGroup().put(world.getName().toLowerCase(), groupsMirror);
|
mirrorsGroup.put(world.getName().toLowerCase(), groupsMirror);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class GMWorldListener implements Listener {
|
||||||
GroupManager.logger.info("New world detected...");
|
GroupManager.logger.info("New world detected...");
|
||||||
GroupManager.logger.info("Creating data for: " + worldName);
|
GroupManager.logger.info("Creating data for: " + worldName);
|
||||||
|
|
||||||
if (plugin.getWorldsHolder().getWorldData("all_unnamed_worlds") != null) {
|
if (plugin.getWorldsHolder().isWorldKnown("all_unnamed_worlds")) {
|
||||||
|
|
||||||
String usersMirror = plugin.getWorldsHolder().getMirrorsUser().get("all_unnamed_worlds");
|
String usersMirror = plugin.getWorldsHolder().getMirrorsUser().get("all_unnamed_worlds");
|
||||||
String groupsMirror = plugin.getWorldsHolder().getMirrorsGroup().get("all_unnamed_worlds");
|
String groupsMirror = plugin.getWorldsHolder().getMirrorsGroup().get("all_unnamed_worlds");
|
||||||
|
|
Loading…
Reference in a new issue