示例#1
0
        public static Item ItemFromSlot(SlotData Item) {
            var newItem = new Item();
            newItem.itemID = Item.ID;
            newItem.itemCount = Item.ItemCount;
            newItem.itemDamage = Item.ItemDamage;
            newItem.nbtData = Item.NbtData;

            return newItem;
        }
示例#2
0
        public static Item ItemFromSlot(SlotData item) {
            var newItem = new Item
            {
                ItemId = item.Id,
                ItemCount = item.ItemCount,
                ItemDamage = item.ItemDamage,
                NbtData = item.NbtData
            };

            return newItem;
        }
        public static void WriteSlot(Wrapped wSock, SlotData Data) {
            if (Data.ID == -1) {
                wSock.writeShort(-1);
                return;
            }

            wSock.writeShort(Data.ID);
            wSock.writeByte(Data.ItemCount);
            wSock.writeShort(Data.ItemDamage);

            if (Data.NbtData == null) {
                wSock.writeShort(-1);
                return;
            }

            wSock.writeShort((short)Data.NbtData.Length);
            wSock.Send(Data.NbtData);
        }
        public static SlotData ReadSlot(Wrapped wSock) {
            var Data = new SlotData();
            Data.ID = wSock.readShort();

            if (Data.ID == -1) {
                Data.ID = 0;
                Data.ItemCount = 0;
                Data.ItemDamage = 0;
                return Data;
            }

            Data.ItemCount = wSock.readByte();
            Data.ItemDamage = wSock.readShort();
            var NBTLength = wSock.readShort();

            if (NBTLength == -1)
                return Data;

            Data.NbtData = wSock.readByteArray(NBTLength);
            return Data;
        }
示例#5
0
 public void Read(Wrapped wSock) {
     EntityID = wSock.readInt();
     Slot = wSock.readShort();
     Item = WrappedExtension.ReadSlot(wSock);
 }
示例#6
0
 public void Read(Wrapped wSock) {
     Slot = wSock.readShort();
     Clickeditem = WrappedExtension.ReadSlot(wSock);
 }
示例#7
0
 public void Read(Wrapped wSock) {
     WindowID = wSock.readSByte();
     Slot = wSock.readShort();
     Button = wSock.readSByte();
     Actionnumber = wSock.readShort();
     Mode = wSock.readSByte();
     Clickeditem = WrappedExtension.ReadSlot(wSock);
 }
示例#8
0
 public void Read(Wrapped wSock) {
     WindowID = wSock.readSByte();
     Slot = wSock.readShort();
     Slotdata = WrappedExtension.ReadSlot(wSock);
 }
        public static SlotData ReadSlot(Wrapped wSock) {
            var data = new SlotData {Id = wSock.readShort()};

            if (data.Id == -1) {
                data.Id = 0;
                data.ItemCount = 0;
                data.ItemDamage = 0;
                return data;
            }

            data.ItemCount = wSock.readByte();
            data.ItemDamage = wSock.readShort();
            var nbtLength = wSock.readShort();

            if (nbtLength == -1)
                return data;

            data.NbtData = wSock.readByteArray(nbtLength);
            return data;
        }