From c26e05c3929e1b9ef672345e3dc6be7ba0dbd61f Mon Sep 17 00:00:00 2001 From: Paul Reilly Date: Thu, 30 Mar 2023 21:21:50 -0500 Subject: [PATCH] Fix discrepancies. --- .../totalfreedommod/command/Command_loginmessage.java | 2 +- commons/src/main/resources/plugin.yml | 2 ++ discord/pom.xml | 2 +- .../totalfreedom/discord/listener/AdminChatListener.java | 7 ++++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/commons/src/main/java/me/totalfreedom/totalfreedommod/command/Command_loginmessage.java b/commons/src/main/java/me/totalfreedom/totalfreedommod/command/Command_loginmessage.java index 324066d4..25a20019 100644 --- a/commons/src/main/java/me/totalfreedom/totalfreedommod/command/Command_loginmessage.java +++ b/commons/src/main/java/me/totalfreedom/totalfreedommod/command/Command_loginmessage.java @@ -15,7 +15,7 @@ public class Command_loginmessage extends FreedomCommand @Override public boolean run(final CommandSender sender, final Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (plugin.sh == null || !plugin.pl.getData(playerSender).hasItem(ShopItem.LOGIN_MESSAGES) && !isAdmin(playerSender)) + if (plugin.sh == null && !sender.hasPermission("tfm.loginmessage.custom") || !plugin.pl.getData(playerSender).hasItem(ShopItem.LOGIN_MESSAGES) && !isAdmin(playerSender)) { msg("You did not purchase the ability to use login messages, or the shop is not present! Purchase the ability from the shop.", ChatColor.RED); return true; diff --git a/commons/src/main/resources/plugin.yml b/commons/src/main/resources/plugin.yml index 26d0d4f7..65746737 100644 --- a/commons/src/main/resources/plugin.yml +++ b/commons/src/main/resources/plugin.yml @@ -2,6 +2,8 @@ name: TotalFreedomMod main: me.totalfreedom.totalfreedommod.TotalFreedomMod version: ${project.version} description: Plugin for the Total Freedom server. +depend: + - LuckPerms softdepend: - BukkitTelnet - Essentials diff --git a/discord/pom.xml b/discord/pom.xml index 09ca44ea..f2f11df9 100644 --- a/discord/pom.xml +++ b/discord/pom.xml @@ -33,7 +33,7 @@ io.projectreactor reactor-core - 3.5.1 + 3.5.4 provided diff --git a/discord/src/main/java/me/totalfreedom/discord/listener/AdminChatListener.java b/discord/src/main/java/me/totalfreedom/discord/listener/AdminChatListener.java index ff1a1ca5..a0e8b46d 100644 --- a/discord/src/main/java/me/totalfreedom/discord/listener/AdminChatListener.java +++ b/discord/src/main/java/me/totalfreedom/discord/listener/AdminChatListener.java @@ -16,6 +16,7 @@ import me.totalfreedom.totalfreedommod.rank.GroupProvider; import me.totalfreedom.totalfreedommod.rank.Title; import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FUtil; +import net.kyori.adventure.text.format.TextColor; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ComponentBuilder; import net.md_5.bungee.api.chat.TextComponent; @@ -33,7 +34,7 @@ public class AdminChatListener this.bot = tfd4j.getBot(); } - public static net.md_5.bungee.api.ChatColor getColor(Displayable display) + public static TextColor getColor(Displayable display) { return display.getColor(); } @@ -90,9 +91,9 @@ public class AdminChatListener if (!Strings.isNullOrEmpty(format)) { Displayable display = getDisplay(member); - net.md_5.bungee.api.ChatColor color = getColor(display); + TextColor color = getColor(display); String m1 = format.replace("%name%", member.getDisplayName()) - .replace("%rank%", display.getAbbr()) + .replace("%rank%", FUtil.miniMessage(display.getAbbr())) .replace("%rankcolor%", color.toString()) .replace("%msg%", FUtil.colorize(msg.getContent())); builder.append(FUtil.colorize(m1));