MapDataPacket
:mapId
is an int
to be able to reference which map to change.data
is a byte[]
array which holds the indices inside the color palette. Its size should be at least rows*columns
.x
is an unsigned byte (stored inside a short
) which represents the X coordinate of the left-most pixel to write. Ranges from 0 to 127 (inclusive).y
is an unsigned byte (stored inside a short
) which represents the Y coordinate of the top-most pixel to write. Ranges from 0 to 127 (inclusive).rows
is an unsigned byte (stored inside a short
) which represents the number of rows to update.columns
is an unsigned byte (stored inside a short
) which represents the number of columns to update.x+width*y
). Attempting to write pixels outside of the 128x128 area WILL crash and/or disconnect the client, so be careful. Minestom does not check which area you are writing to.PlayerConnection#sendPacket(ServerPacket)
Framebuffer
and LargeFramebuffer
. The difference is that Framebuffer
is meant to render to a single map (so resolution limited to 128x128), while LargeFramebuffer
can render to any framebuffer size, by rendering over multiple maps. Large framebuffers offer a method to create Framebuffer
views to help with rendering onto a map.MapDataPacket
for you.DirectFramebuffer
/ LargeDirectFramebuffer
MapDataPacket
. They hold an internal byte[]
representing the colors on the map, which can be accessed and modified through get
and set
respectively. The entire internal buffer is also exposed via getColors()
(you can modify it from the returned value).Graphics2DFramebuffer
/ LargeGraphics2DFramebuffer
Graphics2D
object through getRenderer()
and render your content on it.