summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2011-10-01 17:07:34 +0100
committerElgarL <ElgarL@palmergames.com>2011-10-01 17:07:34 +0100
commitbfd60499133c106438b97e79c52409a3ec91e2f3 (patch)
tree70083578e0da841fef1f5de2fe1f192c4262147c
parentd2c02569d06657d9d67159df6e45c6a11154e668 (diff)
downloadEssentials-bfd60499133c106438b97e79c52409a3ec91e2f3.tar
Essentials-bfd60499133c106438b97e79c52409a3ec91e2f3.tar.gz
Essentials-bfd60499133c106438b97e79c52409a3ec91e2f3.tar.lz
Essentials-bfd60499133c106438b97e79c52409a3ec91e2f3.tar.xz
Essentials-bfd60499133c106438b97e79c52409a3ec91e2f3.zip
Missed Event class
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java
new file mode 100644
index 000000000..ccd6367f4
--- /dev/null
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java
@@ -0,0 +1,36 @@
+package org.anjocaido.groupmanager.events;
+
+import org.anjocaido.groupmanager.GroupManager;
+import org.bukkit.event.world.WorldInitEvent;
+import org.bukkit.event.world.WorldListener;
+
+
+
+/**
+ * @author ElgarL
+ *
+ * Handle new world creation from other plugins
+ *
+ */
+public class GMWorldListener extends WorldListener {
+
+ private final GroupManager plugin;
+
+ public GMWorldListener(GroupManager instance) {
+ plugin = instance;
+ }
+
+ @Override
+ public void onWorldInit(WorldInitEvent event) {
+ String worldName = event.getWorld().getName();
+
+ if (GroupManager.isLoaded() && !plugin.getWorldsHolder().isInList(worldName)) {
+ GroupManager.logger.info("New world detected...");
+ GroupManager.logger.info("Creating data for: " + worldName);
+ plugin.getWorldsHolder().setupWorldFolder(worldName);
+ plugin.getWorldsHolder().loadWorld(worldName);
+ if (plugin.getWorldsHolder().isInList(worldName))
+ GroupManager.logger.info("Don't forget to configure/mirror this world in config.yml.");
+ }
+ }
+} \ No newline at end of file