Esempio n. 1
0
        private void UpdateRenderer()
        {
            renderer.SetFillLevel((int)((FuelSlot.StackSize + OreSlot.StackSize + OutSlot.StackSize * 2) / 40f * 14));

            // Ease in in beginning and ease out on end
            double easinLevel   = Math.Min(1, 24 * (api.World.Calendar.TotalDays - burningStartTotalDays));
            double easeoutLevel = Math.Min(1, 24 * (burningUntilTotalDays - api.World.Calendar.TotalDays));

            double glowLevel = Math.Max(0, Math.Min(easinLevel, easeoutLevel) * 128);

            renderer.glowLevel = burning ? (int)glowLevel : 0;
        }
Esempio n. 2
0
        private void UpdateRenderer()
        {
            // max = 8 voxels
            float fillLevel = Math.Min(14, FuelSlot.StackSize + (float)8f * OreSlot.StackSize / OreCapacity + OutSlot.StackSize);

            renderer.SetFillLevel(fillLevel);

            // Ease in in beginning and ease out on end
            double easinLevel   = Math.Min(1, 24 * (Api.World.Calendar.TotalDays - burningStartTotalDays));
            double easeoutLevel = Math.Min(1, 24 * (burningUntilTotalDays - Api.World.Calendar.TotalDays));

            double glowLevel = Math.Max(0, Math.Min(easinLevel, easeoutLevel) * 250);

            renderer.glowLevel = burning ? (int)glowLevel : 0;
        }