Class LargeDirectFramebuffer
java.lang.Object
net.minestom.server.map.framebuffers.LargeDirectFramebuffer
- All Implemented Interfaces:
LargeFramebuffer
public class LargeDirectFramebuffer extends java.lang.Object implements 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
Constructors Constructor Description LargeDirectFramebuffer(int width, int height)
Creates a newLargeDirectFramebuffer
with the desired size -
Method Summary
Modifier and Type Method Description Framebuffer
createSubView(int left, int top)
Returns a newFramebuffer
that represent a 128x128 sub-view of this framebuffer.byte[]
getColors()
byte
getMapColor(int x, int y)
int
height()
LargeDirectFramebuffer
setMapColor(int x, int y, byte color)
int
width()
-
Constructor Details
-
LargeDirectFramebuffer
public LargeDirectFramebuffer(int width, int height)Creates a newLargeDirectFramebuffer
with the desired size- Parameters:
width
-height
-
-
-
Method Details
-
width
public int width()- Specified by:
width
in interfaceLargeFramebuffer
-
height
public int height()- Specified by:
height
in interfaceLargeFramebuffer
-
createSubView
Description copied from interface:LargeFramebuffer
Returns a newFramebuffer
that 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:
createSubView
in interfaceLargeFramebuffer
- Returns:
- the sub-view
Framebuffer
-
setMapColor
-
getMapColor
public byte getMapColor(int x, int y)- Specified by:
getMapColor
in interfaceLargeFramebuffer
-
getColors
public byte[] getColors()
-