diff --git a/patches/minecraft/net/minecraft/world/entity/LivingEntity.java.patch b/patches/minecraft/net/minecraft/world/entity/LivingEntity.java.patch index f42fc51771..2fbf5e56f4 100644 --- a/patches/minecraft/net/minecraft/world/entity/LivingEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/LivingEntity.java.patch @@ -505,12 +505,10 @@ } public boolean m_5830_() { -@@ -3198,6 +_,64 @@ - - public void m_21190_(InteractionHand p_21191_) { +@@ -3200,6 +_,64 @@ this.m_21166_(p_21191_ == InteractionHand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND); -+ } -+ + } + + /* ==== FORGE START ==== */ + /*** + * Removes all potion effects that have curativeItem as a curative item for its effect @@ -567,6 +565,17 @@ + public void reviveCaps() { + super.reviveCaps(); + handlers = net.minecraftforge.items.wrapper.EntityEquipmentInvWrapper.create(this); ++ } ++ + public AABB m_6921_() { + if (this.m_6844_(EquipmentSlot.HEAD).m_150930_(Items.f_42683_)) { + float f = 0.5F; +@@ -3210,6 +_,8 @@ } - public AABB m_6921_() { + public static EquipmentSlot m_147233_(ItemStack p_147234_) { ++ final EquipmentSlot slot = p_147234_.getEquipmentSlot(); ++ if (slot != null) return slot; // FORGE: Allow modders to set a non-default equipment slot for a stack; e.g. a non-armor chestplate-slot item + Item item = p_147234_.m_41720_(); + if (!p_147234_.m_150930_(Items.f_42047_) && (!(item instanceof BlockItem) || !(((BlockItem)item).m_40614_() instanceof AbstractSkullBlock))) { + if (item instanceof ArmorItem) { diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java b/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java index 1eb69ab863..2f622346f0 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java @@ -373,7 +373,7 @@ public interface IForgeItem /** * Override this to set a non-default armor slot for an ItemStack, but do * not use this to get the armor slot of said stack; for that, use - * {@link net.minecraft.entity.LivingEntity#getSlotForItemStack(ItemStack)}. + * {@link net.minecraft.world.entity.LivingEntity#getEquipmentSlotForItem(ItemStack)}.. * * @param stack the ItemStack * @return the armor slot of the ItemStack, or {@code null} to let the default diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeItemStack.java b/src/main/java/net/minecraftforge/common/extensions/IForgeItemStack.java index 438e410efb..2a36e4967a 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeItemStack.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeItemStack.java @@ -181,7 +181,7 @@ public interface IForgeItemStack extends ICapabilitySerializable /** * Override this to set a non-default armor slot for an ItemStack, but do * not use this to get the armor slot of said stack; for that, use - * {@link net.minecraft.entity.LivingEntity#getSlotForItemStack(ItemStack)}. + * {@link net.minecraft.world.entity.LivingEntity#getEquipmentSlotForItem(ItemStack)}. * * @return the armor slot of the ItemStack, or {@code null} to let the default * vanilla logic as per {@code LivingEntity.getSlotForItemStack(stack)}