Package be.seeseemelk.mockbukkit.map
Class MapCanvasMock
java.lang.Object
be.seeseemelk.mockbukkit.map.MapCanvasMock
- All Implemented Interfaces:
MapCanvas
Mock implementation of a
MapCanvas.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMapCanvasMock(MapViewMock mapView) Constructs a newMapCanvasMockfor the providedMapViewMock. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidstatic voidexecuteForAllPixels(@NotNull BiConsumer<Integer, Integer> consumer) Runs a Consumer for each pixel coordinate on a map.bytegetBasePixel(int x, int y) @NotNull ColorgetBasePixelColor(int x, int y) @NotNull MapCursorCollection@NotNull MapViewbytegetPixel(int x, int y) @NotNull ColorgetPixelColor(int x, int y) voidsetBase(byte[][] base) Sets the base for use ingetBasePixel(int, int)andgetBasePixelColor(int, int).voidsetCursors(@NotNull MapCursorCollection cursors) voidsetPixel(int x, int y, byte color) voidsetPixelColor(int x, int y, @NotNull Color color)
-
Constructor Details
-
MapCanvasMock
Constructs a newMapCanvasMockfor the providedMapViewMock.- Parameters:
mapView- The map view this canvas is for.
-
-
Method Details
-
getMapView
- Specified by:
getMapViewin interfaceMapCanvas
-
getCursors
- Specified by:
getCursorsin interfaceMapCanvas
-
setCursors
- Specified by:
setCursorsin interfaceMapCanvas
-
setPixelColor
- Specified by:
setPixelColorin interfaceMapCanvas
-
getPixelColor
- Specified by:
getPixelColorin interfaceMapCanvas
-
getBasePixelColor
- Specified by:
getBasePixelColorin interfaceMapCanvas
-
setPixel
public void setPixel(int x, int y, byte color) -
getPixel
public byte getPixel(int x, int y) -
getBasePixel
public byte getBasePixel(int x, int y) - Specified by:
getBasePixelin interfaceMapCanvas
-
setBase
public void setBase(byte[][] base) Sets the base for use ingetBasePixel(int, int)andgetBasePixelColor(int, int).- Parameters:
base- The base to set.- See Also:
-
drawImage
-
drawText
-
executeForAllPixels
Runs a Consumer for each pixel coordinate on a map.- Parameters:
consumer- The consumer to run. First parameter is the X coordinate, second is the Y coordinate.
-