blob: 676cccf640fb4e9746e43e7eb0cf8c43fdb75b41 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package com.dulkirfabric.mixin.render;
import com.dulkirfabric.util.render.GlowingEntityInterface;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.client.render.WorldRenderer;
import net.minecraft.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@Mixin(WorldRenderer.class)
public class WorldRendererMixin {
@ModifyExpressionValue(method = "render",
at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;getTeamColorValue()I"))
public int getGlowColor(int existing, @Local Entity entity) {
if (entity instanceof GlowingEntityInterface dEntity) {
if (dEntity.getDulkirEntityGlowColor() != null) {
return dEntity.getDulkirEntityGlowColor().getRGB();
}
}
return existing;
}
}
|