mirror of
https://github.com/TotalFreedomMC/PlayerParticles.git
synced 2024-12-28 10:24:15 +00:00
Fix preset groups not using executor's permissions
This commit is contained in:
parent
79abe31fd2
commit
5031659aa2
3 changed files with 16 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
|||
=== v7.13 ===
|
||||
+ Added particles for Minecraft 1.16
|
||||
+ Added getVersion() method to API
|
||||
* Fixed '/ppo <user> group load <group>' not using the executor's permissions
|
||||
* Fixed confusion when using '/pp remove fishing'
|
||||
=== v7.12 ===
|
||||
+ Added WorldGuard region support
|
||||
+ Added permission 'playerparticles.worldguard.bypass'
|
||||
|
|
|
@ -164,6 +164,17 @@ public class PermissionManager extends Manager {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given player has the given permission
|
||||
*
|
||||
* @param pplayer The player to check
|
||||
* @param permission The permission to check
|
||||
* @return true if the player has the permission, otherwise false
|
||||
*/
|
||||
public boolean hasPermission(PPlayer pplayer, String permission) {
|
||||
return pplayer.getUnderlyingExecutor().hasPermission(permission);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given player has reached the max number of particles in their active group
|
||||
*
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package dev.esophose.playerparticles.particles;
|
||||
|
||||
import dev.esophose.playerparticles.PlayerParticles;
|
||||
import dev.esophose.playerparticles.manager.PermissionManager;
|
||||
import org.bukkit.Material;
|
||||
|
||||
public class ParticleGroupPreset {
|
||||
|
@ -44,7 +46,7 @@ public class ParticleGroupPreset {
|
|||
*/
|
||||
public boolean canPlayerUse(PPlayer player) {
|
||||
// If this particle group has a permission, does the player have it?
|
||||
if (!this.permission.isEmpty() && !player.getPlayer().hasPermission(this.permission))
|
||||
if (!this.permission.isEmpty() && PlayerParticles.getInstance().getManager(PermissionManager.class).hasPermission(player, this.permission))
|
||||
return false;
|
||||
|
||||
// If allowPermissionOverride is true, always let the player apply this group
|
||||
|
|
Loading…
Reference in a new issue