Class MapCanvasMock

java.lang.Object
be.seeseemelk.mockbukkit.map.MapCanvasMock
All Implemented Interfaces:
org.bukkit.map.MapCanvas

public class MapCanvasMock extends Object implements org.bukkit.map.MapCanvas
Mock implementation of a MapCanvas.
  • Constructor Details

    • MapCanvasMock

      protected MapCanvasMock(MapViewMock mapView)
      Constructs a new MapCanvasMock for the provided MapViewMock.
      Parameters:
      mapView - The map view this canvas is for.
  • Method Details

    • getMapView

      @NotNull public @NotNull org.bukkit.map.MapView getMapView()
      Specified by:
      getMapView in interface org.bukkit.map.MapCanvas
    • getCursors

      @NotNull public @NotNull org.bukkit.map.MapCursorCollection getCursors()
      Specified by:
      getCursors in interface org.bukkit.map.MapCanvas
    • setCursors

      public void setCursors(@NotNull @NotNull org.bukkit.map.MapCursorCollection cursors)
      Specified by:
      setCursors in interface org.bukkit.map.MapCanvas
    • setPixelColor

      public void setPixelColor(int x, int y, @NotNull @NotNull Color color)
      Specified by:
      setPixelColor in interface org.bukkit.map.MapCanvas
    • getPixelColor

      @NotNull public @NotNull Color getPixelColor(int x, int y)
      Specified by:
      getPixelColor in interface org.bukkit.map.MapCanvas
    • getBasePixelColor

      @NotNull public @NotNull Color getBasePixelColor(int x, int y)
      Specified by:
      getBasePixelColor in interface org.bukkit.map.MapCanvas
    • setPixel

      public void setPixel(int x, int y, byte color)
      Specified by:
      setPixel in interface org.bukkit.map.MapCanvas
    • getPixel

      public byte getPixel(int x, int y)
      Specified by:
      getPixel in interface org.bukkit.map.MapCanvas
    • getBasePixel

      public byte getBasePixel(int x, int y)
      Specified by:
      getBasePixel in interface org.bukkit.map.MapCanvas
    • setBase

      public void setBase(byte[][] base)
      Parameters:
      base - The base to set.
      See Also:
    • drawImage

      public void drawImage(int x, int y, @NotNull @NotNull Image image)
      Specified by:
      drawImage in interface org.bukkit.map.MapCanvas
    • drawText

      public void drawText(int x, int y, @NotNull @NotNull org.bukkit.map.MapFont font, @NotNull @NotNull String text)
      Specified by:
      drawText in interface org.bukkit.map.MapCanvas
    • executeForAllPixels

      public static void executeForAllPixels(@NotNull @NotNull BiConsumer<Integer,Integer> consumer)
      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.