From 51095b288ecf70dc30dbf07d7bdd461fce4f7956 Mon Sep 17 00:00:00 2001 From: Provismet <17149901+Provismet@users.noreply.github.com> Date: Fri, 3 May 2024 22:19:44 +0100 Subject: [PATCH] Fix Dagger potion uses counting twice. --- .../com/provismet/AdditionalArmoury/items/DaggerItem.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/provismet/AdditionalArmoury/items/DaggerItem.java b/src/main/java/com/provismet/AdditionalArmoury/items/DaggerItem.java index 5553ed4..78cf6ae 100644 --- a/src/main/java/com/provismet/AdditionalArmoury/items/DaggerItem.java +++ b/src/main/java/com/provismet/AdditionalArmoury/items/DaggerItem.java @@ -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); }