|
21 | 21 | import clientapi.event.defaults.game.render.TeamColorEvent; |
22 | 22 | import net.minecraft.client.renderer.entity.Render; |
23 | 23 | import net.minecraft.entity.Entity; |
| 24 | +import net.minecraft.scoreboard.ScorePlayerTeam; |
24 | 25 | import org.spongepowered.asm.mixin.Mixin; |
25 | 26 | import org.spongepowered.asm.mixin.injection.At; |
26 | 27 | import org.spongepowered.asm.mixin.injection.Inject; |
27 | 28 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
28 | 29 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
| 30 | +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; |
29 | 31 |
|
30 | 32 | /** |
31 | 33 | * @author Brady |
|
34 | 36 | @Mixin(Render.class) |
35 | 37 | public class MixinRender { |
36 | 38 |
|
37 | | - @Inject(method = "getTeamColor", at = @At("HEAD"), cancellable = true) |
38 | | - private void getTeamColor(Entity entityIn, CallbackInfoReturnable<Integer> ci) { |
39 | | - TeamColorEvent event = new TeamColorEvent(entityIn); |
| 39 | + @Inject(method = "getTeamColor", at = @At("RETURN"), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD) |
| 40 | + private void getTeamColor(Entity entityIn, CallbackInfoReturnable<Integer> cir, int i, ScorePlayerTeam scoreplayerteam) { |
| 41 | + TeamColorEvent event = new TeamColorEvent(entityIn, i); |
40 | 42 | ClientAPI.EVENT_BUS.post(event); |
41 | 43 | if (event.isCancelled()) |
42 | | - ci.setReturnValue(event.getColor()); |
| 44 | + cir.setReturnValue(event.getColor()); |
43 | 45 | } |
44 | 46 |
|
45 | 47 | @Inject(method = "renderLivingLabel", at = @At("HEAD"), cancellable = true) |
|
0 commit comments