mirror of
https://github.com/MinecraftForge/MinecraftForge
synced 2026-08-22 04:26:10 -04:00
Honor attacker shield disabling status (#10321)
This commit is contained in:
parent
dd2591b5f3
commit
783c8b7d2b
2 changed files with 7 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue