public override IEnumerable <IRenderable> GetCustomVisualizers(IVoxelHandle handle) { foreach (var e in base.GetCustomVisualizers(handle)) { yield return(e); } yield return(new EntityVisualizer(e => { e.Mesh = UtilityMeshes.CreateBoxColored(new Color4(0, 0, 1), new Vector3(1)); var miner = ((IVoxel)handle).GetPart <Miner>(); var targetVoxel = miner.TargetOreVoxel; e.Visible = targetVoxel != null; if (targetVoxel == null) { return; } var progress = miner.OreMiningProgress; var factor = progress < 0.5f ? progress * 2 : 1 - (progress - 0.5f) * 2; var toOre = handle.GetOffset(targetVoxel); var offset = (toOre.ToVector2() * factor).ToXZ(); e.WorldMatrix = Matrix.Translation(((GameVoxel)handle).GetBoundingBox().GetCenter() + offset * 10); })); }