mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-06-30 02:51:40 +00:00
Fix kits to only show to people who can use them.
This commit is contained in:
parent
8c434783a2
commit
57c1d75779
1 changed files with 4 additions and 15 deletions
|
@ -19,7 +19,8 @@ public class Commandkit extends EssentialsCommand
|
||||||
{
|
{
|
||||||
if (args.length < 1)
|
if (args.length < 1)
|
||||||
{
|
{
|
||||||
listKits(user);
|
final String kitList = Kit.listKits(ess, user);
|
||||||
|
user.sendMessage(kitList.length() > 0 ? _("kits", kitList) : _("noKits"));
|
||||||
throw new NoChargeException();
|
throw new NoChargeException();
|
||||||
}
|
}
|
||||||
else if (args.length > 1 && user.isAuthorized("essentials.kit.others"))
|
else if (args.length > 1 && user.isAuthorized("essentials.kit.others"))
|
||||||
|
@ -40,7 +41,8 @@ public class Commandkit extends EssentialsCommand
|
||||||
{
|
{
|
||||||
if (args.length < 2)
|
if (args.length < 2)
|
||||||
{
|
{
|
||||||
listKits(sender);
|
final String kitList = Kit.listKits(ess, null);
|
||||||
|
sender.sendMessage(kitList.length() > 0 ? _("kits", kitList) : _("noKits"));
|
||||||
throw new NoChargeException();
|
throw new NoChargeException();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -56,19 +58,6 @@ public class Commandkit extends EssentialsCommand
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void listKits(CommandSender sender) throws Exception
|
|
||||||
{
|
|
||||||
final String kitList = Kit.listKits(ess, null);
|
|
||||||
if (kitList.length() > 0)
|
|
||||||
{
|
|
||||||
sender.sendMessage(_("kits", kitList));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sender.sendMessage(_("noKits"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void giveKit(User userTo, User userFrom, String kitName) throws Exception
|
private void giveKit(User userTo, User userFrom, String kitName) throws Exception
|
||||||
{
|
{
|
||||||
final Map<String, Object> kit = ess.getSettings().getKit(kitName);
|
final Map<String, Object> kit = ess.getSettings().getKit(kitName);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue