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