mirror of
https://github.com/TeamMidnightDust/SwordBlocking.git
synced 2025-12-15 14:35:10 +01:00
Code cleanup
This commit is contained in:
@@ -23,9 +23,7 @@ public class SwordBlockingClient implements ClientModInitializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean canWeaponBlock(LivingEntity entity) {
|
public static boolean canWeaponBlock(LivingEntity entity) {
|
||||||
if (!SwordBlockingConfig.enabled)
|
if (SwordBlockingConfig.enabled && (entity.getOffHandStack().getItem() instanceof ShieldItem || entity.getMainHandStack().getItem() instanceof ShieldItem)) {
|
||||||
return false;
|
|
||||||
if (entity.getOffHandStack().getItem() instanceof ShieldItem || entity.getMainHandStack().getItem() instanceof ShieldItem) {
|
|
||||||
Item mainItem = entity.getOffHandStack().getItem() instanceof ShieldItem ? entity.getMainHandStack().getItem() : entity.getOffHandStack().getItem();
|
Item mainItem = entity.getOffHandStack().getItem() instanceof ShieldItem ? entity.getMainHandStack().getItem() : entity.getOffHandStack().getItem();
|
||||||
return mainItem instanceof SwordItem || mainItem instanceof AxeItem || mainItem instanceof MaceItem;
|
return mainItem instanceof SwordItem || mainItem instanceof AxeItem || mainItem instanceof MaceItem;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user