feat: Add Paper Chat API with hover/click/mentions/emojis/URLs + custom nicknames

This commit is contained in:
loki5512344 2026-02-23 15:40:48 +01:00
parent 7658f6f3e6
commit 69cae99476
21 changed files with 670 additions and 229 deletions

View file

@ -188,7 +188,9 @@ public class GradientAdminCommand implements CommandExecutor, TabCompleter {
data.setPrefixEnabled(true);
data.setPrefixPurchased(true);
module.getLuckPermsHook().setPrefix(target.getUniqueId(), DisplayNameUtil.buildColoredPrefix(module, data));
if (module.getLuckPermsHook() != null) {
module.getLuckPermsHook().setPrefix(target.getUniqueId(), DisplayNameUtil.buildColoredPrefix(module, data));
}
Player onlineTarget = target.getPlayer();
if (onlineTarget != null) {
@ -244,10 +246,12 @@ public class GradientAdminCommand implements CommandExecutor, TabCompleter {
GradientPlayerData data = module.getDataManager().getPlayerData(target.getUniqueId());
data.setPrefixEnabled(enable);
if (enable && data.hasPrefix()) {
module.getLuckPermsHook().setPrefix(target.getUniqueId(), DisplayNameUtil.buildColoredPrefix(module, data));
} else {
module.getLuckPermsHook().removePrefix(target.getUniqueId());
if (module.getLuckPermsHook() != null) {
if (enable && data.hasPrefix()) {
module.getLuckPermsHook().setPrefix(target.getUniqueId(), DisplayNameUtil.buildColoredPrefix(module, data));
} else {
module.getLuckPermsHook().removePrefix(target.getUniqueId());
}
}
Player onlineTarget = target.getPlayer();
@ -306,7 +310,9 @@ public class GradientAdminCommand implements CommandExecutor, TabCompleter {
data.setPrefix(null);
data.setPrefixEnabled(false);
module.getLuckPermsHook().removePrefix(target.getUniqueId());
if (module.getLuckPermsHook() != null) {
module.getLuckPermsHook().removePrefix(target.getUniqueId());
}
Player onlineTarget = target.getPlayer();
if (onlineTarget != null) {