Package be.seeseemelk.mockbukkit.map
Class MapCanvasMock
java.lang.Object
be.seeseemelk.mockbukkit.map.MapCanvasMock
- All Implemented Interfaces:
org.bukkit.map.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 org.bukkit.map.MapCursorCollection@NotNull org.bukkit.map.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 org.bukkit.map.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
@NotNull public @NotNull org.bukkit.map.MapView getMapView()- Specified by:
getMapViewin interfaceorg.bukkit.map.MapCanvas
-
getCursors
@NotNull public @NotNull org.bukkit.map.MapCursorCollection getCursors()- Specified by:
getCursorsin interfaceorg.bukkit.map.MapCanvas
-
setCursors
public void setCursors(@NotNull @NotNull org.bukkit.map.MapCursorCollection cursors) - Specified by:
setCursorsin interfaceorg.bukkit.map.MapCanvas
-
setPixelColor
- Specified by:
setPixelColorin interfaceorg.bukkit.map.MapCanvas
-
getPixelColor
- Specified by:
getPixelColorin interfaceorg.bukkit.map.MapCanvas
-
getBasePixelColor
- Specified by:
getBasePixelColorin interfaceorg.bukkit.map.MapCanvas
-
setPixel
public void setPixel(int x, int y, byte color) - Specified by:
setPixelin interfaceorg.bukkit.map.MapCanvas
-
getPixel
public byte getPixel(int x, int y) - Specified by:
getPixelin interfaceorg.bukkit.map.MapCanvas
-
getBasePixel
public byte getBasePixel(int x, int y) - Specified by:
getBasePixelin interfaceorg.bukkit.map.MapCanvas
-
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
- Specified by:
drawImagein interfaceorg.bukkit.map.MapCanvas
-
drawText
public void drawText(int x, int y, @NotNull @NotNull org.bukkit.map.MapFont font, @NotNull @NotNull String text) - Specified by:
drawTextin interfaceorg.bukkit.map.MapCanvas
-
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.
-