// Path: src/main/java/net/frozenbit/plugin5zig/cubecraft/gamemodes/CubeCraftGameMode.java
// public abstract class CubeCraftGameMode extends GameMode {
//     protected List<CubeCraftPlayer> players = new CopyOnWriteArrayList<>();
//     private String kit;
//     private boolean kitsEnabled;
//     private int pointsEarned;
// 
//     public CubeCraftPlayer getPlayerByName(String name) {
//         for (CubeCraftPlayer player : players) {
//             if (player.getName().equals(name)) {
//                 return player;
//             }
//         }
//         return null;
//     }
// 
//     /**
//      * @return A list of players currently in this gamemode. The list can be modified, however
//      * {@link #playerListUpdate()} MUST be called afterwards.
//      */
//     public List<CubeCraftPlayer> getPlayers() {
//         return players;
//     }
// 
//     public void playerListUpdate() {
//     }
// 
//     public String getKit() {
//         return kit;
//     }
// 
//     public void setKit(String kit) {
//         this.kit = kit;
//     }
// 
//     public boolean hasKitsEnabled() {
//         return kitsEnabled;
//     }
// 
//     public void setKitsEnabled(boolean kitsEnabled) {
//         this.kitsEnabled = kitsEnabled;
//     }
// 
//     public int getPointsEarned() {
//         return pointsEarned;
//     }
// 
//     public void addPointsEarned(int pointsEarned) {
//         this.pointsEarned += pointsEarned;
//     }
// 
//     public boolean isStalkerEnabled() {
//         return true;
//     }
// 
//     /**
//      * Return a singleton instance for the stalker of this gamemode. Before calling this method
//      * always check {@link #isStalkerEnabled()}.
//      * <p>
//      * Implementing classes that do not need a stalker must overwrite {@link #isStalkerEnabled()}
//      * and should throw an exception here.
//      *
//      * @return A stalker singleton.
//      */
//     public abstract Stalker getStalker();
// }
// 
// Path: src/main/java/net/frozenbit/plugin5zig/cubecraft/stalker/StalkedPlayer.java
// public class StalkedPlayer {
//     private int kills, deaths;
//     private CubeCraftPlayer cubeCraftPlayer;
// 
//     public StalkedPlayer(CubeCraftPlayer cubeCraftPlayer, int kills, int deaths) {
//         this.cubeCraftPlayer = cubeCraftPlayer;
//         this.kills = kills;
//         this.deaths = deaths;
//     }
// 
//     public StalkedPlayer(CubeCraftPlayer cubeCraftPlayer, JSONObject playerData) {
//         this.cubeCraftPlayer = cubeCraftPlayer;
//         kills = playerData.getInt("kills");
//         deaths = playerData.getInt("deaths");
//     }
// 
//     public String getName() {
//         return cubeCraftPlayer.getName();
//     }
// 
//     public UUID getId() {
//         return cubeCraftPlayer.getId();
//     }
// 
//     public int getKills() {
//         return kills;
//     }
// 
//     public void onKill() {
//         ++kills;
//     }
// 
//     public int getDeaths() {
//         return deaths;
//     }
// 
//     public void onDeath() {
//         ++deaths;
//     }
// 
//     public int getThreat() {
//         return deaths - kills;
//     }
// 
//     public ChatColor getThreatColor() {
//         if (getThreat() <= 0)
//             return ChatColor.WHITE;
//         else if (getThreat() <= 3)
//             return ChatColor.YELLOW;
//         else
//             return ChatColor.RED;
//     }
// 
//     public JSONObject toJSON() {
//         JSONObject playerData = new JSONObject();
//         playerData.put("kills", kills);
//         playerData.put("deaths", deaths);
//         return playerData;
//     }
// }


import eu.the5zig.mod.The5zigAPI;
import eu.the5zig.mod.modules.GameModeItem;
import eu.the5zig.mod.render.RenderLocation;
import eu.the5zig.util.minecraft.ChatColor;
import net.frozenbit.plugin5zig.cubecraft.gamemodes.CubeCraftGameMode;
import net.frozenbit.plugin5zig.cubecraft.stalker.StalkedPlayer;
import java.util.List;
package net.frozenbit.plugin5zig.cubecraft.items;



public class StalkerItem extends GameModeItem<CubeCraftGameMode> {

    private final static int minWidthName = 100;
    private final static int widthKills = 30;
    private final static int widthDeaths = 40;

    private int widthName;

    public StalkerItem() {
        super(CubeCraftGameMode.class);
    }

