mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
fix stuff social links
This commit is contained in:
parent
c9a0626239
commit
1ad60c1c80
@ -19,6 +19,8 @@ public class Command_links extends FreedomCommand
|
|||||||
protected boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
protected boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||||
{
|
{
|
||||||
ConfigurationSection section = plugin.getConfig().getConfigurationSection("social_links");
|
ConfigurationSection section = plugin.getConfig().getConfigurationSection("social_links");
|
||||||
|
if (section != null)
|
||||||
|
{
|
||||||
Map<String, Object> values = section.getValues(false);
|
Map<String, Object> values = section.getValues(false);
|
||||||
|
|
||||||
List<String> lines = new ArrayList<>();
|
List<String> lines = new ArrayList<>();
|
||||||
@ -29,19 +31,18 @@ public class Command_links extends FreedomCommand
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
String link = (String) values.get(key);
|
String link = (String) values.get(key);
|
||||||
|
|
||||||
lines.add(ChatColor.GOLD + "- " + key + ": " + ChatColor.AQUA + link);
|
lines.add(ChatColor.GOLD + "- " + key + ": " + ChatColor.AQUA + link);
|
||||||
}
|
}
|
||||||
if (lines.size() == 0)
|
|
||||||
{
|
|
||||||
lines.add(ChatColor.GOLD + "- There are no links currently added in the config.");
|
|
||||||
}
|
|
||||||
|
|
||||||
lines.add(ChatColor.AQUA + "TotalFreedom Social Media Links:");
|
sender.sendMessage(ChatColor.AQUA + "Social Media Links:");
|
||||||
sender.sendMessage(lines.toArray(new String[0]));
|
sender.sendMessage(lines.toArray(new String[0]));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sender.sendMessage(ChatColor.RED + "There are no links added in the configuration file.");
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user