diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-26 22:20:38 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-26 22:20:38 +0200 |
commit | 579fb57fe38c06376621e341b4806d9234679bd5 (patch) | |
tree | af34e3b6dd77254523bdc6a30c23c87994e46e8d /src/main/java/at/hannibal2 | |
parent | 52d45970bbcb534004ac4f799035ff448e10f212 (diff) | |
download | skyhanni-579fb57fe38c06376621e341b4806d9234679bd5.tar.gz skyhanni-579fb57fe38c06376621e341b4806d9234679bd5.tar.bz2 skyhanni-579fb57fe38c06376621e341b4806d9234679bd5.zip |
Fixed city project material list is visible in other inventories
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectMaterialHelper.kt | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectMaterialHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectMaterialHelper.kt index 869154ec1..ef4a81173 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectMaterialHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectMaterialHelper.kt @@ -5,7 +5,6 @@ import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryOpenEvent -import at.hannibal2.skyhanni.features.garden.AnitaMedalProfit import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name @@ -25,11 +24,11 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class CityProjectMaterialHelper { private val config get() = SkyHanniMod.feature.misc.cityProject private var display = listOf<List<Any>>() - private var inCityProjectInventory = false + private var inInventory = false @SubscribeEvent fun onInventoryClose(event: InventoryCloseEvent) { - AnitaMedalProfit.inInventory = false + inInventory = false } @SubscribeEvent @@ -40,7 +39,7 @@ class CityProjectMaterialHelper { val lore = event.inventoryItems[4]?.getLore() ?: return if (lore.isEmpty()) return if (lore[0] != "ยง8City Project") return - inCityProjectInventory = true + inInventory = true // internal name -> amount val materials = mutableMapOf<String, Int>() @@ -77,7 +76,7 @@ class CityProjectMaterialHelper { LorenzUtils.sendCommandToServer("bz ${name.removeColor()}") OSUtils.copyToClipboard("$amount") } - }) { inCityProjectInventory && !NEUItems.neuHasFocus() }) + }) { inInventory && !NEUItems.neuHasFocus() }) val price = NEUItems.getPrice(internalName) * amount val format = NumberUtil.format(price) @@ -114,7 +113,7 @@ class CityProjectMaterialHelper { fun onBackgroundDraw(event: GuiRenderEvent.ChestBackgroundRenderEvent) { if (!LorenzUtils.inSkyBlock) return if (!config.showMaterials) return - if (!inCityProjectInventory) return + if (!inInventory) return config.pos.renderStringsAndItems(display, posLabel = "City Project Materials") } @@ -123,7 +122,7 @@ class CityProjectMaterialHelper { fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { if (!LorenzUtils.inSkyBlock) return if (!config.showReady) return - if (!inCityProjectInventory) return + if (!inInventory) return if (event.gui !is GuiChest) return |