added FPerm arg reader.
This commit is contained in:
parent
96954e4eb2
commit
4e9d963c67
51
src/com/massivecraft/factions/cmd/arg/ARFPerm.java
Normal file
51
src/com/massivecraft/factions/cmd/arg/ARFPerm.java
Normal file
@ -0,0 +1,51 @@
|
||||
package com.massivecraft.factions.cmd.arg;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.FPerm;
|
||||
import com.massivecraft.mcore.cmd.arg.ARAbstractSelect;
|
||||
import com.massivecraft.mcore.util.Txt;
|
||||
|
||||
public class ARFPerm extends ARAbstractSelect<FPerm>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static ARFPerm i = new ARFPerm();
|
||||
public static ARFPerm get() { return i; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public String typename()
|
||||
{
|
||||
return "faction permission";
|
||||
}
|
||||
|
||||
@Override
|
||||
public FPerm select(String str, CommandSender sender)
|
||||
{
|
||||
return FPerm.parse(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> altNames(CommandSender sender)
|
||||
{
|
||||
List<String> ret = new ArrayList<String>();
|
||||
|
||||
for (FPerm fperm : FPerm.values())
|
||||
{
|
||||
ret.add(Txt.getNicedEnum(fperm));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user