diff --git a/changelog.md b/changelog.md index 608c6e5..890c345 100644 --- a/changelog.md +++ b/changelog.md @@ -23,6 +23,7 @@ These changes will (most likely) be included in the next version. - Boss rewards also support the `all()` and `random()` functions as well as the `nothing` keyword. - New command `/ma addreward ` can be used to add a reward to an arena player's reward list. This can be useful for hooking into the rewards system from scripts or other plugins. - The Root Target ability now uses potion effects (slowness, slow falling, and negative jump boost) instead of repeated teleports. This should make for a smoother root experience. +- Permissions for arenas and classes are now based on "slugs". It is now possible to configure permissions for arenas and classes with multi-word names (including "My Items"). Check the Permissions page on the wiki for details. - Using `spectate-on-death: true` no longer forces players out to their join location/exit warp before moving them to the spectator area. This should prevent "jumpy" behavior in multi-world setups. - Players should now properly respawn at the spectator area rather than at world spawn on servers with plugins that override respawn locations. - Config-files with missing `pet-items` nodes no longer errors. A missing `pet-items` node in `global-settings` is treated as empty, i.e. no pet items will be registered. diff --git a/src/main/java/com/garbagemule/MobArena/ArenaClass.java b/src/main/java/com/garbagemule/MobArena/ArenaClass.java index e9c7abc..a809ba0 100644 --- a/src/main/java/com/garbagemule/MobArena/ArenaClass.java +++ b/src/main/java/com/garbagemule/MobArena/ArenaClass.java @@ -148,8 +148,13 @@ public class ArenaClass } public boolean hasPermission(Player p) { - String perm = "mobarena.classes." + configName; - return !p.isPermissionSet(perm) || p.hasPermission(perm); + String key = "mobarena.classes." + slug; + if (p.isPermissionSet(key)) { + return p.hasPermission(key); + } + + // Permissive by default. + return true; } /** diff --git a/src/main/java/com/garbagemule/MobArena/ArenaImpl.java b/src/main/java/com/garbagemule/MobArena/ArenaImpl.java index d81824b..87e0455 100644 --- a/src/main/java/com/garbagemule/MobArena/ArenaImpl.java +++ b/src/main/java/com/garbagemule/MobArena/ArenaImpl.java @@ -680,8 +680,13 @@ public class ArenaImpl implements Arena @Override public boolean hasPermission(Player p) { - String perm = "mobarena.arenas." + name; - return !p.isPermissionSet(perm) || p.hasPermission(perm); + String key = "mobarena.arenas." + slug; + if (p.isPermissionSet(key)) { + return p.hasPermission(key); + } + + // Permissive by default. + return true; } @Override