public RelativeEntityMoveLookEventArgs(int id, byte x, byte y, byte z, byte yaw, byte pitch) : base() { ID = id; Translation = new Vector3D(x, y, z); Yaw = yaw; Pitch = pitch; }
protected void ParseMultiBlockChange(BinaryReader reader) { int x = reader.ReadNetworkInt32(); int z = reader.ReadNetworkInt32(); short size = reader.ReadNetworkInt16(); List<MCBlockTransform> changes = new List<MCBlockTransform>(); Vector3D[] relativepos = new Vector3D[size]; byte[] blocks = new byte[size]; byte[] metadatas = new byte[size]; for (short i = 0; i < size; i++) { short xyz = reader.ReadNetworkInt16(); int xpos = (xyz >> 12) & 0xF; int zpos = (xyz >> 8) & 0xF; int ypos = xyz & 0xFF; relativepos[i] = new Vector3D(xpos, ypos, zpos); } for (short i = 0; i < size; i++) blocks[i] = reader.ReadByte(); for (short i = 0; i < size; i++) metadatas[i] = reader.ReadByte(); for (short i = 0; i < size; i++) changes.Add(new MCBlockTransform(relativepos[i], blocks[i], metadatas[i])); HandleMultiBlockChange(x, z, size, changes); }
public MCBlockTransform(Vector3D pos, byte type, byte metadata) { RelativePosition = pos; Block = (MCBlockType)type; MetaData = metadata; }