mirror of
https://github.com/rockyhawk64/CommandPanels.git
synced 2025-11-18 07:14:17 +01:00
permission observer ability to disable added
This commit is contained in:
parent
cd127d229b
commit
855334ce0a
@ -1,6 +1,6 @@
|
||||
# |------------------------------------------------------------------------
|
||||
# | CommandPanels Config File
|
||||
# | By RockyHawk v7
|
||||
# | By RockyHawk v8
|
||||
# | https://www.spigotmc.org/resources/67788/
|
||||
# |
|
||||
# |------------------------------------------------------------------------
|
||||
@ -11,5 +11,9 @@ custom-commands: true
|
||||
# Amount of time in ticks players must wait between opening panels
|
||||
cooldown-ticks: 5
|
||||
|
||||
# Will make console logs when panels are opened
|
||||
panel-snooper: false
|
||||
# Logs to console whenever a panel is opened
|
||||
panel-snooper: false
|
||||
|
||||
# When enabled, panels will automatically refresh if any observed permissions change.
|
||||
# Permissions used in HASPERM conditions are considered observed permissions.
|
||||
permission-observer: true
|
||||
@ -101,6 +101,8 @@ public class InventoryPanelUpdater {
|
||||
updateDelay
|
||||
);
|
||||
|
||||
final boolean isUsingPermObserver = ctx.fileHandler.config.getBoolean("permission-observer");
|
||||
|
||||
// Fast heartbeat check task, should run frequently
|
||||
this.checkTask = Bukkit.getRegionScheduler().runAtFixedRate(
|
||||
ctx.plugin,
|
||||
@ -114,7 +116,8 @@ public class InventoryPanelUpdater {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do a refresh if an observed perms state changes
|
||||
// Permission Observer: Refresh if an observed perms state changes
|
||||
if(!isUsingPermObserver) return; // Skip if disabled
|
||||
for (String node : panel.getObservedPerms()) {
|
||||
boolean currentState = p.hasPermission(node);
|
||||
Boolean previousState = lastObservedPermStates.get(node);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user