Files
src
build.gradle
Code
20 1,505
src/main/java/com/mysticcats/plugin/MysticCats.java
package com.mysticcats.plugin;
import com.mysticcats.plugin.commands.MysticCatsCommand;
import com.mysticcats.plugin.data.DataManager;
import com.mysticcats.plugin.listeners.AbilityActivationListener;
import com.mysticcats.plugin.listeners.CatDeathListener;
import com.mysticcats.plugin.listeners.CatProtectionListener;
import com.mysticcats.plugin.listeners.CatSpawnListener;
import com.mysticcats.plugin.listeners.PlayerJoinListener;
import com.mysticcats.plugin.managers.AbilityManager;
import com.mysticcats.plugin.managers.CatManager;
import com.mysticcats.plugin.managers.CooldownManager;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.plugin.java.JavaPlugin;
public class MysticCats extends JavaPlugin {
private DataManager dataManager;
private CatManager catManager;
private AbilityManager abilityManager;
private CooldownManager cooldownManager;
private NamespacedKey mysteryEggKey;
@Override
public void onEnable() {
saveDefaultConfig();
this.mysteryEggKey = new NamespacedKey(this, "mystery_egg");
this.dataManager = new DataManager(getDataFolder());
this.catManager = new CatManager(this);
this.cooldownManager = new CooldownManager();
this.abilityManager = new AbilityManager(this);
dataManager.loadData();
registerListeners();
registerCommands();
getLogger().info("MysticCats has been enabled!");
}
@Override
public void onDisable() {
dataManager.saveData();
getLogger().info("MysticCats has been disabled!");
}
private void registerListeners() {
Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
Bukkit.getPluginManager().registerEvents(new CatSpawnListener(this), this);
Bukkit.getPluginManager().registerEvents(new CatProtectionListener(this), this);
Bukkit.getPluginManager().registerEvents(new CatDeathListener(this), this);
Bukkit.getPluginManager().registerEvents(new AbilityActivationListener(this), this);
}
private void registerCommands() {
MysticCatsCommand commandHandler = new MysticCatsCommand(this);
getCommand("mysticcats").setExecutor(commandHandler);
getCommand("mysticcats").setTabCompleter(commandHandler);
}
public DataManager getDataManager() {
return dataManager;
}
public CatManager getCatManager() {
return catManager;
}
public AbilityManager getAbilityManager() {
return abilityManager;
}
public CooldownManager getCooldownManager() {
return cooldownManager;
}
public NamespacedKey getMysteryEggKey() {
return mysteryEggKey;
}
}