mirror of
https://github.com/TotalFreedomMC/TFGuilds.git
synced 2024-06-26 07:40:37 +00:00
![Nathan Curran](/assets/img/avatar_default.png)
* TFGuilds rewrite almost completed (FS-164 FS-133 FS-244) The rewrite is nearing completion - few modifications to TFGuilds and TFM and it will be ready for production * Finalise few things * Code cleanup * Use empty list instead and true instead of false
56 lines
1.5 KiB
Java
56 lines
1.5 KiB
Java
package me.totalfreedom.tfguilds.command;
|
|
|
|
import me.totalfreedom.tfguilds.Common;
|
|
import me.totalfreedom.tfguilds.guild.Guild;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
|
|
public class InfoSubCommand extends Common implements SubCommand
|
|
{
|
|
|
|
@Override
|
|
public void execute(CommandSender sender, Player playerSender, String[] args)
|
|
{
|
|
if (args.length >= 2)
|
|
{
|
|
Player player = Bukkit.getPlayer(args[1]);
|
|
if (player != null && !tfmBridge.isVanished(player))
|
|
{
|
|
Guild guild = Guild.getGuild(player);
|
|
if (guild != null)
|
|
{
|
|
sender.sendMessage(guild.toString());
|
|
return;
|
|
}
|
|
}
|
|
|
|
Guild guild = Guild.getGuild(StringUtils.join(args, " ", 1, args.length));
|
|
if (guild == null)
|
|
{
|
|
sender.sendMessage(PREFIX + "That guild does not exist.");
|
|
return;
|
|
}
|
|
|
|
sender.sendMessage(guild.toString());
|
|
return;
|
|
}
|
|
|
|
if (!(sender instanceof Player))
|
|
{
|
|
sender.sendMessage(USAGE + "/g info <name>");
|
|
return;
|
|
}
|
|
|
|
Guild guild = Guild.getGuild(playerSender);
|
|
if (guild == null)
|
|
{
|
|
sender.sendMessage(NOT_IN_GUILD);
|
|
return;
|
|
}
|
|
|
|
sender.sendMessage(guild.toString());
|
|
}
|
|
}
|