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
else
{
message(Mson.prepondfix(
title.add(mson(":").color(ChatColor.GRAY)),
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);
}
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
// -------------------------------------------- //

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, ?>> void setInnerProperties(Collection<I> innerProperties) { this.innerProperties = new MassiveList<Property<T, ?>>(innerProperties); }
@SuppressWarnings("unchecked")
public <I extends Property<T, ?>> void setInnerProperties(I... innerProperties) { this.setInnerProperties(Arrays.asList(innerProperties)); }
@SafeVarargs
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)); }
// -------------------------------------------- //
@ -652,7 +652,7 @@ public abstract class TypeAbstract<T> implements Type<T>
{
if (this.hasInnerProperties())
{
return new CommandEditProperties<O, T>(settings, property, null);
return new CommandEditProperties<O, T>(settings, property, null);
}
else
{