From 37378e2677aa60039f57895e3d955bd719cd29b5 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Tue, 7 May 2024 23:05:27 +0200 Subject: Fix: Farming tool detection (#1692) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt index 2ec370dee..b6ae8f105 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -48,6 +48,7 @@ import net.minecraft.item.ItemStack import net.minecraft.network.play.client.C09PacketHeldItemChange import net.minecraft.util.AxisAlignedBB import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.seconds object GardenAPI { @@ -96,6 +97,11 @@ object GardenAPI { fun onInventoryClose(event: InventoryCloseEvent) { if (!inGarden()) return checkItemInHand() + DelayedRun.runDelayed(500.milliseconds) { + if (inGarden()) { + checkItemInHand() + } + } } @SubscribeEvent -- cgit