summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) {