blob: bfcb9490873c42823e8f33e35aa96641c08f3c8b (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
package at.hannibal2.skyhanni.features.fishing
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class OdgerWaypoint {
private val location = LorenzVec(-373, 207, -808)
private var hasLavaRodInHand = false
private var trophyFishInInv = false
@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
if (!isEnabled()) return
if (event.isMod(10)) {
hasLavaRodInHand = isLavaFishingRod()
trophyFishInInv = InventoryUtils.getItemsInOwnInventory().map { it.getLore() }
.any { it.isNotEmpty() && it.last().endsWith("TROPHY FISH") }
}
}
private fun isLavaFishingRod(): Boolean {
val heldItem = InventoryUtils.getItemInHand() ?: return false
val isRod = heldItem.name?.contains("Rod") ?: return false
if (!isRod) return false
return heldItem.getLore().any { it.contains("Lava Rod") }
}
@SubscribeEvent
fun onRenderWorld(event: RenderWorldLastEvent) {
if (!isEnabled()) return
if (hasLavaRodInHand) return
if (!trophyFishInInv) return
event.drawWaypointFilled(location, LorenzColor.WHITE.toColor())
event.drawDynamicText(location, "Odger", 1.5)
}
fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.fishing.odgerLocation &&
LorenzUtils.skyBlockIsland == IslandType.CRIMSON_ISLE
}
|