fixed acinform not working with floating point numbers

This commit is contained in:
Elias Müller 2024-12-25 23:06:15 +01:00
parent e36256d5be
commit a33ee357e8

View File

@ -18,7 +18,7 @@ public class AcInform extends Appliance {
String anticheatName = null;
String playerName = null;
String checkName = null;
Integer violationCount = null;
Float violationCount = null;
for(int i = 0; i < args.length; i++) {
if(!args[i].startsWith("--")) continue;
@ -30,14 +30,14 @@ public class AcInform extends Appliance {
case "--anticheatName" -> anticheatName = nextArgument;
case "--playerName" -> playerName = nextArgument;
case "--check" -> checkName = nextArgument;
case "--violationCount" -> violationCount = Integer.valueOf(nextArgument);
case "--violationCount" -> violationCount = Float.valueOf(nextArgument);
}
}
this.notifyAdmins(anticheatName, playerName, checkName, violationCount);
}
public void notifyAdmins(@Nullable String anticheatName, @Nullable String playerName, @Nullable String checkName, @Nullable Integer violationCount) {
public void notifyAdmins(@Nullable String anticheatName, @Nullable String playerName, @Nullable String checkName, @Nullable Float violationCount) {
ComponentBuilder<TextComponent, TextComponent.Builder> component = Component.text();
Component prefix = Component.text("# ", NamedTextColor.DARK_RED);
NamedTextColor textColor = NamedTextColor.GRAY;