diff options
author | ElgarL <ElgarL@palmergames.com> | 2011-10-01 17:58:44 +0100 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2011-10-01 17:58:44 +0100 |
commit | 0e867df1950ae9e056dc9a95ffd73c97bb56e2e5 (patch) | |
tree | 1e4311c4823b1eba68df2cc6f512d3ac25960efc /EssentialsGroupManager/src/org/anjocaido/groupmanager/events | |
parent | bfd60499133c106438b97e79c52409a3ec91e2f3 (diff) | |
download | Essentials-0e867df1950ae9e056dc9a95ffd73c97bb56e2e5.tar Essentials-0e867df1950ae9e056dc9a95ffd73c97bb56e2e5.tar.gz Essentials-0e867df1950ae9e056dc9a95ffd73c97bb56e2e5.tar.lz Essentials-0e867df1950ae9e056dc9a95ffd73c97bb56e2e5.tar.xz Essentials-0e867df1950ae9e056dc9a95ffd73c97bb56e2e5.zip |
Moved events into GMWorldListener
Better error output
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/events')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java index ccd6367f4..037971314 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java @@ -1,11 +1,11 @@ package org.anjocaido.groupmanager.events;
import org.anjocaido.groupmanager.GroupManager;
+import org.bukkit.event.Event;
import org.bukkit.event.world.WorldInitEvent;
import org.bukkit.event.world.WorldListener;
-
/**
* @author ElgarL
*
@@ -18,8 +18,13 @@ public class GMWorldListener extends WorldListener { public GMWorldListener(GroupManager instance) {
plugin = instance;
+ registerEvents();
}
+ private void registerEvents() {
+ plugin.getServer().getPluginManager().registerEvent(Event.Type.WORLD_INIT, this, Event.Priority.Lowest, plugin);
+ }
+
@Override
public void onWorldInit(WorldInitEvent event) {
String worldName = event.getWorld().getName();
@@ -29,8 +34,10 @@ public class GMWorldListener extends WorldListener { GroupManager.logger.info("Creating data for: " + worldName);
plugin.getWorldsHolder().setupWorldFolder(worldName);
plugin.getWorldsHolder().loadWorld(worldName);
- if (plugin.getWorldsHolder().isInList(worldName))
+ if (plugin.getWorldsHolder().isInList(worldName)) {
GroupManager.logger.info("Don't forget to configure/mirror this world in config.yml.");
- }
+ } else
+ GroupManager.logger.severe("Failed to configure this world.");
+ }
}
}
\ No newline at end of file |