Skip to content

Commit

Permalink
Fix acrobatics (#5088)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ineusia authored Sep 20, 2024
1 parent 2fd86e8 commit 1c08cac
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ public boolean doInteraction(Event event, mcMMO plugin) {
// no-op - fall was fatal or otherwise did not get processed
return false;
}
entityDamageEvent.setDamage(rollResult.getModifiedDamage());

// Clear out the damage from falling so that way our modified damage doesn't get re-reduced by protection/feather falling
entityDamageEvent.setDamage(0);
// Send the damage is MAGIC so that it cuts through all resistances
// This is fine because we considered protection/featherfalling in the rollCheck method
entityDamageEvent.setDamage(EntityDamageEvent.DamageModifier.MAGIC, rollResult.getModifiedDamage());

if (entityDamageEvent.getFinalDamage() == 0) {
entityDamageEvent.setCancelled(true);
Expand Down Expand Up @@ -216,7 +221,7 @@ public boolean canRoll(McMMOPlayer mmoPlayer) {
*/
@VisibleForTesting
public RollResult rollCheck(McMMOPlayer mmoPlayer, EntityDamageEvent entityDamageEvent) {
double baseDamage = entityDamageEvent.getDamage();
double baseDamage = entityDamageEvent.getFinalDamage();
final boolean isGraceful = mmoPlayer.getPlayer().isSneaking();
final RollResult.Builder rollResultBuilder
= new RollResult.Builder(entityDamageEvent, isGraceful);
Expand Down

0 comments on commit 1c08cac

Please sign in to comment.