aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/ambientaddons/features/misc/Salvage.kt
diff options
context:
space:
mode:
authorAppability <appable@icloud.com>2022-11-12 14:35:15 -0800
committerAppability <appable@icloud.com>2022-11-12 14:35:15 -0800
commitde601769d8a1b5fc7543d5b0b4a95596db926416 (patch)
tree3fea24e9e4d55f93e00553e2a2ca9f6ecb1ef713 /src/main/kotlin/com/ambientaddons/features/misc/Salvage.kt
parent2b21d3a18b412ec8c205beacf403f0147dc04618 (diff)
downloadAmbientAddons-de601769d8a1b5fc7543d5b0b4a95596db926416.tar.gz
AmbientAddons-de601769d8a1b5fc7543d5b0b4a95596db926416.tar.bz2
AmbientAddons-de601769d8a1b5fc7543d5b0b4a95596db926416.zip
placeholder custom end info, farming qol, thunder warning
Diffstat (limited to 'src/main/kotlin/com/ambientaddons/features/misc/Salvage.kt')
-rw-r--r--src/main/kotlin/com/ambientaddons/features/misc/Salvage.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/kotlin/com/ambientaddons/features/misc/Salvage.kt b/src/main/kotlin/com/ambientaddons/features/misc/Salvage.kt
index 914870f..a1ee583 100644
--- a/src/main/kotlin/com/ambientaddons/features/misc/Salvage.kt
+++ b/src/main/kotlin/com/ambientaddons/features/misc/Salvage.kt
@@ -8,6 +8,7 @@ import com.ambientaddons.utils.Extensions.itemQuality
import com.ambientaddons.utils.Extensions.items
import com.ambientaddons.utils.Extensions.skyblockID
import com.ambientaddons.utils.Extensions.stars
+import com.ambientaddons.utils.SBLocation
import com.ambientaddons.utils.SalvageStrategy
import com.ambientaddons.utils.render.OverlayUtils
import net.minecraft.client.gui.inventory.GuiContainer
@@ -30,6 +31,7 @@ object Salvage {
@SubscribeEvent
fun onGuiDraw(event: GuiScreenEvent.DrawScreenEvent) {
+ if (!SBLocation.inSkyblock) return
val chest = event.gui?.chest ?: return
if (config.salvageMode < 3 || chest.lowerChestInventory.name != "Salvage Item") return
val color = chest.lowerChestInventory.items.last()?.itemDamage
@@ -65,12 +67,14 @@ object Salvage {
@SubscribeEvent
fun onContainerOpen(event: GuiOpenEvent) {
+ if (!SBLocation.inSkyblock) return
if (event.gui?.chest == null) return
status = SalvageStatus.Idle
}
@SubscribeEvent
fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) {
+ if (!SBLocation.inSkyblock) return
if (config.salvageMode < 2 || event.slot == null) return
if (!isSlotInInventory(event.gui, event.slot)) return
if (status != SalvageStatus.Idle
@@ -91,6 +95,7 @@ object Salvage {
@SubscribeEvent
fun onDrawSlot(event: GuiContainerEvent.DrawSlotEvent) {
+ if (!SBLocation.inSkyblock) return
if (config.salvageMode == 0 || !isSlotInInventory(event.gui, event.slot)) return
val color = when (getSalvageStrategy(event.slot.stack ?: return)) {
SalvageStrategy.Always -> Color.GREEN