aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/KeeperWaypoints.kt
blob: a8770c222e6ce60db9987e0b12d87d7d5fd628cb (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
package dulkirmod.features

import dulkirmod.DulkirMod.Companion.mc
import dulkirmod.config.DulkirConfig
import dulkirmod.utils.TabListUtils
import dulkirmod.utils.Utils
import dulkirmod.utils.WorldRenderUtils
import net.minecraft.util.Vec3
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import kotlin.math.max

object KeeperWaypoints {
    @SubscribeEvent
    fun onWorldRenderLast(event: RenderWorldLastEvent) {
        if (!DulkirConfig.keeperWaypoints) return
        if (TabListUtils.area != "Spider's Den") return

        val vec1 = Vec3(-208.5, 44.5, -259.5)
        val vec2 = Vec3(-311.5, 43.5, -232.5)
        val vec3 = Vec3(-230.5, 57.5, -307.5)
        val vec4 = Vec3(-269.5, 47.5, -166.5)
        val vec5 = Vec3(-292.5, 47.5, -167.5)
        val vec6 = Vec3(-291.5, 47.5, -183.5)
        val vec7 = Vec3(-282.5, 47.5, -195.5)
        val vec8 = Vec3(-262.5, 49.5, -191.5)
        val vec9 = Vec3(-269.5, 61.5, -159.5)
        val playerVec = mc.thePlayer.positionVector

        val scale1 = max(1f, playerVec.distanceTo(vec1).toFloat()/10f)
        val scale2 = max(1f,playerVec.distanceTo(vec2).toFloat()/10f)
        val scale3 = max(1f, playerVec.distanceTo(vec3).toFloat()/10f)
        val scale4 = max(1f, playerVec.distanceTo(vec4).toFloat()/10f)
        val scale5 = max(1f, playerVec.distanceTo(vec5).toFloat()/10f)
        val scale6 = max(1f, playerVec.distanceTo(vec6).toFloat()/10f)
        val scale7 = max(1f, playerVec.distanceTo(vec7).toFloat()/10f)
        val scale8 = max(1f, playerVec.distanceTo(vec8).toFloat()/10f)
        val scale9 = max(1f, playerVec.distanceTo(vec9).toFloat()/10f)

        val color = Utils.getColorString(DulkirConfig.bestiaryNotifColor)
        WorldRenderUtils.renderString(vec1, "${color}1", false, scale1, true)
        WorldRenderUtils.renderString(vec2, "${color}2", false, scale2, true)
        WorldRenderUtils.renderString(vec3, "${color}3", false, scale3, true)
        WorldRenderUtils.renderString(vec4, "${color}4", false, scale4, true)
        WorldRenderUtils.renderString(vec5, "${color}5", false, scale5, true)
        WorldRenderUtils.renderString(vec6, "${color}6", false, scale6, true)
        WorldRenderUtils.renderString(vec7, "${color}7", false, scale7, true)
        WorldRenderUtils.renderString(vec8, "${color}8", false, scale8, true)
        WorldRenderUtils.renderString(vec9, "${color}9", false, scale9, true)
    }
}