aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-04-03 20:10:48 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-04-03 20:10:48 +0200
commit5d2905197d6268a40325e9939a94a92cd8a94163 (patch)
tree837c02b9fc42498bd7785c285bbbddb47d0ee077 /src
parenta7c6e08864f4d7a2ebf5776d2b4d5c8f1a691b56 (diff)
downloadskyhanni-5d2905197d6268a40325e9939a94a92cd8a94163.tar.gz
skyhanni-5d2905197d6268a40325e9939a94a92cd8a94163.tar.bz2
skyhanni-5d2905197d6268a40325e9939a94a92cd8a94163.zip
code cleanup
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt6
2 files changed, 2 insertions, 6 deletions
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())