mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-02 17:09:58 +01:00
Fix yaml issue with /kit
This commit is contained in:
parent
e198b61eae
commit
8aab57e86b
@ -79,6 +79,7 @@ public class Kit
|
||||
throw new Exception(_("kitError2"));
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
return (List<String>)kit.get("items");
|
||||
|
@ -26,12 +26,12 @@ public class Commandkit extends EssentialsCommand
|
||||
else if (args.length > 1 && user.isAuthorized("essentials.kit.others"))
|
||||
{
|
||||
final User userTo = getPlayer(server, args, 1, true);
|
||||
final String kitName = Util.sanitizeString(args[0].toLowerCase(Locale.ENGLISH));
|
||||
final String kitName = Util.sanitizeString(args[0].toLowerCase(Locale.ENGLISH)).trim();
|
||||
giveKit(userTo, user, kitName);
|
||||
}
|
||||
else
|
||||
{
|
||||
final String kitName = Util.sanitizeString(args[0].toLowerCase(Locale.ENGLISH));
|
||||
final String kitName = Util.sanitizeString(args[0].toLowerCase(Locale.ENGLISH)).trim();
|
||||
giveKit(user, user, kitName);
|
||||
}
|
||||
}
|
||||
@ -60,6 +60,11 @@ public class Commandkit extends EssentialsCommand
|
||||
|
||||
private void giveKit(User userTo, User userFrom, String kitName) throws Exception
|
||||
{
|
||||
if (kitName.isEmpty())
|
||||
{
|
||||
throw new Exception(_("kitError2"));
|
||||
}
|
||||
|
||||
final Map<String, Object> kit = ess.getSettings().getKit(kitName);
|
||||
|
||||
if (!userFrom.isAuthorized("essentials.kit." + kitName))
|
||||
|
@ -19,7 +19,7 @@ public class SignKit extends EssentialsSign
|
||||
{
|
||||
validateTrade(sign, 3, ess);
|
||||
|
||||
final String kitName = sign.getLine(1).toLowerCase(Locale.ENGLISH);
|
||||
final String kitName = sign.getLine(1).toLowerCase(Locale.ENGLISH).trim();
|
||||
|
||||
if (kitName.isEmpty())
|
||||
{
|
||||
@ -48,7 +48,7 @@ public class SignKit extends EssentialsSign
|
||||
@Override
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
|
||||
{
|
||||
final String kitName = sign.getLine(1).toLowerCase(Locale.ENGLISH);
|
||||
final String kitName = sign.getLine(1).toLowerCase(Locale.ENGLISH).trim();
|
||||
final String group = sign.getLine(2);
|
||||
if ((!group.isEmpty() && ("§2Everyone".equals(group) || player.inGroup(group)))
|
||||
|| (group.isEmpty() && (player.isAuthorized("essentials.kit." + kitName))))
|
||||
|
Loading…
Reference in New Issue
Block a user