Package net.glowstone.map
Class GlowMapCanvas
java.lang.Object
net.glowstone.map.GlowMapCanvas
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GlowMapCanvascreateAndRender(org.bukkit.map.MapView mapView, org.bukkit.entity.Player player) Creates a new GlowMapCanvas for the givenMapViewand applies all updates seen by the given player.voidvoidbytegetBasePixel(int x, int y) protected byte[]org.bukkit.map.MapCursorCollectionorg.bukkit.map.MapViewbytegetPixel(int x, int y) protected voidsetBase(byte... base) voidsetCursors(org.bukkit.map.MapCursorCollection cursors) voidsetPixel(int x, int y, byte color) Converts a snapshot of this canvas to aMapDataMessage.Sectionfor transmission to the client.voidupdate(org.bukkit.entity.Player player) Applies all updates seen by the given player according to theMapView's renderers.
-
Field Details
-
MAP_SIZE
public static final int MAP_SIZE- See Also:
-
-
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 givenMapViewand applies all updates seen by the given player.- Parameters:
mapView- TheMapViewto associate with this canvas and renderplayer- The player to pass toMapRenderer.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 theMapView's renderers.- Parameters:
player- The player to pass toMapRenderer.render(MapView, MapCanvas, Player)
-
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
protected void setBase(byte... base) -
drawImage
- Specified by:
drawImagein interfaceorg.bukkit.map.MapCanvas
-
drawText
- Specified by:
drawTextin interfaceorg.bukkit.map.MapCanvas
-
toSection
Converts a snapshot of this canvas to aMapDataMessage.Sectionfor transmission to the client.- Returns:
- a
MapDataMessage.Sectionholding a copy of this canvas's contents
-
getBuffer
protected byte[] getBuffer() -
getMapView
public org.bukkit.map.MapView getMapView()- Specified by:
getMapViewin interfaceorg.bukkit.map.MapCanvas
-
getCursors
public org.bukkit.map.MapCursorCollection getCursors()- Specified by:
getCursorsin interfaceorg.bukkit.map.MapCanvas
-
setCursors
public void setCursors(org.bukkit.map.MapCursorCollection cursors) - Specified by:
setCursorsin interfaceorg.bukkit.map.MapCanvas
-