use of net.glowstone.net.message.play.game.TitleMessage in project Glowstone by GlowstoneMC.
the class TitleCodec method decode.
@Override
public TitleMessage decode(ByteBuf buffer) throws IOException {
int actionId = ByteBufUtils.readVarInt(buffer);
Action action = Action.getAction(actionId);
switch(action) {
case TITLE:
case SUBTITLE:
case ACTION:
String text = ByteBufUtils.readUTF8(buffer);
return new TitleMessage(action, TextMessage.decode(text));
case TIMES:
int fadeIn = buffer.readInt();
int stay = buffer.readInt();
int fadeOut = buffer.readInt();
return new TitleMessage(action, fadeIn, stay, fadeOut);
default:
return new TitleMessage(action);
}
}
Aggregations