diff --git a/patches/net/minecraft/client/gui/Gui.java.patch b/patches/net/minecraft/client/gui/Gui.java.patch index 7fe3d1496c..9ddd3d3f74 100644 --- a/patches/net/minecraft/client/gui/Gui.java.patch +++ b/patches/net/minecraft/client/gui/Gui.java.patch @@ -101,12 +101,20 @@ } private void renderCameraOverlays(GuiGraphics p_316735_, DeltaTracker p_348538_) { -@@ -238,6 +_,8 @@ +@@ -236,8 +_,14 @@ + for (EquipmentSlot equipmentslot : EquipmentSlot.values()) { + ItemStack itemstack = this.minecraft.player.getItemBySlot(equipmentslot); Equippable equippable = itemstack.get(DataComponents.EQUIPPABLE); - if (equippable != null && equippable.slot() == equipmentslot && equippable.cameraOverlay().isPresent()) { - this.renderTextureOverlay(p_316735_, equippable.cameraOverlay().get().withPath(p_380782_ -> "textures/" + p_380782_ + ".png"), 1.0F); -+ } else { -+ net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(itemstack).renderHelmetOverlay(itemstack, this.minecraft.player, p_316735_, p_348538_); +- if (equippable != null && equippable.slot() == equipmentslot && equippable.cameraOverlay().isPresent()) { +- this.renderTextureOverlay(p_316735_, equippable.cameraOverlay().get().withPath(p_380782_ -> "textures/" + p_380782_ + ".png"), 1.0F); ++ if (equippable != null && equippable.slot() == equipmentslot) { ++ if (equippable.cameraOverlay().isPresent()) { ++ this.renderTextureOverlay(p_316735_, equippable.cameraOverlay().get().withPath(p_380782_ -> "textures/" + p_380782_ + ".png"), 1.0F); ++ } ++ ++ if (equipmentslot == EquipmentSlot.HEAD) { ++ net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(itemstack).renderFirstPersonOverlay(itemstack, this.minecraft.player, p_316735_, p_348538_); ++ } } } } diff --git a/src/main/java/net/neoforged/neoforge/client/extensions/common/IClientItemExtensions.java b/src/main/java/net/neoforged/neoforge/client/extensions/common/IClientItemExtensions.java index 41f4fbf1ed..a32aaa0c2c 100644 --- a/src/main/java/net/neoforged/neoforge/client/extensions/common/IClientItemExtensions.java +++ b/src/main/java/net/neoforged/neoforge/client/extensions/common/IClientItemExtensions.java @@ -145,7 +145,7 @@ default Model getGenericArmorModel(ItemStack itemStack, EquipmentClientInfo.Laye default void setupModelAnimations(LivingEntity livingEntity, ItemStack itemStack, EquipmentSlot equipmentSlot, Model model, float limbSwing, float limbSwingAmount, float partialTick, float ageInTicks, float netHeadYaw, float headPitch) {} /** - * Called when the client starts rendering the HUD, and is wearing this item in the helmet slot. + * Called when the client starts rendering the HUD, and is wearing this item in the head equipment slot. *
* This is where pumpkins would render their overlay. *
@@ -156,7 +156,7 @@ default void setupModelAnimations(LivingEntity livingEntity, ItemStack itemStack * @param guiGraphics The gui graphics * @param deltaTracker The delta tracker */ - default void renderHelmetOverlay(ItemStack stack, Player player, GuiGraphics guiGraphics, DeltaTracker deltaTracker) {} + default void renderFirstPersonOverlay(ItemStack stack, Player player, GuiGraphics guiGraphics, DeltaTracker deltaTracker) {} /** * {@return Whether the item should bob when rendered in the world as an entity}