Search in sources :

Example 1 with StopSoundMessage

use of net.glowstone.net.message.play.game.StopSoundMessage in project Glowstone by GlowstoneMC.

the class StopSoundCodec method decode.

@Override
public StopSoundMessage decode(ByteBuf buf) throws IOException {
    byte flags = buf.readByte();
    SoundCategory source = ((flags & FLAG_SOURCE) != 0) ? SOURCE_ID_MAP.inverse().get(readVarInt(buf)) : null;
    String sound = ((flags & FLAG_SOUND) != 0) ? readUTF8(buf) : null;
    return new StopSoundMessage(source, sound);
}
Also used : SoundCategory(org.bukkit.SoundCategory) StopSoundMessage(net.glowstone.net.message.play.game.StopSoundMessage)

Aggregations

StopSoundMessage (net.glowstone.net.message.play.game.StopSoundMessage)1 SoundCategory (org.bukkit.SoundCategory)1