Skip to content

Commit

Permalink
use new dlist filter calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Feb 11, 2019
1 parent 641b7ae commit e24d7ee
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Expand Up @@ -91,7 +91,7 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
dList serverNames = new dList();
serverNames.setPrefix("servers");

for (dServer server : servers.filter(dServer.class)) {
for (dServer server : servers.filter(dServer.class, scriptEntry)) {
serverNames.add(server.getName());
}

Expand Down
Expand Up @@ -46,7 +46,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException
for (aH.Argument arg : aH.interpret(scriptEntry.getArguments())) {

if (!scriptEntry.hasObject("list")) {
scriptEntry.addObject("list", arg.asType(dList.class).filter(dServer.class));
scriptEntry.addObject("list", arg.asType(dList.class).filter(dServer.class, scriptEntry));
}
else {
arg.reportUnhandled();
Expand Down
Expand Up @@ -95,7 +95,7 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
dList serverNames = new dList();
serverNames.setPrefix("servers");

for (dServer server : servers.filter(dServer.class)) {
for (dServer server : servers.filter(dServer.class, scriptEntry)) {
serverNames.add(server.getName());
}

Expand Down
Expand Up @@ -53,7 +53,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException

else if (!scriptEntry.hasObject("players")
&& arg.matchesPrefix("players")) {
scriptEntry.addObject("players", arg.asType(dList.class).filter(dPlayer.class));
scriptEntry.addObject("players", arg.asType(dList.class).filter(dPlayer.class, scriptEntry));
}

else if (!scriptEntry.hasObject("files")) {
Expand Down
Expand Up @@ -61,17 +61,17 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException
else if (!scriptEntry.hasObject("add")
&& arg.matchesPrefix("add", "join")
&& arg.matchesArgumentList(dPlayer.class)) {
scriptEntry.addObject("add", arg.asType(dList.class).filter(dPlayer.class));
scriptEntry.addObject("add", arg.asType(dList.class).filter(dPlayer.class, scriptEntry));
}
else if (!scriptEntry.hasObject("remove")
&& arg.matchesPrefix("remove", "leave")
&& arg.matchesArgumentList(dPlayer.class)) {
scriptEntry.addObject("remove", arg.asType(dList.class).filter(dPlayer.class));
scriptEntry.addObject("remove", arg.asType(dList.class).filter(dPlayer.class, scriptEntry));
}
else if (!scriptEntry.hasObject("spectate")
&& arg.matchesPrefix("spectate", "spec")
&& arg.matchesArgumentList(dPlayer.class)) {
scriptEntry.addObject("spectate", arg.asType(dList.class).filter(dPlayer.class));
scriptEntry.addObject("spectate", arg.asType(dList.class).filter(dPlayer.class, scriptEntry));
}
else {
arg.reportUnhandled();
Expand Down
Expand Up @@ -127,7 +127,7 @@ public boolean applyDetermination(ScriptContainer container, String determinatio
return true;
}
else if (aH.Argument.valueOf(determination).matchesArgumentList(dItem.class)) {
List<dItem> items = dList.valueOf(determination).filter(dItem.class);
List<dItem> items = dList.valueOf(determination).filter(dItem.class, container);
for (dItem i : items) {
newDrops.add(i.getItemStack());
}
Expand Down

0 comments on commit e24d7ee

Please sign in to comment.