From 5b639c82983aad318073c494f31a3a36400a5951 Mon Sep 17 00:00:00 2001 From: Mickey42302 <46900084+Mickey42302@users.noreply.github.com> Date: Wed, 23 Jul 2025 00:21:14 -0400 Subject: [PATCH 1/3] Update plugin.yml --- Essentials/src/main/resources/plugin.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Essentials/src/main/resources/plugin.yml b/Essentials/src/main/resources/plugin.yml index a8174ccc302..dcb86be442a 100644 --- a/Essentials/src/main/resources/plugin.yml +++ b/Essentials/src/main/resources/plugin.yml @@ -964,6 +964,8 @@ permissions: description: Allows the user to keep their exp on death, instead of dropping it. essentials.joinfullserver: description: Allows the to join the server even if it is full + essentials.whitelist.bypass: + description: Allows a player to join the server even if they are not whitelisted. essentials.kick: description: Allows access to the /kick command essentials.kick.exempt: From 6816efa688cd99d55f58ac67fc2369d20667ffca Mon Sep 17 00:00:00 2001 From: Mickey42302 <46900084+Mickey42302@users.noreply.github.com> Date: Wed, 23 Jul 2025 00:21:58 -0400 Subject: [PATCH 2/3] Update EssentialsPlayerListener.java --- .../com/earth2me/essentials/EssentialsPlayerListener.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java index 8b6b2d51f16..d0e2d0ace07 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java @@ -574,6 +574,13 @@ public void onPlayerLogin(final PlayerLoginEvent event) { event.disallow(Result.KICK_FULL, tlLiteral("serverFull")); } } + if (event.getResult() == Result.KICK_WHITELIST) { + final User kfuser = ess.getUser(event.getPlayer()); + kfuser.update(event.getPlayer()); + if (kfuser.isAuthorized("essentials.whitelist.bypass")) { + event.allow(); + } + } } @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) From 627d3afb936f927476c44d80d470e7ddc18f1c94 Mon Sep 17 00:00:00 2001 From: JRoy <10731363+JRoy@users.noreply.github.com> Date: Sun, 3 Aug 2025 19:38:50 -0700 Subject: [PATCH 3/3] message --- .../essentials/EssentialsPlayerListener.java | 4 ++++ .../main/java/com/earth2me/essentials/ISettings.java | 2 ++ .../main/java/com/earth2me/essentials/Settings.java | 7 ++++++- Essentials/src/main/resources/config.yml | 12 ++++++++---- Essentials/src/main/resources/messages.properties | 1 + 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java index d0e2d0ace07..013ef74d6aa 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java @@ -579,6 +579,10 @@ public void onPlayerLogin(final PlayerLoginEvent event) { kfuser.update(event.getPlayer()); if (kfuser.isAuthorized("essentials.whitelist.bypass")) { event.allow(); + return; + } + if (ess.getSettings().isCustomWhitelistMessage()) { + event.disallow(Result.KICK_WHITELIST, tlLiteral("whitelistKick")); } } } diff --git a/Essentials/src/main/java/com/earth2me/essentials/ISettings.java b/Essentials/src/main/java/com/earth2me/essentials/ISettings.java index 67be6b14d89..bed33c482d0 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/main/java/com/earth2me/essentials/ISettings.java @@ -316,6 +316,8 @@ public interface ISettings extends IConf { boolean isCustomServerFullMessage(); + boolean isCustomWhitelistMessage(); + boolean isNotifyNoNewMail(); boolean isDropItemsIfFull(); diff --git a/Essentials/src/main/java/com/earth2me/essentials/Settings.java b/Essentials/src/main/java/com/earth2me/essentials/Settings.java index 8980aa97b3f..265ed0e1d61 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/Settings.java +++ b/Essentials/src/main/java/com/earth2me/essentials/Settings.java @@ -1619,6 +1619,11 @@ public boolean isCustomServerFullMessage() { return config.getBoolean("use-custom-server-full-message", true); } + @Override + public boolean isCustomWhitelistMessage() { + return config.getBoolean("use-custom-whitelist-message", true); + } + @Override public int getJoinQuitMessagePlayerCount() { return config.getInt("hide-join-quit-messages-above", -1); @@ -2124,7 +2129,7 @@ public boolean showZeroBaltop() { public String getNickRegex() { return config.getString("allowed-nicks-regex", "^[a-zA-Z_0-9ยง]+$"); } - + @Override public BigDecimal getMultiplier(final User user) { BigDecimal multiplier = defaultMultiplier; diff --git a/Essentials/src/main/resources/config.yml b/Essentials/src/main/resources/config.yml index 771d9372b64..6b1d13243e9 100644 --- a/Essentials/src/main/resources/config.yml +++ b/Essentials/src/main/resources/config.yml @@ -78,7 +78,7 @@ change-tab-complete-name: false #add-prefix-in-playerlist: true # When this option is enabled, player suffixes will be shown in the (tab) player list. -# This feature only works for Minecraft version 1.8 and higher. +# This feature only works for Minecraft version 1.8 and higher. # The value of 'change-playerlist' above must be true. #add-suffix-in-playerlist: true @@ -566,7 +566,7 @@ custom-quit-message: "none" # Set this to "none" to use the 'custom-join-message' setting for every join. # # Available placeholders: -# {PLAYER} - The player's display name. +# {PLAYER} - The player's display name. # {USERNAME} - The player's username. # {OLDUSERNAME} - The player's old username. # {PREFIX} - The player's prefix. @@ -580,6 +580,10 @@ custom-new-username-message: "none" # Set to false to keep the vanilla message. use-custom-server-full-message: true +# Should Essentials override the vanilla "You are not whitelisted on this server" message with its own from the language file? +# Set to false to keep the vanilla message. +use-custom-whitelist-message: true + # You can disable join and quit messages when the player count reaches a certain limit. # When the player count is below this number, join/quit messages will always be shown. # Set this to -1 to always show join and quit messages regardless of player count. @@ -923,7 +927,7 @@ chat: # You can add command costs for shout/question by adding 'chat-shout' and 'chat-question' to the 'command-costs' section above. radius: 0 - # Chat formatting can be configured in two ways: + # Chat formatting can be configured in two ways: # - A standard format for all chat ('format' section) # - Group-specific chat formats for extra variation ('group-formats' section) # @@ -1256,7 +1260,7 @@ random-respawn-location: "none" spawn-on-join: false # The following value of 'guests' states that all players in the 'guests' group will be teleported to spawn when joining. #spawn-on-join: guests -# The following list value states that all players in the 'guests' or 'admin' groups will be teleported to spawn when joining. +# The following list value states that all players in the 'guests' or 'admin' groups will be teleported to spawn when joining. #spawn-on-join: # - guests # - admin diff --git a/Essentials/src/main/resources/messages.properties b/Essentials/src/main/resources/messages.properties index f37586d6dc3..1f390e214b7 100644 --- a/Essentials/src/main/resources/messages.properties +++ b/Essentials/src/main/resources/messages.properties @@ -1129,6 +1129,7 @@ sellCommandUsage4=/ blocks [amount] sellCommandUsage4Description=Sells all (or the given amount, if specified) of blocks in your inventory sellHandPermission=You do not have permission to hand sell. serverFull=Server is full\! +whitelistKick=Whitelist enabled\! serverReloading=There's a good chance you're reloading your server right now. If that's the case, why do you hate yourself? Expect no support from the EssentialsX team when using /reload. serverTotal=Server Total\: {0} serverUnsupported=You are running an unsupported server version\!