Files
src
build.gradle
manifest.kod
Code
16 686
src/main/java/com/bloodnightsouls/BloodNightSouls.java
package com.bloodnightsouls;
import com.bloodnightsouls.commands.BloodNightCommand;
import com.bloodnightsouls.commands.SetSoulsCommand;
import com.bloodnightsouls.commands.SoulsCommand;
import com.bloodnightsouls.data.DataManager;
import com.bloodnightsouls.listeners.PlayerDeathListener;
import com.bloodnightsouls.listeners.PlayerJoinListener;
import com.bloodnightsouls.listeners.TimeChangeListener;
import com.bloodnightsouls.managers.BloodNightManager;
import com.bloodnightsouls.managers.JoinManager;
import com.bloodnightsouls.managers.SoulManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class BloodNightSouls extends JavaPlugin {
private DataManager dataManager;
private BloodNightManager bloodNightManager;
private SoulManager soulManager;
private JoinManager joinManager;
@Override
public void onEnable() {
saveDefaultConfig();
this.dataManager = new DataManager(this);
this.dataManager.load();
this.bloodNightManager = new BloodNightManager(this);
this.soulManager = new SoulManager(this);
this.joinManager = new JoinManager(this);
Bukkit.getPluginManager().registerEvents(new PlayerDeathListener(this), this);
Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
Bukkit.getPluginManager().registerEvents(new TimeChangeListener(this), this);
getCommand("souls").setExecutor(new SoulsCommand(this));
getCommand("setsouls").setExecutor(new SetSoulsCommand(this));
getCommand("bloodnight").setExecutor(new BloodNightCommand(this));
getLogger().info("BloodNightSouls has been enabled!");
}
@Override
public void onDisable() {
if (this.dataManager != null) {
this.dataManager.save();
}
getLogger().info("BloodNightSouls has been disabled!");
}
}