From 5d2905197d6268a40325e9939a94a92cd8a94163 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 3 Apr 2024 20:10:48 +0200 Subject: code cleanup --- src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt | 2 +- src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt index 0a0a6b819..fc046c965 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt @@ -133,7 +133,7 @@ object MaxwellAPI { // load earlier, so that other features can already use the api in this event @SubscribeEvent(priority = EventPriority.HIGH) - fun onInventoryFullyLoaded(event: InventoryOpenEvent) { + fun onInventoryOpen(event: InventoryOpenEvent) { if (!isEnabled()) return if (isThaumaturgyInventory(event.inventoryName)) { diff --git a/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt index 8fbd3531e..2297b3cf5 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt @@ -134,20 +134,18 @@ object QuiverAPI { clearedPattern.matchMatcher(message) { currentAmount = 0 arrowAmount.clear() - return } arrowResetPattern.matchMatcher(message) { currentArrow = NONE_ARROW_TYPE currentAmount = 0 - return } } @SubscribeEvent - fun onInventoryFullyLoaded(event: InventoryFullyOpenedEvent) { + fun onInventoryOpen(event: InventoryFullyOpenedEvent) { if (!isEnabled()) return if (!quiverInventoryNamePattern.matches(event.inventoryName)) return @@ -158,9 +156,7 @@ object QuiverAPI { val stacks = event.inventoryItems for (stack in stacks.values) { if (stack.getItemCategoryOrNull() != ItemCategory.ARROW) continue - val arrow = stack.getInternalNameOrNull() ?: continue - val arrowType = getArrowByNameOrNull(arrow) ?: continue arrowAmount.addOrPut(arrowType.internalName, stack.stackSize.toFloat()) -- cgit