mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2025-01-09 07:37:37 +01:00
Fixed an issue with /mm reload
This commit is contained in:
parent
30fa13ffb1
commit
56996788a9
@ -383,7 +383,8 @@ public class MMOCore extends LuminePlugin {
|
||||
* @param clearBefore True when issuing a plugin reload
|
||||
*/
|
||||
public void initializePlugin(boolean clearBefore) {
|
||||
reloadConfig();
|
||||
if (clearBefore)
|
||||
reloadConfig();
|
||||
|
||||
configManager = new ConfigManager();
|
||||
|
||||
@ -417,6 +418,9 @@ public class MMOCore extends LuminePlugin {
|
||||
actionBarManager.reload(getConfig().getConfigurationSection("action-bar"));
|
||||
|
||||
StatType.load();
|
||||
|
||||
if (clearBefore)
|
||||
PlayerData.getAll().forEach(PlayerData::update);
|
||||
}
|
||||
|
||||
public static void log(String message) {
|
||||
|
@ -18,15 +18,11 @@ public class ReloadCommandTreeNode extends CommandTreeNode {
|
||||
sender.sendMessage(ChatColor.YELLOW + "Reloading " + MMOCore.plugin.getName() + " " + MMOCore.plugin.getDescription().getVersion() + "...");
|
||||
long ms = System.currentTimeMillis();
|
||||
|
||||
MMOCore.plugin.reloadConfig();
|
||||
MMOCore.plugin.initializePlugin(true);
|
||||
|
||||
PlayerData.getAll().forEach(PlayerData::update);
|
||||
|
||||
ms = System.currentTimeMillis() - ms;
|
||||
sender.sendMessage(ChatColor.YELLOW + MMOCore.plugin.getName() + " " + MMOCore.plugin.getDescription().getVersion() + " successfully reloaded.");
|
||||
sender.sendMessage(ChatColor.YELLOW + "Time Taken: " + ChatColor.GOLD + ms + ChatColor.YELLOW + "ms (" + ChatColor.GOLD + (double) ms / 50 + ChatColor.YELLOW + " ticks)");
|
||||
return CommandResult.SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,10 +41,8 @@ public class MythicHook implements Listener {
|
||||
// When MM is reloaded, reload placeholders because they are no longer registered
|
||||
registerPlaceholders();
|
||||
|
||||
// Reload skills
|
||||
MMOCore.plugin.skillManager.initialize(true);
|
||||
MMOCore.plugin.classManager.initialize(true);
|
||||
PlayerData.getAll().forEach(PlayerData::update);
|
||||
// Reload every god damn thing
|
||||
MMOCore.plugin.initializePlugin(true);
|
||||
}
|
||||
|
||||
private void registerPlaceholders() {
|
||||
|
Loading…
Reference in New Issue
Block a user