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
@ -78,6 +78,7 @@ public class Kit
|
|||||||
{
|
{
|
||||||
throw new Exception(_("kitError2"));
|
throw new Exception(_("kitError2"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -26,12 +26,12 @@ public class Commandkit extends EssentialsCommand
|
|||||||
else if (args.length > 1 && user.isAuthorized("essentials.kit.others"))
|
else if (args.length > 1 && user.isAuthorized("essentials.kit.others"))
|
||||||
{
|
{
|
||||||
final User userTo = getPlayer(server, args, 1, true);
|
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);
|
giveKit(userTo, user, kitName);
|
||||||
}
|
}
|
||||||
else
|
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);
|
giveKit(user, user, kitName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -59,7 +59,12 @@ public class Commandkit extends EssentialsCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void giveKit(User userTo, User userFrom, String kitName) throws Exception
|
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);
|
final Map<String, Object> kit = ess.getSettings().getKit(kitName);
|
||||||
|
|
||||||
if (!userFrom.isAuthorized("essentials.kit." + kitName))
|
if (!userFrom.isAuthorized("essentials.kit." + kitName))
|
||||||
|
@ -19,7 +19,7 @@ public class SignKit extends EssentialsSign
|
|||||||
{
|
{
|
||||||
validateTrade(sign, 3, ess);
|
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())
|
if (kitName.isEmpty())
|
||||||
{
|
{
|
||||||
@ -48,7 +48,7 @@ public class SignKit extends EssentialsSign
|
|||||||
@Override
|
@Override
|
||||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
|
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);
|
final String group = sign.getLine(2);
|
||||||
if ((!group.isEmpty() && ("§2Everyone".equals(group) || player.inGroup(group)))
|
if ((!group.isEmpty() && ("§2Everyone".equals(group) || player.inGroup(group)))
|
||||||
|| (group.isEmpty() && (player.isAuthorized("essentials.kit." + kitName))))
|
|| (group.isEmpty() && (player.isAuthorized("essentials.kit." + kitName))))
|
||||||
|
Loading…
Reference in New Issue
Block a user