Fix scripting

This commit is contained in:
Jesse Boyd 2016-06-12 15:26:58 +10:00
parent bfd9b53555
commit 6165469e76
3 changed files with 14 additions and 7 deletions

View File

@ -182,10 +182,6 @@ public class PS {
PS.debug("Incompatible version of WorldEdit, please upgrade: http://builds.enginehub.org/job/worldedit?branch=master");
}
}
// Commands
if (Settings.Enabled_Components.COMMANDS) {
this.IMP.registerCommands();
}
if (Settings.Enabled_Components.EVENTS) {
this.IMP.registerPlayerEvents();
this.IMP.registerInventoryEvents();
@ -232,6 +228,10 @@ public class PS {
AbstractTitle.TITLE_CLASS = this.IMP.initTitleManager();
// Chat
ChatManager.manager = this.IMP.initChatManager();
// Commands
if (Settings.Enabled_Components.COMMANDS) {
this.IMP.registerCommands();
}
// Economy
if (Settings.Enabled_Components.ECONOMY) {
TaskManager.runTask(new Runnable() {

View File

@ -60,10 +60,14 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
* @param value
*/
public void setMeta(String key, Object value) {
if (this.meta == null) {
this.meta = new ConcurrentHashMap<>();
if (value == null) {
deleteMeta(key);
} else {
if (this.meta == null) {
this.meta = new ConcurrentHashMap<>();
}
this.meta.put(key, value);
}
this.meta.put(key, value);
}
/**

View File

@ -59,6 +59,9 @@ public abstract class Command {
this.required = required;
this.category = cat;
this.aliases = Arrays.asList(id);
if (this.parent != null) {
this.parent.register(this);
}
}
public Command(Command parent, boolean isStatic) {