blob: 8fb195a3bbb4fd6c9b5a547713e96483fa0f6853 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package at.hannibal2.skyhanni.mixins.hooks
import at.hannibal2.skyhanni.utils.EntityOutlineRenderer
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.entity.EntityLivingBase
class RendererLivingEntityHook {
fun setOutlineColor(red: Float, green: Float, blue: Float, alpha: Float, entity: EntityLivingBase) {
val color = EntityOutlineRenderer.getCustomOutlineColor(entity)
if (color != null) {
val colorRed = (color shr 16 and 255).toFloat() / 255.0f
val colorGreen = (color shr 8 and 255).toFloat() / 255.0f
val colorBlue = (color and 255).toFloat() / 255.0f
GlStateManager.color(colorRed, colorGreen, colorBlue, alpha)
} else {
GlStateManager.color(red, green, blue, alpha)
}
}
}
|