Search in sources :

Example 1 with StatusResponse

use of org.spongepowered.api.network.status.StatusResponse in project SpongeCommon by SpongePowered.

the class SpongeStatusResponse method clone.

private static ServerStatusResponse clone(ServerStatusResponse original) {
    ServerStatusResponse clone = new ServerStatusResponse();
    clone.setServerDescription(original.getServerDescription());
    if (original.getFavicon() != null) {
        ((ClientPingServerEvent.Response) clone).setFavicon(((StatusResponse) original).getFavicon().get());
    }
    clone.setPlayers(clone(original.getPlayers()));
    clone.setVersion(clone(original.getVersion()));
    return clone;
}
Also used : ServerStatusResponse(net.minecraft.network.ServerStatusResponse) StatusResponse(org.spongepowered.api.network.status.StatusResponse) ServerStatusResponse(net.minecraft.network.ServerStatusResponse) ServerStatusResponse(net.minecraft.network.ServerStatusResponse) StatusResponse(org.spongepowered.api.network.status.StatusResponse)

Example 2 with StatusResponse

use of org.spongepowered.api.network.status.StatusResponse in project SpongeCommon by SpongePowered.

the class SpongeStatusResponse method clone.

private static ServerStatus clone(final ServerStatus original) {
    final ServerStatus clone = new ServerStatus();
    clone.setDescription(original.getDescription());
    if (original.getFavicon() != null) {
        ((ClientPingServerEvent.Response) clone).setFavicon(((StatusResponse) original).favicon().get());
    }
    clone.setPlayers(SpongeStatusResponse.clone(original.getPlayers()));
    clone.setVersion(SpongeStatusResponse.clone(original.getVersion()));
    return clone;
}
Also used : StatusResponse(org.spongepowered.api.network.status.StatusResponse) ServerStatus(net.minecraft.network.protocol.status.ServerStatus) StatusResponse(org.spongepowered.api.network.status.StatusResponse)

Example 3 with StatusResponse

use of org.spongepowered.api.network.status.StatusResponse in project Sponge by SpongePowered.

the class SpongeStatusResponse method clone.

private static ServerStatus clone(final ServerStatus original) {
    final ServerStatus clone = new ServerStatus();
    clone.setDescription(original.getDescription());
    if (original.getFavicon() != null) {
        ((ClientPingServerEvent.Response) clone).setFavicon(((StatusResponse) original).favicon().get());
    }
    clone.setPlayers(SpongeStatusResponse.clone(original.getPlayers()));
    clone.setVersion(SpongeStatusResponse.clone(original.getVersion()));
    return clone;
}
Also used : StatusResponse(org.spongepowered.api.network.status.StatusResponse) ServerStatus(net.minecraft.network.protocol.status.ServerStatus) StatusResponse(org.spongepowered.api.network.status.StatusResponse)

Aggregations

StatusResponse (org.spongepowered.api.network.status.StatusResponse)3 ServerStatus (net.minecraft.network.protocol.status.ServerStatus)2 ServerStatusResponse (net.minecraft.network.ServerStatusResponse)1