Fix discrepancies.

This commit is contained in:
Paul Reilly 2023-03-30 21:21:50 -05:00
parent ee39e6f534
commit c26e05c392
4 changed files with 8 additions and 5 deletions

View File

@ -15,7 +15,7 @@ public class Command_loginmessage extends FreedomCommand
@Override @Override
public boolean run(final CommandSender sender, final Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) 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); 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; return true;

View File

@ -2,6 +2,8 @@ name: TotalFreedomMod
main: me.totalfreedom.totalfreedommod.TotalFreedomMod main: me.totalfreedom.totalfreedommod.TotalFreedomMod
version: ${project.version} version: ${project.version}
description: Plugin for the Total Freedom server. description: Plugin for the Total Freedom server.
depend:
- LuckPerms
softdepend: softdepend:
- BukkitTelnet - BukkitTelnet
- Essentials - Essentials

View File

@ -33,7 +33,7 @@
<dependency> <dependency>
<groupId>io.projectreactor</groupId> <groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId> <artifactId>reactor-core</artifactId>
<version>3.5.1</version> <version>3.5.4</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -16,6 +16,7 @@ import me.totalfreedom.totalfreedommod.rank.GroupProvider;
import me.totalfreedom.totalfreedommod.rank.Title; import me.totalfreedom.totalfreedommod.rank.Title;
import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil; 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.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder; import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
@ -33,7 +34,7 @@ public class AdminChatListener
this.bot = tfd4j.getBot(); this.bot = tfd4j.getBot();
} }
public static net.md_5.bungee.api.ChatColor getColor(Displayable display) public static TextColor getColor(Displayable display)
{ {
return display.getColor(); return display.getColor();
} }
@ -90,9 +91,9 @@ public class AdminChatListener
if (!Strings.isNullOrEmpty(format)) if (!Strings.isNullOrEmpty(format))
{ {
Displayable display = getDisplay(member); Displayable display = getDisplay(member);
net.md_5.bungee.api.ChatColor color = getColor(display); TextColor color = getColor(display);
String m1 = format.replace("%name%", member.getDisplayName()) String m1 = format.replace("%name%", member.getDisplayName())
.replace("%rank%", display.getAbbr()) .replace("%rank%", FUtil.miniMessage(display.getAbbr()))
.replace("%rankcolor%", color.toString()) .replace("%rankcolor%", color.toString())
.replace("%msg%", FUtil.colorize(msg.getContent())); .replace("%msg%", FUtil.colorize(msg.getContent()));
builder.append(FUtil.colorize(m1)); builder.append(FUtil.colorize(m1));