Skip to content

Commit cd6a48a

Browse files
committed
fix: block anim only plays in offhand without a shield
1 parent c19dc9a commit cd6a48a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/eu/midnightdust/swordblocking/SwordBlockingClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ public static boolean canEntityBlock(ItemStack mainHandStack, ItemStack offHandS
3333
public static boolean canShieldSwordBlock(ItemStack mainHandStack, ItemStack offHandStack) {
3434
if (!SwordBlockingConfig.enabled) return false;
3535
boolean hasShield = offHandStack.getItem() instanceof ShieldItem || mainHandStack.getItem() instanceof ShieldItem;
36-
if (hasShield || !SwordBlockingConfig.requireShield) {
36+
if (!SwordBlockingConfig.requireShield) {
37+
return mainHandStack.getItem().components().has(DataComponents.DAMAGE) || offHandStack.getItem().components().has(DataComponents.DAMAGE);
38+
} else if (hasShield) {
3739
final Item weaponItem = offHandStack.getItem() instanceof ShieldItem ? mainHandStack.getItem() : offHandStack.getItem();
3840
return weaponItem.components().has(DataComponents.DAMAGE);
3941
} else {

0 commit comments

Comments
 (0)