From 6647088429a9f13475adc9bd279201357eacaeb8 Mon Sep 17 00:00:00 2001 From: Lemon Date: Sat, 2 Jun 2018 03:40:25 +0500 Subject: [PATCH] why did that not push --- .../command/Command_myadmin.java | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_myadmin.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_myadmin.java index a80b8a2e..d62e68a8 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_myadmin.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_myadmin.java @@ -13,7 +13,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @CommandPermissions(level = Rank.OP, source = SourceType.BOTH) -@CommandParameters(description = "Manage my admin entry", usage = "/ [-o ] | setlogin | clearlogin | settag | cleartag>") +@CommandParameters(description = "Manage my admin entry", usage = "/ [-o ] | setlogin | clearlogin | settag | cleartag | setacformat | clearacformat> | oldtags>") public class Command_myadmin extends FreedomCommand { @@ -174,12 +174,38 @@ public class Command_myadmin extends FreedomCommand case "cleartag": { FUtil.adminAction(sender.getName(), "Clearing personal default tag" + (init == null ? "" : " for " + targetPlayer.getName()), false); - String tag = StringUtils.join(args, " ", 1, args.length); target.setTag(null); plugin.al.save(); plugin.al.updateTables(); return true; } + case "setacformat": + { + String format = StringUtils.join(args, " ", 1, args.length); + target.setAcFormat(format); + plugin.al.save(); + plugin.al.updateTables(); + msg("Set admin chat format to \"" + format + "\".", ChatColor.GRAY); + String example = format.replace("%name%", "ExampleAdmin").replace("%rank%", "STA").replace("%msg%", "The quick brown fox jumps over the lazy dog."); + msg(ChatColor.GRAY + "Example: " + FUtil.colorize(example)); + return true; + } + case "clearacformat": + { + target.setAcFormat(null); + plugin.al.save(); + plugin.al.updateTables(); + msg("Cleared admin chat format.", ChatColor.GRAY); + return true; + } + case "oldtags": + { + target.setOldTags(!target.getOldTags()); + plugin.al.save(); + plugin.al.updateTables(); + msg(target.getOldTags() ? "Enabled" : "Disabled" + " old tags."); + return true; + } default: {