mirror of
https://github.com/TotalFreedomMC/TFGuilds.git
synced 2024-12-22 16:05:00 +00:00
dan being smart
This commit is contained in:
parent
4d70e31fd8
commit
d495e8d6ea
2 changed files with 11 additions and 5 deletions
|
@ -4,6 +4,7 @@ import me.totalfreedom.tfguilds.Common;
|
||||||
import me.totalfreedom.tfguilds.guild.Guild;
|
import me.totalfreedom.tfguilds.guild.Guild;
|
||||||
import me.totalfreedom.tfguilds.util.GUtil;
|
import me.totalfreedom.tfguilds.util.GUtil;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
@ -18,6 +19,16 @@ public class InfoSubcommand extends Common implements CommandExecutor
|
||||||
{
|
{
|
||||||
if (args.length >= 2)
|
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)));
|
Guild guild = Guild.getGuild(GUtil.flatten(StringUtils.join(args, " ", 1, args.length)));
|
||||||
if (guild == null)
|
if (guild == null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,11 +40,6 @@ public class TagSubcommand extends Common implements CommandExecutor
|
||||||
if (args[1].toLowerCase().equals("set"))
|
if (args[1].toLowerCase().equals("set"))
|
||||||
{
|
{
|
||||||
String tag = StringUtils.join(args, " ", 2, args.length);
|
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());
|
tag = tag.replace("%tag%", guild.getName());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue