aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/StarredMobBoxes.kt
blob: a9aa932a34dbde3615333012f0ae1301b83ffd79 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package dulkirmod.features

import dulkirmod.config.DulkirConfig
import dulkirmod.utils.TabListUtils
import dulkirmod.utils.WorldRenderUtils
import net.minecraftforge.client.event.RenderLivingEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.awt.Color

object StarredMobBoxes {
    @SubscribeEvent
    fun render(event: RenderLivingEvent.Post<*>) {
        if (!DulkirConfig.starredBoxes) return
        if (TabListUtils.area != "Dungeon") return
        val name = event.entity.name ?: return
        if (name.startsWith("§6✯ ") && name.endsWith("§c❤")) {
            val newPos = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z)
            val x = newPos[0]
            val y = newPos[1]
            val z = newPos[2]

            if ("Spider" in name) {
//                        x - 0.625,
//                        y - 1,
//                        z - 0.625,
//                        x + 0.625,
//                        y - 0.25,
//                        z + 0.625
                WorldRenderUtils.drawCustomBox(
                    x - .625,
                    1.25,
                    y - 1,
                    .75,
                    z - .625,
                    1.25,
                    Color(15, 247, 236, 255),
                    3f,
                    phase = false
                )
            } else if ("Fels" in name || "Withermancer" in name) {
                    //AxisAlignedBB(x - 0.5, y - 3, z - 0.5, x + 0.5, y, z + 0.5),
                WorldRenderUtils.drawCustomBox(
                    x - .5,
                    1.0,
                    y - 3,
                    3.0,
                    z - .5,
                    1.0,
                    Color(15, 247, 236, 255),
                    3f,
                    phase = false
                )
            } else {
                    //AxisAlignedBB(x - 0.5, y - 2, z - 0.5, x + 0.5, y, z + 0.5),
                WorldRenderUtils.drawCustomBox(
                    x - .5,
                    1.0,
                    y - 2,
                    2.0,
                    z - .5,
                    1.0,
                    Color(15, 247, 236, 255),
                    3f,
                    phase = false
                )
            }
        }
    }
}