Shade in CommandAPI and fix startup issue

This commit is contained in:
Draycia committed 2020-09-03 00:03:34 -07:00
1 parent 0807506045
commit e258b57a1f
3 files changed
+11 -3

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ dependencies {
compile 'io.lettuce:lettuce-core:6.0.0.M1'
// Commands
compileOnly "dev.jorel:commandapi-core:4.0"
compile "dev.jorel:commandapi-shade:4.1"
// Plugins
compileOnly 'com.gmail.nossr50.mcMMO:mcMMO:2.1.143'
@@ -1,5 +1,6 @@
package net.draycia.carbon;
import dev.jorel.commandapi.CommandAPI;
import net.draycia.carbon.channels.contexts.impl.EconomyContext;
import net.draycia.carbon.channels.contexts.impl.DistanceContext;
import net.draycia.carbon.channels.contexts.impl.TownyContext;
@@ -51,8 +52,14 @@ public final class CarbonChat extends JavaPlugin {
.useUnusualXRepeatedCharacterHexFormat()
.build();
@Override
public void onLoad() {
CommandAPI.onLoad(false);
}
@Override
public void onEnable() {
CommandAPI.onEnable(this);
Metrics metrics = new Metrics(this, BSTATS_PLUGIN_ID);
// Ensure config is present to be modified by the user
@@ -160,7 +167,9 @@ public final class CarbonChat extends JavaPlugin {
loadModConfig();
loadLanguage();
loadCommandsConfig();
}
public void reloadFilters() {
filterHandler.reloadFilters();
}
@@ -35,13 +35,12 @@ public class ChatReloadCommand {
private void execute(CommandSender sender, Object[] args) {
carbonChat.reloadConfig();
carbonChat.reloadFilters();
Component message = carbonChat.getAdventureManager().processMessage(carbonChat.getLanguage().getString("reloaded"),
"br", "\n");
carbonChat.getAdventureManager().getAudiences().audience(sender).sendMessage(message);
// TODO: Ensure moderation filters ETC are updated when reloading.
}
}