Ejemplo n.º 1
0
        public ItemHandler(int size = 1)
        {
            Items = new Item[size];
            for (int i = 0; i < size; i++)
            {
                Items[i] = new Item();
            }

            Modes = new SlotMode[size];
        }
Ejemplo n.º 2
0
        public void Load(TagCompound tag)
        {
            SetSize(tag.ContainsKey("Count") ? tag.GetInt("Count") : Slots);
            foreach (TagCompound compound in tag.GetList <TagCompound>("Items"))
            {
                Item     item = ItemIO.Load(compound.GetCompound("Item"));
                int      slot = compound.GetInt("Slot");
                SlotMode mode = (SlotMode)compound.GetByte("Mode");

                if (slot >= 0 && slot < Slots)
                {
                    Items[slot] = item;
                    Modes[slot] = mode;
                }
            }
        }
Ejemplo n.º 3
0
 public ItemHandler(Item[] items)
 {
     Items = items;
     Modes = new SlotMode[items.Length];
 }