package org.chrisoft.trashyaddon.mixin; import com.mojang.logging.LogUtils; import meteordevelopment.meteorclient.utils.render.color.Color; import meteordevelopment.meteorclient.utils.render.postprocess.PostProcessShaders; import net.minecraft.entity.Entity; import org.chrisoft.trashyaddon.commands.EntityHighlightCommand; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(value = Entity.class, priority = 1001) public abstract class EntityMixin { @Inject(method = "getTeamColorValue", at = @At("HEAD"), cancellable = true) private void onGetTeamColorValue(CallbackInfoReturnable info) { if (PostProcessShaders.rendering) { Color color = EntityHighlightCommand.getEntityColor((Entity) (Object) this); if (color != null) { info.setReturnValue(color.getPacked()); info.cancel(); } } } }