summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2013-02-22 12:59:50 +0000
committerElgarL <ElgarL@palmergames.com>2013-02-22 12:59:50 +0000
commit65251ade16f195e3d125aff56dfd7c4bef5acfe8 (patch)
treefd53dec1ad867d14af950632496bfe50848baaba /EssentialsGroupManager
parentfcf28e4b845a69dabbd3c2769fa0b32b0b82ed34 (diff)
downloadEssentials-65251ade16f195e3d125aff56dfd7c4bef5acfe8.tar
Essentials-65251ade16f195e3d125aff56dfd7c4bef5acfe8.tar.gz
Essentials-65251ade16f195e3d125aff56dfd7c4bef5acfe8.tar.lz
Essentials-65251ade16f195e3d125aff56dfd7c4bef5acfe8.tar.xz
Essentials-65251ade16f195e3d125aff56dfd7c4bef5acfe8.zip
Don't try to use the worldHolder before it's initialised.
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java15
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java2
2 files changed, 11 insertions, 6 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
index 0dc9a63e9..2553b3bc3 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
@@ -76,6 +76,11 @@ public class WorldsHolder {
return mirrorsUser;
}
+ public boolean isWorldKnown(String name) {
+
+ return worldsData.containsKey(name.toLowerCase());
+ }
+
public void resetWorldsHolder() {
worldsData = new HashMap<String, OverloadedWorldHolder>();
@@ -116,16 +121,16 @@ public class WorldsHolder {
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 (plugin.getWorldsHolder().getWorldData("all_unnamed_worlds") != null) {
+ if (worldsData.containsKey("all_unnamed_worlds")) {
- String usersMirror = plugin.getWorldsHolder().getMirrorsUser().get("all_unnamed_worlds");
- String groupsMirror = plugin.getWorldsHolder().getMirrorsGroup().get("all_unnamed_worlds");
+ String usersMirror = mirrorsUser.get("all_unnamed_worlds");
+ String groupsMirror = mirrorsGroup.get("all_unnamed_worlds");
if (usersMirror != null)
- plugin.getWorldsHolder().getMirrorsUser().put(world.getName().toLowerCase(), usersMirror);
+ mirrorsUser.put(world.getName().toLowerCase(), usersMirror);
if (groupsMirror != null)
- plugin.getWorldsHolder().getMirrorsGroup().put(world.getName().toLowerCase(), groupsMirror);
+ mirrorsGroup.put(world.getName().toLowerCase(), groupsMirror);
}
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java
index f89a70c4a..51937bd67 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java
@@ -36,7 +36,7 @@ public class GMWorldListener implements Listener {
GroupManager.logger.info("New world detected...");
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 groupsMirror = plugin.getWorldsHolder().getMirrorsGroup().get("all_unnamed_worlds");