diff --git a/buildnumber.properties b/buildnumber.properties index 355dd79..a31fd84 100644 --- a/buildnumber.properties +++ b/buildnumber.properties @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Mon May 05 15:29:34 CEST 2014 -build.number=821 +#Mon May 05 16:00:01 CEST 2014 +build.number=822 diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tagnyan.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tagnyan.java new file mode 100644 index 0000000..87e8c72 --- /dev/null +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tagnyan.java @@ -0,0 +1,37 @@ +package me.StevenLawson.TotalFreedomMod.Commands; + +import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; +import me.StevenLawson.TotalFreedomMod.TFM_Util; +import net.minecraft.util.org.apache.commons.lang3.StringUtils; +import org.bukkit.ChatColor; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +@CommandPermissions(level = AdminLevel.OP, source = SourceType.ONLY_IN_GAME) +@CommandParameters(description = "Gives you a tag with random colors", usage = "/ ", aliases = "tn") +public class Command_tagnyan extends TFM_Command +{ + @Override + public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) + { + if (args.length < 1) + { + return false; + } + + final StringBuilder tag = new StringBuilder(); + + for (char c : ChatColor.stripColor(TFM_Util.colorize(StringUtils.join(args, " "))).toCharArray()) + { + tag.append(TFM_Util.randomChatColor()).append(c); + } + + final TFM_PlayerData data = TFM_PlayerData.getPlayerData(sender_p); + data.setTag(tag.toString()); + + playerMsg("Set tag to " + tag); + + return true; + } +}