icontrolu/src/main/java/pw/kaboom/icontrolu/utilities/PlayerList.java

39 lines
1.1 KiB
Java
Raw Normal View History

2019-12-17 16:59:28 +00:00
package pw.kaboom.icontrolu.utilities;
import java.util.HashMap;
import java.util.UUID;
import org.bukkit.entity.Player;
public final class PlayerList {
2022-05-20 02:21:46 +00:00
private PlayerList() {
}
2019-12-17 16:59:28 +00:00
2022-05-20 02:21:46 +00:00
private static HashMap<UUID, Player> controllerFor = new HashMap<UUID, Player>();
private static HashMap<UUID, Player> targetFor = new HashMap<UUID, Player>();
2019-12-17 16:59:28 +00:00
2022-05-20 02:21:46 +00:00
public static Player getController(final UUID playerUuid) {
return controllerFor.get(playerUuid);
}
2019-12-17 16:59:28 +00:00
2022-05-20 02:21:46 +00:00
public static Player getTarget(final UUID playerUuid) {
return targetFor.get(playerUuid);
}
2019-12-17 16:59:28 +00:00
2022-05-20 02:21:46 +00:00
public static void removeController(final UUID playerUuid) {
controllerFor.remove(playerUuid);
}
2019-12-17 16:59:28 +00:00
2022-05-20 02:21:46 +00:00
public static void removeTarget(final UUID playerUuid) {
targetFor.remove(playerUuid);
}
2019-12-17 16:59:28 +00:00
2022-05-20 02:21:46 +00:00
public static void setController(final UUID playerUuid, final Player player) {
controllerFor.put(playerUuid, player);
}
2019-12-17 16:59:28 +00:00
2022-05-20 02:21:46 +00:00
public static void setTarget(final UUID playerUuid, final Player player) {
targetFor.put(playerUuid, player);
}
2019-12-17 16:59:28 +00:00
}