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
ConstructorDescriptionLargeDirectFramebuffer
(int width, int height) Creates a newLargeDirectFramebuffer
with the desired size -
Method Summary
Modifier and TypeMethodDescriptioncreateSubView
(int left, int top) Returns a newFramebuffer
that represent a 128x128 sub-view of this framebuffer.byte[]
byte
getMapColor
(int x, int y) int
height()
setMapColor
(int x, int y, byte color) int
width()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minestom.server.map.LargeFramebuffer
preparePacket
-
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
- Parameters:
left
-top
-- Returns:
- the sub-view
Framebuffer
-
setMapColor
-
getMapColor
public byte getMapColor(int x, int y) - Specified by:
getMapColor
in interfaceLargeFramebuffer
-
getColors
public byte[] getColors()
-