Files
src
build.gradle
settings.gradle
Code
12 762
src/main/java/com/kodari/diyalog/DiyalogPlugin.java
package com.kodari.diyalog;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class DiyalogPlugin extends JavaPlugin {
private DialogueService dialogueService;
@Override
public void onEnable() {
saveDefaultConfig();
DialogueStore store = new DialogueStore(this);
Typewriter typewriter = new Typewriter(this);
dialogueService = new DialogueService(this, typewriter);
DialogueCommand dialogueCommand = new DialogueCommand(store, dialogueService);
PluginCommand command = getCommand("diyalog");
if (command == null) {
throw new IllegalStateException("plugin.yml içinde diyalog komutu tanımlı değil.");
}
command.setExecutor(dialogueCommand);
command.setTabCompleter(dialogueCommand);
getServer().getPluginManager().registerEvents(new DialogueListener(dialogueService), this);
getLogger().info("OxicosDiyalog eklentisi etkinleştirildi.");
}
@Override
public void onDisable() {
if (dialogueService != null) {
dialogueService.stopAll();
}
}
}