mirror of
https://github.com/chev2/terraria-mods.git
synced 2025-12-28 10:52:18 +00:00
- Update Main.tileLighted (attempt to fix bug where lights wouldn't work in multiplayer until the config was reloaded) - Organize and tidy code a bit
21 lines
707 B
C#
21 lines
707 B
C#
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace LifeSourcesLight
|
|
{
|
|
public class LightOverrideHeartCrystal : GlobalTile
|
|
{
|
|
// Modify overall light brightness
|
|
private static readonly float LifeCrystalBrightCoefficient = 0.7f;
|
|
|
|
public override void ModifyLight(int i, int j, int type, ref float r, ref float g, ref float b)
|
|
{
|
|
if (type == TileID.Heart && LifeSourcesLightModSystem.EnableLightHeartCrystal)
|
|
{
|
|
r = (255f / 255f) * LifeCrystalBrightCoefficient;
|
|
g = (38f / 255f) * LifeCrystalBrightCoefficient;
|
|
b = (106f / 255f) * LifeCrystalBrightCoefficient;
|
|
}
|
|
}
|
|
}
|
|
}
|