Fix ArrayOutOfBounds Exception

This commit is contained in:
RayzsYT committed 2024-06-09 00:51:27 +02:00
1 parent bcf64d297b
commit f0bb43fb51
4 files changed
+7 -11

No files matched your search

@@ -38,8 +38,8 @@ public class LegacyPacketHandler implements BukkitPacketHandler {
input = input.replace("/", "");
if(input.contains(" ")) {
String[] split = input.split(" ");
input = split[0];
spaces = split.length;
if(spaces > 0) input = split[0];
}
cancelsBeforeHand = Storage.Blacklist.isBlocked(player, input, !Storage.ConfigSections.Settings.TURN_BLACKLIST_TO_WHITELIST.ENABLED);
@@ -47,10 +47,10 @@ public class ModernPacketHandler implements BukkitPacketHandler {
int spaces = 0;
if(input.startsWith("/")) {
input = input.replace("/", "");
String[] split = input.split(" ");
if(input.contains(" ")) {
String[] split = input.split(" ");
spaces = split.length;
input = split[0];
if(spaces > 0) input = split[0];
}
cancelsBeforeHand = Storage.Blacklist.isBlocked(player, input, !Storage.ConfigSections.Settings.TURN_BLACKLIST_TO_WHITELIST.ENABLED);
@@ -175,10 +175,8 @@ public class BungeePacketAnalyzer {
if(playerInput.contains(" ")) {
String[] split = playerInput.split(" ");
if(split.length > 0) {
playerInput = split[0];
spaces = split.length;
}
spaces = split.length;
if(spaces > 0) playerInput = split[0];
}
if(!playerInput.equals("/"))
@@ -154,10 +154,8 @@ public class VelocityPacketAnalyzer {
if(playerInput.contains(" ")) {
String[] split = playerInput.split(" ");
if(split.length > 0) {
playerInput = split[0];
spaces = split.length;
}
spaces = split.length;
if(spaces > 0) playerInput = split[0];
}
if(!playerInput.equals("/"))