Skip to content

Commit

Permalink
Fix critical hit damage on vanilla
Browse files Browse the repository at this point in the history
  • Loading branch information
aromaa committed Oct 12, 2023
1 parent 4053462 commit 29b92a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void callItemDestroyedEvent(
public CriticalHitResult callCriticalHitEvent(
final Player player, final Entity targetEntity, final boolean isCriticalAttack, final float v
) {
final CriticalHitEvent hitResult = ForgeHooks.getCriticalHit(player, targetEntity, isCriticalAttack, v);
final CriticalHitEvent hitResult = ForgeHooks.getCriticalHit(player, targetEntity, isCriticalAttack, v + 1.0F);
if (hitResult != null) {
return new CriticalHitResult(true, hitResult.getDamageModifier() - 1.0F);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void attack(final Entity targetEntity) {
isCriticalAttack = isStrongAttack && this.fallDistance > 0.0F && !this.onGround && !this.shadow$onClimbable() && !this.shadow$isInWater() && !this.shadow$hasEffect(
MobEffects.BLINDNESS) && !this.shadow$isPassenger() && targetEntity instanceof LivingEntity;
isCriticalAttack = isCriticalAttack && !this.shadow$isSprinting();
final EventHooks.CriticalHitResult criticalResult = PlatformHooks.INSTANCE.getEventHooks().callCriticalHitEvent((net.minecraft.world.entity.player.Player) (Object) this, targetEntity, isCriticalAttack, isCriticalAttack ? 1.5F : 1.0F);
final EventHooks.CriticalHitResult criticalResult = PlatformHooks.INSTANCE.getEventHooks().callCriticalHitEvent((net.minecraft.world.entity.player.Player) (Object) this, targetEntity, isCriticalAttack, isCriticalAttack ? 0.5F : 0.0F);
isCriticalAttack = criticalResult.criticalHit;
if (isCriticalAttack) {
// Sponge Start - add critical attack tuple
Expand Down

0 comments on commit 29b92a5

Please sign in to comment.