Code overhaul

This commit is contained in:
jklmao committed 2023-01-14 00:51:32 +01:00
1 parent 44c76711be
commit a7ce523004
21 files changed
-1429

No files matched your search

@@ -1,79 +0,0 @@
package com.jklmao.plugin;
import java.util.HashMap;
import java.util.HashSet;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import com.jklmao.plugin.commands.CommandReload;
import com.jklmao.plugin.commands.CommandTpCancel;
import com.jklmao.plugin.commands.CommandTpToggle;
import com.jklmao.plugin.commands.CommandTpa;
import com.jklmao.plugin.commands.CommandTpaDeny;
import com.jklmao.plugin.commands.CommandTpaHere;
import com.jklmao.plugin.commands.CommandTpaccept;
import com.jklmao.plugin.commands.CommandTpo;
import com.jklmao.plugin.commands.CommandTpoHere;
import com.jklmao.plugin.events.PlayerEvents;
import com.jklmao.plugin.utils.CustomList;
import com.jklmao.plugin.utils.TeleportMode;
public final class ClickTpa extends JavaPlugin {
private HashSet<Player> graceList = new HashSet<>();
private HashMap<Player, Player> tpaCancel = new HashMap<>();
private HashMap<Player, CustomList> playerTpaList = new HashMap<>();
@Override
public void onEnable() {
commandHandler();
addAllPlayers();
saveDefaultConfig();
getServer().getPluginManager().registerEvents(new PlayerEvents(this), this);
getLogger().info("ClickTPA has been loaded Successfully!");
}
public HashSet<Player> getGraceList() {
return this.graceList;
}
public HashMap<Player, Player> getTpaCancel() {
return tpaCancel;
}
public HashMap<Player, CustomList> getTpaPlayers() {
return this.playerTpaList;
}
public void reloadTheConfig() {
reloadConfig();
}
public void commandHandler() {
getCommand("tpa").setExecutor(new CommandTpa(this));
getCommand("tpahere").setExecutor(new CommandTpaHere(this));
getCommand("tpacancel").setExecutor(new CommandTpCancel(this));
getCommand("tpaccept").setExecutor(new CommandTpaccept(this));
getCommand("tpdeny").setExecutor(new CommandTpaDeny(this));
getCommand("tpo").setExecutor(new CommandTpo(this));
getCommand("tpohere").setExecutor(new CommandTpoHere(this));
getCommand("tptoggle").setExecutor(new CommandTpToggle(this));
getCommand("clicktparl").setExecutor(new CommandReload(this));
}
public void addAllPlayers() {
CustomList list = new CustomList();
list.setMode(TeleportMode.DEFAULT);
for (Player p : Bukkit.getOnlinePlayers()) {
playerTpaList.put(p, list);
}
}
}