Files
src
build.gradle
manifest.kod
settings.gradle
Code
26 1,604
src/main/java/com/kodari/wraithcore/WraithCorePlugin.java
package com.kodari.wraithcore;
import com.kodari.wraithcore.command.CoreCommand;
import com.kodari.wraithcore.gui.GuiManager;
import com.kodari.wraithcore.listener.CoreListener;
import com.kodari.wraithcore.recipe.RecipeManager;
import com.kodari.wraithcore.service.ConfigManager;
import com.kodari.wraithcore.service.GuideService;
import com.kodari.wraithcore.service.MessageService;
import com.kodari.wraithcore.service.SpawnManager;
import com.kodari.wraithcore.service.TeleportManager;
import com.kodari.wraithcore.service.TeleportRequestManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public class WraithCorePlugin extends JavaPlugin {
private ConfigManager configManager;
private MessageService messageService;
private RecipeManager recipeManager;
private GuideService guideService;
private TeleportManager teleportManager;
private TeleportRequestManager teleportRequestManager;
private SpawnManager spawnManager;
private GuiManager guiManager;
@Override
public void onEnable() {
saveDefaultConfig();
saveResource("guide.yml", false);
saveResource("recipes.yml", false);
configManager = new ConfigManager(this);
messageService = new MessageService(this);
recipeManager = new RecipeManager(this);
guideService = new GuideService(this);
teleportManager = new TeleportManager(this);
teleportRequestManager = new TeleportRequestManager(this);
spawnManager = new SpawnManager(this);
guiManager = new GuiManager(this);
recipeManager.load();
guideService.reload();
CoreCommand command = new CoreCommand(this);
Bukkit.getPluginManager().registerEvents(new CoreListener(this), this);
getCommand("menugui").setExecutor(command);
getCommand("guide").setExecutor(command);
getCommand("recipes").setExecutor(command);
getCommand("tpa").setExecutor(command);
getCommand("tpaccept").setExecutor(command);
getCommand("tpacancel").setExecutor(command);
getCommand("tpahere").setExecutor(command);
getCommand("setspawn").setExecutor(command);
getCommand("spawn").setExecutor(command);
getCommand("wraithcore").setExecutor(command);
}
@Override
public void onDisable() {
if (teleportRequestManager != null) {
teleportRequestManager.shutdown();
}
if (teleportManager != null) {
teleportManager.shutdown();
}
}
public void reloadAll() {
reloadConfig();
configManager.reload();
recipeManager.load();
guideService.reload();
}
public ConfigManager config() {
return configManager;
}
public MessageService messages() {
return messageService;
}
public RecipeManager recipes() {
return recipeManager;
}
public GuideService guide() {
return guideService;
}
public TeleportManager teleports() {
return teleportManager;
}
public TeleportRequestManager requests() {
return teleportRequestManager;
}
public SpawnManager spawn() {
return spawnManager;
}
public GuiManager gui() {
return guiManager;
}
}