Skip to content

Commit

Permalink
Combatify 1.2.0 1.20.5 Beta 2 - Shield delay KB fix and change sweep
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandra-Myers committed Feb 21, 2024
1 parent f63225e commit 84508f8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/net/atlas/combatify/item/WeaponType.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/atlas/combatify/mixin/PlayerMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/atlas/combatify/util/MethodHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 84508f8

Please sign in to comment.