Exemplo n.º 1
0
 public static void WriteRecord(Wrapped wSock, Record Data) {
     int RecordData = Data.Metadata & 0xF | (Data.BlockID & 0xFFF) << 4 | (Data.Y & 0xFF) << 16 | (Data.Z & 0xF) << 24 | (Data.X & 0xF) << 28;
     wSock.writeInt(RecordData);
 }
Exemplo n.º 2
0
 public static void WriteRecord(Wrapped wSock, Record data) {
     wSock.writeByte((byte)(data.X << 4 | data.Z));
     wSock.writeByte(data.Y);
     wSock.writeVarInt(data.BlockId);
 }
Exemplo n.º 3
0
        public static Record ReadRecord(Wrapped wSock) {
            var Data = new Record();
            var RecordData = wSock.readInt();

            Data.Metadata = (byte)(RecordData & 0xF);
            Data.BlockID = (short)((RecordData >> 4) & 0xFFF);
            Data.Y = (byte)((RecordData >> 16) & 0xFF);
            Data.Z = (byte)((RecordData >> 24) & 0xF);
            Data.X = (byte)((RecordData >> 28) & 0xF);

            return Data;
        }
Exemplo n.º 4
0
        public static Record ReadRecord(Wrapped wSock) {
            var data = new Record();

            var horizional = wSock.readByte();
            data.X = (byte)(horizional & 0xF0);
            data.Z = (byte) (horizional & 0x0F);

            data.Y = wSock.readByte();
            data.BlockId = wSock.readVarInt();

            return data;
        }