Open diamonddevv opened 5 months ago
The maps protocol works like this: each map has an integer id, and when a client receives this ID in the item data (1.20.5+ minecraft:map_id
), it requests the map data from the server. The server responds with NBT that lists every pixel and its RGB value.
Here's what Luafy needs to extend:
Luafy.create_map_image
, this method will return a symbolic script object for unique map integer IDs, (starting at 1,000,000
to avoid collisions), that you can then access with MapScriptObject.ids
(an ordered list) & width
/ height
. This method will also have an option to scale the image with either bilinear or nearest neighbor, defaulting to converting the entire image. Internally, Luafy will:
create_map_data
is called or the client requests it)Prior Art: an external tool (some of the relevant code here), a server mod by Patbox
Apply an image loaded as a static resource to a map item. Not too sure how to tackle this.