Search in sources :

Example 1 with MessagePlayInResourcePackStatus

use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayInResourcePackStatus in project LanternServer by LanternPowered.

the class CodecPlayInResourcePackStatus method decode.

@Override
public MessagePlayInResourcePackStatus decode(CodecContext context, ByteBuffer buf) throws CodecException {
    int status0 = buf.readVarInt();
    ResourcePackStatus status = this.status.get(status0);
    if (status == null) {
        throw new DecoderException("Unknown status: " + status0);
    }
    return new MessagePlayInResourcePackStatus(status);
}
Also used : DecoderException(io.netty.handler.codec.DecoderException) MessagePlayInResourcePackStatus(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayInResourcePackStatus) ResourcePackStatus(org.spongepowered.api.event.entity.living.humanoid.player.ResourcePackStatusEvent.ResourcePackStatus) MessagePlayInResourcePackStatus(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayInResourcePackStatus)

Aggregations

DecoderException (io.netty.handler.codec.DecoderException)1 MessagePlayInResourcePackStatus (org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayInResourcePackStatus)1 ResourcePackStatus (org.spongepowered.api.event.entity.living.humanoid.player.ResourcePackStatusEvent.ResourcePackStatus)1