mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 00:20:44 +00:00
Merge pull request #236 from MrJeremyFisher/nicer-ja-renames
Make `/janame` feedback a bit nicer
This commit is contained in:
@@ -15,6 +15,8 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import vg.civcraft.mc.namelayer.permission.PermissionType;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class NameCommand extends BaseCommand {
|
||||
@CommandAlias("janame")
|
||||
@Syntax("<name>")
|
||||
@@ -37,9 +39,9 @@ public class NameCommand extends BaseCommand {
|
||||
|
||||
String prevName = snitch.getName();
|
||||
JukeAlert.getInstance().getSnitchManager().renameSnitch(snitch, newName);
|
||||
TextComponent lineText = new TextComponent(ChatColor.AQUA + " Changed snitch name to ");
|
||||
TextComponent lineText = new TextComponent(ChatColor.AQUA + (Objects.equals(prevName, "") ? "Set " : "Changed ") + "snitch name to ");
|
||||
lineText.addExtra(JAUtility.genTextComponent(snitch));
|
||||
lineText.addExtra(ChatColor.AQUA + " from " + ChatColor.GOLD + prevName);
|
||||
lineText.addExtra(Objects.equals(prevName, "") ? "" : ChatColor.AQUA + " from " + ChatColor.GOLD + prevName);
|
||||
player.spigot().sendMessage(lineText);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user