Merge pull request #2 from dazoe/perms-fix
non-op players couldn't make a welcome sign
This commit is contained in:
commit
b1e2f12edf
|
@ -97,8 +97,7 @@ public class Warp extends Addon {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPermPrefix(World world) {
|
public String getPermPrefix(World world) {
|
||||||
this.getPlugin().getIWM().getPermissionPrefix(world);
|
return this.getPlugin().getIWM().getPermissionPrefix(world);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class WarpSignsListener implements Listener {
|
||||||
// Welcome sign detected - check to see if it is
|
// Welcome sign detected - check to see if it is
|
||||||
// this player's sign
|
// this player's sign
|
||||||
if ((list.containsKey(user.getUniqueId()) && list.get(user.getUniqueId()).equals(s.getLocation()))
|
if ((list.containsKey(user.getUniqueId()) && list.get(user.getUniqueId()).equals(s.getLocation()))
|
||||||
|| user.isOp() || user.hasPermission(addon.getPermPrefix(e.getBlock().getWorld()) + "mod.removesign")) {
|
|| user.isOp() || user.hasPermission(addon.getPermPrefix(e.getBlock().getWorld()) + ".mod.removesign")) {
|
||||||
addon.getWarpSignsManager().removeWarp(s.getLocation());
|
addon.getWarpSignsManager().removeWarp(s.getLocation());
|
||||||
Bukkit.getPluginManager().callEvent(new WarpRemoveEvent(addon, s.getLocation(), user.getUniqueId()));
|
Bukkit.getPluginManager().callEvent(new WarpRemoveEvent(addon, s.getLocation(), user.getUniqueId()));
|
||||||
} else {
|
} else {
|
||||||
|
@ -96,9 +96,9 @@ public class WarpSignsListener implements Listener {
|
||||||
// Check if someone is changing their own sign
|
// Check if someone is changing their own sign
|
||||||
if (title.equalsIgnoreCase(addon.getConfig().getString("welcomeLine"))) {
|
if (title.equalsIgnoreCase(addon.getConfig().getString("welcomeLine"))) {
|
||||||
// Welcome sign detected - check permissions
|
// Welcome sign detected - check permissions
|
||||||
if (!(user.hasPermission(addon.getPermPrefix(b.getWorld()) + "island.addwarp"))) {
|
if (!(user.hasPermission(addon.getPermPrefix(b.getWorld()) + ".island.addwarp"))) {
|
||||||
user.sendMessage("warps.error.no-permission");
|
user.sendMessage("warps.error.no-permission");
|
||||||
user.sendMessage("general.errors.you-need", "[permission]", addon.getPermPrefix(b.getWorld()) + "island.addwarp");
|
user.sendMessage("general.errors.you-need", "[permission]", addon.getPermPrefix(b.getWorld()) + ".island.addwarp");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long level = plugin.getAddonsManager().getAddonByName(LEVEL_PLUGIN_NAME).map(l -> (Level)l)
|
long level = plugin.getAddonsManager().getAddonByName(LEVEL_PLUGIN_NAME).map(l -> (Level)l)
|
||||||
|
|
|
@ -10,7 +10,13 @@ permissions:
|
||||||
bskyblock.island.warp:
|
bskyblock.island.warp:
|
||||||
description: Player can use warp or warps commands
|
description: Player can use warp or warps commands
|
||||||
default: true
|
default: true
|
||||||
|
bskyblock.island.addwarp:
|
||||||
|
description: Player can create a welcome warp sign
|
||||||
|
default: true
|
||||||
acidisland.island.warp:
|
acidisland.island.warp:
|
||||||
description: Player can use warp or warps commands
|
description: Player can use warp or warps commands
|
||||||
default: true
|
default: true
|
||||||
|
acidisland.island.addwarp:
|
||||||
|
description: Player can create a welcome warp sign
|
||||||
|
default: true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue