From d5a2aa1c30ec850cd65d0964d6119b6076f892b7 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Fri, 23 Jun 2023 23:43:16 +0200 Subject: [PATCH] Completed implementation of PaperClientOptions --- .../pandacube/lib/paper/players/PaperOnlinePlayer.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/players/PaperOnlinePlayer.java b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/players/PaperOnlinePlayer.java index 4aec24e..3011498 100644 --- a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/players/PaperOnlinePlayer.java +++ b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/players/PaperOnlinePlayer.java @@ -123,12 +123,14 @@ public interface PaperOnlinePlayer extends PaperOffPlayer, AbstractOnlinePlayer */ @Override - PaperClientOptions getClientOptions(); + default PaperClientOptions getClientOptions() { + return new PaperClientOptions(this); + } /** * Provides various configuration values of the Minecraft client. */ - abstract class PaperClientOptions implements AbstractOnlinePlayer.ClientOptions { + class PaperClientOptions implements AbstractOnlinePlayer.ClientOptions { private final PaperOnlinePlayer op; @@ -198,8 +200,8 @@ public interface PaperOnlinePlayer extends PaperOffPlayer, AbstractOnlinePlayer } @Override - public boolean isTextFilteringEnabled() { // needs reflection to get the actual value - return false; + public boolean isTextFilteringEnabled() { + return op.getBukkitPlayer().getClientOption(ClientOption.TEXT_FILTERING_ENABLED); } @Override