summaryrefslogtreecommitdiff
path: root/serialize.fmt
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-08-23 11:38:14 +0200
committerHimbeer <himbeer@disroot.org>2024-08-23 11:38:14 +0200
commit8e6a5a093473718d34a10180d4efcdc3d9dbe918 (patch)
treece72065e1404099fb736f36e650c11d71b59afc6 /serialize.fmt
parent3b78a789bb205356c3aff64926f8699070db7a61 (diff)
Switch to Minetest 5.9.0
Diffstat (limited to 'serialize.fmt')
-rw-r--r--serialize.fmt25
1 files changed, 25 insertions, 0 deletions
diff --git a/serialize.fmt b/serialize.fmt
index 8215651..d79f7db 100644
--- a/serialize.fmt
+++ b/serialize.fmt
@@ -155,3 +155,28 @@ PointedThing chk(writePointedThing(w, x))
_, err := b.WriteTo(w)
chk(err)
}
+
+map[string]PointabilityType { // For Pointabilities.
+ if len(x) > math.MaxUint32 {
+ chk(ErrTooLong)
+ }
+ write32(w, uint32(len(x)))
+ for name, typ := range x {
+ if len(name) > math.MaxUint16 {
+ chk(ErrTooLong)
+ }
+ chk(serialize(w, name))
+ write8(w, uint8(typ))
+ }
+ }
+
+map[float32]image/color.NRGBA { // For WearBarParams.ColorStops.
+ if len(x) > math.MaxUint16 {
+ chk(ErrTooLong)
+ }
+ write16(w, uint16(len(x)))
+ for wear, colorStop := range x {
+ write32(w, uint32(wear))
+ chk(serialize(w, colorStop))
+ }
+ }