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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic GlowMapCanvas
createAndRender
(org.bukkit.map.MapView mapView, org.bukkit.entity.Player player) Creates a new GlowMapCanvas for the givenMapView
and applies all updates seen by the given player.void
void
byte
getBasePixel
(int x, int y) @NotNull Color
getBasePixelColor
(int x, int y) protected byte[]
org.bukkit.map.MapCursorCollection
org.bukkit.map.MapView
byte
getPixel
(int x, int y) @NotNull Color
getPixelColor
(int x, int y) protected void
setBase
(byte... base) void
setCursors
(org.bukkit.map.MapCursorCollection cursors) void
setPixel
(int x, int y, byte color) void
setPixelColor
(int x, int y, @NotNull Color color) Converts a snapshot of this canvas to aMapDataMessage.Section
for transmission to the client.void
update
(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 givenMapView
and applies all updates seen by the given player.- Parameters:
mapView
- TheMapView
to 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)
-
setPixelColor
- Specified by:
setPixelColor
in interfaceorg.bukkit.map.MapCanvas
-
getPixelColor
- Specified by:
getPixelColor
in interfaceorg.bukkit.map.MapCanvas
-
getBasePixelColor
- Specified by:
getBasePixelColor
in interfaceorg.bukkit.map.MapCanvas
-
setPixel
public void setPixel(int x, int y, byte color) - Specified by:
setPixel
in interfaceorg.bukkit.map.MapCanvas
-
getPixel
public byte getPixel(int x, int y) - Specified by:
getPixel
in interfaceorg.bukkit.map.MapCanvas
-
getBasePixel
public byte getBasePixel(int x, int y) - Specified by:
getBasePixel
in interfaceorg.bukkit.map.MapCanvas
-
setBase
protected void setBase(byte... base) -
drawImage
- Specified by:
drawImage
in interfaceorg.bukkit.map.MapCanvas
-
drawText
- Specified by:
drawText
in interfaceorg.bukkit.map.MapCanvas
-
toSection
Converts a snapshot of this canvas to aMapDataMessage.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 interfaceorg.bukkit.map.MapCanvas
-
getCursors
public org.bukkit.map.MapCursorCollection getCursors()- Specified by:
getCursors
in interfaceorg.bukkit.map.MapCanvas
-
setCursors
public void setCursors(org.bukkit.map.MapCursorCollection cursors) - Specified by:
setCursors
in interfaceorg.bukkit.map.MapCanvas
-