MassiveCore - Minor Editor Stuff

This commit is contained in:
Olof Larsson 2016-05-11 08:53:22 +02:00
parent 44d525446b
commit ed15088ed5
No known key found for this signature in database
GPG Key ID: BBEF14F97DA52474
3 changed files with 20 additions and 7 deletions

View File

@ -329,8 +329,6 @@ public class CommandEditAbstract<O, V> extends MassiveCommand
// Others // Others
else else
{ {
message(Mson.prepondfix( message(Mson.prepondfix(
title.add(mson(":").color(ChatColor.GRAY)), title.add(mson(":").color(ChatColor.GRAY)),
show, show,

View File

@ -89,14 +89,29 @@ public class EditSettings<O>
} }
// -------------------------------------------- // // -------------------------------------------- //
// USED COMMAND // COMMAND CREATION
// -------------------------------------------- // // -------------------------------------------- //
public CommandEditUsed<O> createCommandEditUsed() public CommandEditUsed<O> createCommandUsed()
{ {
return new CommandEditUsed<O>(this); return new CommandEditUsed<O>(this);
} }
public CommandEditShow<O, O> createCommandShow()
{
return new CommandEditShow<O, O>(this, new PropertyThis<>(this.getObjectType()));
}
public CommandEditAbstract<O, O> createCommandEdit()
{
// TODO: Where does command creation belong? Inside the type or the edit settings.
// TODO: Resolve and research asymmetry between createCommandShow() and createCommandEdit().
// TODO: Where should the permission nodes and requirements be set?
CommandEditAbstract<O, O> ret = this.getObjectType().createEditCommand(this, new PropertyThis<>(this.getObjectType()));
ret.setAliases("edit");
return ret;
}
// -------------------------------------------- // // -------------------------------------------- //
// TYPE READ UTILITY // TYPE READ UTILITY
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -150,8 +150,8 @@ public abstract class TypeAbstract<T> implements Type<T>
public <I extends Property<T, ?>> I getInnerProperty(int index) { return (I) this.getInnerProperties().get(index); } public <I extends Property<T, ?>> I getInnerProperty(int index) { return (I) this.getInnerProperties().get(index); }
public <I extends Property<T, ?>> void setInnerProperties(Collection<I> innerProperties) { this.innerProperties = new MassiveList<Property<T, ?>>(innerProperties); } public <I extends Property<T, ?>> void setInnerProperties(Collection<I> innerProperties) { this.innerProperties = new MassiveList<Property<T, ?>>(innerProperties); }
@SuppressWarnings("unchecked") @SafeVarargs
public <I extends Property<T, ?>> void setInnerProperties(I... innerProperties) { this.setInnerProperties(Arrays.asList(innerProperties)); } public final <I extends Property<T, ?>> void setInnerProperties(I... innerProperties) { this.setInnerProperties(Arrays.asList(innerProperties)); }
public void setInnerProperties(Class<T> clazz) { this.setInnerProperties(PropertyReflection.getAll(clazz, this)); } public void setInnerProperties(Class<T> clazz) { this.setInnerProperties(PropertyReflection.getAll(clazz, this)); }
// -------------------------------------------- // // -------------------------------------------- //