From 84508f8075dd4a78173403b57d7bc5446b32e762 Mon Sep 17 00:00:00 2001 From: Alexandra-Myers Date: Tue, 20 Feb 2024 20:04:17 -0500 Subject: [PATCH] Combatify 1.2.0 1.20.5 Beta 2 - Shield delay KB fix and change sweep --- gradle.properties | 2 +- src/main/java/net/atlas/combatify/item/WeaponType.java | 5 +---- src/main/java/net/atlas/combatify/mixin/PlayerMixin.java | 2 +- src/main/java/net/atlas/combatify/util/MethodHandler.java | 3 ++- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index d54fa4f..59d4f25 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx3G org.gradle.parallel = true # Mod Properties -version = 1.20.5-1.2.0-BETA-1 +version = 1.20.5-1.2.0-BETA-2 maven_group = net.atlas archives_base_name = combatify owo_version=0.11.0+1.20 diff --git a/src/main/java/net/atlas/combatify/item/WeaponType.java b/src/main/java/net/atlas/combatify/item/WeaponType.java index 5f3d1e6..d0ed634 100644 --- a/src/main/java/net/atlas/combatify/item/WeaponType.java +++ b/src/main/java/net/atlas/combatify/item/WeaponType.java @@ -198,10 +198,7 @@ public boolean canSweep() { if (configurableWeaponData.canSweep != null) return configurableWeaponData.canSweep; } - return switch (this) { - case SWORD, LONGSWORD, KNIFE -> true; - default -> false; - }; + return false; } public boolean isEmpty() { return this == EMPTY; diff --git a/src/main/java/net/atlas/combatify/mixin/PlayerMixin.java b/src/main/java/net/atlas/combatify/mixin/PlayerMixin.java index bba7baf..b7a3ecc 100644 --- a/src/main/java/net/atlas/combatify/mixin/PlayerMixin.java +++ b/src/main/java/net/atlas/combatify/mixin/PlayerMixin.java @@ -297,7 +297,7 @@ public boolean isAttackAvailable(float baseTime) { protected boolean checkSweepAttack() { float charge = Combatify.CONFIG.chargedAttacks() ? 1.95F : 0.9F; - boolean sweepingItem = ((ItemExtensions)getMainHandItem().getItem()).canSweep() && (!Combatify.CONFIG.sweepWithSweeping() || Combatify.CONFIG.vanillaSweep()); + boolean sweepingItem = ((ItemExtensions)getMainHandItem().getItem()).canSweep(); boolean sweep = getAttackStrengthScale(baseValue) > charge && (EnchantmentHelper.getSweepingDamageRatio(player) > 0.0F || sweepingItem); if (!Combatify.CONFIG.sweepWithSweeping()) return sweepingItem && sweep; diff --git a/src/main/java/net/atlas/combatify/util/MethodHandler.java b/src/main/java/net/atlas/combatify/util/MethodHandler.java index 1217f61..4a36993 100644 --- a/src/main/java/net/atlas/combatify/util/MethodHandler.java +++ b/src/main/java/net/atlas/combatify/util/MethodHandler.java @@ -80,7 +80,8 @@ public static void knockback(LivingEntity entity, double strength, double x, dou } double knockbackRes = entity.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE); ItemStack blockingItem = getBlockingItem(entity); - if (!blockingItem.isEmpty()) { + boolean delay = ((ItemExtensions) blockingItem.getItem()).getBlockingType().hasDelay() && Combatify.CONFIG.shieldDelay() > 0 && blockingItem.getUseDuration() - entity.getUseItemRemainingTicks() < Combatify.CONFIG.shieldDelay(); + if (!blockingItem.isEmpty() && !delay) { BlockingType blockingType = ((ItemExtensions)blockingItem.getItem()).getBlockingType(); if (!blockingType.defaultKbMechanics()) knockbackRes = Math.max(knockbackRes, blockingType.getShieldKnockbackResistanceValue(blockingItem));