Make MassiveCommandToggle more overrideable.
This commit is contained in:
parent
b0c74b0dd4
commit
25f127e099
@ -33,23 +33,32 @@ public abstract class MassiveCommandToggle extends MassiveCommand
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// ABSTRACT
|
||||
// VALUE
|
||||
// -------------------------------------------- //
|
||||
|
||||
public abstract boolean getValue();
|
||||
public abstract boolean getValue() throws MassiveException;
|
||||
|
||||
public abstract void setValue(boolean value);
|
||||
public abstract void setValue(boolean value) throws MassiveException;
|
||||
|
||||
// -------------------------------------------- //
|
||||
// GET NAME
|
||||
// NAME
|
||||
// -------------------------------------------- //
|
||||
|
||||
public String getName()
|
||||
public String getName() throws MassiveException
|
||||
{
|
||||
List<String> aliases = this.getAliases();
|
||||
return Txt.upperCaseFirst(aliases.get(aliases.size() - 1));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// TARGET
|
||||
// -------------------------------------------- //
|
||||
|
||||
public boolean readTarget(boolean before) throws MassiveException
|
||||
{
|
||||
return this.readArg(!before);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
// -------------------------------------------- //
|
||||
@ -59,7 +68,7 @@ public abstract class MassiveCommandToggle extends MassiveCommand
|
||||
{
|
||||
// Args
|
||||
boolean before = this.getValue();
|
||||
boolean after = this.readArg( ! before);
|
||||
boolean after = this.readTarget(before);
|
||||
String afterDesc = TypeBooleanOn.get().getVisual(after, sender);
|
||||
|
||||
// NoChange
|
||||
|
Loading…
Reference in New Issue
Block a user