Class LargeDirectFramebuffer
java.lang.Object
net.minestom.server.map.framebuffers.LargeDirectFramebuffer
- All Implemented Interfaces:
LargeFramebuffer
LargeFramebuffer with direct access to the colors array.
This implementation does not throw errors when accessing out-of-bounds coordinates through sub-views, and will instead
use MapColors.NONE. This is only the case for sub-views, access through setMapColor(int, int, byte)
and getMapColor(int, int) will throw an exception if out-of-bounds coordinates are inputted.
-
Constructor Summary
ConstructorsConstructorDescriptionLargeDirectFramebuffer(int width, int height) Creates a newLargeDirectFramebufferwith the desired size -
Method Summary
Modifier and TypeMethodDescriptioncreateSubView(int left, int top) Returns a newFramebufferthat represent a 128x128 sub-view of this framebuffer.byte[]bytegetMapColor(int x, int y) intheight()setMapColor(int x, int y, byte color) intwidth()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minestom.server.map.LargeFramebuffer
preparePacket
-
Constructor Details
-
LargeDirectFramebuffer
public LargeDirectFramebuffer(int width, int height) Creates a newLargeDirectFramebufferwith the desired size- Parameters:
width-height-
-
-
Method Details
-
width
public int width()- Specified by:
widthin interfaceLargeFramebuffer
-
height
public int height()- Specified by:
heightin interfaceLargeFramebuffer
-
createSubView
Description copied from interface:LargeFramebufferReturns a newFramebufferthat represent a 128x128 sub-view of this framebuffer. Implementations are free (but not guaranteed) to throw exceptions if left & top produces out-of-bounds coordinates.- Specified by:
createSubViewin interfaceLargeFramebuffer- Parameters:
left-top-- Returns:
- the sub-view
Framebuffer
-
setMapColor
-
getMapColor
public byte getMapColor(int x, int y) - Specified by:
getMapColorin interfaceLargeFramebuffer
-
getColors
public byte[] getColors()
-