mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Detect missing expansions
This commit is contained in:
1 parent
c7aa0a6317
commit
ccaabf4d32
2 files changed
+32
No files matched your search
@@ -1,6 +1,9 @@
|
||||
package net.draycia.carbon;
|
||||
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import me.clip.placeholderapi.expansion.manager.LocalExpansionManager;
|
||||
import net.draycia.carbon.channels.contexts.impl.DistanceContext;
|
||||
import net.draycia.carbon.listeners.*;
|
||||
import net.draycia.carbon.managers.*;
|
||||
@@ -15,6 +18,8 @@ import net.milkbowl.vault.permission.Permission;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public final class CarbonChat extends JavaPlugin {
|
||||
|
||||
private Permission permission;
|
||||
@@ -73,6 +78,30 @@ public final class CarbonChat extends JavaPlugin {
|
||||
registerContexts();
|
||||
|
||||
new CarbonPlaceholders(this).register();
|
||||
|
||||
if (getConfig().getBoolean("show-tips")) {
|
||||
LocalExpansionManager expansionManager = PlaceholderAPIPlugin.getInstance().getLocalExpansionManager();
|
||||
|
||||
Optional<PlaceholderExpansion> vault = expansionManager.findExpansionByName("Vault");
|
||||
|
||||
if (!vault.isPresent()) {
|
||||
getLogger().info("PlaceholderAPI expansion 'Vault' not found! To install it, run:");
|
||||
getLogger().info("/papi ecloud download Vault");
|
||||
}
|
||||
|
||||
Optional<PlaceholderExpansion> player = expansionManager.findExpansionByName("Player");
|
||||
|
||||
if (!player.isPresent()) {
|
||||
getLogger().info("PlaceholderAPI expansion 'Player' not found! To install it, run:");
|
||||
getLogger().info("/papi ecloud download Player");
|
||||
}
|
||||
|
||||
if (!player.isPresent() || !vault.isPresent()) {
|
||||
getLogger().info("Then /papi reload");
|
||||
getLogger().info("The default formats use the expansions Vault and Player.");
|
||||
getLogger().info("Without them, default formats may look weird.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
# CarbonChat Docs:
|
||||
# https://github.com/Draycia/Chat/wiki
|
||||
|
||||
# Set this to false to disable warnings and tips when the plugin thinks there may be configuration issues.
|
||||
show-tips: true
|
||||
|
||||
# All of the settings under this 'default' section can be applied to each channel individually to override these.
|
||||
# These are provided as a way to configure default channel settings.
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user