Search in sources :

Example 1 with MinecraftServerAccess

use of net.pl3x.minimap.mixin.MinecraftServerAccess in project MiniMap by pl3xgaming.

the class FileManager method start.

public void start() {
    this.worldDirs.clear();
    this.tilesDir = null;
    if (MiniMap.getClient().isInSingleplayer()) {
        MinecraftServerAccess server = (MinecraftServerAccess) MiniMap.getClient().getServer();
        if (server == null) {
            throw new RuntimeException("Cannot obtain single player world name");
        }
        this.tilesDir = resolve(this.configDir, "singleplayer/" + server.getSession().getDirectoryName());
    } else {
        ServerInfo server = MiniMap.getClient().getCurrentServerEntry();
        if (server == null) {
            throw new RuntimeException("Cannot obtain multiplayer server ip address");
        }
        this.tilesDir = resolve(this.configDir, "multiplayer/" + server.address);
    }
}
Also used : ServerInfo(net.minecraft.client.network.ServerInfo) MinecraftServerAccess(net.pl3x.minimap.mixin.MinecraftServerAccess)

Aggregations

ServerInfo (net.minecraft.client.network.ServerInfo)1 MinecraftServerAccess (net.pl3x.minimap.mixin.MinecraftServerAccess)1