diff --git a/Resources/plugin.yml b/Resources/plugin.yml index 80a1724e..d773feb9 100644 --- a/Resources/plugin.yml +++ b/Resources/plugin.yml @@ -1,6 +1,6 @@ main: com.sekwah.advancedportals.AdvancedPortalsPlugin name: AdvancedPortals -version: 0.0.15 +version: 0.0.16 author: sekwah41 description: An advanced portals plugin for bukkit. commands: diff --git a/src/com/sekwah/advancedportals/portals/Portal.java b/src/com/sekwah/advancedportals/portals/Portal.java index 55591b1f..41eeea56 100644 --- a/src/com/sekwah/advancedportals/portals/Portal.java +++ b/src/com/sekwah/advancedportals/portals/Portal.java @@ -353,9 +353,15 @@ public class Portal { // add other variables or filter code here, or somehow have a way to register them + // TODO on load and unload recode the permissions to try to register themselves + // https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/plugin/PluginManager.html#addPermission(org.bukkit.permissions.Permission) + // check they havent been registered before too and store a list of ones made by this plugin to remove when portals are unloaded. + // When a portal is added or removed it reloads all portals(i think) so add code for unloading too. + String permission = portal.getArg("permission"); /*if((permission == null || (permission != null && player.hasPermission(permission)) || player.isOp())){*/ - if (!((permission != null && player.hasPermission(permission)) || player.isOp())) { + // 3 checks, 1st is if it doesnt need perms. 2nd is if it does do they have it. And third is are they op. + if (!(permission == null || (permission != null && player.hasPermission(permission)) || player.isOp())) { player.sendMessage("\u00A7c[\u00A77AdvancedPortals\u00A7c] You do not have permission to use this portal!"); return false; }