diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Title.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Title.java index 79a12578..5e93e28d 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Title.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Title.java @@ -28,11 +28,20 @@ public class Title extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { - action = Action.values()[readVarInt( buf )]; + int index = readVarInt( buf ); + + // If we're working on 1.10 or lower, increment the value of the index so we pull out the correct value. + if ( protocolVersion <= ProtocolConstants.MINECRAFT_1_10 && index <= 2 ) + { + index++; + } + + action = Action.values()[index]; switch ( action ) { case TITLE: case SUBTITLE: + case ACTIONBAR: text = readString( buf ); break; case TIMES: @@ -46,11 +55,20 @@ public class Title extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { - writeVarInt( action.ordinal(), buf ); + int index = readVarInt( buf ); + + // If we're working on 1.10 or lower, increment the value of the index so we pull out the correct value. + if ( protocolVersion <= ProtocolConstants.MINECRAFT_1_10 && index <= 2 ) + { + index++; + } + + action = Action.values()[index]; switch ( action ) { case TITLE: case SUBTITLE: + case ACTIONBAR: writeString( text, buf ); break; case TIMES: @@ -72,6 +90,7 @@ public class Title extends DefinedPacket TITLE, SUBTITLE, + ACTIONBAR, TIMES, CLEAR, RESET