Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor refactor of permissions handlers
* Move `essentials.build` perm check from AntiBuild into default SuperPerms handler * Don't emulate wildcards for LuckPerms or PEX * Add `build: true` meta support for LuckPerms (+ other plugins as needed)
- Loading branch information
Showing
5 changed files
with
53 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
Essentials/src/com/earth2me/essentials/perm/impl/ModernVaultHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.earth2me.essentials.perm.impl; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Objects; | ||
import org.bukkit.entity.Player; | ||
|
||
public class ModernVaultHandler extends AbstractVaultHandler { | ||
private final List<String> supportedPlugins = Arrays.asList("PermissionsEx", "LuckPerms"); | ||
|
||
@Override | ||
protected boolean emulateWildcards() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean canBuild(final Player base, final String group) { | ||
Objects.requireNonNull(base, "Can't check build override for nonexistent player!"); | ||
return super.canBuild(base, group) || chat.getPlayerInfoBoolean(base.getWorld().getName(), base, "build", false); | ||
} | ||
|
||
@Override | ||
public boolean tryProvider() { | ||
return super.canLoad() && supportedPlugins.contains(getEnabledPermsPlugin()); | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
Essentials/src/com/earth2me/essentials/perm/impl/PermissionsExHandler.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters