Class GlowMapCanvas

java.lang.Object
net.glowstone.map.GlowMapCanvas
All Implemented Interfaces:
org.bukkit.map.MapCanvas

public final class GlowMapCanvas extends Object implements org.bukkit.map.MapCanvas
Represents a canvas for drawing to a map. Each canvas is associated with a specific MapRenderer and represents that renderer's layer on the map.
  • Field Details

  • Constructor Details

    • GlowMapCanvas

      protected GlowMapCanvas(org.bukkit.map.MapView mapView)
  • Method Details

    • createAndRender

      public static GlowMapCanvas createAndRender(org.bukkit.map.MapView mapView, org.bukkit.entity.Player player)
      Creates a new GlowMapCanvas for the given MapView and applies all updates seen by the given player.
      Parameters:
      mapView - The MapView to associate with this canvas and render
      player - The player to pass to MapRenderer.render(MapView, MapCanvas, Player)
      Returns:
      a new, rendered GlowMapCanvas
    • update

      public void update(org.bukkit.entity.Player player)
      Applies all updates seen by the given player according to the MapView's renderers.
      Parameters:
      player - The player to pass to MapRenderer.render(MapView, MapCanvas, Player)
    • 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

      protected void setBase(byte... base)
    • drawImage

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

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

      public MapDataMessage.Section toSection()
      Converts a snapshot of this canvas to a MapDataMessage.Section for transmission to the client.
      Returns:
      a MapDataMessage.Section holding a copy of this canvas's contents
    • getBuffer

      protected byte[] getBuffer()
    • getMapView

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

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

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