int y = buffer.readUnsignedByte();
int z = buffer.readInt();
int direction = buffer.readUnsignedByte();
int id = buffer.readUnsignedShort();
if (id == 0xFFFF) {
return new BlockPlacementMessage(x, y, z, direction);
} else {
int count = buffer.readUnsignedByte();
int damage = buffer.readUnsignedByte();
return new BlockPlacementMessage(x, y, z, direction, id, count, damage);
}
}