Example #1
0
        public static bool TryGetItem(string name, out CustomItem item)
        {
            foreach (CustomItem cItem in Plugin.Singleton.ItemManagers)
            {
                if (cItem.Name.Equals(name, System.StringComparison.OrdinalIgnoreCase))
                {
                    item = cItem;
                    return(true);
                }
            }

            item = null;
            return(false);
        }
Example #2
0
        public static bool TryGetItem(int id, out CustomItem item)
        {
            foreach (CustomItem cItem in Plugin.Singleton.ItemManagers)
            {
                if (cItem.Id == id)
                {
                    item = cItem;
                    return(true);
                }
            }

            item = null;
            return(false);
        }
Example #3
0
 public static void GiveItem(this Player player, CustomItem item) => item.GiveItem(player);
Example #4
0
 public static void SpawnItem(this CustomItem item, Vector3 position) => item.SpawnItem(position);