diff options
author | Lorenz <ESs95s3P5z8Pheb> | 2022-07-15 21:24:08 +0200 |
---|---|---|
committer | Lorenz <ESs95s3P5z8Pheb> | 2022-07-15 21:24:08 +0200 |
commit | 5457ff7723bcc10437cbea4a3104b0a6b1f088de (patch) | |
tree | 30c55a8a54b76197fe901c2c4cae29e69c6bf545 /src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt | |
parent | 6e5abff66a77294c1cbc9034f3fd31ef3b5b77f0 (diff) | |
download | skyhanni-5457ff7723bcc10437cbea4a3104b0a6b1f088de.tar.gz skyhanni-5457ff7723bcc10437cbea4a3104b0a6b1f088de.tar.bz2 skyhanni-5457ff7723bcc10437cbea4a3104b0a6b1f088de.zip |
add salvage items to repo
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt | 61 |
1 files changed, 18 insertions, 43 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt index 95759a981..32d53e2c3 100644 --- a/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt @@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.removeColorCodes import at.hannibal2.skyhanni.utils.MultiFilter import at.hannibal2.skyhanni.utils.RenderUtils.highlight +import com.google.gson.JsonObject import net.minecraft.client.Minecraft import net.minecraft.client.gui.inventory.GuiChest import net.minecraft.client.renderer.GlStateManager @@ -32,6 +33,7 @@ class HideNotClickableItems { private val hideNpcSellList = MultiFilter() private val hideInStorageList = MultiFilter() private val tradeNpcList = MultiFilter() + private val itemsToSalvage = mutableListOf<String>() @SubscribeEvent fun onRepoReload(event: RepositoryReloadEvent) { @@ -42,12 +44,27 @@ class HideNotClickableItems { val tradeNpcs = event.getConstant("TradeNpcs")!! tradeNpcList.load(tradeNpcs) + + updateSalvageList(hideNotClickableItems) + } catch (e: Exception) { e.printStackTrace() LorenzUtils.error("error in RepositoryReloadEvent") } } + private fun updateSalvageList(hideNotClickableItems: JsonObject) { + itemsToSalvage.clear() + val salvage = hideNotClickableItems["salvage"].asJsonObject + itemsToSalvage.addAll(salvage.asJsonObject["items"].asJsonArray.map { it.asString }) + for (armor in salvage.asJsonObject["armor"].asJsonArray.map { it.asString }) { + itemsToSalvage.add("$armor Helmet") + itemsToSalvage.add("$armor Chestplate") + itemsToSalvage.add("$armor Leggings") + itemsToSalvage.add("$armor Boots") + } + } + @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { if (!LorenzUtils.inSkyblock) return @@ -312,49 +329,7 @@ class HideNotClickableItems { } val name = stack.cleanName() - - val armorSets = listOf( - "Zombie Knight", - "Heavy", - "Zombie Soldier", - "Skeleton Grunt", - "Skeleton Soldier", - "Zombie Commander", - "Skeleton Master", - "Sniper", - "Skeletor", - "Rotten", - ) - - val items = mutableListOf<String>() - for (armor in armorSets) { - items.add("$armor Helmet") - items.add("$armor Chestplate") - items.add("$armor Leggings") - items.add("$armor Boots") - } - - items.add("Zombie Soldier Cutlass") - items.add("Silent Death") - items.add("Zombie Knight Sword") - items.add("Conjuring") - items.add("Dreadlord Sword") - items.add("Soulstealer Bow") - items.add("Machine Gun Bow") - items.add("Earth Shard") - items.add("Zombie Commander Whip") - items.add("Sniper Bow") - - //Crimson essence - items.add("Blade of the Volcano") - items.add("Staff of the Volcano") - items.add("Slug Boots") - items.add("Flaming Chestplate") - items.add("Moogma Leggings") - items.add("Rampart Leggings") - items.add("Rampart Boots") - - for (item in items) { + for (item in itemsToSalvage) { if (name.endsWith(item)) { return false } |