From b7d7942c33565b98f5f402c97b50941991b4ae0a Mon Sep 17 00:00:00 2001 From: Azoor <31021840+azoor-desu@users.noreply.github.com> Date: Thu, 15 Aug 2024 19:06:22 +0800 Subject: [PATCH] Fix mekabow autofire not working properly in modpacks The Meka Bow's autofire unit does not work when player's attack speed is vastly increased. To replicate: Equip God's Crown from Reliquary mod (+120% all stats), Meka Bow's autofire stops working properly. (MC version 1.19.2, but probably happens on other versions too) Changed firing check from == to <= as a hotfix. --- src/main/java/meranha/mekaweapons/items/ItemMekaBow.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/meranha/mekaweapons/items/ItemMekaBow.java b/src/main/java/meranha/mekaweapons/items/ItemMekaBow.java index e600094..526d17f 100644 --- a/src/main/java/meranha/mekaweapons/items/ItemMekaBow.java +++ b/src/main/java/meranha/mekaweapons/items/ItemMekaBow.java @@ -71,7 +71,7 @@ public void adjustAttributes(ItemAttributeModifierEvent event) { } public void onUseTick(@Nonnull Level world, @Nonnull LivingEntity player, @Nonnull ItemStack stack, int timeLeft) { - if (isModuleEnabled(stack, MekaWeapons.AUTOFIRE_UNIT) && getUseDuration(stack, player) - timeLeft == getUseTick(stack)) { + if (isModuleEnabled(stack, MekaWeapons.AUTOFIRE_UNIT) && getUseDuration(stack, player) - timeLeft <= getUseTick(stack)) { player.stopUsingItem(); stack.releaseUsing(world, player, 0); player.startUsingItem(player.getUsedItemHand()); @@ -152,4 +152,4 @@ public float getUseTick(@Nonnull ItemStack stack) { } return useTick; } -} \ No newline at end of file +}