diff --git a/patches/net/minecraft/client/gui/Gui.java.patch b/patches/net/minecraft/client/gui/Gui.java.patch index 9f54c87df67..c417173c2fd 100644 --- a/patches/net/minecraft/client/gui/Gui.java.patch +++ b/patches/net/minecraft/client/gui/Gui.java.patch @@ -106,7 +106,7 @@ if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem())) { this.renderTextureOverlay(p_316735_, PUMPKIN_BLUR_LOCATION, 1.0F); + } else { -+ net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(itemstack).renderHelmetOverlay(itemstack, this.minecraft.player, p_316735_.guiWidth(), p_316735_.guiHeight(), p_348538_.getGameTimeDeltaPartialTick(true)); ++ net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(itemstack).renderHelmetOverlay(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 16ac6d38535..69d9713c801 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 @@ -7,8 +7,11 @@ import com.mojang.blaze3d.vertex.PoseStack; import java.util.function.Consumer; + +import net.minecraft.client.DeltaTracker; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.model.HumanoidModel; import net.minecraft.client.model.Model; import net.minecraft.client.player.LocalPlayer; @@ -143,18 +146,23 @@ default Model getGenericArmorModel(LivingEntity livingEntity, ItemStack itemStac */ default void setupModelAnimations(LivingEntity livingEntity, ItemStack itemStack, EquipmentSlot equipmentSlot, Model model, float limbSwing, float limbSwingAmount, float partialTick, float ageInTicks, float netHeadYaw, float headPitch) {} + /** + * @deprecated Switch to {@link IClientItemExtensions#renderHelmetOverlay(ItemStack, Player, GuiGraphics, DeltaTracker)} + */ + @Deprecated(forRemoval = true) + default void renderHelmetOverlay(ItemStack stack, Player player, int width, int height, float partialTick) {} + /** * Called when the client starts rendering the HUD, and is wearing this item in the helmet slot. *

* This is where pumpkins would render their overlay. * - * @param stack The item stack - * @param player The player entity - * @param width The viewport width - * @param height Viewport height - * @param partialTick Partial tick time, useful for interpolation + * @param stack The item stack + * @param player The player entity + * @param guiGraphics The gui graphics + * @param deltaTracker The delta tracker */ - default void renderHelmetOverlay(ItemStack stack, Player player, int width, int height, float partialTick) {} + default void renderHelmetOverlay(ItemStack stack, Player player, GuiGraphics guiGraphics, DeltaTracker deltaTracker) {} /** * Queries this item's renderer.