Skip to content

Commit

Permalink
add more context to the method, deprecate the old one
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Jan 11, 2025
1 parent d6e9e93 commit 050840f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion patches/net/minecraft/client/gui/Gui.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
* <p>
* 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.
Expand Down

0 comments on commit 050840f

Please sign in to comment.