Skip to content

Commit

Permalink
Add config for use of Paper chat events (#6050)
Browse files Browse the repository at this point in the history
adds a config option to disable the use of paper chat events while other
plugins learn how to join the 21st century.

re #6048
re #6051
  • Loading branch information
JRoy authored Feb 19, 2025
1 parent 196a2a1 commit 8313d52
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
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

0 comments on commit 8313d52

Please sign in to comment.