|
25 | 25 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; |
26 | 26 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; |
27 | 27 | import com.mojang.blaze3d.platform.GlStateManager; |
| 28 | +import com.mojang.blaze3d.vertex.BufferBuilder; |
28 | 29 | import io.github.axolotlclient.AxolotlClient; |
29 | 30 | import io.github.axolotlclient.modules.freelook.Perspective; |
30 | 31 | import io.github.axolotlclient.modules.hud.gui.hud.PlayerHud; |
|
37 | 38 | import net.minecraft.entity.living.LivingEntity; |
38 | 39 | import net.minecraft.text.Text; |
39 | 40 | import org.spongepowered.asm.mixin.Mixin; |
40 | | -import org.spongepowered.asm.mixin.injection.At; |
41 | | -import org.spongepowered.asm.mixin.injection.Constant; |
42 | | -import org.spongepowered.asm.mixin.injection.Inject; |
43 | | -import org.spongepowered.asm.mixin.injection.ModifyConstant; |
| 41 | +import org.spongepowered.asm.mixin.injection.*; |
44 | 42 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
45 | 43 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
46 | 44 |
|
@@ -81,6 +79,14 @@ protected LivingEntityRendererMixin(EntityRenderDispatcher entityRenderDispatche |
81 | 79 | return orig; |
82 | 80 | } |
83 | 81 |
|
| 82 | + @WrapOperation(method = "renderNameTag(Lnet/minecraft/entity/living/LivingEntity;DDD)V", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/BufferBuilder;vertex(DDD)Lcom/mojang/blaze3d/vertex/BufferBuilder;")) |
| 83 | + public BufferBuilder axolotlclient$noBg(BufferBuilder instance, double d, double e, double f, Operation<BufferBuilder> original) { |
| 84 | + if (AxolotlClient.config().nametagBackground.get()) { |
| 85 | + original.call(instance, d, e, f); |
| 86 | + } |
| 87 | + return instance; |
| 88 | + } |
| 89 | + |
84 | 90 | @ModifyConstant(method = "setupOverlayColor(Lnet/minecraft/entity/living/LivingEntity;FZ)Z", constant = @Constant(floatValue = 1.0f, ordinal = 0)) |
85 | 91 | private float axolotlclient$customHitColorRed(float constant) { |
86 | 92 | return AxolotlClient.config().hitColor.get().getRed() / 255F; |
|
0 commit comments