Merge pull request #2 from dazoe/perms-fix

non-op players couldn't make a welcome sign
This commit is contained in:
tastybento 2018-09-02 05:46:49 +08:00 committed by GitHub
commit b1e2f12edf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View File

@ -97,8 +97,7 @@ public class Warp extends Addon {
}
public String getPermPrefix(World world) {
this.getPlugin().getIWM().getPermissionPrefix(world);
return null;
return this.getPlugin().getIWM().getPermissionPrefix(world);
}
/**

View File

@ -68,7 +68,7 @@ public class WarpSignsListener implements Listener {
// Welcome sign detected - check to see if it is
// this player's sign
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());
Bukkit.getPluginManager().callEvent(new WarpRemoveEvent(addon, s.getLocation(), user.getUniqueId()));
} else {
@ -96,9 +96,9 @@ public class WarpSignsListener implements Listener {
// Check if someone is changing their own sign
if (title.equalsIgnoreCase(addon.getConfig().getString("welcomeLine"))) {
// 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("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;
}
long level = plugin.getAddonsManager().getAddonByName(LEVEL_PLUGIN_NAME).map(l -> (Level)l)

View File

@ -10,7 +10,13 @@ permissions:
bskyblock.island.warp:
description: Player can use warp or warps commands
default: true
bskyblock.island.addwarp:
description: Player can create a welcome warp sign
default: true
acidisland.island.warp:
description: Player can use warp or warps commands
default: true
acidisland.island.addwarp:
description: Player can create a welcome warp sign
default: true