mirror of
https://github.com/RayzsYT/ProAntiTab.git
synced 2026-11-30 20:39:53 -05:00
Minor
This commit is contained in:
1 parent
9fee87a28b
commit
c8359fd722
4 files changed
+26
-5
No files matched your search
@@ -45,15 +45,36 @@ public class ModernPacketHandler implements PacketHandler {
|
||||
}
|
||||
|
||||
boolean cancelsBeforeHand = false;
|
||||
int spaces = 0;
|
||||
if(input.startsWith("/")) {
|
||||
input = input.replace("/", "");
|
||||
String[] split = input.split(" ");
|
||||
if(input.contains(" ")) input = split[0];
|
||||
if(input.contains(" ")) {
|
||||
spaces = split.length;
|
||||
input = split[0];
|
||||
}
|
||||
|
||||
cancelsBeforeHand = Storage.Blacklist.isListed(input, !Storage.ConfigSections.Settings.TURN_BLACKLIST_TO_WHITELIST.ENABLED);
|
||||
}
|
||||
|
||||
Suggestions suggestions = (Suggestions) suggestionObj;
|
||||
if((input.length() < 1 || cancelsBeforeHand) && Reflection.isWeird())
|
||||
return false;
|
||||
|
||||
if(spaces > 1 && cancelsBeforeHand) {
|
||||
suggestions.getList().clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
if(spaces == 0) {
|
||||
suggestions.getList().removeIf(suggestion -> {
|
||||
String command = suggestion.getText();
|
||||
return Storage.Blacklist.isBlocked(player, command);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
if(input.length() < 1 && Reflection.isWeird() || cancelsBeforeHand && Reflection.isWeird())
|
||||
return false;
|
||||
else if(cancelsBeforeHand)
|
||||
@@ -65,7 +86,7 @@ public class ModernPacketHandler implements PacketHandler {
|
||||
String command = suggestion.getText();
|
||||
return Storage.Blacklist.isBlocked(player, command);
|
||||
});
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public class BukkitPlayerConnectionListener implements Listener {
|
||||
if(!Storage.ConfigSections.Settings.HANDLE_THROUGH_PROXY.ENABLED && Storage.OUTDATED && (PermissionUtil.hasPermission(player, "update"))) {
|
||||
Bukkit.getScheduler().runTaskLater(BukkitLoader.getPlugin(), () -> {
|
||||
if(player.isOnline()) {
|
||||
MessageTranslator.send(player, Storage.ConfigSections.Settings.UPDATE.OUTDATED.getLines());
|
||||
MessageTranslator.send(player, Storage.ConfigSections.Settings.UPDATE.OUTDATED.getLines(), "%player%", player.getName());
|
||||
}
|
||||
}, 20);
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ public class BungeePlayerConnectionListener implements Listener {
|
||||
if(Storage.OUTDATED && (PermissionUtil.hasPermission(player, "update"))) {
|
||||
ProxyServer.getInstance().getScheduler().schedule(BungeeLoader.getPlugin(), () -> {
|
||||
if (player.isConnected()) {
|
||||
MessageTranslator.send(player, Storage.ConfigSections.Settings.UPDATE.OUTDATED);
|
||||
MessageTranslator.send(player, Storage.ConfigSections.Settings.UPDATE.OUTDATED, "%player%", player.getName());
|
||||
}
|
||||
}, 1, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class VelocityConnectionListener {
|
||||
if(Storage.OUTDATED && (PermissionUtil.hasPermission(player, "update"))) {
|
||||
server.getScheduler().buildTask(loader, () -> {
|
||||
if (player.isActive())
|
||||
MessageTranslator.send(player, Storage.ConfigSections.Settings.UPDATE.OUTDATED);
|
||||
MessageTranslator.send(player, Storage.ConfigSections.Settings.UPDATE.OUTDATED, "%player%", player.getUsername());
|
||||
}).delay(1, TimeUnit.SECONDS).schedule();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user