diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-05-08 13:39:12 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-05-08 13:39:12 +0200 |
commit | 423b78168b7c487f14c92bf3cd083d9db2a5fd09 (patch) | |
tree | 30afe52df17c44bf4134f6cf5d33e54731c9ad75 /src/main | |
parent | 773b199b6d28154a74a129b12a3a3f9d8b769765 (diff) | |
download | skyhanni-423b78168b7c487f14c92bf3cd083d9db2a5fd09.tar.gz skyhanni-423b78168b7c487f14c92bf3cd083d9db2a5fd09.tar.bz2 skyhanni-423b78168b7c487f14c92bf3cd083d9db2a5fd09.zip |
code cleanup
Diffstat (limited to 'src/main')
3 files changed, 13 insertions, 15 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt index 33643a172..e64e0c76b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt @@ -101,15 +101,14 @@ class GardenVisitorSupercraft { } @SubscribeEvent(priority = EventPriority.HIGH) - fun onStackClick(event: GuiContainerEvent.SlotClickEvent) { + fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { if (!hasIngredients) return - if (event.slotId == 31) { - event.isCanceled = true - if (lastClick.passedSince() > 0.3.seconds) { - ChatUtils.sendCommandToServer("recipe $lastSuperCraftMaterial") - lastClick = SimpleTimeMark.now() - } + if (event.slotId != 31) return + event.isCanceled = true + if (lastClick.passedSince() > 0.3.seconds) { + ChatUtils.sendCommandToServer("recipe $lastSuperCraftMaterial") + lastClick = SimpleTimeMark.now() } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt index 883562a0b..75d0af8bb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt @@ -52,7 +52,7 @@ class VisitorRewardWarning { } @SubscribeEvent(priority = EventPriority.HIGH) - fun onStackClick(event: GuiContainerEvent.SlotClickEvent) { + fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { if (!VisitorAPI.inInventory) return val stack = event.slot?.stack ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryShortcut.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryShortcut.kt index a1a62c727..d3bb031b2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryShortcut.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryShortcut.kt @@ -59,13 +59,12 @@ class ChocolateFactoryShortcut { } @SubscribeEvent(priority = EventPriority.HIGH) - fun onStackClick(event: GuiContainerEvent.SlotClickEvent) { - if (showItem && event.slotId == 15) { - event.cancel() - if (lastClick.passedSince() > 2.seconds) { - HypixelCommands.chocolateFactory() - lastClick = SimpleTimeMark.now() - } + fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { + if (!showItem || event.slotId != 15) return + event.cancel() + if (lastClick.passedSince() > 2.seconds) { + HypixelCommands.chocolateFactory() + lastClick = SimpleTimeMark.now() } } } |