From 34f4bae9232e36022217e181f00453d629553efd Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 16 Mar 2013 20:37:36 +1100 Subject: [PATCH] Fix score add definition --- .../bungee/protocol/netty/Instruction.java | 1 + .../net/md_5/bungee/protocol/netty/Score.java | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 protocol/src/main/java/net/md_5/bungee/protocol/netty/Score.java diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/netty/Instruction.java b/protocol/src/main/java/net/md_5/bungee/protocol/netty/Instruction.java index f6cd82bc..9a25a2a8 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/netty/Instruction.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/netty/Instruction.java @@ -19,6 +19,7 @@ abstract class Instruction static final Instruction LONG = new Jump( 8 ); static final Instruction METADATA = new MetaData(); static final Instruction OPTIONAL_MOTION = new OptionalMotion(); + static final Instruction SCORE = new Score(); static final Instruction SHORT = new Jump( 2 ); static final Instruction SHORT_BYTE = new ShortHeader( BYTE ); static final Instruction SHORT_ITEM = new ShortHeader( ITEM ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/netty/Score.java b/protocol/src/main/java/net/md_5/bungee/protocol/netty/Score.java new file mode 100644 index 00000000..f5feb541 --- /dev/null +++ b/protocol/src/main/java/net/md_5/bungee/protocol/netty/Score.java @@ -0,0 +1,19 @@ +package net.md_5.bungee.protocol.netty; + +import io.netty.buffer.ByteBuf; +import java.io.IOException; + +public class Score extends Instruction +{ + + @Override + void read(ByteBuf in) throws IOException + { + STRING.read( in ); + if ( in.readByte() == 0 ) + { + STRING.read( in ); + INT.read( in ); + } + } +}