fabric-rendering-v1-16.2.0+bee81f016f.jar

Download file
    package net.fabricmc.fabric.mixin.client.rendering;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.fabricmc.fabric.api.client.rendering.v1.hud.VanillaHudElements;
import net.fabricmc.fabric.impl.client.rendering.hud.HudElementRegistryImpl;
import net.minecraft.class_11223;
import net.minecraft.class_1657;
import net.minecraft.class_310;
import net.minecraft.class_327;
import net.minecraft.class_329;
import net.minecraft.class_332;
import net.minecraft.class_365;
import net.minecraft.class_9779;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Environment(EnvType.CLIENT)
@Mixin({class_329.class})
abstract class InGameHudMixin {
   @Shadow
   @Final
   private class_310 field_2035;

   @Inject(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At("TAIL")}
   )
   public void render(class_332 drawContext, class_9779 tickCounter, CallbackInfo callbackInfo) {
      ((HudRenderCallback)HudRenderCallback.EVENT.invoker()).onHudRender(drawContext, tickCounter);
   }

   @WrapOperation(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_55798(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapMiscOverlays(class_329 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.MISC_OVERLAYS).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_1736(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapCrosshair(class_329 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.CROSSHAIR).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_55805(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_365;method_1978(Lnet/minecraft/class_332;)V"
)}
   )
   private void wrapSpectatorMenu(class_365 instance, class_332 context, Operation<Void> renderVanilla, @Local(argsOnly = true) class_9779 tickCounter) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.SPECTATOR_MENU).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx}));
   }

   @WrapOperation(
      method = {"method_55805(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_1759(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapHotbar(class_329 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.HOTBAR).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_1760(Lnet/minecraft/class_332;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_58478(Lnet/minecraft/class_332;Lnet/minecraft/class_1657;IIII)V"
)}
   )
   private void wrapArmorBar(class_332 context, class_1657 player, int i, int j, int k, int x, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.ARMOR_BAR).render(context, this.field_2035.method_61966(), (ctx, tc) -> renderVanilla.call(new Object[]{ctx, player, i, j, k, x}));
   }

   @WrapOperation(
      method = {"method_1760(Lnet/minecraft/class_332;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_37298(Lnet/minecraft/class_332;Lnet/minecraft/class_1657;IIIIFIIIZ)V"
)}
   )
   private void wrapHealthBar(class_329 instance, class_332 context, class_1657 player, int x, int y, int lines, int regeneratingHeartIndex, float maxHealth, int lastHealth, int health, int absorption, boolean blinking, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.HEALTH_BAR).render(context, this.field_2035.method_61966(), (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, player, x, y, lines, regeneratingHeartIndex, maxHealth, lastHealth, health, absorption, blinking}));
   }

   @WrapOperation(
      method = {"method_1760(Lnet/minecraft/class_332;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_58477(Lnet/minecraft/class_332;Lnet/minecraft/class_1657;II)V"
)}
   )
   private void wrapFoodBar(class_329 instance, class_332 context, class_1657 player, int top, int right, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.FOOD_BAR).render(context, this.field_2035.method_61966(), (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, player, top, right}));
   }

   @WrapOperation(
      method = {"method_1760(Lnet/minecraft/class_332;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_65022(Lnet/minecraft/class_332;Lnet/minecraft/class_1657;III)V"
)}
   )
   private void wrapAirBar(class_329 instance, class_332 context, class_1657 player, int heartCount, int top, int left, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.AIR_BAR).render(context, this.field_2035.method_61966(), (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, player, heartCount, top, left}));
   }

   @WrapOperation(
      method = {"method_55805(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_1741(Lnet/minecraft/class_332;)V"
)}
   )
   private void wrapMountHealth(class_329 instance, class_332 context, Operation<Void> renderVanilla, @Local(argsOnly = true) class_9779 tickCounter) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.MOUNT_HEALTH).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx}));
   }

   @WrapOperation(
      method = {"method_55805(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_11223;method_70865(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapRenderBar(class_11223 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.INFO_BAR).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_55805(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_11223;method_70866(Lnet/minecraft/class_332;Lnet/minecraft/class_327;I)V"
)}
   )
   private void wrapExperienceLevel(class_332 context, class_327 textRenderer, int level, Operation<Void> renderVanilla, @Local(argsOnly = true) class_9779 tickCounter) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.EXPERIENCE_LEVEL).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{ctx, textRenderer, level}));
   }

   @WrapOperation(
      method = {"method_55805(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_1749(Lnet/minecraft/class_332;)V"
)}
   )
   private void wrapHeldItemTooltip(class_329 instance, class_332 context, Operation<Void> renderVanilla, @Local(argsOnly = true) class_9779 tickCounter) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.HELD_ITEM_TOOLTIP).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx}));
   }

   @WrapOperation(
      method = {"method_55805(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_365;method_71054(Lnet/minecraft/class_332;)V"
)}
   )
   private void wrapRenderSpectatorHud(class_365 instance, class_332 context, Operation<Void> renderVanilla, @Local(argsOnly = true) class_9779 tickCounter) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.SPECTATOR_TOOLTIP).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx}));
   }

   @WrapOperation(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_1765(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapStatusEffectOverlay(class_329 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.STATUS_EFFECTS).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_70837(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapBossBarHud(class_329 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.BOSS_BAR).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_55799(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapSleepOverlay(class_329 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.SLEEP).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_1766(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapDemoTimer(class_329 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.DEMO_TIMER).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_55803(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapScoreboardSidebar(class_329 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.SCOREBOARD).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_55800(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapOverlayMessage(class_329 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.OVERLAY_MESSAGE).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_55801(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapTitleAndSubtitle(class_329 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.TITLE_AND_SUBTITLE).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_55802(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapChat(class_329 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.CHAT).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_55804(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"
)}
   )
   private void wrapPlayerList(class_329 instance, class_332 context, class_9779 tickCounter, Operation<Void> renderVanilla) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.PLAYER_LIST).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, tc}));
   }

   @WrapOperation(
      method = {"method_1753(Lnet/minecraft/class_332;Lnet/minecraft/class_9779;)V"},
      at = {@At(
   value = "INVOKE",
   target = "Lnet/minecraft/class_329;method_70839(Lnet/minecraft/class_332;Z)V"
)}
   )
   private void wrapSubtitlesHud(class_329 instance, class_332 context, boolean bl, Operation<Void> renderVanilla, @Local(argsOnly = true) class_9779 tickCounter) {
      HudElementRegistryImpl.getRoot(VanillaHudElements.SUBTITLES).render(context, tickCounter, (ctx, tc) -> renderVanilla.call(new Object[]{instance, ctx, bl}));
   }
}
    
Download file