diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-02 09:38:50 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-02 09:38:50 +0200 |
commit | 9aac2eb3a620f5baf93ac2c6f5f99ede6440ba7b (patch) | |
tree | 4dbd090b15ce0531448ebbc2fcf462e2cb7c1cfa /src/main | |
parent | b57755be9d163a614aa9c6ea4666423732fba153 (diff) | |
download | skyhanni-9aac2eb3a620f5baf93ac2c6f5f99ede6440ba7b.tar.gz skyhanni-9aac2eb3a620f5baf93ac2c6f5f99ede6440ba7b.tar.bz2 skyhanni-9aac2eb3a620f5baf93ac2c6f5f99ede6440ba7b.zip |
Fixed /shtestcomposter crash, removed SIMPLE_CARROT_CANDY from composter
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt index 8fe0f2272..5d43b5821 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt @@ -361,7 +361,7 @@ class ComposterOverlay { bigList: MutableList<List<Any>>, factors: Map<String, Double>, missing: Double, - testOffset: Int = 0, + testOffset_: Int = 0, onClick: (String) -> Unit, ): String { val map = mutableMapOf<String, Double>() @@ -369,6 +369,12 @@ class ComposterOverlay { map[internalName] = factor / getPrice(internalName) } + val testOffset = if (testOffset_ > map.size) { + LorenzUtils.chat("§cSkyHanni] Invalid Composter Overlay Offset! $testOffset cannot be greather than ${map.size}!") + ComposterOverlay.testOffset = 0 + 0 + } else testOffset_ + var i = 0 var first: String? = null for (internalName in map.sortedDesc().keys) { @@ -384,6 +390,9 @@ class ComposterOverlay { val totalPrice = itemsNeeded * price val list = mutableListOf<Any>() + if (testOffset != 0) { + list.add("#$i ") + } list.add(item) val format = NumberUtil.format(totalPrice) val selected = @@ -402,8 +411,14 @@ class ComposterOverlay { if (i == 10 + testOffset) break } + if (testOffset != 0) { + bigList.addAsSingletonList(Renderable.link("testOffset = $testOffset") { + ComposterOverlay.testOffset = 0 + update() + }) + } - return first!! + return first ?: error("First is empty!") } private fun getPrice(internalName: String): Double { @@ -447,6 +462,7 @@ class ComposterOverlay { if (internalName.endsWith("_CHESTPLATE")) continue if (internalName.endsWith("_LEGGINGS")) continue if (internalName == "SPEED_TALISMAN") continue + if (internalName == "SIMPLE_CARROT_CANDY") continue val (newId, amount) = NEUItems.getMultiplier(internalName) if (amount <= 9) continue val finalAmount = |