dan being smart

This commit is contained in:
Super_ 2020-07-14 22:49:14 -04:00
parent 4d70e31fd8
commit d495e8d6ea
2 changed files with 11 additions and 5 deletions

View file

@ -4,6 +4,7 @@ import me.totalfreedom.tfguilds.Common;
import me.totalfreedom.tfguilds.guild.Guild;
import me.totalfreedom.tfguilds.util.GUtil;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -18,6 +19,16 @@ public class InfoSubcommand extends Common implements CommandExecutor
{
if (args.length >= 2)
{
Player player = Bukkit.getPlayer(args[1]);
if (player != null)
{
Guild guild = Guild.getGuild(player);
if (guild != null)
{
sender.sendMessage(guild.getInformation());
return true;
}
}
Guild guild = Guild.getGuild(GUtil.flatten(StringUtils.join(args, " ", 1, args.length)));
if (guild == null)
{

View file

@ -40,11 +40,6 @@ public class TagSubcommand extends Common implements CommandExecutor
if (args[1].toLowerCase().equals("set"))
{
String tag = StringUtils.join(args, " ", 2, args.length);
if (!tag.contains("%tag%"))
{
sender.sendMessage(ChatColor.RED + "You must have your guild name in your tag. Use %tag% to specify where you want your tag");
return true;
}
tag = tag.replace("%tag%", guild.getName());