    @Override
    public void render(int x, int y, RenderLocation renderLocation, boolean dummy) {
        if (dummy) {
            renderDummyStalker(x, y);
            return;
        }
        widthName = Math.max(minWidthName, getGameMode().getStalker().getMaxNameWidth() + 20);
// Path: src/main/java/net/frozenbit/plugin5zig/cubecraft/gamemodes/CubeCraftGameMode.java
// public abstract class CubeCraftGameMode extends GameMode {
//     protected List<CubeCraftPlayer> players = new CopyOnWriteArrayList<>();
//     private String kit;
//     private boolean kitsEnabled;
//     private int pointsEarned;
// 
//     public CubeCraftPlayer getPlayerByName(String name) {
//         for (CubeCraftPlayer player : players) {
//             if (player.getName().equals(name)) {
//                 return player;
//             }
//         }
//         return null;
//     }
// 
//     /**
//      * @return A list of players currently in this gamemode. The list can be modified, however
//      * {@link #playerListUpdate()} MUST be called afterwards.
//      */
//     public List<CubeCraftPlayer> getPlayers() {
//         return players;
//     }
// 
//     public void playerListUpdate() {
//     }
// 
//     public String getKit() {
//         return kit;
//     }
// 
//     public void setKit(String kit) {
//         this.kit = kit;
//     }
// 
//     public boolean hasKitsEnabled() {
//         return kitsEnabled;
//     }
// 
//     public void setKitsEnabled(boolean kitsEnabled) {
//         this.kitsEnabled = kitsEnabled;
//     }
// 
//     public int getPointsEarned() {
//         return pointsEarned;
//     }
// 
//     public void addPointsEarned(int pointsEarned) {
//         this.pointsEarned += pointsEarned;
//     }
// 
//     public boolean isStalkerEnabled() {
//         return true;
//     }
// 
//     /**
//      * Return a singleton instance for the stalker of this gamemode. Before calling this method
//      * always check {@link #isStalkerEnabled()}.
//      * <p>
//      * Implementing classes that do not need a stalker must overwrite {@link #isStalkerEnabled()}
//      * and should throw an exception here.
//      *
//      * @return A stalker singleton.
//      */
//     public abstract Stalker getStalker();
// }
// 
// Path: src/main/java/net/frozenbit/plugin5zig/cubecraft/stalker/StalkedPlayer.java
// public class StalkedPlayer {
//     private int kills, deaths;
//     private CubeCraftPlayer cubeCraftPlayer;
// 
//     public StalkedPlayer(CubeCraftPlayer cubeCraftPlayer, int kills, int deaths) {
//         this.cubeCraftPlayer = cubeCraftPlayer;
//         this.kills = kills;
//         this.deaths = deaths;
//     }
// 
//     public StalkedPlayer(CubeCraftPlayer cubeCraftPlayer, JSONObject playerData) {
//         this.cubeCraftPlayer = cubeCraftPlayer;
//         kills = playerData.getInt("kills");
//         deaths = playerData.getInt("deaths");
//     }
// 
//     public String getName() {
//         return cubeCraftPlayer.getName();
//     }
// 
//     public UUID getId() {
//         return cubeCraftPlayer.getId();
//     }
// 
//     public int getKills() {
//         return kills;
//     }
// 
//     public void onKill() {
//         ++kills;
//     }
// 
//     public int getDeaths() {
//         return deaths;
//     }
// 
//     public void onDeath() {
//         ++deaths;
//     }
// 
//     public int getThreat() {
//         return deaths - kills;
//     }
// 
//     public ChatColor getThreatColor() {
//         if (getThreat() <= 0)
//             return ChatColor.WHITE;
//         else if (getThreat() <= 3)
//             return ChatColor.YELLOW;
//         else
//             return ChatColor.RED;
//     }
// 
//     public JSONObject toJSON() {
//         JSONObject playerData = new JSONObject();
//         playerData.put("kills", kills);
//         playerData.put("deaths", deaths);
//         return playerData;
//     }
// }


// Path: src/main/java/net/frozenbit/plugin5zig/cubecraft/items/StalkerItem.java
import eu.the5zig.mod.The5zigAPI;
import eu.the5zig.mod.modules.GameModeItem;
import eu.the5zig.mod.render.RenderLocation;
import eu.the5zig.util.minecraft.ChatColor;
import net.frozenbit.plugin5zig.cubecraft.gamemodes.CubeCraftGameMode;
import net.frozenbit.plugin5zig.cubecraft.stalker.StalkedPlayer;
import java.util.List;

package net.frozenbit.plugin5zig.cubecraft.items;



public class StalkerItem extends GameModeItem<CubeCraftGameMode> {

    private final static int minWidthName = 100;
    private final static int widthKills = 30;
    private final static int widthDeaths = 40;

    private int widthName;

    public StalkerItem() {
        super(CubeCraftGameMode.class);
    }

    @Override
    public void render(int x, int y, RenderLocation renderLocation, boolean dummy) {
        if (dummy) {
            renderDummyStalker(x, y);
            return;
        }
        widthName = Math.max(minWidthName, getGameMode().getStalker().getMaxNameWidth() + 20);
        List<StalkedPlayer> stalkedPlayers = getGameMode().getStalker().getStalkedPlayerList();