From 487cb3ad9ee8cf9564580ff6b1ce650a29a8eca0 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Fri, 29 Oct 2021 01:45:50 +0200 Subject: [PATCH] Adds missing info about Bungee-related permissions to the readme and adjusts permissions a bit Adds stargate.server and stargate.admin.bungee permissions to the readme Renames stargate.reload to stargate.admin.reload for better consistency Makes the stargate.admin permission only give the reload, hidden, private and bungee permissions while the wildcard permission gives all permissions --- README.md | 45 +++++++++++-------- .../stargate/command/CommandReload.java | 2 +- src/main/resources/plugin.yml | 31 +++++++------ 3 files changed, 42 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 91bffb3..6d96651 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,14 @@ version of Stargate compliant with Spigot 1.17, even if it means changing the en # Permissions ``` -stargate.use -- Allow use of all gates linking to any world in any network (Override ALL network/world permissions. Set to false to use network/world specific permissions) - stargate.world -- Allow use of gates linking to any world - stargate.world.{world} -- Allow use of gates with a destination in {world}. Set to false to disallow use. - stargate.network -- Allow use of gates on all networks - stargate.network.{network} -- Allow use of all gates in {network}. Set to false to disallow use. - +stargate.use -- Allow use of all Stargates linking to any world in any network (Override ALL network/world permissions. Set to false to use network/world specific permissions) + stargate.world -- Allow use of Stargates linking to any world + stargate.world.{world} -- Allow use of Stargates with a destination in {world}. Set to false to disallow use. + stargate.network -- Allow use of Stargates on all networks + stargate.network.{network} -- Allow use of all Stargates in {network}. Set to false to disallow use. + stargate.server -- Allow use of Stargates going to all servers + stargate.server.{server} -- Allow usee of all Stargates going to {server}. Set to false to disallow use. + stargate.option -- Allow use of all options stargate.option.hidden -- Allow use of 'H'idden stargate.option.alwayson -- Allow use of 'A'lways-On @@ -33,21 +35,21 @@ stargate.option -- Allow use of all options stargate.option.backwards -- Allow use of 'B'ackwards stargate.option.show -- Allow use of 'S'how stargate.option.nonetwork -- Allow use of 'N'oNetwork - stargate.option.random -- Allow use of 'Random' gates + stargate.option.random -- Allow use of 'Random' stargates -stargate.create -- Allow creating gates on any network (Override all create permissions) - stargate.create.personal -- Allow creating gates on network {playername} - stargate.create.network -- Allow creating gates on any network - stargate.create.network.{networkname} -- Allow creating gates on network {networkname}. Set to false to disallow creation on {networkname} - stargate.create.gate -- Allow creation of any gate layout - stargate.create.gate.{gatefile} -- Allow creation of only {gatefile} gates +stargate.create -- Allow creating Stargates on any network (Override all create permissions) + stargate.create.personal -- Allow creating Stargates on network {playername} + stargate.create.network -- Allow creating Stargates on any network + stargate.create.network.{networkname} -- Allow creating Stargates on network {networkname}. Set to false to disallow creation on {networkname} + stargate.create.gate -- Allow creation using any gate layout + stargate.create.gate.{gatefile} -- Allow creation using only {gatefile} gates -stargate.destroy -- Allow destruction gates on any network (Orderride all destroy permissions) - stargate.destroy.personal -- Allow destruction of gates owned by user only - stargate.destroy.network -- Allow destruction of gates on any network - stargate.destroy.network.{networkname} -- Allow destruction of gates on network {networkname}. Set to false to disallow destruction of {networkname} +stargate.destroy -- Allow destruction of Stargates on any network (Orderride all destroy permissions) + stargate.destroy.personal -- Allow destruction of Stargates owned by the player only + stargate.destroy.network -- Allow destruction of Stargates on any network + stargate.destroy.network.{networkname} -- Allow destruction of Stargates on network {networkname}. Set to false to disallow destruction of {networkname} -stargate.free -- Allow free use/creation/destruction of gates +stargate.free -- Allow free use/creation/destruction of Stargates stargate.free.use -- Allow free use of Stargates stargate.free.create -- Allow free creation of Stargates stargate.free.destroy -- Allow free destruction of Stargates @@ -55,7 +57,8 @@ stargate.free -- Allow free use/creation/destruction of gates stargate.admin -- Allow all admin features (Hidden/Private only so far) stargate.admin.private -- Allow use of Private gates not owned by user stargate.admin.hidden -- Allow access to Hidden gates not ownerd by user - stargate.admin.reload -- Allow use of /sg reload + stargate.admin.bungee -- Allow the creation of BungeeCord stargates (U option) + stargate.admin.reload -- Allow use of the reload command ``` ## Default Permissions @@ -369,6 +372,10 @@ bungeeSign=Teleport to - Implements proper snowman snow blocking, and removes the "temporary" ignoreEntrances option - Adds a default gate using end stone bricks and end gateway for more default diversity - Makes portals using end portal blocks work as expected +- Adds missing permissions to the readme +- Adds missing permissions to plugin.yml and simplifies permission checks by specifying default values for child + permissions +- Renames stargate.reload to stargate.admin.reload to maintain consistency #### \[Version 0.8.0.3] PseudoKnight fork diff --git a/src/main/java/net/knarcraft/stargate/command/CommandReload.java b/src/main/java/net/knarcraft/stargate/command/CommandReload.java index 56366f8..6d29304 100644 --- a/src/main/java/net/knarcraft/stargate/command/CommandReload.java +++ b/src/main/java/net/knarcraft/stargate/command/CommandReload.java @@ -16,7 +16,7 @@ public class CommandReload implements CommandExecutor { public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] args) { if (commandSender instanceof Player player) { - if (!player.hasPermission("stargate.reload")) { + if (!player.hasPermission("stargate.admin.reload")) { Stargate.getMessageSender().sendErrorMessage(commandSender, "Permission Denied"); return true; } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index dc4eb91..1f4abd2 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -15,17 +15,23 @@ commands: usage: / - Used to see stargate info or reload the plugin permissions: stargate.*: - description: Wildcard permission. Same as stargate.admin - default: op + description: Wildcard permission which gives all Stargate permissions + default: false children: stargate.admin: true + stargate.use: true + stargate.create: true + stargate.destroy: true + stargate.free: true + stargate.option: true + stargate.server: true stargate.reload: description: Allows reloading the plugin default: false stargate.use: description: Allow use of all stargates linking to any world in any network default: true - children: + children: stargate.world: true stargate.network: true stargate.server: true @@ -36,9 +42,9 @@ permissions: description: Allows use of stargates in any network default: false stargate.create: - description: Allow creating gates on any network + description: Allow creating stargates on any network using any gate type default: op - children: + children: stargate.create.personal: true stargate.create.network: true stargate.create.gate: true @@ -66,7 +72,7 @@ permissions: stargate.free: description: Allow free use/creation/destruction of stargates default: op - children: + children: stargate.free.use: true stargate.free.create: true stargate.free.destroy: true @@ -128,17 +134,10 @@ permissions: description: Allows the creation of a BungeeCord stargate going to any server default: false stargate.admin: - description: Allow all features and admin commands + description: Allow all admin features and commands (Hidden/Private bypass, BungeeCord, Reload) default: op children: - stargate.use: true - stargate.create: true - stargate.destroy: true - stargate.free: true - stargate.option: true - stargate.admin: true - stargate.reload: true + stargate.admin.reload: true stargate.admin.hidden: true stargate.admin.private: true - stargate.admin.bungee: true - stargate.server: true \ No newline at end of file + stargate.admin.bungee: true \ No newline at end of file