mirror of
https://github.com/TotalFreedomMC/TFGuilds.git
synced 2025-01-03 13:38:19 +00:00
get other guilds
This commit is contained in:
parent
cce9d0879d
commit
87e591abc1
2 changed files with 57 additions and 3 deletions
|
@ -16,6 +16,9 @@ public class GuildInfoCommand extends GBase implements CommandExecutor
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
|
||||||
{
|
{
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
|
|
||||||
|
if (args.length == 0)
|
||||||
|
{
|
||||||
String guild = GUtil.getGuild(player);
|
String guild = GUtil.getGuild(player);
|
||||||
|
|
||||||
if (guild == null)
|
if (guild == null)
|
||||||
|
@ -36,7 +39,30 @@ public class GuildInfoCommand extends GBase implements CommandExecutor
|
||||||
player.sendMessage(GUtil.color("&2Guild Creation Date: &a" + creation));
|
player.sendMessage(GUtil.color("&2Guild Creation Date: &a" + creation));
|
||||||
player.sendMessage(GUtil.color("&2Member Count: &a" + members.size()));
|
player.sendMessage(GUtil.color("&2Member Count: &a" + members.size()));
|
||||||
player.sendMessage(GUtil.color("&2Members: &a" + members));
|
player.sendMessage(GUtil.color("&2Members: &a" + members));
|
||||||
player.sendMessage(GUtil.color("&2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="));
|
player.sendMessage(GUtil.color("&2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
String guild = GUtil.getGuild(args[0]);
|
||||||
|
if (guild == null)
|
||||||
|
{
|
||||||
|
sender.sendMessage(ChatColor.RED + "Guild not found.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
String owner = GUtil.getOwner(guild);
|
||||||
|
String tag = GUtil.getTag(guild);
|
||||||
|
String creation = GUtil.getTimeCreated(guild);
|
||||||
|
List<String> members = GUtil.getMember(guild);
|
||||||
|
|
||||||
|
player.sendMessage(GUtil.color("&2-=-=-=- &aGuild Information &2-=-=-=-"));
|
||||||
|
player.sendMessage(GUtil.color("&2Guild Name: &a" + guild));
|
||||||
|
player.sendMessage(GUtil.color("&2Guild Owner: &a" + owner));
|
||||||
|
player.sendMessage(GUtil.color("&2Guild Tag: &a" + tag));
|
||||||
|
player.sendMessage(GUtil.color("&2Guild Creation Date: &a" + creation));
|
||||||
|
player.sendMessage(GUtil.color("&2Member Count: &a" + members.size()));
|
||||||
|
player.sendMessage(GUtil.color("&2Members: &a" + members));
|
||||||
|
player.sendMessage(GUtil.color("&2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -119,6 +119,34 @@ public class GUtil
|
||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getGuild(String arg)
|
||||||
|
{
|
||||||
|
String g = "";
|
||||||
|
boolean a = false;
|
||||||
|
ConfigurationSection guildMembers = plugin.guilds.getConfigurationSection("guilds");
|
||||||
|
if (guildMembers != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for (String guild : guildMembers.getKeys(false))
|
||||||
|
{
|
||||||
|
if (guild.equals(arg))
|
||||||
|
{
|
||||||
|
a = true;
|
||||||
|
g = guild;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.fillInStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!a)
|
||||||
|
return null;
|
||||||
|
return g;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getOwner(String guildName)
|
public static String getOwner(String guildName)
|
||||||
{
|
{
|
||||||
return plugin.guilds.getString("guilds." + guildName + ".owner");
|
return plugin.guilds.getString("guilds." + guildName + ".owner");
|
||||||
|
|
Loading…
Reference in a new issue