mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Shade in CommandAPI and fix startup issue
This commit is contained in:
1 parent
0807506045
commit
e258b57a1f
3 files changed
+11
-3
No files matched your search
@@ -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.
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user