Honor attacker shield disabling status (#10321)

This commit is contained in:
Jonathing authored and GitHub committed 2025-02-18 14:58:43 -08:00
1 parent dd2591b5f3
commit 783c8b7d2b
2 files changed
+7 -2

No files matched your search

@@ -15,7 +15,7 @@
ItemStack itemstack = p_40529_.m_43722_();
Optional<BlockState> optional3 = Optional.empty();
if (optional.isPresent()) {
@@ -71,9 +_,20 @@
@@ -71,9 +_,25 @@
}
}
@@ -34,5 +34,10 @@
+ @Override
+ public boolean canPerformAction(ItemStack stack, net.minecraftforge.common.ToolAction toolAction) {
+ return net.minecraftforge.common.ToolActions.DEFAULT_AXE_ACTIONS.contains(toolAction);
+ }
+
+ @Override
+ public boolean canDisableShield(ItemStack stack, ItemStack shield, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.entity.LivingEntity attacker) {
+ return true;
}
}
@@ -692,7 +692,7 @@ public interface IForgeItem
*/
default boolean canDisableShield(ItemStack stack, ItemStack shield, LivingEntity entity, LivingEntity attacker)
{
return this instanceof AxeItem;
return attacker.canDisableShield();
}
/**