From 89bceb6735a1e934287c3e01636a203758b085c8 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Sun, 2 Feb 2025 00:08:18 +0100 Subject: feat: Highlight century cake slice players --- .../kotlin/util/render/TintedOverlayTexture.kt | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/main/kotlin/util/render/TintedOverlayTexture.kt (limited to 'src/main/kotlin/util/render/TintedOverlayTexture.kt') diff --git a/src/main/kotlin/util/render/TintedOverlayTexture.kt b/src/main/kotlin/util/render/TintedOverlayTexture.kt new file mode 100644 index 0000000..a02eccc --- /dev/null +++ b/src/main/kotlin/util/render/TintedOverlayTexture.kt @@ -0,0 +1,44 @@ +package moe.nea.firmament.util.render + +import com.mojang.blaze3d.platform.GlConst +import com.mojang.blaze3d.systems.RenderSystem +import me.shedaniel.math.Color +import net.minecraft.client.render.OverlayTexture +import net.minecraft.util.math.ColorHelper +import moe.nea.firmament.util.ErrorUtil + +class TintedOverlayTexture : OverlayTexture() { + companion object { + val size = 16 + } + + private var lastColor: Color? = null + fun setColor(color: Color): TintedOverlayTexture { + val image = ErrorUtil.notNullOr(texture.image, "Disposed TintedOverlayTexture written to") { return this } + if (color == lastColor) return this + lastColor = color + + for (i in 0..