aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/skyblock/ScreenIdentification.kt
blob: 7ddc4814c4142909a17e27cffb8c06e3ac24cdbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package moe.nea.firmament.util.skyblock

import net.minecraft.client.gui.screen.Screen
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen
import moe.nea.firmament.util.mc.displayNameAccordingToNbt
import moe.nea.firmament.util.mc.loreAccordingToNbt
import moe.nea.firmament.util.unformattedString


fun Screen.isBazaarUi(): Boolean {
	if (this !is GenericContainerScreen) return false
	return (
		this.screenHandler.stacks[this.screenHandler.rows * 9 - 4]
			.displayNameAccordingToNbt
			.unformattedString == "Manage Orders"
			|| this.screenHandler.stacks[this.screenHandler.rows * 9 - 5]
			.loreAccordingToNbt
			.any {
				it.unformattedString == "To Bazaar"
			})
}

fun Screen.isSuperPairs(): Boolean {
	return title.unformattedString.startsWith("Superpairs")
}

fun Screen.isExperimentationRngMeter(): Boolean {
	return this.title.unformattedString.contains("Experimentation Table RNG")
}

fun Screen.isDyeCompendium(): Boolean {
	return this.title.unformattedString.contains("Dye Compendium")
}