Esempio n. 1
0
        public override void Initialize(ICoreAPI api)
        {
            base.Initialize(api);

            if (api is ICoreClientAPI)
            {
                CairoFont font = new CairoFont(20, GuiStyle.StandardFontName, new double[] { 0, 0, 0, 0.8 });

                signRenderer = new BlockEntitySignPostRenderer(Pos, (ICoreClientAPI)api, font);

                if (textByCardinalDirection.Length > 0)
                {
                    signRenderer.SetNewText(textByCardinalDirection, color);
                }

                Shape shape = api.Assets.TryGet(AssetLocation.Create("shapes/block/wood/signpost/sign.json")).ToObject <Shape>();
                if (shape != null)
                {
                    (api as ICoreClientAPI).Tesselator.TesselateShape(Block, shape, out signMesh);
                }
            }
        }
Esempio n. 2
0
 public override void OnBlockRemoved()
 {
     signRenderer?.Dispose();
     signRenderer = null;
 }