From d9eb92efe254f3e01a3a49fb33f79d6696cdd20b Mon Sep 17 00:00:00 2001 From: drekamor Date: Fri, 22 Mar 2024 00:20:06 +0000 Subject: [PATCH] Small fixes --- .../namelayer/command/commands/DeleteGroup.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/namelayer-paper/src/main/java/vg/civcraft/mc/namelayer/command/commands/DeleteGroup.java b/plugins/namelayer-paper/src/main/java/vg/civcraft/mc/namelayer/command/commands/DeleteGroup.java index f46083acb..6d1a9d2ff 100644 --- a/plugins/namelayer-paper/src/main/java/vg/civcraft/mc/namelayer/command/commands/DeleteGroup.java +++ b/plugins/namelayer-paper/src/main/java/vg/civcraft/mc/namelayer/command/commands/DeleteGroup.java @@ -10,6 +10,7 @@ import java.util.Map; import java.util.UUID; import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.TextColor; import org.bukkit.ChatColor; import org.bukkit.entity.Player; @@ -44,7 +45,7 @@ public class DeleteGroup extends BaseCommandMiddle { //player could have lost delete permission in the mean time if (!NameAPI.getGroupManager().hasAccess(gD, uuid, PermissionType.getPermission("DELETE"))){ - p.sendMessage(Component.text("You do not have permission to run that command.").color(TextColor.color(255, 0, 0))); + p.sendMessage(Component.text("You do not have permission to run that command.").color(NamedTextColor.RED)); return; } Date now = new Date(System.currentTimeMillis() - 15000); @@ -53,15 +54,15 @@ public class DeleteGroup extends BaseCommandMiddle { { //good to go delete the group if(gm.deleteGroup(gD.getName())) - p.sendMessage(Component.text("Group was successfully deleted.").color(TextColor.color(0, 255, 0))); + p.sendMessage(Component.text("Group was successfully deleted.").color(NamedTextColor.GREEN)); else - p.sendMessage(Component.text("Group is now disciplined. Check back later to see if group is deleted.").color(TextColor.color(0, 255, 0))); + p.sendMessage(Component.text("Group is now disciplined. Check back later to see if group is deleted.").color(NamedTextColor.GREEN)); confirmDeleteGroup.remove(uuid); return; } else{ - p.sendMessage(Component.text("You did not do /nldg %s fast enough, you will need to start over".formatted(confirm)).color(TextColor.color(255, 0, 0))); + p.sendMessage(Component.text("You did not do /nldg %s_%s fast enough, you will need to start over".formatted(confirm, gD.getName())).color(NamedTextColor.RED)); confirmDeleteGroup.remove(uuid); return; } @@ -75,23 +76,23 @@ public class DeleteGroup extends BaseCommandMiddle { return; } if (!NameAPI.getGroupManager().hasAccess(g, uuid, PermissionType.getPermission("DELETE"))){ - p.sendMessage(Component.text("You do not have permission to run that command.").color(TextColor.color(255, 0, 0))); + p.sendMessage(Component.text("You do not have permission to run that command.").color(NamedTextColor.RED)); return; } PlayerType pType = g.getPlayerType(uuid); if (pType == null && !p.hasPermission("namelayer.admin")){ - p.sendMessage(Component.text("You are not on that group.").color(TextColor.color(255, 0, 0))); + p.sendMessage(Component.text("You are not on that group.").color(NamedTextColor.RED)); return; } if (g.isDisciplined() && !p.hasPermission("namelayer.admin")){ - p.sendMessage(Component.text("Group is disiplined.").color(TextColor.color(255, 0, 0))); + p.sendMessage(Component.text("Group is disiplined.").color(NamedTextColor.RED)); return; } //set that user can confirm group in 15 seconds Date date = new Date(); Long dateString = date.getTime(); String[] groupDate = new String[] {g.getName(), dateString.toString()}; - p.sendMessage(Component.text("To confirm the IRREVERSIBLE deletion of the group '%s' along with ALL reinforcements, bastions and snitches on it:\nType /nldg %s_%s within 15 seconds.".formatted(g.getName(), confirm, g.getName())).color(TextColor.color(255, 0, 0))); + p.sendMessage(Component.text("To confirm the IRREVERSIBLE deletion of the group '%s' along with ALL reinforcements, bastions and snitches on it:\nType /nldg %s_%s within 15 seconds.".formatted(g.getName(), confirm, g.getName())).color(NamedTextColor.RED)); confirmDeleteGroup.put(uuid, groupDate); return; }