Disable Vault integration
This commit is contained in:
1 parent
a57ba166ff
commit
863d10273c
4 files changed
+30
-3
No files matched your search
@@ -221,10 +221,12 @@ public class LPBukkitPlugin extends AbstractLuckPermsPlugin {
|
||||
* - https://hub.spigotmc.org/jira/browse/SPIGOT-5546
|
||||
* - https://github.com/PaperMC/Paper/pull/3509
|
||||
*/
|
||||
PluginManagerUtil.injectDependency(this.bootstrap.getServer().getPluginManager(), this.bootstrap.getLoader().getName(), "Vault");
|
||||
if (getConfiguration().get(ConfigKeys.VAULT_ENABLED)) {
|
||||
PluginManagerUtil.injectDependency(this.bootstrap.getServer().getPluginManager(), this.bootstrap.getLoader().getName(), "Vault");
|
||||
|
||||
// Provide vault support
|
||||
tryVaultHook(false);
|
||||
// Provide vault support
|
||||
tryVaultHook(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -237,6 +239,10 @@ public class LPBukkitPlugin extends AbstractLuckPermsPlugin {
|
||||
return; // already hooked
|
||||
}
|
||||
|
||||
if (!getConfiguration().get(ConfigKeys.VAULT_ENABLED)) {
|
||||
return; // disabled in config
|
||||
}
|
||||
|
||||
try {
|
||||
if (force || this.bootstrap.getServer().getPluginManager().isPluginEnabled("Vault")) {
|
||||
this.vaultHookManager = new VaultHookManager(this);
|
||||
|
||||
@@ -94,6 +94,10 @@ public class BukkitPlatformListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPluginEnable(PluginEnableEvent e) {
|
||||
if (!this.plugin.getConfiguration().get(ConfigKeys.VAULT_ENABLED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Plugin p = e.getPlugin();
|
||||
boolean shouldHook = p.getName().equalsIgnoreCase("Vault") ||
|
||||
(PLUGIN_DESCRIPTION_FILE_PROVIDES_SUPPORTED && p.getDescription().getProvides().contains("Vault"));
|
||||
|
||||
@@ -627,8 +627,19 @@ commands-allow-op: true
|
||||
|
||||
# +----------------------------------------------------------------------------------------------+ #
|
||||
# | Vault integration settings | #
|
||||
# | | #
|
||||
# | Disabled by default (vault-enabled: false). The remaining vault-* settings below only take | #
|
||||
# | effect when vault-enabled is set to true. | #
|
||||
# +----------------------------------------------------------------------------------------------+ #
|
||||
|
||||
# If the Vault API bridge should be registered.
|
||||
#
|
||||
# - When false (default), LuckPerms will not hook into Vault at all. Vault-dependent plugins will
|
||||
# fall back to SuperPerms and will not see LuckPerms groups, prefixes, or meta.
|
||||
# - When true, LuckPerms will register Vault permission and chat providers if the Vault plugin is
|
||||
# installed. Required for any plugin that reads groups/prefix/suffix via the Vault API.
|
||||
vault-enabled: false
|
||||
|
||||
# If Vault lookups for offline players on the main server thread should be enabled.
|
||||
#
|
||||
# LuckPerms has a "catch" for plugins attempting to perform unsafe offline player data lookups
|
||||
|
||||
@@ -493,6 +493,12 @@ public final class ConfigKeys {
|
||||
*/
|
||||
public static final ConfigKey<Boolean> COMMANDS_RATE_LIMIT = booleanKey("commands-rate-limit", true);
|
||||
|
||||
/**
|
||||
* If the Vault API bridge should be registered on platforms that support it (Bukkit).
|
||||
* Disabled by default; the remaining vault-* keys below only take effect when this is true.
|
||||
*/
|
||||
public static final ConfigKey<Boolean> VAULT_ENABLED = booleanKey("vault-enabled", false);
|
||||
|
||||
/**
|
||||
* If Vault lookups for offline players on the main server thread should be enabled
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user