summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java1
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java11
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java13
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java1
4 files changed, 17 insertions, 9 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java
index 3a83491db..aa838d9e8 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java
@@ -8,6 +8,7 @@ import java.io.File;
import java.io.IOException;
import java.util.Map;
import java.util.logging.Level;
+
import org.anjocaido.groupmanager.utils.Tasks;
import org.bukkit.util.config.Configuration;
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
index 5f3e9e347..a13406eab 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -59,7 +59,7 @@ public class GroupManager extends JavaPlugin {
private GMConfiguration config;
private GMLoggerHandler ch;
public static BukkitPermissions BukkitPermissions;
- private WorldListener WorldEvents;
+ private static WorldListener WorldEvents;
public static final Logger logger = Logger.getLogger(GroupManager.class.getName());
//PERMISSIONS FOR COMMAND BEING LOADED
@@ -74,6 +74,10 @@ public class GroupManager extends JavaPlugin {
worldsHolder.saveChanges();
}
disableScheduler();
+
+ WorldEvents = null;
+ BukkitPermissions = null;
+
// EXAMPLE: Custom code, here we just output some info so we can check all is well
PluginDescriptionFile pdfFile = this.getDescription();
System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is disabled!");
@@ -99,12 +103,10 @@ public class GroupManager extends JavaPlugin {
throw new IllegalStateException("An error ocurred while loading GroupManager");
}
- // Setup the world listener and bukkit permissions to handle events.
+ // Initialize the world listener and bukkit permissions to handle events.
WorldEvents = new GMWorldListener(this);
BukkitPermissions = new BukkitPermissions(this);
- this.getServer().getPluginManager().registerEvent(Event.Type.WORLD_INIT, WorldEvents, Event.Priority.Lowest, this);
-
enableScheduler();
/*
@@ -117,7 +119,6 @@ public class GroupManager extends JavaPlugin {
setLoaded(true);
}
- //setLoaded(true);
System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
}
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
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
index b4035a1f5..5d153738e 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
@@ -43,7 +43,6 @@ import org.bukkit.event.server.ServerListener;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.permissions.PermissionAttachmentInfo;
-//import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;