summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-02-18 09:05:28 +0000
committerElgarL <ElgarL@palmergames.com>2012-02-18 09:05:28 +0000
commit3d1c0fd1578f0ee72cc7f65500f49f30f379ac54 (patch)
tree1d5e182afdb7c262ff73fd7f43173705fead8293 /EssentialsGroupManager
parent3fc6bb4e4ff070713b1f48fb70e57c3d97c73490 (diff)
downloadEssentials-3d1c0fd1578f0ee72cc7f65500f49f30f379ac54.tar
Essentials-3d1c0fd1578f0ee72cc7f65500f49f30f379ac54.tar.gz
Essentials-3d1c0fd1578f0ee72cc7f65500f49f30f379ac54.tar.lz
Essentials-3d1c0fd1578f0ee72cc7f65500f49f30f379ac54.tar.xz
Essentials-3d1c0fd1578f0ee72cc7f65500f49f30f379ac54.zip
A command of '/manload' with no world arguments now performs a full
reload of GM.
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java54
2 files changed, 23 insertions, 34 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index 4cfc241c4..31d40413f 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -140,4 +140,5 @@ v 1.9:
- Fixed world mirroring so it returns the correct data for the requested world.
- Change Service registration to register WorldsHolder instead of AnjoPermissionsHandler. This is the correct entry point for all data.
- Depreciate PlayerTeleportEvent, PlayerRespawnEvent and PlayerPortalEvent as it's all handled in PlayerChangedWorldEvent.
- This also means we no longer update permissions before we change worlds. \ No newline at end of file
+ This also means we no longer update permissions before we change worlds.
+ - A command of '/manload' with no world arguments now performs a full reload of GM. \ No newline at end of file
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
index b87d1de8c..d8d151200 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -25,7 +25,10 @@ import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.anjocaido.groupmanager.dataholder.worlds.WorldsHolder;
+import org.anjocaido.groupmanager.events.GMSystemEvent;
import org.anjocaido.groupmanager.events.GMWorldListener;
+import org.anjocaido.groupmanager.events.GroupManagerEventHandler;
+import org.anjocaido.groupmanager.events.GMGroupEvent.Action;
import org.anjocaido.groupmanager.utils.GMLoggerHandler;
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
import org.anjocaido.groupmanager.utils.Tasks;
@@ -1492,7 +1495,9 @@ public class GroupManager extends JavaPlugin {
return true;
case manload:
- // THIS CASE DONT NEED SENDER
+ /**
+ * Attempt to reload a specific world
+ */
if (args.length > 0) {
auxString = "";
for (int i = 0; i < args.length; i++) {
@@ -1502,51 +1507,34 @@ public class GroupManager extends JavaPlugin {
}
}
- isLoaded = false; // Disable Bukkit Perms update
+ isLoaded = false; // Disable Bukkit Perms update and event triggers
globalGroups.load();
worldsHolder.loadWorld(auxString);
- sender.sendMessage("The request to world '" + auxString + "' was sent.");
+ sender.sendMessage("The request to reload world '" + auxString + "' was attempted.");
isLoaded = true;
BukkitPermissions.updateAllPlayers();
- return true;
- }
- // VALIDANDO ESTADO DO SENDER
- if (dataHolder == null || permissionHandler == null) {
- if (!setDefaultWorldHandler(sender))
- return true;
- }
- // WORKING
- config.load();
- globalGroups.load();
- worldsHolder.mirrorSetUp();
-
- isLoaded = false;
-
- if (args.length > 0) {
- auxString = "";
- for (int i = 0; i < args.length; i++) {
- auxString += args[i];
- if ((i + 1) < args.length) {
- auxString += " ";
- }
- }
- worldsHolder.loadWorld(auxString);
- sender.sendMessage("The request to world '" + auxString + "' was sent.");
} else {
- worldsHolder.reloadAll();
- sender.sendMessage(ChatColor.YELLOW + " All worlds were reloaded.");
+
+ /**
+ * Reload all settings and data as no world was specified.
+ */
+ onDisable();
+ onEnable();
}
-
- isLoaded = true;
-
- BukkitPermissions.updateAllPlayers();
+
+ /**
+ * Fire an event as none will have been triggered in the reload.
+ */
+ if (GroupManager.isLoaded())
+ GroupManagerEventHandler.callEvent(GMSystemEvent.Action.RELOADED);
return true;
+
case listgroups:
// VALIDANDO ESTADO DO SENDER
if (dataHolder == null || permissionHandler == null) {