diff --git a/README b/README index f5700c5..75117ea 100644 --- a/README +++ b/README @@ -41,6 +41,16 @@ 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 +============= +Default Permissions +============= +stargate.use -- Everyone +stargate.create -- Op +stargate.destroy -- Op +stargate.option -- Op +stargate.free -- Op +stargate.admin -- Op + ============= Instructions ============= @@ -146,6 +156,9 @@ maxgates - If non-zero, will define the maximum amount of gates allowed on any n ============= Changes ============= +[Version 0.6.2] + - Fixed an issue with private gates + - Added default permissions [Version 0.6.1] - Stop destruction of open gates on startup [Version 0.6.0] diff --git a/src/net/TheDgtl/Stargate/Portal.java b/src/net/TheDgtl/Stargate/Portal.java index c910263..9874689 100644 --- a/src/net/TheDgtl/Stargate/Portal.java +++ b/src/net/TheDgtl/Stargate/Portal.java @@ -754,7 +754,10 @@ public class Portal { // Check if the player can create gates on this network if (!Stargate.canCreate(player, network)) { Stargate.debug("createPortal", "Player doesn't have create permissions on network. Trying personal"); - network = player.getName().substring(0, 11); + network = player.getName(); + if (network.length() > 11) { + network = network.substring(0, 11); + } // Check if we can create a gate on our own network if (!Stargate.canCreate(player, network)) { diff --git a/src/net/TheDgtl/Stargate/Stargate.java b/src/net/TheDgtl/Stargate/Stargate.java index 6b365e9..e09756b 100644 --- a/src/net/TheDgtl/Stargate/Stargate.java +++ b/src/net/TheDgtl/Stargate/Stargate.java @@ -432,7 +432,9 @@ public class Stargate extends JavaPlugin { if (hasPerm(player, "stargate.create.network." + network)) return true; // Check if this is a personal gate, and if the player has create.personal - if (player.getName().substring(0, 11).equalsIgnoreCase(network) && hasPerm(player, "stargate.create.personal")) return true; + String pNet = player.getName(); + if (pNet.length() > 11) pNet = pNet.substring(0, 11); + if (pNet.equalsIgnoreCase(network) && hasPerm(player, "stargate.create.personal")) return true; return false; } diff --git a/src/plugin.yml b/src/plugin.yml index cd11e74..5c116a5 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,10 +1,29 @@ name: Stargate main: net.TheDgtl.Stargate.Stargate -version: 0.6.1 +version: 0.6.2 description: Stargate mod for Bukkit author: Drakia website: http://www.thedgtl.net commands: sg: description: Used to reload the plugin. Console use only. - usage: / reload - Used to reload the plugin. Console use only. \ No newline at end of file + usage: / reload - Used to reload the plugin. Console use only. +permissions: + stargate.use: + description: Allow use of all gates linking to any world in any network + default: true + stargate.create: + description: Allow creating gates on any network + default: op + stargate.destroy: + description: Allow destruction gates on any network + default: op + stargate.free: + description: Allow free use/creation/destruction of gates + default: op + stargate.option: + description: Allow use of all options + default: op + stargate.admin: + description: Allow all admin features (Hidden/Private only so far) + default: op \ No newline at end of file