Exemple #1
0
        public override void Initialize(ICoreAPI api)
        {
            base.Initialize(api);

            inventory.LateInitialize("quern-1", api);

            RegisterGameTickListener(Every100ms, 100);
            RegisterGameTickListener(Every500ms, 500);

            if (api is ICoreClientAPI)
            {
                renderer = new PestleRenderer(api as ICoreClientAPI, Pos, GenMesh("top"));

                (api as ICoreClientAPI).Event.RegisterRenderer(renderer, EnumRenderStage.Opaque);

                if (quernBaseMesh == null)
                {
                    quernBaseMesh = GenMesh("base");
                }
                if (quernTopMesh == null)
                {
                    quernTopMesh = GenMesh("top");
                }
            }
        }
Exemple #2
0
        public override void OnBlockRemoved()
        {
            base.OnBlockRemoved();

            if (renderer != null)
            {
                renderer.Unregister();
                renderer = null;
            }
        }