Skip to content

Commit

Permalink
Fix dagger potion use counting twice.
Browse files Browse the repository at this point in the history
  • Loading branch information
Provismet committed May 3, 2024
1 parent e1733ff commit 299ac19
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,18 @@ public void postChargedHit (ItemStack stack, LivingEntity user, LivingEntity tar
);
}
this.spawnInkParticles(newTarget, 3, stack);
++damage;
}
damage += 2;
}

boolean hasAdhesive = EnchantmentHelper.getLevel(AAEnchantments.ADHESIVE, stack) > 0;
if (hasAdhesive) {
stack.damage(damage, user, p -> {
stack.damage(damage * 2, user, p -> {
if (p.getStackInHand(Hand.MAIN_HAND) == stack) p.sendToolBreakStatus(Hand.MAIN_HAND);
else p.sendToolBreakStatus(Hand.OFF_HAND);
});
}
else if (user instanceof PlayerEntity player && !player.isCreative() && potion != Potions.EMPTY && this.decrementCurrentPotionUses(stack, damage * 2) <= 0) {
else if (user instanceof PlayerEntity player && !player.isCreative() && potion != Potions.EMPTY && this.decrementCurrentPotionUses(stack, damage) <= 0) {
PotionUtil.setPotion(stack, Potions.EMPTY);
stack.removeSubNbt(PotionUtil.CUSTOM_POTION_EFFECTS_KEY);
}
Expand Down

0 comments on commit 299ac19

Please sign in to comment.