Honor attacker shield disabling status (#10321)

This commit is contained in:
Jonathing 2025-02-18 17:58:43 -05:00 committed by GitHub
parent dd2591b5f3
commit 783c8b7d2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -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;
}
}

View file

@ -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();
}
/**