From e35e494c55003db38daebe69bf6fc9bfa6ba6d85 Mon Sep 17 00:00:00 2001 From: RayzsYT <51991564+RayzsYT@users.noreply.github.com> Date: Mon, 17 Jun 2024 03:09:21 +0200 Subject: [PATCH] Modify --- .../settings/CustomProtocolPingSection.java | 9 +++++---- src/main/resources/files/bukkit-config.yml | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/rayzs/pat/api/storage/config/settings/CustomProtocolPingSection.java b/src/main/java/de/rayzs/pat/api/storage/config/settings/CustomProtocolPingSection.java index 30880150..af03d07a 100644 --- a/src/main/java/de/rayzs/pat/api/storage/config/settings/CustomProtocolPingSection.java +++ b/src/main/java/de/rayzs/pat/api/storage/config/settings/CustomProtocolPingSection.java @@ -6,7 +6,7 @@ import de.rayzs.pat.utils.configuration.helper.ConfigSectionHelper; public class CustomProtocolPingSection extends ConfigStorage { - public boolean ENABLED, ALWAYS_SHOW; + public boolean ENABLED, ALWAYS_SHOW, HIDE_PLAYERS; public String PROTOCOL; public CustomProtocolPingSection() { @@ -16,9 +16,10 @@ public class CustomProtocolPingSection extends ConfigStorage { @Override public void load() { super.load(); - if(!Reflection.isProxyServer()) return; - ENABLED = new ConfigSectionHelper(this, "enabled", true).getOrSet(); - ALWAYS_SHOW = new ConfigSectionHelper(this, "always-show", true).getOrSet(); + ENABLED = new ConfigSectionHelper(this, "enabled", Reflection.isProxyServer() || Reflection.isPaper()).getOrSet(); + ALWAYS_SHOW = new ConfigSectionHelper(this, "always-show", Reflection.isProxyServer() || Reflection.isPaper()).getOrSet(); PROTOCOL = new ConfigSectionHelper(this, "protocol", "&f&lProAntiTab &7(&a%online%&7/&c%max%&7)").getOrSet(); + if(!Reflection.isProxyServer()) return; + HIDE_PLAYERS = new ConfigSectionHelper(this, "hide-players", true).getOrSet(); } } diff --git a/src/main/resources/files/bukkit-config.yml b/src/main/resources/files/bukkit-config.yml index 6786ed22..8d870bce 100644 --- a/src/main/resources/files/bukkit-config.yml +++ b/src/main/resources/files/bukkit-config.yml @@ -38,6 +38,26 @@ handle-through-proxy: # Enabling this will disable ALL commands except for those that are in the (group-)list. turn-blacklist-to-whitelist: true +# Change the protocol for the version name when the server is being pinged +# (!) Warning: It's required to use Paper or Purpur to use this feature! +# (!) Warning: For following server version: 1.12.2 - latest +custom-protocol-ping: + enabled: true + + # Normally it would only display when someone pings the server with the wrong version. + # Enabling this will always display the protocol and replace it with the normal player count. + always-show: true + + # Enabling this option hides the list of players on your server, + # when you hover over the player count. + hide-players: true + + # The displayed protocol message + # Available placeholders: + # %online% - current online player count + # %max% - max player count + protocol: '&f&lProAntiTab &7(&a%online%&7/&c%max%&7)' + #>> HTP (Sync) # This feature allows you to create your own 'Unknown command.' message. # It is very helpful considering the fact you might have to set the same message