Files
src
build.gradle
Code
29 1,995
src/main/java/com/example/wallexplosi/WallExplosi.java
package com.example.wallexplosi;
import com.example.wallexplosi.chest.ChestManager;
import com.example.wallexplosi.commands.WallCommand;
import com.example.wallexplosi.config.ConfigManager;
import com.example.wallexplosi.data.DataManager;
import com.example.wallexplosi.hologram.HologramManager;
import com.example.wallexplosi.inventory.gui.GUIListener;
import com.example.wallexplosi.inventory.gui.GUIManager;
import com.example.wallexplosi.listener.ExplosiveThrowListener;
import com.example.wallexplosi.listener.WallInteractListener;
import com.example.wallexplosi.selection.SelectionManager;
import com.example.wallexplosi.wall.WallManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class WallExplosi extends JavaPlugin {
private ConfigManager configManager;
private DataManager dataManager;
private SelectionManager selectionManager;
private WallManager wallManager;
private ChestManager chestManager;
private HologramManager hologramManager;
private GUIManager guiManager;
@Override
public void onEnable() {
saveDefaultConfig();
this.configManager = new ConfigManager(this);
this.dataManager = new DataManager(this);
this.selectionManager = new SelectionManager();
this.hologramManager = new HologramManager(this);
this.wallManager = new WallManager(this);
this.chestManager = new ChestManager(this);
this.guiManager = new GUIManager();
this.dataManager.loadData();
getCommand("wallexplosi").setExecutor(new WallCommand(this));
Bukkit.getPluginManager().registerEvents(new WallInteractListener(this), this);
Bukkit.getPluginManager().registerEvents(new ExplosiveThrowListener(this), this);
Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
getLogger().info("WallExplosi has been enabled!");
}
@Override
public void onDisable() {
if (this.wallManager != null) {
this.wallManager.shutdown();
}
if (this.hologramManager != null) {
this.hologramManager.removeAllHolograms();
}
if (this.dataManager != null) {
this.dataManager.saveData();
}
getLogger().info("WallExplosi has been disabled!");
}
}