use of org.bukkit.scoreboard.RenderType in project Denizen-For-Bukkit by DenizenScript.
the class ScoreboardCommand method parseArgs.
@Override
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
for (Argument arg : scriptEntry) {
if (!scriptEntry.hasObject("action") && arg.matchesEnum(Action.class)) {
scriptEntry.addObject("action", arg.asElement());
} else if (!scriptEntry.hasObject("lines") && arg.matchesPrefix("lines", "l")) {
scriptEntry.addObject("lines", arg.asElement());
} else if (!scriptEntry.hasObject("id") && arg.matchesPrefix("id")) {
scriptEntry.addObject("id", arg.asElement());
} else if (!scriptEntry.hasObject("objective") && arg.matchesPrefix("objective", "obj", "o")) {
scriptEntry.addObject("objective", arg.asElement());
} else if (!scriptEntry.hasObject("criteria") && arg.matchesPrefix("criteria", "c")) {
scriptEntry.addObject("criteria", arg.asElement());
} else if (!scriptEntry.hasObject("score") && arg.matchesInteger()) {
scriptEntry.addObject("score", arg.asElement());
} else if (!scriptEntry.hasObject("displayslot") && (arg.matchesEnum(DisplaySlot.class) || arg.matches("none"))) {
scriptEntry.addObject("displayslot", arg.asElement());
} else if (!scriptEntry.hasObject("displayslot") && arg.matchesPrefix("displayname")) {
scriptEntry.addObject("displayname", arg.asElement());
} else if (!scriptEntry.hasObject("rendertype") && arg.matchesPrefix("rendertype") && arg.matchesEnum(RenderType.class)) {
scriptEntry.addObject("rendertype", arg.asElement());
} else if (!scriptEntry.hasObject("viewers") && arg.matchesArgumentList(PlayerTag.class)) {
scriptEntry.addObject("viewers", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry));
} else {
arg.reportUnhandled();
}
}
scriptEntry.defaultObject("action", new ElementTag("add"));
scriptEntry.defaultObject("id", new ElementTag("main"));
}
Aggregations