From c8ccf29f3154299b7f692e75cfe835935e9b8362 Mon Sep 17 00:00:00 2001 From: raven Date: Sun, 22 Mar 2026 15:22:22 -0500 Subject: EnvMapAspect --- classic/ext_env_map_aspect.go | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 classic/ext_env_map_aspect.go (limited to 'classic') diff --git a/classic/ext_env_map_aspect.go b/classic/ext_env_map_aspect.go new file mode 100644 index 0000000..0c2f5e1 --- /dev/null +++ b/classic/ext_env_map_aspect.go @@ -0,0 +1,50 @@ +package classic + +import "bytes" + +type DoubleString [128]byte + +func PadDString(str string) DoubleString { + var pstr DoubleString + copy(pstr[:], []byte(str)) + if len(str) < 64 { + copy(pstr[len(str):], bytes.Repeat([]byte(" "), 128 - len(str))) + } + return pstr +} + +func UnpadDString(pstr DoubleString) string { + return string(bytes.TrimRight(pstr[:], " ")) +} + +func (s DoubleString) String() string { + return UnpadDString(s) +} + +type SetMapEnvUrl struct { + TexturePackUrl DoubleString +} +func (p *SetMapEnvUrl) PacketId() byte { + return 0x28 +} + +const ( + SideBlock = iota + HorizonBlock + EdgeHeight + CloudsHeight + ViewDistance + CloudsSpeed + WeatherSpeed + WeatherFad + ExpFog + SidesEdgeOffset +) + +type SetMapEnvProperty struct { + PropertyType byte + PropertyVal int +} +func (p *SetMapEnvProperty) PacketId() byte { + return 0x29 +} -- cgit v1.2.3