Skip to content

Commit

Permalink
update to match recent core cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 31, 2021
1 parent bbd539f commit d157132
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Expand Up @@ -75,7 +75,8 @@ public void process(ByteBuf data) {
entry.shouldDebugBool = false;
}
}
ScriptQueue queue = new InstantQueue("BUNGEE_").addEntries(entries);
ScriptQueue queue = new InstantQueue("BUNGEE_");
queue.addEntries(entries);
List<String> defSets = CoreUtilities.split(defs, '\r');
List<String> defNames = CoreUtilities.split(defSets.get(0), '\n');
List<String> defValues = CoreUtilities.split(defSets.get(1), '\n');
Expand Down
Expand Up @@ -71,7 +71,8 @@ public void process(ByteBuf data) {
if (entries.isEmpty()) {
return;
}
ScriptQueue queue = new InstantQueue("BUNGEERUN_" + scriptName).addEntries(entries);
ScriptQueue queue = new InstantQueue("BUNGEERUN_" + scriptName);
queue.addEntries(entries);
int x = 1;
TagContext context = new BukkitTagContext(linkedPlayer, null, script);
ListTag definitions = ListTag.valueOf(defs, context);
Expand Down
Expand Up @@ -67,7 +67,6 @@ else if (arg.matches("{")) {
if (!scriptEntry.hasObject("servers")) {
throw new InvalidArgumentsException("Must define servers to run the script on.");
}
scriptEntry.addObject("braces", getBracedCommands(scriptEntry));
}

@Override
Expand All @@ -80,14 +79,9 @@ public void execute(ScriptEntry scriptEntry) {
Debug.echoError("Cannot Bungee command: bungee is not connected!");
return;
}
List<BracedCommand.BracedData> bdlist = (List<BracedData>) scriptEntry.getObject("braces");
if (bdlist == null || bdlist.isEmpty()) {
Debug.echoError(scriptEntry.getResidingQueue(), "Empty subsection - did you forget a ':'?");
return;
}
List<ScriptEntry> bracedCommandsList = bdlist.get(0).value;
List<ScriptEntry> bracedCommandsList = BracedCommand.getBracedCommandsDirect(scriptEntry, scriptEntry);
if (bracedCommandsList == null || bracedCommandsList.isEmpty()) {
Debug.echoError(scriptEntry.getResidingQueue(), "Empty subsection - did you forget to add the sub-commands inside the command?");
Debug.echoError(scriptEntry.getResidingQueue(), "Empty subsection - did you forget a ':'?");
return;
}
StringBuilder toSend = new StringBuilder();
Expand Down

0 comments on commit d157132

Please sign in to comment.