aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features/world/TemporaryWaypoints.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/features/world/TemporaryWaypoints.kt')
-rw-r--r--src/main/kotlin/features/world/TemporaryWaypoints.kt23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/main/kotlin/features/world/TemporaryWaypoints.kt b/src/main/kotlin/features/world/TemporaryWaypoints.kt
index b36c49d..ac1600e 100644
--- a/src/main/kotlin/features/world/TemporaryWaypoints.kt
+++ b/src/main/kotlin/features/world/TemporaryWaypoints.kt
@@ -1,10 +1,9 @@
package moe.nea.firmament.features.world
-import kotlin.compareTo
-import kotlin.text.clear
+import me.shedaniel.math.Color
import kotlin.time.Duration.Companion.seconds
-import net.minecraft.text.Text
-import net.minecraft.util.math.BlockPos
+import net.minecraft.network.chat.Component
+import net.minecraft.core.BlockPos
import moe.nea.firmament.annotations.Subscribe
import moe.nea.firmament.events.ProcessChatEvent
import moe.nea.firmament.events.WorldReadyEvent
@@ -16,8 +15,8 @@ import moe.nea.firmament.util.render.RenderInWorldContext
object TemporaryWaypoints {
data class TemporaryWaypoint(
- val pos: BlockPos,
- val postedAt: TimeMark,
+ val pos: BlockPos,
+ val postedAt: TimeMark,
)
val temporaryPlayerWaypointList = mutableMapOf<String, TemporaryWaypoint>()
val temporaryPlayerWaypointMatcher = "(?i)x: (-?[0-9]+),? y: (-?[0-9]+),? z: (-?[0-9]+)".toPattern()
@@ -38,24 +37,24 @@ object TemporaryWaypoints {
if (temporaryPlayerWaypointList.isEmpty()) return
RenderInWorldContext.renderInWorld(event) {
temporaryPlayerWaypointList.forEach { (_, waypoint) ->
- block(waypoint.pos, 0xFFFFFF00.toInt())
+ block(waypoint.pos, Color.ofRGBA(255, 255, 0, 128).color)
}
temporaryPlayerWaypointList.forEach { (player, waypoint) ->
val skin =
- MC.networkHandler?.listedPlayerListEntries?.find { it.profile.name == player }?.skinTextures?.texture
- withFacingThePlayer(waypoint.pos.toCenterPos()) {
- waypoint(waypoint.pos, Text.stringifiedTranslatable("firmament.waypoint.temporary", player))
+ MC.networkHandler?.listedOnlinePlayers?.find { it.profile.name == player }?.skin?.body
+ withFacingThePlayer(waypoint.pos.center) {
+ waypoint(waypoint.pos, Component.translatableEscape("firmament.waypoint.temporary", player))
if (skin != null) {
matrixStack.translate(0F, -20F, 0F)
// Head front
texture(
- skin, 16, 16,
+ skin.id(), 16, 16, // TODO: 1.21.10 test
1 / 8f, 1 / 8f,
2 / 8f, 2 / 8f,
)
// Head overlay
texture(
- skin, 16, 16,
+ skin.id(), 16, 16, // TODO: 1.21.10
5 / 8f, 1 / 8f,
6 / 8f, 2 / 8f,
)