Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config for use of Paper chat events #6050

Merged
merged 2 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public interface ISettings extends IConf {

boolean isChatQuestionEnabled();

boolean isUsePaperChatEvent();

BigDecimal getCommandCost(IEssentialsCommand cmd);

BigDecimal getCommandCost(String label);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ public boolean isChatQuestionEnabled() {
return config.getBoolean("chat.question-enabled", true);
}

@Override
public boolean isUsePaperChatEvent() {
return config.getBoolean("chat.paper-chat-events", true);
}

public boolean _isTeleportSafetyEnabled() {
return config.getBoolean("teleport-safety", true);
}
Expand Down
6 changes: 6 additions & 0 deletions Essentials/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,12 @@ chat:
# Whether chat questions should be enabled or not.
question-enabled: true

# Whether EssentialsX should use Paper's modern chat event system in 1.16.5+.
# This is required for modern chat features such as hover events and click events.
# If you're experiencing issues with other plugins that use the chat event system, you can disable this.
# You must restart your server after changing this setting.
paper-chat-events: true

############################################################
# +------------------------------------------------------+ #
# | EssentialsX Protect | #
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void onEnable() {
return;
}

if (VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.v1_16_5_R01) && VersionUtil.isPaper()) {
if (VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.v1_16_5_R01) && VersionUtil.isPaper() && ess.getSettings().isUsePaperChatEvent()) {
final PaperChatHandler paperHandler = new PaperChatHandler((Essentials) ess, this);
paperHandler.registerListeners();
} else {
Expand Down
Loading