public override void Initialize(ICoreAPI api) { base.Initialize(api); ownBlock = api.World.BlockAccessor.GetBlock(pos); 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"); } } }
public override void OnBlockRemoved() { base.OnBlockRemoved(); if (renderer != null) { renderer.Unregister(); renderer = null; } }