diff --git a/src/com/massivecraft/massivecore/command/editor/CommandEditUsed.java b/src/com/massivecraft/massivecore/command/editor/CommandEditUsed.java index 3b6d4243..1b4125d9 100644 --- a/src/com/massivecraft/massivecore/command/editor/CommandEditUsed.java +++ b/src/com/massivecraft/massivecore/command/editor/CommandEditUsed.java @@ -11,7 +11,7 @@ public class CommandEditUsed extends CommandEditSimple public CommandEditUsed(EditSettings settings) { // Super - super(settings.createUsedSettings(), settings.getUsedProperty()); + super(settings.getUsedSettings(), settings.getUsedProperty()); // Aliases this.setAliases("used", "selected"); diff --git a/src/com/massivecraft/massivecore/command/editor/EditSettings.java b/src/com/massivecraft/massivecore/command/editor/EditSettings.java index 52b3d90a..864b07a6 100644 --- a/src/com/massivecraft/massivecore/command/editor/EditSettings.java +++ b/src/com/massivecraft/massivecore/command/editor/EditSettings.java @@ -26,6 +26,28 @@ public class EditSettings public Property getUsedProperty() { return this.usedProperty; } public void setUsedProperty(Property usedProperty) { this.usedProperty = usedProperty; } + // The Internal EditSettings for setting the used. + protected EditSettings usedSettings = null; + public EditSettings getUsedSettings() + { + if (this.usedSettings == null) + { + this.usedSettings = this.createUsedSettings(); + } + return this.usedSettings; + } + protected EditSettings createUsedSettings() + { + final EditSettings main = this; + return new EditSettings(TypeSender.get(), new PropertyThis(TypeSender.get())) { + @Override + public Permission getPropertyPermission(Property property) + { + return main.getUsedPermission(); + } + }; + } + // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // @@ -41,20 +63,6 @@ public class EditSettings this(objectType, null); } - public EditSettings createUsedSettings() - { - final EditSettings main = this; - return new EditSettings(TypeSender.get(), new PropertyThis(TypeSender.get())) { - - @Override - public Permission getPropertyPermission(Property property) - { - return main.getUsedPermission(); - }; - - }; - } - // -------------------------------------------- // // OBJECT // -------------------------------------------- //