blob: a5438d720db77dcfd5b5b746745fb7acece01c88 (
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
|
package at.hannibal2.skyhanni.features.fishing.trophy
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.features.fishing.FishingAPI
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemCategory
import at.hannibal2.skyhanni.utils.ItemUtils.getItemCategoryOrNull
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText
import at.hannibal2.skyhanni.utils.RenderUtils.drawWaypointFilled
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@SkyHanniModule
object OdgerWaypoint {
private val config get() = SkyHanniMod.feature.fishing.trophyFishing
private val location = LorenzVec(-373, 207, -808)
private var trophyFishInInventory = false
@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
if (!isEnabled() || !event.isMod(10)) return
trophyFishInInventory = InventoryUtils.getItemsInOwnInventory()
.any { it.getItemCategoryOrNull() == ItemCategory.TROPHY_FISH }
}
@SubscribeEvent
fun onRenderWorld(event: LorenzRenderWorldEvent) {
if (!isEnabled()) return
if (FishingAPI.holdingLavaRod) return
if (!trophyFishInInventory) return
event.drawWaypointFilled(location, LorenzColor.WHITE.toColor())
event.drawDynamicText(location, "Odger", 1.5)
}
@SubscribeEvent
fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
event.move(2, "fishing.odgerLocation", "fishing.trophyFishing.odgerLocation")
}
fun isEnabled() = IslandType.CRIMSON_ISLE.isInIsland() && config.odgerLocation
}
|