mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-21 10:52:01 +00:00
A command of '/manload' with no world arguments now performs a full
reload of GM.
This commit is contained in:
parent
3fc6bb4e4f
commit
3d1c0fd157
|
@ -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.
|
||||
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.
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue