Ejemplo n.º 1
0
        private void Initialize(Item item)
        {
            if (this.AwaitsInitialization || this.IsInitialized || !ElementsItem.CanHaveElements(item))
            {
                return;
            }
            this.AwaitsInitialization = true;

            LoadHooks.AddWorldLoadOnceHook(() => {
                this.AwaitsInitialization = false;
                this.IsInitialized        = true;

                if (ElementsAPI.PreItemInitialize(item))
                {
                    this.AutoInitializeElement(item);
                }
            });
        }
Ejemplo n.º 2
0
        ////////////////

        public override bool NeedsSaving(Item item)
        {
            return(ElementsItem.CanHaveElements(item) &&
                   this != ModContent.GetInstance <ElementsItem>());
        }