3. User class - projectwoosh/AntiCheat GitHub Wiki

In this class, we are going to store information such as the previous actions.
But just for now we're going to store the Player object:

package tk.thewoosh.wikianticheat;

import org.bukkit.entity.Player;

public class User {

private final Player player;

public User(Player player) {
this.player = player;
}

public Player getPlayer() {
return player;
}

}

Now to apply this, we're going to store them in a HashMap.

In AntiCheat.java, after the CheckManager instance:

public static final HashMap<UUID, User> PLAYERS = new HashMap<>();

In AntiCheat.java, before initializing the CheckManager:

for (Player player : Bukkit.getOnlinePlayers()) {
PLAYERS.put(player.getUniqueId(), new User(player));
}

⚠️ **GitHub.com Fallback** ⚠️