Ejemplo n.º 1
0
 /// <summary>
 /// Create an empty container with ID, Type and Title
 /// </summary>
 /// <param name="id">Container ID</param>
 /// <param name="type">Container Type</param>
 /// <param name="title">Container title</param>
 public Container(int id, ContainerTypeOld type, string title)
 {
     ID    = id;
     Title = title;
     Type  = ConvertType.ToNew(type);
     Items = new Dictionary <int, Item>();
 }
        public static ContainerType ToNew(ContainerTypeOld type)
        {
            switch (type)
            {
            case ContainerTypeOld.CONTAINER: return(ContainerType.Unknown);

            case ContainerTypeOld.CHEST: return(ContainerType.Generic_9x3);

            case ContainerTypeOld.CRAFTING_TABLE: return(ContainerType.Crafting);

            case ContainerTypeOld.FURNACE: return(ContainerType.Furnace);

            case ContainerTypeOld.DISPENSER: return(ContainerType.Generic_3x3);

            case ContainerTypeOld.ENCHANTING_TABLE: return(ContainerType.Enchantment);

            case ContainerTypeOld.BREWING_STAND: return(ContainerType.BrewingStand);

            case ContainerTypeOld.VILLAGER: return(ContainerType.Merchant);

            case ContainerTypeOld.HOPPER: return(ContainerType.Hopper);

            case ContainerTypeOld.DROPPER: return(ContainerType.Generic_3x3);

            case ContainerTypeOld.SHULKER_BOX: return(ContainerType.ShulkerBox);

            case ContainerTypeOld.ENTITYHORSE: return(ContainerType.Unknown);

            default: return(ContainerType.Unknown);
            }
        }
 public Container(int id, ContainerTypeOld type, string title)
 {
     ID    = id;
     Title = title;
     Type  = ConvertType.ToNew(type);
 }