Compare commits
19
Commits
backend-recode
...
v2.3.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
428ddfb78d | ||
|
|
56bd8be247 | ||
|
|
f7b2aa281e | ||
|
|
0599d504af | ||
|
|
471e0b100f | ||
|
|
52d842b27a | ||
|
|
dfc6ba91eb | ||
|
|
54d59d7b03 | ||
|
|
a4931199af | ||
|
|
02469e977c | ||
|
|
f9386fd3f1 | ||
|
|
242590f3e8 | ||
|
|
65c383491e | ||
|
|
0356c2f606 | ||
|
|
60067f75d3 | ||
|
|
e896ccb72d | ||
|
|
6c3dc58cd6 | ||
|
|
57ada83bfe | ||
|
|
8a86f05133 |
No files matched your search
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>de.rayzs.pat</groupId>
|
||||
<artifactId>ProAntiTab</artifactId>
|
||||
<version>2.3.1</version>
|
||||
<version>2.3.2</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
@@ -100,7 +100,7 @@
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
<version>1.20-R0.3-SNAPSHOT</version>
|
||||
<version>1.21-R0.5-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -227,14 +227,14 @@
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-text-minimessage</artifactId>
|
||||
<version>4.25.0</version>
|
||||
<version>4.26.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-api</artifactId>
|
||||
<version>4.25.0</version>
|
||||
<version>4.26.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import de.rayzs.pat.utils.Reflection;
|
||||
|
||||
public class CustomServerBrand {
|
||||
|
||||
public static final String CHANNEL_NAME = Reflection.getMinor() < 13 ? "MC|Brand" : "minecraft:brand";
|
||||
public static final String CHANNEL_NAME = Reflection.isBefore(1, 13) ? "MC|Brand" : "minecraft:brand";
|
||||
private static final ServerBrand SERVER_BRAND = Reflection.isVelocityServer() ? new VelocityServerBrand() : Reflection.isProxyServer() ? new BungeeServerBrand() : new BukkitServerBrand();
|
||||
|
||||
public static void initialize() { refreshTask(); }
|
||||
|
||||
@@ -30,7 +30,7 @@ public class BukkitServerBrand implements ServerBrand {
|
||||
|
||||
if (Reflection.isWeird()) {
|
||||
|
||||
NO_PREP_CHANNELS = Reflection.getMinor() >= 22 || (Reflection.getMinor() == 21 && Reflection.getRelease() >= 7);
|
||||
NO_PREP_CHANNELS = Reflection.isAtLeast(1, 21, 7);
|
||||
|
||||
if (brandPayloadClass == null)
|
||||
brandPayloadClass = Reflection.getClass("net.minecraft.network.protocol.common.custom.BrandPayload");
|
||||
|
||||
@@ -8,6 +8,7 @@ import de.rayzs.pat.plugin.BukkitLoader;
|
||||
import de.rayzs.pat.api.communication.*;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.*;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class BukkitClient implements Client, PluginMessageListener {
|
||||
|
||||
@@ -56,12 +57,22 @@ public class BukkitClient implements Client, PluginMessageListener {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
SERVER.sendPluginMessage(BukkitLoader.getPlugin(), CHANNEL_NAME, preparedPacket);
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
final Player carrier = selectCarrier();
|
||||
if (carrier == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
PATScheduler.execute(() -> {
|
||||
if (!carrier.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
carrier.sendPluginMessage(BukkitLoader.getPlugin(), CHANNEL_NAME, preparedPacket);
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}, carrier);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,4 +95,9 @@ public class BukkitClient implements Client, PluginMessageListener {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private Player selectCarrier() {
|
||||
final Iterator<? extends Player> iterator = SERVER.getOnlinePlayers().iterator();
|
||||
return iterator.hasNext() ? iterator.next() : null;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class BukkitPacketAnalyzer {
|
||||
|
||||
private static final String HANDLER_NAME = "pat-bukkit-handler", PIPELINE_NAME = "packet_handler";
|
||||
|
||||
private static final BukkitPacketHandler PACKET_HANDLER = Reflection.getMinor() >= 16 ? new ModernPacketHandler() : new LegacyPacketHandler();
|
||||
private static final BukkitPacketHandler PACKET_HANDLER = Reflection.isAtLeast(1, 16) ? new ModernPacketHandler() : new LegacyPacketHandler();
|
||||
private static final BukkitPacketHandler COMMANDS_NODE_HANDLER = new ModernCommandsNodeHandler();
|
||||
|
||||
private static final HashMap<Player, String> PLAYER_INPUT_CACHE = new HashMap<>();
|
||||
@@ -74,7 +74,10 @@ public class BukkitPacketAnalyzer {
|
||||
return success;
|
||||
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
if (!Storage.ConfigSections.Settings.INJECTION_FAILED.SUPPRESS_EXCEPTIONS) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ public class ModernPacketHandler implements BukkitPacketHandler {
|
||||
}
|
||||
|
||||
|
||||
if (Reflection.getMinor() < 17) {
|
||||
if (Reflection.isBefore(1, 17)) {
|
||||
Field suggestionsField = Reflection.getFieldsByType(packetObj.getClass(), "Suggestions", Reflection.SearchOption.ENDS).get(0);
|
||||
if (suggestionsField == null) return false;
|
||||
suggestionObj = suggestionsField.get(packetObj);
|
||||
|
||||
@@ -103,8 +103,11 @@ public class BungeePacketAnalyzer {
|
||||
channel.pipeline().addAfter(BungeePacketAnalyzer.PIPELINE_NAME, BungeePacketAnalyzer.HANDLER_NAME, new PacketDecoder(player));
|
||||
BungeePacketAnalyzer.INJECTED_PLAYERS.put(player, channel);
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
} catch (Exception exception) {
|
||||
if (!Storage.ConfigSections.Settings.INJECTION_FAILED.SUPPRESS_EXCEPTIONS) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@@ -118,8 +118,11 @@ public class VelocityPacketAnalyzer {
|
||||
Logger.warning("Failed to find 'handler' inside player pipeline! (name=" + player.getUsername() + ", uuid=" + player.getUniqueId() + ", version=" + player.getProtocolVersion() + ", brand=" + player.getClientBrand() + " )");
|
||||
return false;
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
} catch (Exception exception) {
|
||||
if (!Storage.ConfigSections.Settings.INJECTION_FAILED.SUPPRESS_EXCEPTIONS) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ public class Storage {
|
||||
getLoader().handleReload();
|
||||
PermissionUtil.reloadPermissions();
|
||||
|
||||
if (Reflection.getMinor() < 13) {
|
||||
if (Reflection.isBefore(1, 13)) {
|
||||
final List<UUID> playerIds = Storage.getLoader().getPlayerIds();
|
||||
final List<String> commands = new ArrayList<>(Blacklist.BLACKLIST.getCommands());
|
||||
|
||||
@@ -363,6 +363,7 @@ public class Storage {
|
||||
public static AutoLowercaseCommandsSection AUTO_LOWERCASE_COMMANDS = new AutoLowercaseCommandsSection();
|
||||
public static BlockNamespaceCommandsSection BLOCK_NAMESPACE_COMMANDS = new BlockNamespaceCommandsSection();
|
||||
public static HandleThroughProxySection HANDLE_THROUGH_PROXY = new HandleThroughProxySection();
|
||||
public static InjectionFailedSection INJECTION_FAILED = new InjectionFailedSection();
|
||||
public static PatchExploitSection PATCH_EXPLOITS = new PatchExploitSection();
|
||||
public static CustomBrandSection CUSTOM_BRAND = new CustomBrandSection();
|
||||
public static CancelCommandSection CANCEL_COMMAND = new CancelCommandSection();
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public class CustomProtocolPingSection extends ConfigStorage {
|
||||
public void load() {
|
||||
super.load();
|
||||
|
||||
if (!Reflection.isProxyServer() && (!Reflection.isPaper() || Reflection.getMinor() < 12))
|
||||
if (!Reflection.isProxyServer() && (!Reflection.isPaper() || Reflection.isBefore(1, 12)))
|
||||
return;
|
||||
|
||||
ENABLED = new ConfigSectionHelper<Boolean>(this, "enabled", true).getOrSet();
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package de.rayzs.pat.api.storage.config.settings;
|
||||
|
||||
import de.rayzs.pat.api.storage.storages.ConfigStorage;
|
||||
import de.rayzs.pat.utils.configuration.helper.ConfigSectionHelper;
|
||||
|
||||
public class InjectionFailedSection extends ConfigStorage {
|
||||
|
||||
public boolean ENABLED, SUPPRESS_EXCEPTIONS;
|
||||
public String KICK_MESSAGE, CONSOLE_MESSAGE;
|
||||
|
||||
public InjectionFailedSection() {
|
||||
super("injection-failed");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
super.load();
|
||||
ENABLED = new ConfigSectionHelper<Boolean>(this, "kick-on-failure", true).getOrSet();
|
||||
SUPPRESS_EXCEPTIONS = new ConfigSectionHelper<Boolean>(this, "suppress-exceptions", false).getOrSet();
|
||||
KICK_MESSAGE = new ConfigSectionHelper<String>(this, "kick-message", "&cInjection process failed! Please reconnect.").getOrSet();
|
||||
CONSOLE_MESSAGE = new ConfigSectionHelper<String>(this, "console-message", "&cInjection process failed! (%player%)").getOrSet();
|
||||
}
|
||||
}
|
||||
@@ -97,11 +97,11 @@ public class BukkitLoader extends JavaPlugin implements PluginLoader {
|
||||
manager.registerEvents(new BukkitPlayerListener(), this);
|
||||
manager.registerEvents(new BukkitBlockCommandListener(), this);
|
||||
|
||||
if (Reflection.getMinor() >= 13) {
|
||||
if (Reflection.isAtLeast(1, 13)) {
|
||||
manager.registerEvents(new BukkitAntiTabListener(), this);
|
||||
}
|
||||
|
||||
if (Reflection.isPaper() && Reflection.getMinor() >= 12)
|
||||
if (Reflection.isPaper() && Reflection.isAtLeast(1, 12))
|
||||
manager.registerEvents(new PaperServerListPing(), this);
|
||||
|
||||
registerCommand("proantitab", "pat");
|
||||
@@ -299,7 +299,7 @@ public class BukkitLoader extends JavaPlugin implements PluginLoader {
|
||||
}
|
||||
|
||||
public static void handleUpdateCommandsPacket(CommunicationPackets.Proxy2Backend.UpdatePacket packet) {
|
||||
if (Reflection.getMinor() < 13) {
|
||||
if (Reflection.isBefore(1, 13)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import java.util.*;
|
||||
|
||||
@Plugin(name = "ProAntiTab",
|
||||
id = "proantitab",
|
||||
version = "2.3.1",
|
||||
version = "2.3.2",
|
||||
authors = "Rayzs_YT",
|
||||
description = "Hides more than just your plugins.",
|
||||
url = "https://www.rayzs.de/products/proantitab/page",
|
||||
|
||||
@@ -97,7 +97,7 @@ public class BukkitAntiTabListener implements Listener {
|
||||
}
|
||||
|
||||
private static boolean notUpdatablePlayer(UUID uuid) {
|
||||
return Storage.USE_VIAVERSION && Reflection.getMinor() >= 16 && ViaVersionAdapter.getPlayerProtocol(uuid) < 754;
|
||||
return Storage.USE_VIAVERSION && Reflection.isAtLeast(1, 16) && ViaVersionAdapter.getPlayerProtocol(uuid) < 754;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import de.rayzs.pat.api.netty.bukkit.BukkitPacketAnalyzer;
|
||||
import de.rayzs.pat.api.communication.BackendUpdater;
|
||||
import de.rayzs.pat.plugin.logger.Logger;
|
||||
import de.rayzs.pat.utils.Reflection;
|
||||
import de.rayzs.pat.utils.StringUtils;
|
||||
import de.rayzs.pat.utils.message.MessageTranslator;
|
||||
import de.rayzs.pat.utils.permission.PermissionPlugin;
|
||||
import de.rayzs.pat.utils.permission.PermissionUtil;
|
||||
@@ -51,7 +52,7 @@ public class BukkitPlayerListener implements Listener {
|
||||
PermissionUtil.reloadPermissions(sender);
|
||||
}
|
||||
|
||||
if (Reflection.getMinor() >= 13) {
|
||||
if (Reflection.isAtLeast(1, 13)) {
|
||||
BukkitAntiTabListener.handleTabCompletion(player);
|
||||
}
|
||||
}, 20);
|
||||
@@ -63,15 +64,26 @@ public class BukkitPlayerListener implements Listener {
|
||||
PATScheduler.createScheduler(() -> {
|
||||
if (player.isOnline()) {
|
||||
if (!BukkitPacketAnalyzer.inject(player)) {
|
||||
Logger.warning("Failed to inject into player! (" + player.getName() + ")" );
|
||||
player.kickPlayer("Failed to inject player!");
|
||||
|
||||
if (Storage.ConfigSections.Settings.INJECTION_FAILED.ENABLED) {
|
||||
|
||||
Logger.info(MessageTranslator.replaceMessage(
|
||||
sender,
|
||||
Storage.ConfigSections.Settings.INJECTION_FAILED.CONSOLE_MESSAGE
|
||||
));
|
||||
|
||||
player.kickPlayer(MessageTranslator.replaceMessage(
|
||||
sender,
|
||||
Storage.ConfigSections.Settings.INJECTION_FAILED.KICK_MESSAGE
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
|
||||
// Update sub arguments for <1.12.2 servers.
|
||||
if (Reflection.getMinor() < 13) {
|
||||
if (Reflection.isBefore(1, 13)) {
|
||||
Storage.quickSubArgumentUpdate(uuid);
|
||||
}
|
||||
|
||||
@@ -107,7 +119,7 @@ public class BukkitPlayerListener implements Listener {
|
||||
assert sender != null;
|
||||
PermissionUtil.reloadPermissions(sender);
|
||||
|
||||
if (Reflection.getMinor() >= 13) {
|
||||
if (Reflection.isAtLeast(1, 13)) {
|
||||
BukkitAntiTabListener.handleTabCompletion(player);
|
||||
}
|
||||
}
|
||||
|
||||
+15
-4
@@ -66,12 +66,23 @@ public class VelocityConnectionListener {
|
||||
if (!VelocityPacketAnalyzer.isInjected(player)) {
|
||||
|
||||
if (!VelocityPacketAnalyzer.inject(player)) {
|
||||
Logger.warning("Attempting delayed injection for " + player.getUsername());
|
||||
server.getScheduler().buildTask(loader, () -> {
|
||||
|
||||
if (!VelocityPacketAnalyzer.inject(player)) {
|
||||
Logger.warning("Second injection for " + player.getUsername() + " failed as well!");
|
||||
player.disconnect(Component.text("Failed to inject player!"));
|
||||
|
||||
if (Storage.ConfigSections.Settings.INJECTION_FAILED.ENABLED) {
|
||||
|
||||
Logger.info(MessageTranslator.replaceMessage(
|
||||
player,
|
||||
Storage.ConfigSections.Settings.INJECTION_FAILED.CONSOLE_MESSAGE
|
||||
));
|
||||
|
||||
player.disconnect(Component.text(
|
||||
MessageTranslator.replaceMessage(
|
||||
player,
|
||||
Storage.ConfigSections.Settings.INJECTION_FAILED.KICK_MESSAGE
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
}).delay(1, TimeUnit.SECONDS).schedule();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class UpdateCommand extends ProCommand {
|
||||
}
|
||||
});
|
||||
|
||||
if (!Reflection.isProxyServer() && Reflection.getMinor() >= 13) {
|
||||
if (!Reflection.isProxyServer() && Reflection.isAtLeast(1, 13)) {
|
||||
BukkitAntiTabListener.handleTabCompletion();
|
||||
} else if (Reflection.isProxyServer()) {
|
||||
Communicator.Proxy2Backend.sendUpdateCommand();
|
||||
@@ -65,7 +65,7 @@ public class UpdateCommand extends ProCommand {
|
||||
|
||||
PermissionUtil.reloadPermissions(targetSender);
|
||||
|
||||
if (!Reflection.isProxyServer() && Reflection.getMinor() >= 13) {
|
||||
if (!Reflection.isProxyServer() && Reflection.isAtLeast(1, 13)) {
|
||||
BukkitAntiTabListener.handleTabCompletion(uuid);
|
||||
} else if (Reflection.isProxyServer()) {
|
||||
Communicator.Proxy2Backend.sendUpdateCommand(uuid, targetSender.getServerName());
|
||||
|
||||
@@ -78,6 +78,7 @@ public class SubArguments {
|
||||
}
|
||||
|
||||
final List<String> inputs = source.getAllInputs();
|
||||
final List<String> actuallyExistingCommands = helper.getChildrenNames();
|
||||
|
||||
if (turn) {
|
||||
List<String> allEntries = inputs.stream().map(StringUtils::getFirstArg).toList();
|
||||
@@ -98,8 +99,9 @@ public class SubArguments {
|
||||
|
||||
if (!negated) {
|
||||
|
||||
if (turn) helper.add(input, true);
|
||||
else helper.removeSubArguments(input);
|
||||
if (turn && actuallyExistingCommands.contains(StringUtils.getFirstArg(input))) {
|
||||
helper.add(input, true);
|
||||
} else helper.removeSubArguments(input);
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -112,7 +114,9 @@ public class SubArguments {
|
||||
input = Storage.Blacklist.BlockTypeFetcher.cleanse(input);
|
||||
|
||||
if (turn) helper.removeSubArguments(input);
|
||||
else helper.add(input, true);
|
||||
else if (actuallyExistingCommands.contains(StringUtils.getFirstArg(input))) {
|
||||
helper.add(input, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,11 +236,6 @@ public class SubArguments {
|
||||
online = Storage.getLoader().isPlayerOnline(s),
|
||||
general = Storage.getLoader().doesPlayerExist(s);
|
||||
|
||||
if (number) {
|
||||
split[i] = "%numbers%";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (online && general) {
|
||||
split[i] = "%both_players%";
|
||||
continue;
|
||||
@@ -247,8 +246,14 @@ public class SubArguments {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (general)
|
||||
if (general) {
|
||||
split[i] = "%players%";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (number) {
|
||||
split[i] = "%numbers%";
|
||||
}
|
||||
}
|
||||
|
||||
return String.join(" ", split);
|
||||
|
||||
@@ -14,7 +14,6 @@ public class Reflection {
|
||||
private static int major, minor, release;
|
||||
|
||||
private static Software software;
|
||||
private static Version version;
|
||||
|
||||
public static void initialize(Object serverObj) {
|
||||
|
||||
@@ -29,10 +28,9 @@ public class Reflection {
|
||||
|
||||
loadVersionName(serverObj);
|
||||
loadAges();
|
||||
loadVersionEnum();
|
||||
|
||||
legacy = minor <= 16;
|
||||
weird = Reflection.getMinor() == 20 && Reflection.getRelease() >= 6 || Reflection.getMinor() > 20;
|
||||
legacy = isAtMost(1, 16);
|
||||
weird = isAtLeast(1, 20, 6);
|
||||
|
||||
oldChannelMethod = software.isPaperBased() && weird;
|
||||
} catch (Exception exception) {
|
||||
@@ -56,7 +54,6 @@ public class Reflection {
|
||||
public static int[] getAges() { return new int[]{major, minor, release}; }
|
||||
public static String getVersionName() { return versionName; }
|
||||
public static String getRawVersionName() { return rawVersionName; }
|
||||
public static Version getVersion() { return version; }
|
||||
public static boolean isModern() { return !legacy; }
|
||||
public static boolean isLegacy() { return legacy; }
|
||||
public static boolean isWeird() { return weird; }
|
||||
@@ -300,7 +297,7 @@ public class Reflection {
|
||||
}
|
||||
|
||||
public static Object getPlayerNetworkManager(Object playerConnection) throws Exception {
|
||||
Optional<Field> optional = getFieldsByType(Reflection.getMinor() == 20 && Reflection.getRelease() > 2 || Reflection.getMinor() > 20 ? playerConnection.getClass().getSuperclass() : playerConnection.getClass(), "NetworkManager", SearchOption.ENDS).stream().findFirst();
|
||||
Optional<Field> optional = getFieldsByType(Reflection.isAfter(1, 20, 2) ? playerConnection.getClass().getSuperclass() : playerConnection.getClass(), "NetworkManager", SearchOption.ENDS).stream().findFirst();
|
||||
if(!optional.isPresent()) return null;
|
||||
return optional.get().get(playerConnection);
|
||||
}
|
||||
@@ -358,32 +355,68 @@ public class Reflection {
|
||||
versionPackageName = versionPackageName.substring(versionPackageName.lastIndexOf('.') + 1);
|
||||
}
|
||||
|
||||
private static void loadVersionEnum() {
|
||||
try {
|
||||
final String primaryVersionName, fullVersionName;
|
||||
StringBuilder builder = new StringBuilder("v_");
|
||||
builder.append(major).append("_").append(minor);
|
||||
primaryVersionName = builder.toString();
|
||||
if (release != 0) builder.append("_").append(release);
|
||||
fullVersionName = builder.toString();
|
||||
boolean couldFindOriginalVersion = Arrays.stream(Version.values()).anyMatch(searchingVersion -> searchingVersion.toString().equals(fullVersionName));
|
||||
version = Version.valueOf(couldFindOriginalVersion ? fullVersionName : primaryVersionName);
|
||||
} catch (Exception exception) {
|
||||
version = Version.UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
private static void loadAges() {
|
||||
String[] versionArgs = rawVersionName.split("_");
|
||||
final String[] versionArgs = rawVersionName.split("_");
|
||||
|
||||
major = Integer.parseInt(versionArgs[0]);
|
||||
minor = Integer.parseInt(versionArgs[1]);
|
||||
release = versionArgs.length > 2 ? Integer.parseInt(versionArgs[2]) : 0;
|
||||
|
||||
if (versionArgs.length >= 3) {
|
||||
|
||||
try {
|
||||
release = Integer.parseInt(versionArgs[2]);
|
||||
return;
|
||||
} catch (NumberFormatException ignored) {}
|
||||
|
||||
}
|
||||
|
||||
release = 0;
|
||||
}
|
||||
|
||||
public static int getMajor() { return major; }
|
||||
public static int getMinor() { return minor; }
|
||||
public static int getRelease() { return release; }
|
||||
|
||||
public static boolean isAtLeast(int major, int minor) {
|
||||
return Reflection.getMajor() > major || (Reflection.getMajor() == major && Reflection.getMinor() >= minor);
|
||||
}
|
||||
|
||||
public static boolean isAtLeast(int major, int minor, int release) {
|
||||
return Reflection.getMajor() > major
|
||||
|| (Reflection.getMajor() == major && Reflection.getMinor() > minor)
|
||||
|| (Reflection.getMajor() == major && Reflection.getMinor() == minor && Reflection.getRelease() >= release);
|
||||
}
|
||||
|
||||
public static boolean isAtMost(int major, int minor) {
|
||||
return Reflection.getMajor() < major || (Reflection.getMajor() == major && Reflection.getMinor() <= minor);
|
||||
}
|
||||
|
||||
public static boolean isAtMost(int major, int minor, int release) {
|
||||
return Reflection.getMajor() < major
|
||||
|| (Reflection.getMajor() == major && Reflection.getMinor() < minor)
|
||||
|| (Reflection.getMajor() == major && Reflection.getMinor() == minor && Reflection.getRelease() <= release);
|
||||
}
|
||||
|
||||
public static boolean isAfter(int major, int minor) {
|
||||
return Reflection.getMajor() > major || (Reflection.getMajor() == major && Reflection.getMinor() > minor);
|
||||
}
|
||||
|
||||
public static boolean isAfter(int major, int minor, int release) {
|
||||
return Reflection.getMajor() > major
|
||||
|| (Reflection.getMajor() == major && Reflection.getMinor() > minor)
|
||||
|| (Reflection.getMajor() == major && Reflection.getMinor() == minor && Reflection.getRelease() > release);
|
||||
}
|
||||
|
||||
public static boolean isBefore(int major, int minor) {
|
||||
return Reflection.getMajor() < major || (Reflection.getMajor() == major && Reflection.getMinor() < minor);
|
||||
}
|
||||
|
||||
public static boolean isBefore(int major, int minor, int release) {
|
||||
return Reflection.getMajor() < major
|
||||
|| (Reflection.getMajor() == major && Reflection.getMinor() < minor)
|
||||
|| (Reflection.getMajor() == major && Reflection.getMinor() == minor && Reflection.getRelease() < release);
|
||||
}
|
||||
|
||||
public enum Software {
|
||||
BUKKIT(false, false),
|
||||
SPIGOT(false, false),
|
||||
@@ -394,8 +427,9 @@ public class Reflection {
|
||||
WATERFALL(true, true),
|
||||
VELOCITY(true, true);
|
||||
|
||||
private final boolean paperBased, proxySoftware;
|
||||
private final String name;
|
||||
private final boolean paperBased, proxySoftware;
|
||||
|
||||
Software(final boolean paperBased, final boolean proxySoftware) {
|
||||
this.paperBased = paperBased;
|
||||
this.proxySoftware = proxySoftware;
|
||||
@@ -416,23 +450,5 @@ public class Reflection {
|
||||
}
|
||||
}
|
||||
|
||||
public enum Version {
|
||||
UNKNOWN, UNSUPPORTED,
|
||||
v_1_8, v_1_8_8,
|
||||
v_1_9, v_1_9_4,
|
||||
v_1_10, v_1_10_2,
|
||||
v_1_11, v_1_11_2,
|
||||
v_1_12, v_1_12_2,
|
||||
v_1_13, v_1_13_2,
|
||||
v_1_14, v_1_14_4,
|
||||
v_1_15, v_1_15_2,
|
||||
v_1_16, v_1_16_4, v_1_16_5,
|
||||
v_1_17, v_1_17_1, v_1_18,
|
||||
v_1_18_1, v_1_18_2,
|
||||
v_1_19, v_1_19_1, v_1_19_2, v_1_19_3, v_1_19_4,
|
||||
v_1_20, v_1_20_1, v_1_20_2, v_1_20_3, v_1_20_4, v_1_20_5, v_1_20_6,
|
||||
v_1_21, v_1_21_1, v_1_21_2, v_1_21_3, v_1_21_4, v_1_21_5, v_1_21_6, v_1_21_7, v_1_21_8, v_1_21_9, v_1_21_10, v_1_21_11
|
||||
}
|
||||
|
||||
public enum SearchOption { CONTAINS, EQUALS, ENDS, STARTS }
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class GroupManagerAdapter implements Listener {
|
||||
.filter(permission -> permission.startsWith("proantitab."))
|
||||
.forEach(permission -> PermissionUtil.setPermission(uuid, permission, true));
|
||||
|
||||
if (Reflection.getMinor() >= 13) {
|
||||
if (Reflection.isAtLeast(1, 13)) {
|
||||
BukkitAntiTabListener.handleTabCompletion(uuid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class LuckPermsAdapter {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Reflection.getMinor() >= 13)
|
||||
if (Reflection.isAtLeast(1, 13))
|
||||
BukkitAntiTabListener.handleTabCompletion(uuid);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class MessageTranslator {
|
||||
for (Map.Entry<Character, String> entry : colors.entrySet())
|
||||
endingColors.put(entry.getKey(), "</" + entry.getValue().substring(1));
|
||||
|
||||
support = !Reflection.isCraftbukkit() && (Reflection.getMinor() >= 18 || Reflection.isProxyServer());
|
||||
support = !Reflection.isCraftbukkit() && (Reflection.isAtLeast(1, 18) || Reflection.isProxyServer());
|
||||
|
||||
if (support) {
|
||||
translator = Reflection.isVelocityServer() ? new VelocityMessageTranslator()
|
||||
|
||||
@@ -150,8 +150,13 @@ public class ProxyCommandNodeHelper<T> {
|
||||
|
||||
String part = args[index];
|
||||
|
||||
if (index == 0)
|
||||
if (index == 0) {
|
||||
part = Storage.Blacklist.BlockTypeFetcher.modify(Storage.Blacklist.BlockTypeFetcher.modify(part));
|
||||
}
|
||||
|
||||
if (part.length() > 1 && part.startsWith("%") && part.endsWith("%")) {
|
||||
return;
|
||||
}
|
||||
|
||||
String next = index + 1 >= args.length ? null : args[index + 1];
|
||||
CommandNode<T> childNode = parent.getChild(part);
|
||||
|
||||
@@ -8,7 +8,7 @@ public class ActionHandler {
|
||||
|
||||
private static final Action ACTION = Reflection.isProxyServer() ? Reflection.isVelocityServer()
|
||||
? new VelocityAction() : new BungeeAction()
|
||||
: Reflection.getMinor() <= 16
|
||||
: Reflection.isAtMost(1, 16)
|
||||
? new OldBukkitAction() : new ModernBukkitAction();
|
||||
|
||||
public static void initialize() {}
|
||||
|
||||
@@ -3,7 +3,7 @@ description: Hides more than just your plugins.
|
||||
website: https://www.rayzs.de/products/proantitab/page
|
||||
|
||||
author: Rayzs_YT
|
||||
version: 2.3.1
|
||||
version: 2.3.2
|
||||
main: de.rayzs.pat.plugin.BungeeLoader
|
||||
|
||||
softDepends: [LuckPerms, PAPIProxyBridge]
|
||||
@@ -218,6 +218,17 @@ patch-exploits:
|
||||
alert-message: '%prefix% &4%player% &ctried to crash/lag the server.'
|
||||
kick-message: '&cFailed to read packet! Please reconnect.'
|
||||
|
||||
# Small extra option on how to respond to players who failed
|
||||
# the injection process. ONLY necessary for those who are using
|
||||
# a "spoofer plugins" which creates fake players with a corrupt
|
||||
# pipeline and does not provide any information on if a player is
|
||||
# spoofed or not.
|
||||
injection-failed:
|
||||
kick-on-failure: true
|
||||
suppress-exceptions: false
|
||||
kick-message: '&cInjection process failed! Please reconnect.'
|
||||
console-message: '&cInjection process failed! (%player%)'
|
||||
|
||||
#>> HTP (Overwritten)
|
||||
# This feature allows you to customize your server brand you see when you press F3.
|
||||
# Normally there is something like 'Purpur', or 'Spigot'.
|
||||
|
||||
@@ -185,9 +185,20 @@ auto-lowercase-commands:
|
||||
# it would be a waste not to provide some simple patches like these. ^^
|
||||
patch-exploits:
|
||||
enabled: true
|
||||
suppress-exceptions: false
|
||||
alert-message: '%prefix% &4%player% &ctried to crash/lag the server.'
|
||||
kick-message: '&cFailed to read packet! Please reconnect.'
|
||||
|
||||
# Small extra option on how to respond to players who failed
|
||||
# the injection process. ONLY necessary for those who are using
|
||||
# a "spoofer plugins" which creates fake players with a corrupt
|
||||
# pipeline and does not provide any information on if a player is
|
||||
# spoofed or not.
|
||||
injection-failed:
|
||||
kick-on-failure: true
|
||||
kick-message: '&cInjection process failed! Please reconnect.'
|
||||
console-message: '&cInjection process failed! (%player%)'
|
||||
|
||||
# This feature allows you to customize your server brand you see when you press F3.
|
||||
# Normally there is something like 'Purpur', or 'Spigot'.
|
||||
# With this feature, you are able to change and even animate it.
|
||||
|
||||
@@ -21,22 +21,19 @@
|
||||
# Example: alert
|
||||
# Execute console command:
|
||||
# Syntax: console::command
|
||||
# Example: console::say %player% is an evil player
|
||||
# Example: console::send %player% lobby
|
||||
# Execute player command:
|
||||
# Syntax: execute::command
|
||||
# Example: execute::help
|
||||
# Example: execute::server lobby
|
||||
# Send actionbar:
|
||||
# Syntax: actionbar::text
|
||||
# Example: actionbar::&cThis is not cool %player%!
|
||||
# Send title:
|
||||
# Syntax: title::title::subtitle::5::20::5
|
||||
# Example: title::&aTest title::&cHello %player%!
|
||||
# Play sound: (Available sounds: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html)
|
||||
# Play sound: (Available sounds: https://www.digminecraft.com/lists/sound_list_pc.php)
|
||||
# Syntax: sound::soundName::volume::pitch
|
||||
# Example: sound::ENTITY_ENDER_DRAGON_GROWL::1.0::1.0
|
||||
# Give potion effect:
|
||||
# Syntax: effect::potionEffect::duration::amplifier
|
||||
# Example: effect::BLINDNESS::45::1
|
||||
# Example: sound::entity.ender_dragon.growl::1.0::1.0
|
||||
# Send console message to backend server:
|
||||
# Syntax: p2b-message::text
|
||||
# Example: p2b-message::&cPlayer &4%player% &cdid something bad.
|
||||
@@ -125,7 +122,6 @@
|
||||
# - "&cThis sub-command does not exist. Please type: &e/ah help"
|
||||
# actions:
|
||||
# - "console::say That's not nice %player%!"
|
||||
# - "effect::BLINDNESS::45::1"
|
||||
# - "sound::ENTITY_ENDER_DRAGON_GROWL::1.0::1.0"
|
||||
# - "sound::entity.ender_dragon.growl::1.0::1.0"
|
||||
# - "title::&cHey!::&cYou can't do that %player%!::5::20::5"
|
||||
# - "actionbar::&cNop, sorry %player%"
|
||||
@@ -3,7 +3,7 @@ description: Hides more than just your plugins.
|
||||
website: https://www.rayzs.de/products/proantitab/page
|
||||
|
||||
author: Rayzs_YT
|
||||
version: 2.3.1
|
||||
version: 2.3.2
|
||||
api-version: 1.13
|
||||
folia-supported: true
|
||||
main: de.rayzs.pat.plugin.BukkitLoader
|
||||
|
||||
Reference in new issue
Block a user