mirror of
https://github.com/RayzsYT/ProAntiTab.git
synced 2026-11-15 21:35:54 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f7e6cd77a | ||
|
|
34cba027f9 | ||
|
|
db42fc1295 | ||
|
|
5270a432e9 | ||
|
|
ab052d62b5 | ||
|
|
a878944b33 |
No files matched your search
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>de.rayzs.pat</groupId>
|
||||
<artifactId>ProAntiTab</artifactId>
|
||||
<version>1.8.3</version>
|
||||
<version>1.8.5</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
|
||||
@@ -62,7 +62,7 @@ public class ModernPacketHandler implements BukkitPacketHandler {
|
||||
if(!cancelsBeforeHand) cancelsBeforeHand = Storage.ConfigSections.Settings.CUSTOM_VERSION.isCommand(input) || Storage.ConfigSections.Settings.CUSTOM_PLUGIN.isCommand(input);
|
||||
}
|
||||
|
||||
if(is121Packet || Reflection.isPaper() && packetObj.getClass().getSimpleName().equals("PacketPlayOutTabComplete")) {
|
||||
if(is121Packet || Reflection.isFoliaServer() && packetObj.getClass().getSimpleName().equals("PacketPlayOutTabComplete")) {
|
||||
try {
|
||||
Field suggestionsField = Reflection.getFieldsByTypeNormal(packetObj.getClass(), "List", Reflection.SearchOption.ENDS).get(0);
|
||||
List<?> suggestionsTmp = (List<?>) suggestionsField.get(packetObj),
|
||||
|
||||
@@ -189,7 +189,7 @@ public class Storage {
|
||||
|
||||
public static class Blacklist {
|
||||
|
||||
private static HashMap<String, GeneralBlacklist> SERVER_BLACKLISTS = new HashMap<>();
|
||||
private static final HashMap<String, GeneralBlacklist> SERVER_BLACKLISTS = new HashMap<>();
|
||||
private static final GeneralBlacklist BLACKLIST = BlacklistCreator.createGeneralBlacklist();
|
||||
private static final IgnoredServersStorage IGNORED_SERVERS = new GeneralIgnoredServers();
|
||||
private static final ExpireCache<String, List<GeneralBlacklist>> CACHED_SERVER_BLACKLIST = new ExpireCache<>(1, TimeUnit.HOURS);
|
||||
@@ -342,13 +342,22 @@ public class Storage {
|
||||
}
|
||||
|
||||
public static boolean isListed(Object playerObj, String command, boolean intensive, boolean listed, boolean slash, String server) {
|
||||
return isListed(playerObj, command, intensive, listed, slash, server, false);
|
||||
}
|
||||
|
||||
public static boolean isListed(Object playerObj, String command, boolean intensive, boolean listed, boolean slash, String server, boolean instantReturn) {
|
||||
if(GroupManager.getGroupsByServer(server).stream().anyMatch(group -> isInListed(command, group.getAllCommands(server), intensive) && group.hasPermission(playerObj)))
|
||||
return false;
|
||||
|
||||
if(!listed) for (GeneralBlacklist blacklist : getBlacklists(server)) {
|
||||
if(listed) return true;
|
||||
|
||||
for (GeneralBlacklist blacklist : getBlacklists(server)) {
|
||||
listed = blacklist.isListed(command, intensive, true, slash);
|
||||
if(instantReturn) return listed;
|
||||
|
||||
if(listed) break;
|
||||
}
|
||||
|
||||
return listed;
|
||||
}
|
||||
|
||||
@@ -371,18 +380,26 @@ public class Storage {
|
||||
if(focusOnBlock && blockedGlobal) return true;
|
||||
|
||||
for (GeneralBlacklist blacklist : getBlacklists(server)) {
|
||||
if(!focusOnBlock) {
|
||||
blockedServer = blacklist.isBlockedIgnorePermission(command, intensive);
|
||||
if (blockedServer) break;
|
||||
} else {
|
||||
if(blacklist.isBlocked(command, intensive)) return true;
|
||||
if(focusOnBlock && blacklist.isBlocked(command, intensive))
|
||||
return true;
|
||||
|
||||
blockedServer = blacklist.isBlockedIgnorePermission(command, intensive);
|
||||
break;
|
||||
|
||||
/* Former code
|
||||
if (!blacklist.isBlockedIgnorePermission(command, intensive)) {
|
||||
blockedServer = false;
|
||||
break;
|
||||
}
|
||||
|
||||
blockedServer = true;
|
||||
*/
|
||||
}
|
||||
|
||||
blocked = turn ? blockedGlobal && blockedServer : blockedServer || blockedGlobal;
|
||||
if(!blocked
|
||||
&& CACHED_SERVER_BLACKLIST.contains(server)
|
||||
&& CACHED_SERVER_BLACKLIST.get(server).size() == 0)
|
||||
&& CACHED_SERVER_BLACKLIST.get(server).isEmpty())
|
||||
if(turn) blocked = true;
|
||||
|
||||
return blocked;
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.*;
|
||||
|
||||
@Plugin(name = "ProAntiTab",
|
||||
id = "proantitab",
|
||||
version = "1.8.3",
|
||||
version = "1.8.5",
|
||||
authors = "Rayzs_YT",
|
||||
description = "Hide more than just your plugins. Hide almost everything!",
|
||||
dependencies = {
|
||||
|
||||
@@ -84,7 +84,7 @@ public class BungeeBlockCommandListener implements Listener {
|
||||
}
|
||||
|
||||
listed = Storage.Blacklist.isListed(command, false, true, false);
|
||||
serverListed = Storage.Blacklist.isListed(player, command, false, listed, false, serverName);
|
||||
serverListed = Storage.Blacklist.isListed(player, command, false, listed, false, serverName, true);
|
||||
ignored = Storage.Blacklist.isOnIgnoredServer(serverName);
|
||||
|
||||
if(ignored ? !listed && serverListed : serverListed) {
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@ public class VelocityBlockCommandListener {
|
||||
}
|
||||
|
||||
listed = Storage.Blacklist.isListed(command, false, true, false);
|
||||
serverListed = Storage.Blacklist.isListed(player, command, false, listed, false, serverName);
|
||||
serverListed = Storage.Blacklist.isListed(player, command, false, listed, false, serverName, true);
|
||||
ignored = Storage.Blacklist.isOnIgnoredServer(serverName);
|
||||
|
||||
if (ignored ? !listed && serverListed : serverListed) {
|
||||
|
||||
@@ -2,7 +2,7 @@ name: ProAntiTab
|
||||
description: Hide more than just your plugins. Hide almost everything!
|
||||
|
||||
author: Rayzs_YT
|
||||
version: 1.8.3
|
||||
version: 1.8.5
|
||||
main: de.rayzs.pat.plugin.BungeeLoader
|
||||
|
||||
softDepends:
|
||||
|
||||
@@ -2,7 +2,7 @@ name: ProAntiTab
|
||||
description: Hide more than just your plugins. Hide almost everything!
|
||||
|
||||
author: Rayzs_YT
|
||||
version: 1.8.3
|
||||
version: 1.8.5
|
||||
api-version: 1.13
|
||||
folia-supported: true
|
||||
main: de.rayzs.pat.plugin.BukkitLoader
|
||||
|
||||
Reference in new issue
Block a user