mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-29 05:55:19 +01:00
Fixed major permission issue
This commit is contained in:
parent
4f33a22f0f
commit
c7690bafad
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user