From 752b98fb5c49a646833b43fea30a3629e76769a0 Mon Sep 17 00:00:00 2001 From: AkmalFairuz Date: Fri, 20 Jun 2025 13:25:54 +0700 Subject: [PATCH] Update gophertunnel to v1.47.4 and change PlayerColour type to color.RGBA in legacy protocol. --- go.mod | 2 +- go.sum | 2 ++ legacyver/proto/player.go | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 55d884b..2014bf3 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/pelletier/go-toml v1.9.5 github.com/rogpeppe/go-internal v1.14.1 github.com/samber/lo v1.49.1 - github.com/sandertv/gophertunnel v1.47.3 + github.com/sandertv/gophertunnel v1.47.4 github.com/segmentio/fasthash v1.0.3 golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 golang.org/x/image v0.25.0 diff --git a/go.sum b/go.sum index e3ef8bd..3c03498 100644 --- a/go.sum +++ b/go.sum @@ -60,6 +60,8 @@ github.com/sandertv/gophertunnel v1.47.2-0.20250618150444-d66380c4a00b h1:/kNTXz github.com/sandertv/gophertunnel v1.47.2-0.20250618150444-d66380c4a00b/go.mod h1:lvzOdyb2fkoo3uySe++hy4UKq0I649oUFJKkro2ZHpY= github.com/sandertv/gophertunnel v1.47.3 h1:MsHv8QEx17+N/39BnAvHn/KU9zv8Rt9ZHTKaZK9vSuo= github.com/sandertv/gophertunnel v1.47.3/go.mod h1:lvzOdyb2fkoo3uySe++hy4UKq0I649oUFJKkro2ZHpY= +github.com/sandertv/gophertunnel v1.47.4 h1:PmNbEUf9+7Fk8bP2875cvYTt22g0d4eeQhtd1dxjqqA= +github.com/sandertv/gophertunnel v1.47.4/go.mod h1:lvzOdyb2fkoo3uySe++hy4UKq0I649oUFJKkro2ZHpY= github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtrmhM= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= diff --git a/legacyver/proto/player.go b/legacyver/proto/player.go index 0b91120..7215c26 100644 --- a/legacyver/proto/player.go +++ b/legacyver/proto/player.go @@ -3,6 +3,7 @@ package proto import ( "github.com/google/uuid" "github.com/sandertv/gophertunnel/minecraft/protocol" + "image/color" ) // PlayerListEntry is an entry found in the PlayerList packet. It represents a single player using the UUID @@ -38,7 +39,7 @@ type PlayerListEntry struct { SubClient bool // PlayerColour is the colour of the player that is shown in UI elements, currently only used for the // player locator bar. - PlayerColour int32 + PlayerColour color.RGBA } // Marshal encodes/decodes a PlayerListEntry. @@ -54,7 +55,7 @@ func (x *PlayerListEntry) Marshal(r protocol.IO) { r.Bool(&x.Host) r.Bool(&x.SubClient) if IsProtoGTE(r, ID800) { - r.Int32(&x.PlayerColour) + r.ARGB(&x.PlayerColour) } }