public ByteBuf encode(EntityObjectMessage message) throws IOException {
ByteBuf buffer = Unpooled.buffer(message.getThrowerId() > 0 ? 29 : 23);
buffer.writeInt(message.getEntityId());
buffer.writeByte(message.getType());
buffer.writeInt(message.getX());
buffer.writeInt(message.getY());
buffer.writeInt(message.getZ());
buffer.writeByte(message.getYaw());
buffer.writeByte(message.getPitch());
int throwerId = message.getThrowerId();
buffer.writeInt(throwerId);