org.bukkit.map.MapRenderer Java Examples

The following examples show how to use org.bukkit.map.MapRenderer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CraftMapView.java    From Kettle with GNU General Public License v3.0 6 votes vote down vote up
public boolean removeRenderer(MapRenderer renderer) {
    if (renderers.contains(renderer)) {
        renderers.remove(renderer);
        for (Map.Entry<CraftPlayer, CraftMapCanvas> entry : canvases.get(renderer).entrySet()) {
            for (int x = 0; x < 128; ++x) {
                for (int y = 0; y < 128; ++y) {
                    entry.getValue().setPixel(x, y, (byte) -1);
                }
            }
        }
        canvases.remove(renderer);
        return true;
    } else {
        return false;
    }
}
 
Example #2
Source File: CraftMapView.java    From Thermos with GNU General Public License v3.0 6 votes vote down vote up
public boolean removeRenderer(MapRenderer renderer) {
    if (renderers.contains(renderer)) {
        renderers.remove(renderer);
        for (Map.Entry<CraftPlayer, CraftMapCanvas> entry : canvases.get(renderer).entrySet()) {
            for (int x = 0; x < 128; ++x) {
                for (int y = 0; y < 128; ++y) {
                    entry.getValue().setPixel(x, y, (byte) -1);
                }
            }
        }
        canvases.remove(renderer);
        return true;
    } else {
        return false;
    }
}
 
Example #3
Source File: CraftMapView.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
public void addRenderer(MapRenderer renderer) {
    if (!renderers.contains(renderer)) {
        renderers.add(renderer);
        canvases.put(renderer, new HashMap<CraftPlayer, CraftMapCanvas>());
        renderer.initialize(this);
    }
}
 
Example #4
Source File: CraftMapView.java    From Thermos with GNU General Public License v3.0 5 votes vote down vote up
public void addRenderer(MapRenderer renderer) {
    if (!renderers.contains(renderer)) {
        renderers.add(renderer);
        canvases.put(renderer, new HashMap<CraftPlayer, CraftMapCanvas>());
        renderer.initialize(this);
    }
}
 
Example #5
Source File: CraftMapView.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public List<MapRenderer> getRenderers() {
    return new ArrayList<MapRenderer>(renderers);
}
 
Example #6
Source File: CraftMapView.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
private boolean isContextual() {
    for (MapRenderer renderer : renderers) {
        if (renderer.isContextual()) return true;
    }
    return false;
}
 
Example #7
Source File: CraftMapView.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
public List<MapRenderer> getRenderers() {
    return new ArrayList<MapRenderer>(renderers);
}
 
Example #8
Source File: CraftMapView.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
private boolean isContextual() {
    for (MapRenderer renderer : renderers) {
        if (renderer.isContextual()) return true;
    }
    return false;
}