Files
src
build.gradle
Code
22 1,413
src/main/java/com/advancedessentials/AdvancedEssentials.java
package com.advancedessentials;
import com.advancedessentials.config.ConfigManager;
import com.advancedessentials.config.MessageManager;
import com.advancedessentials.rtp.RTPManager;
import com.advancedessentials.rtp.command.RtpCommand;
import com.advancedessentials.team.TeamManager;
import com.advancedessentials.team.command.TeamCommand;
import com.advancedessentials.team.listener.TeamDamageListener;
import com.advancedessentials.tpa.TPAManager;
import com.advancedessentials.tpa.command.TpaCommand;
import com.advancedessentials.tpa.command.TpacceptCommand;
import com.advancedessentials.tpa.command.TpdenyCommand;
import com.advancedessentials.warp.WarpManager;
import com.advancedessentials.warp.command.DelWarpCommand;
import com.advancedessentials.warp.command.SetWarpCommand;
import com.advancedessentials.warp.command.WarpCommand;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class AdvancedEssentials extends JavaPlugin {
private ConfigManager configManager;
private MessageManager messageManager;
private WarpManager warpManager;
private TPAManager tpaManager;
private RTPManager rtpManager;
private TeamManager teamManager;
@Override
public void onEnable() {
this.configManager = new ConfigManager(this);
this.configManager.load();
this.messageManager = new MessageManager(this);
this.warpManager = new WarpManager(this);
this.tpaManager = new TPAManager(this);
this.rtpManager = new RTPManager(this);
this.teamManager = new TeamManager(this);
this.warpManager.load();
registerCommands();
registerListeners();
getLogger().info("AdvancedEssentials has been enabled!");
}
@Override
public void onDisable() {
if (this.warpManager != null) {
this.warpManager.save();
}
getLogger().info("AdvancedEssentials has been disabled!");
}
private void registerCommands() {
getCommand("setwarp").setExecutor(new SetWarpCommand(this));
getCommand("warp").setExecutor(new WarpCommand(this));
getCommand("delwarp").setExecutor(new DelWarpCommand(this));
getCommand("tpa").setExecutor(new TpaCommand(this));
getCommand("tpaccept").setExecutor(new TpacceptCommand(this));
getCommand("tpdeny").setExecutor(new TpdenyCommand(this));
getCommand("rtp").setExecutor(new RtpCommand(this));
getCommand("team").setExecutor(new TeamCommand(this));
}
private void registerListeners() {
getServer().getPluginManager().registerEvents(new TeamDamageListener(this), this);
}
}