uuid-based name grabbing for tfguilds command

This commit is contained in:
Super_ 2020-07-14 20:35:58 -04:00
parent 15bb0adad1
commit 5ac1545038

View file

@ -2,10 +2,14 @@ package me.totalfreedom.tfguilds.command;
import me.totalfreedom.tfguilds.Common; import me.totalfreedom.tfguilds.Common;
import me.totalfreedom.tfguilds.util.GLog; import me.totalfreedom.tfguilds.util.GLog;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import java.util.UUID;
public class TFGuildsCommand extends Common implements CommandExecutor public class TFGuildsCommand extends Common implements CommandExecutor
{ {
@Override @Override
@ -13,31 +17,36 @@ public class TFGuildsCommand extends Common implements CommandExecutor
{ {
if (args.length > 1) if (args.length > 1)
return false; return false;
if (args.length == 1)
if (args[0].toLowerCase().equals("reload"))
{ {
if (!plugin.bridge.isAdmin(sender)) if (args[0].toLowerCase().equals("reload"))
{ {
sender.sendMessage(NO_PERMS); if (!plugin.bridge.isAdmin(sender))
{
sender.sendMessage(NO_PERMS);
return true;
}
try
{
plugin.config.load();
plugin.guilds.load();
GLog.info("All configs reloaded successfully");
sender.sendMessage(tl(PREFIX + "All configuration files have been reloaded successfully."));
return true;
}
catch (Exception ex)
{
ex.printStackTrace();
}
return true; return true;
} }
try
{
plugin.config.load();
plugin.guilds.load();
GLog.info("All configs reloaded successfully");
sender.sendMessage(tl(PREFIX + "All configuration files have been reloaded successfully."));
return true;
}
catch (Exception ex)
{
ex.printStackTrace();
}
return true;
} }
sender.sendMessage(tl("%p%TFGuilds %s%is a plugin which allows for players to make their own guilds, providing guild chat, guild teleportation, and more.")); sender.sendMessage(tl("%p%TFGuilds %s%is a plugin which allows for players to make their own guilds, providing guild chat, guild teleportation, and more."));
sender.sendMessage(tl("%s%Version %p%v" + plugin.getDescription().getVersion())); sender.sendMessage(tl("%s%Version %p%v" + plugin.getDescription().getVersion()));
sender.sendMessage(tl("%s%Developed by %p%speednt & supernt")); OfflinePlayer sp = Bukkit.getOfflinePlayer(UUID.fromString("d018f2b8-ce60-4672-a45f-e580e0331299"));
OfflinePlayer su = Bukkit.getOfflinePlayer(UUID.fromString("53b1512e-3481-4702-9f4f-63cb9c8be6a1"));
sender.sendMessage(tl("%s%Developed by %p%" + sp.getName() + " & " + su.getName()));
sender.sendMessage(tl("%s%https://github.com/TFPatches/TFGuilds")); sender.sendMessage(tl("%s%https://github.com/TFPatches/TFGuilds"));
return true; return true;
} }