blob: 39f6bb6fa4571663793f64e724f870df2a603300 (
plain) (
blame)
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 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<Integer> info) {
if (PostProcessShaders.rendering) {
Color color = EntityHighlightCommand.getEntityColor((Entity) (Object) this);
if (color != null) {
info.setReturnValue(color.getPacked());
info.cancel();
}
}
}
}
|