// Path: src/main/java/net/frozenbit/plugin5zig/cubecraft/gamemodes/DuelsGameMode.java
// public class DuelsGameMode extends CubeCraftGameMode {
//     private static Stalker stalker;
// 
//     private NetworkPlayerInfo opponentInfo;
// 
//     @Override
//     public String getName() {
//         return "Duels";
//     }
// 
//     public NetworkPlayerInfo getOpponentInfo() {
//         return opponentInfo;
//     }
// 
//     public void setOpponentInfo(NetworkPlayerInfo opponentInfo) {
//         this.opponentInfo = opponentInfo;
//     }
// 
//     @Override
//     public Stalker getStalker() {
//         if (stalker == null)
//             stalker = new Stalker(this);
//         return stalker;
//     }
// }
// 
// 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.mod.util.NetworkPlayerInfo;
import eu.the5zig.util.minecraft.ChatColor;
import net.frozenbit.plugin5zig.cubecraft.gamemodes.DuelsGameMode;
import net.frozenbit.plugin5zig.cubecraft.stalker.StalkedPlayer;
import static java.lang.String.format;

    private static String getColoredPing(int ping) {
        return ping > 0 ? format("%s%d%s", (ping > 300 ? ChatColor.RED : ping > 150 ? ChatColor.YELLOW : ChatColor.WHITE),
                ping, ChatColor.RESET) : "?";
    }

    @Override
    public boolean shouldRender(boolean dummy) {
        return super.shouldRender(dummy);
    }

    @Override
    public void render(int x, int y, RenderLocation renderLocation, boolean dummy) {
        if (dummy) {
            if (System.currentTimeMillis() - lastDummyPingTime > 1000) {
                lastDummyPingTime = System.currentTimeMillis();
                dummyPing = (int) (Math.random() * 500.0);
            }
            The5zigAPI.getAPI().getRenderHelper().drawString(formatOpponentInfo("nullEuro", dummyPing), x, y);
            The5zigAPI.getAPI().getRenderHelper().drawString(formatOpponentStats(3, 7), x, y + 10);
            lines = 2;
            return;
        }
        NetworkPlayerInfo opponentInfo = getGameMode().getOpponentInfo();
        if (opponentInfo == null) {
            The5zigAPI.getAPI().getRenderHelper().drawString(getPrefix() + ChatColor.GRAY + "...", x, y);
            lines = 1;
            return;
        }
        The5zigAPI.getAPI().getRenderHelper().drawString(formatOpponentInfo(opponentInfo.getGameProfile().getName(), opponentInfo.getPing()), x, y);
// Path: src/main/java/net/frozenbit/plugin5zig/cubecraft/gamemodes/DuelsGameMode.java
// public class DuelsGameMode extends CubeCraftGameMode {
//     private static Stalker stalker;
// 
//     private NetworkPlayerInfo opponentInfo;
// 
//     @Override
//     public String getName() {
//         return "Duels";
//     }
// 
//     public NetworkPlayerInfo getOpponentInfo() {
//         return opponentInfo;
//     }
// 
//     public void setOpponentInfo(NetworkPlayerInfo opponentInfo) {
//         this.opponentInfo = opponentInfo;
//     }
// 
//     @Override
//     public Stalker getStalker() {
//         if (stalker == null)
//             stalker = new Stalker(this);
//         return stalker;
//     }
// }
// 
// 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/OpponentItem.java
import eu.the5zig.mod.The5zigAPI;
import eu.the5zig.mod.modules.GameModeItem;
import eu.the5zig.mod.render.RenderLocation;
import eu.the5zig.mod.util.NetworkPlayerInfo;
import eu.the5zig.util.minecraft.ChatColor;
import net.frozenbit.plugin5zig.cubecraft.gamemodes.DuelsGameMode;
import net.frozenbit.plugin5zig.cubecraft.stalker.StalkedPlayer;
import static java.lang.String.format;


    private static String getColoredPing(int ping) {
        return ping > 0 ? format("%s%d%s", (ping > 300 ? ChatColor.RED : ping > 150 ? ChatColor.YELLOW : ChatColor.WHITE),
                ping, ChatColor.RESET) : "?";
    }

    @Override
    public boolean shouldRender(boolean dummy) {
        return super.shouldRender(dummy);
    }

    @Override
    public void render(int x, int y, RenderLocation renderLocation, boolean dummy) {
        if (dummy) {
            if (System.currentTimeMillis() - lastDummyPingTime > 1000) {
                lastDummyPingTime = System.currentTimeMillis();
                dummyPing = (int) (Math.random() * 500.0);
            }
            The5zigAPI.getAPI().getRenderHelper().drawString(formatOpponentInfo("nullEuro", dummyPing), x, y);
            The5zigAPI.getAPI().getRenderHelper().drawString(formatOpponentStats(3, 7), x, y + 10);
            lines = 2;
            return;
        }
        NetworkPlayerInfo opponentInfo = getGameMode().getOpponentInfo();
        if (opponentInfo == null) {
            The5zigAPI.getAPI().getRenderHelper().drawString(getPrefix() + ChatColor.GRAY + "...", x, y);
            lines = 1;
            return;
        }
        The5zigAPI.getAPI().getRenderHelper().drawString(formatOpponentInfo(opponentInfo.getGameProfile().getName(), opponentInfo.getPing()), x, y);
        StalkedPlayer stalkedOpponent = getGameMode().getStalker().getStalkedPlayerById(opponentInfo.getGameProfile().getId());