This repository has been archived on 2025-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
WolfFFA/src/main/java/hu/jgj52/wolfFFA/Main.java

52 lines
1.5 KiB
Java

package hu.jgj52.wolfFFA;
import hu.jgj52.wolfFFA.Commands.EditKitCommand;
import hu.jgj52.wolfFFA.Commands.LeaveCommand;
import hu.jgj52.wolfFFA.Commands.TpToFfaCommand;
import hu.jgj52.wolfFFA.Listeners.RandomListener;
import hu.jgj52.wolfFFA.Listeners.KitListener;
import hu.jgj52.wolfFFA.Listeners.LeaveCommandListener;
import hu.jgj52.wolfFFA.Utils.MapReset;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.HashMap;
import java.util.Map;
public final class Main extends JavaPlugin {
private MapReset mapReset;
private final Map<Player, Player> players = new HashMap<>();
@Override
public void onEnable() {
// Plugin startup logic
getConfig().options().copyDefaults(true);
saveConfig();
getCommand("tptoffa").setExecutor(new TpToFfaCommand(this));
getCommand("editkit").setExecutor(new EditKitCommand(this));
getCommand("leave").setExecutor(new LeaveCommand(this));
getServer().getPluginManager().registerEvents(new KitListener(this), this);
getServer().getPluginManager().registerEvents(new RandomListener(this), this);
getServer().getPluginManager().registerEvents(new LeaveCommandListener(this), this);
this.mapReset = new MapReset(this);
}
@Override
public void onDisable() {
// Plugin shutdown logic
players.clear();
}
public static Main getInstance() {
return getPlugin(Main.class);
}
public Map<Player, Player> getPlayers() {
return this.players;
}
}