}
List<String> events = new ArrayList<String>();
Map<String, dObject> context = new HashMap<String, dObject>();
events.add("reload scripts");
context.put("all", Element.TRUE);
context.put("sender", new Element(sender.getName()));
context.put("haderror", new Element(ScriptHelper.hadError()));
EventManager.doEvents(events, null, (sender instanceof Player) ? new dPlayer((Player) sender) : null, context);
return;
}
// Reload a specific item
if (args.length() > 2) {
if (args.getString(1).equalsIgnoreCase("saves")) {
denizen.reloadSaves();
Messaging.send(sender, "Denizen/saves.yml reloaded from disk to memory.");
return;
} else if (args.getString(1).equalsIgnoreCase("notables")) {
denizen.notableManager().reloadNotables();
Messaging.send(sender, "Denizen/notables.yml reloaded from disk to memory.");
return;
} else if(args.getString(1).equalsIgnoreCase("config")) {
denizen.reloadConfig();
Messaging.send(sender, "Denizen/config.yml reloaded from disk to memory.");
return;
} else if (args.getString(1).equalsIgnoreCase("scripts")) {
DenizenCore.reloadScripts();
Messaging.send(sender, "Denizen/scripts/... reloaded from disk to memory.");
if (ScriptHelper.hadError()) {
Messaging.sendError(sender, "There was an error loading your scripts, check the console for details!");
}
List<String> events = new ArrayList<String>();
Map<String, dObject> context = new HashMap<String, dObject>();
events.add("reload scripts");
context.put("all", Element.FALSE);
context.put("haderror", new Element(ScriptHelper.hadError()));
context.put("sender", new Element(sender.getName()));
EventManager.doEvents(events, null, (sender instanceof Player) ? new dPlayer((Player) sender) : null, context);
return;
}
else if (args.getString(1).equalsIgnoreCase("externals")) {
denizen.runtimeCompiler.reload();