package net.minecraft.client;

import net.minecraft.client.multiplayer.PlayerInfo;
import net.minecraft.client.multiplayer.ClientPacketListener;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.client.multiplayer.ClientLevel;
import java.util.UUID;
import com.mojang.bridge.game.GameSession;

public class Session implements GameSession {
    private final int players;
    private final boolean isRemoteServer;
    private final String difficulty;
    private final String gameMode;
    private final UUID id;
    
    public Session(final ClientLevel dym, final LocalPlayer ebf, final ClientPacketListener dyn) {
        this.players = dyn.getOnlinePlayers().size();
        this.isRemoteServer = !dyn.getConnection().isMemoryConnection();
        this.difficulty = dym.getDifficulty().getKey();
        final PlayerInfo dyq5 = dyn.getPlayerInfo(ebf.getUUID());
        if (dyq5 != null) {
            this.gameMode = dyq5.getGameMode().getName();
        }
        else {
            this.gameMode = "unknown";
        }
        this.id = dyn.getId();
    }
    
    public int getPlayerCount() {
        return this.players;
    }
    
    public boolean isRemoteServer() {
        return this.isRemoteServer;
    }
    
    public String getDifficulty() {
        return this.difficulty;
    }
    
    public String getGameMode() {
        return this.gameMode;
    }
    
    public UUID getSessionId() {
        return this.id;
    }
}
