aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/items
diff options
context:
space:
mode:
authorLorenz <ESs95s3P5z8Pheb>2022-07-15 22:24:21 +0200
committerLorenz <ESs95s3P5z8Pheb>2022-07-15 22:24:21 +0200
commit4da572a66c5e8a9fc3b49621fc08141e1f669b8f (patch)
tree23cf94ae589f25fd8e3f126ed475d7468bd325f3 /src/main/java/at/hannibal2/skyhanni/items
parente8f5def579ab921a95a918e6f3e8b1ec47ceb0da (diff)
downloadskyhanni-4da572a66c5e8a9fc3b49621fc08141e1f669b8f.tar.gz
skyhanni-4da572a66c5e8a9fc3b49621fc08141e1f669b8f.tar.bz2
skyhanni-4da572a66c5e8a9fc3b49621fc08141e1f669b8f.zip
add hide player trade to repo
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/items')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt
index 32d53e2c3..4b4d9e732 100644
--- a/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt
@@ -4,13 +4,10 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.bazaar.BazaarApi
import at.hannibal2.skyhanni.events.GuiContainerEvent
import at.hannibal2.skyhanni.events.RepositoryReloadEvent
-import at.hannibal2.skyhanni.utils.ItemUtils
+import at.hannibal2.skyhanni.utils.*
import at.hannibal2.skyhanni.utils.ItemUtils.cleanName
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
-import at.hannibal2.skyhanni.utils.LorenzColor
-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
@@ -34,6 +31,7 @@ class HideNotClickableItems {
private val hideInStorageList = MultiFilter()
private val tradeNpcList = MultiFilter()
private val itemsToSalvage = mutableListOf<String>()
+ private val hidePlayerTradeFilter = MultiFilter()
@SubscribeEvent
fun onRepoReload(event: RepositoryReloadEvent) {
@@ -47,6 +45,8 @@ class HideNotClickableItems {
updateSalvageList(hideNotClickableItems)
+ hidePlayerTradeFilter.load(hideNotClickableItems["hide_player_trade"].asJsonObject)
+
} catch (e: Exception) {
e.printStackTrace()
LorenzUtils.error("error in RepositoryReloadEvent")
@@ -174,7 +174,7 @@ class HideNotClickableItems {
hideNpcSell(chestName, stack) -> true
hideInStorage(chestName, stack) -> true
hideSalvage(chestName, stack) -> true
- hideTrade(chestName, stack) -> true
+ hidePlayerTrade(chestName, stack) -> true
hideBazaarOrAH(chestName, stack) -> true
hideAccessoryBag(chestName, stack) -> true
hideSackOfSacks(chestName, stack) -> true
@@ -237,7 +237,7 @@ class HideNotClickableItems {
return true
}
- private fun hideTrade(chestName: String, stack: ItemStack): Boolean {
+ private fun hidePlayerTrade(chestName: String, stack: ItemStack): Boolean {
if (!chestName.startsWith("You ")) return false
if (ItemUtils.isSoulBound(stack)) {
@@ -257,15 +257,8 @@ class HideNotClickableItems {
return true
}
- val result = when {
- name.contains("Personal Deletor") -> true
- name.contains("Day Crystal") -> true
- name.contains("Night Crystal") -> true
- name.contains("Cat Talisman") -> true
- name.contains("Lynx Talisman") -> true
- name.contains("Cheetah Talisman") -> true
- else -> false
- }
+ val result = hidePlayerTradeFilter.match(name)
+ LorenzDebug.log("hidePlayerTradeList filter result for '$name': $result")
if (result) hideReason = "This item cannot be traded!"
return result