diff --git a/src/com/massivecraft/massivecore/command/Parameter.java b/src/com/massivecraft/massivecore/command/Parameter.java index 19160f7b..438da24c 100644 --- a/src/com/massivecraft/massivecore/command/Parameter.java +++ b/src/com/massivecraft/massivecore/command/Parameter.java @@ -187,8 +187,7 @@ public class Parameter public static Parameter getPage() { - // We can't use a singletone, because people might - // want to set a description. + // We can't use a singleton because people might want to set a description. return new Parameter(1, TypeInteger.get(), "page", "1"); } diff --git a/src/com/massivecraft/massivecore/command/editor/Property.java b/src/com/massivecraft/massivecore/command/editor/Property.java index c0ea869b..23a5e2bb 100644 --- a/src/com/massivecraft/massivecore/command/editor/Property.java +++ b/src/com/massivecraft/massivecore/command/editor/Property.java @@ -146,11 +146,6 @@ public abstract class Property implements Named return this.getValueType().createEditCommand(settings, this); } - public String getDisplayName() - { - return ChatColor.AQUA.toString() + this.getName(); - } - public String getInheritedVisual(O object, O source, V value, CommandSender sender) { String string = this.getValueType().getVisual(value, sender); @@ -181,4 +176,34 @@ public abstract class Property implements Named return this.getInheritedVisual(object, source, value, sender); } + // -------------------------------------------- // + // VISUAL + // -------------------------------------------- // + + public String getDisplayName() + { + return ChatColor.AQUA.toString() + this.getName(); + } + + public List getShowLines(O object, CommandSender sender) + { + String ret = Txt.parse("%s: %s", this.getDisplayName(), this.getInheritedVisual(object, sender)); + return new MassiveList(Txt.PATTERN_NEWLINE.split(ret)); + } + + public static List getShowLines(O object, CommandSender sender, Collection> properties) + { + // Create + List ret = new MassiveList(); + + // Fill + for (Property property : properties) + { + ret.addAll(property.getShowLines(object, sender)); + } + + // Return + return ret; + } + } \ No newline at end of file