Completed implementation of PaperClientOptions

This commit is contained in:
Marc Baloup 2023-06-23 23:43:16 +02:00
parent 7d5060d09b
commit d5a2aa1c30

View File

@ -123,12 +123,14 @@ public interface PaperOnlinePlayer extends PaperOffPlayer, AbstractOnlinePlayer
*/ */
@Override @Override
PaperClientOptions getClientOptions(); default PaperClientOptions getClientOptions() {
return new PaperClientOptions(this);
}
/** /**
* Provides various configuration values of the Minecraft client. * Provides various configuration values of the Minecraft client.
*/ */
abstract class PaperClientOptions implements AbstractOnlinePlayer.ClientOptions { class PaperClientOptions implements AbstractOnlinePlayer.ClientOptions {
private final PaperOnlinePlayer op; private final PaperOnlinePlayer op;
@ -198,8 +200,8 @@ public interface PaperOnlinePlayer extends PaperOffPlayer, AbstractOnlinePlayer
} }
@Override @Override
public boolean isTextFilteringEnabled() { // needs reflection to get the actual value public boolean isTextFilteringEnabled() {
return false; return op.getBukkitPlayer().getClientOption(ClientOption.TEXT_FILTERING_ENABLED);
} }
@Override @Override