From 6a86a3cf3bd78525d893e56a81a0d83d8ffd29ea Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 10 Jul 2021 15:10:35 +0200 Subject: [PATCH] Update CustomCommandListener Signed-off-by: yoyosource --- .../bausystem/features/script/CustomCommandListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomCommandListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomCommandListener.java index 551fac93..9712ef4d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomCommandListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomCommandListener.java @@ -48,8 +48,7 @@ public class CustomCommandListener implements Listener { private final BookMeta bookMeta; private final String[] args; - public boolean execute(PlayerCommandPreprocessEvent e) { - String[] command = e.getMessage().split(" "); + public boolean execute(String[] command, PlayerCommandPreprocessEvent e) { if (args.length != command.length) { return false; } @@ -128,7 +127,8 @@ public class CustomCommandListener implements Listener { return; } - customCommands.stream().map(customCommand -> customCommand.execute(e)).filter(b -> !b).findFirst(); + String[] command = e.getMessage().split(" "); + customCommands.stream().map(customCommand -> customCommand.execute(command, e)).filter(b -> !b).findFirst(); } private boolean isNoBook(ItemStack item) {