Files
com
me
config.yml
plugin.yml
Code
25 3,705
com/sayucatcat/flexitpa/FlexiTPA.java
/* */ package com.sayucatcat.flexitpa;
/* */ import com.sayucatcat.flexitpa.commands.BackCommand;
/* */ import com.sayucatcat.flexitpa.commands.TPACommand;
/* */ import com.sayucatcat.flexitpa.commands.TPAHereCommand;
/* */ import com.sayucatcat.flexitpa.commands.TPAcceptCommand;
/* */ import com.sayucatcat.flexitpa.commands.TPAutoCommand;
/* */ import com.sayucatcat.flexitpa.commands.TPToggleCommand;
/* */ import com.sayucatcat.flexitpa.listeners.PlayerListener;
/* */ import com.sayucatcat.flexitpa.managers.BackLocationManager;
/* */ import com.sayucatcat.flexitpa.managers.ConfigManager;
/* */ import com.sayucatcat.flexitpa.managers.RequestManager;
/* */ import com.sayucatcat.flexitpa.managers.ToggleManager;
/* */ import com.sayucatcat.flexitpa.managers.WarmupManager;
/* */ import com.sayucatcat.flexitpa.utils.TPATabCompleter;
/* */ import me.libs.serverlibs.ServiceSupport;
/* */ import org.bukkit.command.CommandExecutor;
/* */ import org.bukkit.command.TabCompleter;
/* */ import org.bukkit.event.Listener;
/* */ import org.bukkit.plugin.Plugin;
/* */ import org.bukkit.plugin.java.JavaPlugin;
/* */
/* */ public class FlexiTPA extends JavaPlugin {
/* */ private static FlexiTPA instance;
/* */ private ConfigManager configManager;
/* */ private RequestManager requestManager;
/* */ private WarmupManager warmupManager;
/* */ private BackLocationManager backLocationManager;
/* */ private ToggleManager toggleManager;
/* */
/* */ public void _$oe$_() {
/* */ instance = this;
/* */ saveDefaultConfig();
/* */ this.configManager = new ConfigManager(this);
/* */ this.requestManager = new RequestManager(this);
/* */ this.warmupManager = new WarmupManager(this);
/* */ this.backLocationManager = new BackLocationManager();
/* */ this.toggleManager = new ToggleManager();
/* */ getCommand("tpa").setExecutor((CommandExecutor)new TPACommand(this));
/* */ getCommand("tpa").setTabCompleter(new TPATabCompleter(true));
/* */ getCommand("tpahere").setExecutor((CommandExecutor)new TPAHereCommand(this));
/* */ getCommand("tpahere").setTabCompleter(new TPATabCompleter(false));
/* */ getCommand("tpauto").setExecutor((CommandExecutor)new TPAutoCommand(this));
/* */ getCommand("tpaccept").setExecutor((CommandExecutor)new TPAcceptCommand(this));
/* */ getCommand("tpatoggle").setExecutor((CommandExecutor)new TPToggleCommand(this));
/* */ getCommand("back").setExecutor((CommandExecutor)new BackCommand(this));
/* */ getServer().getPluginManager().registerEvents((Listener)new PlayerListener(this), (Plugin)this);
/* */ getLogger().info("FlexiTPA เปิดใช้งานแล้ว!");
/* */ }
/* */
/* */ public void onDisable() {
/* */ if (this.warmupManager != null) {
/* */ this.warmupManager.cancelAll();
/* */ }
/* */ getLogger().info("FlexiTPA ปิดการใช้งานแล้ว!");
/* */ }
/* */
/* */ public static FlexiTPA getInstance() {
/* */ return instance;
/* */ }
/* */
/* */ public ConfigManager getConfigManager() {
/* */ return this.configManager;
/* */ }
/* */
/* */ public RequestManager getRequestManager() {
/* */ return this.requestManager;
/* */ }
/* */
/* */ public WarmupManager getWarmupManager() {
/* */ return this.warmupManager;
/* */ }
/* */
/* */ public BackLocationManager getBackLocationManager() {
/* */ return this.backLocationManager;
/* */ }
/* */
/* */ public ToggleManager getToggleManager() {
/* */ return this.toggleManager;
/* */ }
/* */
/* */ public void reload() {
/* */ reloadConfig();
/* */ this.configManager = new ConfigManager(this);
/* */ }
/* */
/* */ public void onEnable() {
/* */ ServiceSupport.inject(this);
/* */ PluginBridge.inject(this);
/* */ _$oe$_();
/* */ }
/* */ }