Files
src
build.gradle
README.md
settings.gradle
Code
11 679
src/main/java/com/kodari/gremoirechatbubbles/GremoireChatBubbles.java
package com.kodari.gremoirechatbubbles;
import com.kodari.gremoirechatbubbles.command.ChatBubblesCommand;
import com.kodari.gremoirechatbubbles.data.PreferenceStore;
import com.kodari.gremoirechatbubbles.listener.ChatListener;
import com.kodari.gremoirechatbubbles.manager.ChatBubbleManager;
import com.kodari.gremoirechatbubbles.compat.BedrockCompat;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public final class GremoireChatBubbles extends JavaPlugin {
private PreferenceStore preferenceStore;
private ChatBubbleManager chatBubbleManager;
@Override
public void onEnable() {
saveDefaultConfig();
preferenceStore = new PreferenceStore(this);
preferenceStore.load();
BedrockCompat bedrockCompat = new BedrockCompat(this);
chatBubbleManager = new ChatBubbleManager(this, preferenceStore, bedrockCompat);
Bukkit.getPluginManager().registerEvents(new ChatListener(this, chatBubbleManager), this);
getCommand("chatbubbles").setExecutor(new ChatBubblesCommand(this, preferenceStore));
getLogger().info("GremoireChatBubbles enabled.");
}
@Override
public void onDisable() {
if (chatBubbleManager != null) {
chatBubbleManager.shutdown();
}
if (preferenceStore != null) {
preferenceStore.save();
}
}
public void reloadPluginConfig() {
reloadConfig();
if (chatBubbleManager != null) {
chatBubbleManager.reload();
}
getLogger().info("GremoireChatBubbles configuration reloaded.");
}
}