Files
src
build.gradle
Code
12 1,014
src/main/java/com/thorplugin/ThorPlugin.java
package com.thorplugin;
import com.thorplugin.commands.ThorCommand;
import com.thorplugin.listeners.ArmorListener;
import com.thorplugin.listeners.CombatListener;
import com.thorplugin.listeners.PlayerListener;
import com.thorplugin.managers.CooldownManager;
import com.thorplugin.managers.ItemManager;
import com.thorplugin.managers.ThorSetManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
public class ThorPlugin extends JavaPlugin {
@Getter
private static ThorPlugin instance;
@Getter
private ItemManager itemManager;
@Getter
private ThorSetManager thorSetManager;
@Getter
private CooldownManager cooldownManager;
@Override
public void onEnable() {
instance = this;
saveDefaultConfig();
this.itemManager = new ItemManager(this);
this.cooldownManager = new CooldownManager();
this.thorSetManager = new ThorSetManager(this);
getServer().getPluginManager().registerEvents(new CombatListener(this), this);
getServer().getPluginManager().registerEvents(new ArmorListener(this), this);
getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
ThorCommand thorCommand = new ThorCommand(this);
getCommand("thor").setExecutor(thorCommand);
getCommand("thor").setTabCompleter(thorCommand);
thorSetManager.startSetRefreshTask();
getLogger().info("ThorPvP enabled!");
}
@Override
public void onDisable() {
if (thorSetManager != null) {
thorSetManager.clearAll();
}
getLogger().info("ThorPvP disabled!");
}
public void reload() {
reloadConfig();
itemManager.reload();
thorSetManager.clearAll();
}
}