Added API for manipulating map items. Thanks SpaceManiac, codename_B, sk89q and dested!
By: EvilSeph <evilseph@gmail.com>
This commit is contained in:
50
paper-api/src/main/java/org/bukkit/map/MapRenderer.java
Normal file
50
paper-api/src/main/java/org/bukkit/map/MapRenderer.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package org.bukkit.map;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Represents a renderer for a map.
|
||||
*/
|
||||
public abstract class MapRenderer {
|
||||
|
||||
private boolean contextual;
|
||||
|
||||
/**
|
||||
* Initialize the map renderer base to be non-contextual. See {@link isContextual}.
|
||||
*/
|
||||
public MapRenderer() {
|
||||
this(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the map renderer base with the given contextual status.
|
||||
* @param contextual Whether the renderer is contextual. See {@link isContextual}.
|
||||
*/
|
||||
public MapRenderer(boolean contextual) {
|
||||
this.contextual = contextual;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get whether the renderer is contextual, i.e. has different canvases for
|
||||
* different players.
|
||||
* @return True if contextual, false otherwise.
|
||||
*/
|
||||
final public boolean isContextual() {
|
||||
return contextual;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize this MapRenderer for the given map.
|
||||
* @param map The MapView being initialized.
|
||||
*/
|
||||
public void initialize(MapView map) { }
|
||||
|
||||
/**
|
||||
* Render to the given map.
|
||||
* @param map The MapView being rendered to.
|
||||
* @param canvas The canvas to use for rendering.
|
||||
* @param player The player who triggered the rendering.
|
||||
*/
|
||||
abstract public void render(MapView map, MapCanvas canvas, Player player);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user