mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 15:08:18 +01:00
Merge pull request #2450 from AgentTroll/patch-2414
Fixes #2414 - Warp signs no permission message
This commit is contained in:
commit
7b165c6c2c
@ -40,16 +40,24 @@ public class SignWarp extends EssentialsSign {
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException {
|
||||
final String warpName = sign.getLine(1);
|
||||
final String group = sign.getLine(2);
|
||||
if ((!group.isEmpty() && ("§2Everyone".equals(group) || player.inGroup(group))) || (group.isEmpty() && (!ess.getSettings().getPerWarpPermission() || player.isAuthorized("essentials.warps." + warpName)))) {
|
||||
final Trade charge = getTrade(sign, 3, ess);
|
||||
try {
|
||||
player.getTeleport().warp(player, warpName, charge, TeleportCause.PLUGIN);
|
||||
Trade.log("Sign", "Warp", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess);
|
||||
} catch (Exception ex) {
|
||||
throw new SignException(ex.getMessage(), ex);
|
||||
|
||||
if (!group.isEmpty()) {
|
||||
if (!"§2Everyone".equals(group) && !player.inGroup(group)) {
|
||||
throw new SignException(tl("warpUsePermission"));
|
||||
}
|
||||
} else {
|
||||
if (ess.getSettings().getPerWarpPermission() && !player.isAuthorized("essentials.warps." + warpName)) {
|
||||
throw new SignException(tl("warpUsePermission"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
final Trade charge = getTrade(sign, 3, ess);
|
||||
try {
|
||||
player.getTeleport().warp(player, warpName, charge, TeleportCause.PLUGIN);
|
||||
Trade.log("Sign", "Warp", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess);
|
||||
} catch (Exception ex) {
|
||||
throw new SignException(ex.getMessage(), ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user