Search in sources :

Example 1 with SpongeFavicon

use of org.spongepowered.common.network.status.SpongeFavicon in project SpongeCommon by SpongePowered.

the class MixinServerStatusResponse method setFavicon.

/**
 * @author minecrell - January 18th, 2015
 * @reason Implements our Status API
 *
 * @param faviconBlob the blob of the favicon
 */
@Overwrite
public void setFavicon(@Nullable String faviconBlob) {
    if (faviconBlob == null) {
        this.favicon = null;
        this.faviconHandle = null;
    } else {
        try {
            this.faviconHandle = new SpongeFavicon(faviconBlob);
            this.favicon = faviconBlob;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
Also used : IOException(java.io.IOException) SpongeFavicon(org.spongepowered.common.network.status.SpongeFavicon) Overwrite(org.spongepowered.asm.mixin.Overwrite)

Example 2 with SpongeFavicon

use of org.spongepowered.common.network.status.SpongeFavicon in project SpongeCommon by SpongePowered.

the class ServerStatusMixin method setFavicon.

/**
 * @author minecrell - January 18th, 2015
 * @reason Implements our Status API
 *
 * @param faviconBlob the blob of the favicon
 */
@Overwrite
public void setFavicon(@Nullable final String faviconBlob) {
    if (faviconBlob == null) {
        this.favicon = null;
        this.impl$faviconHandle = null;
    } else {
        try {
            this.impl$faviconHandle = new SpongeFavicon(faviconBlob);
            this.favicon = faviconBlob;
        } catch (final IOException e) {
            throw new RuntimeException(e);
        }
    }
}
Also used : IOException(java.io.IOException) SpongeFavicon(org.spongepowered.common.network.status.SpongeFavicon) Overwrite(org.spongepowered.asm.mixin.Overwrite)

Aggregations

IOException (java.io.IOException)2 Overwrite (org.spongepowered.asm.mixin.Overwrite)2 SpongeFavicon (org.spongepowered.common.network.status.SpongeFavicon)2