diff --git a/src/main/java/eu/mhsl/craftattack/spawn/appliances/acInform/AcInform.java b/src/main/java/eu/mhsl/craftattack/spawn/appliances/acInform/AcInform.java index 50fa6bd..99e5365 100644 --- a/src/main/java/eu/mhsl/craftattack/spawn/appliances/acInform/AcInform.java +++ b/src/main/java/eu/mhsl/craftattack/spawn/appliances/acInform/AcInform.java @@ -20,17 +20,22 @@ public class AcInform extends Appliance { String checkName = null; Float violationCount = null; - for(int i = 0; i < args.length; i++) { - if(!args[i].startsWith("--")) continue; - if(i == args.length - 1) continue; - String nextArgument = args[i + 1]; - if(nextArgument.startsWith("--")) continue; + for (int i = 0; i < args.length; i++) { + if (!args[i].startsWith("--")) continue; - switch(args[i]) { - case "--anticheatName" -> anticheatName = nextArgument; - case "--playerName" -> playerName = nextArgument; - case "--check" -> checkName = nextArgument; - case "--violationCount" -> violationCount = Float.valueOf(nextArgument); + StringBuilder valueBuilder = new StringBuilder(); + for (int j = i + 1; j < args.length; j++) { + if (args[j].startsWith("--")) break; + if (!valueBuilder.isEmpty()) valueBuilder.append(" "); + valueBuilder.append(args[j]); + } + + String value = valueBuilder.toString(); + switch (args[i]) { + case "--anticheatName" -> anticheatName = value; + case "--playerName" -> playerName = value; + case "--check" -> checkName = value; + case "--violationCount" -> violationCount = value.isEmpty() ? null : Float.valueOf(value); } } @@ -39,7 +44,6 @@ public class AcInform extends Appliance { public void notifyAdmins(@Nullable String anticheatName, @Nullable String playerName, @Nullable String checkName, @Nullable Float violationCount) { ComponentBuilder component = Component.text(); - Component prefix = Component.text("# ", NamedTextColor.DARK_RED); NamedTextColor textColor = NamedTextColor.GRAY; if(playerName == null || playerName.isBlank())