aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-03-27 05:08:26 +1100
committerGitHub <noreply@github.com>2024-03-26 19:08:26 +0100
commit670b115fae0536e495e7042df84f371e1568d728 (patch)
tree233f2b4c332b89b3cb64ce0c04e2dcc277900675 /src/main
parent619b69c8e06d0795f6bae9fff2d0d71c2016020f (diff)
downloadskyhanni-670b115fae0536e495e7042df84f371e1568d728.tar.gz
skyhanni-670b115fae0536e495e7042df84f371e1568d728.tar.bz2
skyhanni-670b115fae0536e495e7042df84f371e1568d728.zip
Fix: Remove removed option (#1274)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt15
2 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java
index 1908b6ef7..6959299cb 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java
@@ -100,7 +100,6 @@ public class InventoryConfig {
PET_LEVEL("§bPet Level", 4),
MINION_TIER("§bMinion Tier", 5),
CRIMSON_ARMOR("§bCrimson Armor", 6),
- REMOVED("§7(Removed)", 7),
KUUDRA_KEY("§bKuudra Key", 8),
SKILL_LEVEL("§bSkill Level", 9),
COLLECTION_LEVEL("§bCollection Level", 10),
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
index 3aa5beaa2..bdac13de2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
@@ -48,6 +48,8 @@ import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getRanchersSpeed
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
+import com.google.gson.JsonArray
+import com.google.gson.JsonElement
import net.minecraft.item.ItemStack
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -282,6 +284,19 @@ object ItemDisplayOverlayFeatures {
event.transform(11, "inventory.itemNumberAsStackSize") { element ->
ConfigUtils.migrateIntArrayListToEnumArrayList(element, ItemNumberEntry::class.java)
}
+ event.transform(29, "inventory.itemNumberAsStackSize") { element ->
+ fixRemovedConfigElement(element)
+ }
+ }
+
+ private fun fixRemovedConfigElement(data: JsonElement): JsonElement {
+ if (!data.isJsonArray) return data
+ val newList = JsonArray()
+ for (element in data.asJsonArray) {
+ if (element.asString == "REMOVED") continue
+ newList.add(element)
+ }
+ return newList
}
fun ItemNumberEntry.isSelected() = config.itemNumberAsStackSize.contains(this)