Java 类org.bukkit.map.MapCursorCollection 实例源码

项目:Uranium    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (UUID key : worldMap.playersVisibleOnMap.keySet()) { // Spigot string -> uuid
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayer(key); // Spigot
        if (other != null && !player.canSee(other)) {
            continue;
        }

        net.minecraft.world.storage.MapData.MapCoord decoration = (net.minecraft.world.storage.MapData.MapCoord) worldMap.playersVisibleOnMap.get(key);
        cursors.addCursor(decoration.centerX, decoration.centerZ, (byte) (decoration.iconRotation & 15), decoration.iconSize);
    }
}
项目:ThermosRebased    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Object key : worldMap.playersVisibleOnMap.keySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayerExact((String) key);
        if (other != null && !player.canSee(other)) {
            continue;
        }

        net.minecraft.world.storage.MapData.MapCoord decoration = (net.minecraft.world.storage.MapData.MapCoord) worldMap.playersVisibleOnMap.get(key);
        cursors.addCursor(decoration.centerX, decoration.centerZ, (byte) (decoration.iconRotation & 15), decoration.iconSize);
    }
}
项目:KCauldron    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Map.Entry<UUID, MapData.MapCoord> key : worldMap.playersVisibleOnMap.entrySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayer(key.getKey());
        if (other != null && !player.canSee(other)) {
            continue;
        }

        MapData.MapCoord decoration = key.getValue();
        cursors.addCursor(decoration.centerX, decoration.centerZ, (byte) (decoration.iconRotation & 15), decoration.iconSize);
    }
}
项目:CauldronGit    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Object key : worldMap.playersVisibleOnMap.keySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayerExact((String) key);
        if (other != null && !player.canSee(other)) {
            continue;
        }

        net.minecraft.world.storage.MapData.MapCoord decoration = (net.minecraft.world.storage.MapData.MapCoord) worldMap.playersVisibleOnMap.get(key);
        cursors.addCursor(decoration.centerX, decoration.centerZ, (byte) (decoration.iconRotation & 15), decoration.iconSize);
    }
}
项目:Cauldron-Old    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Object key : worldMap.playersVisibleOnMap.keySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayerExact((String) key);
        if (other != null && !player.canSee(other)) {
            continue;
        }

        net.minecraft.world.storage.MapData.MapCoord decoration = (net.minecraft.world.storage.MapData.MapCoord) worldMap.playersVisibleOnMap.get(key);
        cursors.addCursor(decoration.centerX, decoration.centerZ, (byte) (decoration.iconRotation & 15), decoration.iconSize);
    }
}
项目:Cauldron-Reloaded    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Object key : worldMap.playersVisibleOnMap.keySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayerExact((String) key);
        if (other != null && !player.canSee(other)) {
            continue;
        }

        net.minecraft.world.storage.MapData.MapCoord decoration = (net.minecraft.world.storage.MapData.MapCoord) worldMap.playersVisibleOnMap.get(key);
        cursors.addCursor(decoration.centerX, decoration.centerZ, (byte) (decoration.iconRotation & 15), decoration.iconSize);
    }
}
项目:FFoKC    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Object key : worldMap.playersVisibleOnMap.keySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayerExact((String) key);
        if (other != null && !player.canSee(other)) {
            continue;
        }

        net.minecraft.world.storage.MapData.MapCoord decoration = (net.minecraft.world.storage.MapData.MapCoord) worldMap.playersVisibleOnMap.get(key);
        cursors.addCursor(decoration.centerX, decoration.centerZ, (byte) (decoration.iconRotation & 15), decoration.iconSize);
    }
}
项目:CraftBukkit    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Object key : worldMap.decorations.keySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayerExact((String) key);
        if (other != null && !player.canSee(other)) {
            continue;
        }

        WorldMapDecoration decoration = (WorldMapDecoration) worldMap.decorations.get(key);
        cursors.addCursor(decoration.locX, decoration.locY, (byte) (decoration.rotation & 15), decoration.type);
    }
}
项目:Almura-Server    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Object key : worldMap.g.keySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayerExact((String) key);
        if (other != null && !player.canSee(other)) {
            continue;
        }

        WorldMapDecoration decoration = (WorldMapDecoration) worldMap.g.get(key);
        cursors.addCursor(decoration.locX, decoration.locY, (byte) (decoration.rotation & 15), decoration.type);
    }
}
项目:Tweakkit-Server    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Object key : worldMap.decorations.keySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayerExact((String) key);
        if (other != null && !player.canSee(other)) {
            continue;
        }

        WorldMapDecoration decoration = (WorldMapDecoration) worldMap.decorations.get(key);
        cursors.addCursor(decoration.locX, decoration.locY, (byte) (decoration.rotation & 15), decoration.type);
    }
}
项目:Cauldron    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Object key : worldMap.playersVisibleOnMap.keySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayerExact((String) key);
        if (other != null && !player.canSee(other)) {
            continue;
        }

        net.minecraft.world.storage.MapData.MapCoord decoration = (net.minecraft.world.storage.MapData.MapCoord) worldMap.playersVisibleOnMap.get(key);
        cursors.addCursor(decoration.centerX, decoration.centerZ, (byte) (decoration.iconRotation & 15), decoration.iconSize);
    }
}
项目:SpigotSource    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (UUID key : worldMap.decorations.keySet()) { // Spigot string -> uuid.
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayer(key); // Spigot
        if (other != null && !player.canSee(other)) {
            continue;
        }

        MapIcon decoration = (MapIcon) worldMap.decorations.get(key);
        cursors.addCursor(decoration.getX(), decoration.getY(), (byte) (decoration.getRotation() & 15), decoration.getType());
    }
}
项目:Craft-city    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Object key : worldMap.g.keySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayerExact((String) key);
        if (other != null && !player.canSee(other)) {
            continue;
        }

        WorldMapDecoration decoration = (WorldMapDecoration) worldMap.g.get(key);
        cursors.addCursor(decoration.locX, decoration.locY, (byte) (decoration.rotation & 15), decoration.type);
    }
}
项目:MCPBukkit    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.field_76198_e[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Object key : worldMap.field_76203_h.keySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayerExact((String) key);
        if (other != null && !player.canSee(other)) {
            continue;
        }

        net.minecraft.world.storage.MapCoord decoration = (net.minecraft.world.storage.MapCoord) worldMap.field_76203_h.get(key);
        cursors.addCursor(decoration.field_76214_b, decoration.field_76215_c, (byte) (decoration.field_76212_d & 15), (byte) (decoration.field_76216_a));
    }
}
项目:Skellett    文件:ExprMapCursors.java   
@Override
@Nullable
protected MapCursor[] get(Event e) {
    ArrayList<MapCursor> cursors = new ArrayList<MapCursor>();
    MapCursorCollection collection = SkellettMapRenderer.getCanvas(map.getSingle(e)).getCursors();
    for (int i = 0; i < collection.size(); i++) {
        cursors.add(collection.getCursor(i));
    }
    return cursors.toArray(new MapCursor[cursors.size()]);
}
项目:Thermos    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    if(CauldronCommand.debug) {
    System.out.println("Default Map Render called!");
    for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
        System.out.println(ste);
    } }


    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (UUID key : worldMap.playersVisibleOnMap.keySet()) { // Spigot string -> uuid
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayer(key); // Spigot
        if (other != null && !player.canSee(other)) {
            continue;
        }

        net.minecraft.world.storage.MapData.MapCoord decoration = (net.minecraft.world.storage.MapData.MapCoord) worldMap.playersVisibleOnMap.get(key);
        cursors.addCursor(decoration.centerX, decoration.centerZ, (byte) (decoration.iconRotation & 15), decoration.iconSize);
    }
}
项目:beaconz    文件:TerritoryMapRenderer.java   
/**
 * Places the beacon cursors on the map
 * @param canvas
 * @param coordConverter
 * @param cursors
 * @param showUnclaimedBeacons
 */
@SuppressWarnings("deprecation")
private void setCursors(MapCanvas canvas, MapCoordinateConverter coordConverter, MapCursorCollection cursors, boolean showUnclaimedBeacons) {
    for (int i = 0; i < cursors.size(); i++) {
        cursors.removeCursor(cursors.getCursor(i));
    }
    for (Map.Entry<Point2D, CachedBeacon> entry : beaconRegisterCache.entrySet()) {
        Team team = entry.getValue().owner;
        if (!showUnclaimedBeacons && team == null) continue;
        Point2D point = entry.getKey();
        int x = coordConverter.blockXToPixelX((int) point.getX());
        if (x < 0 || x > 127) continue;
        int z = coordConverter.blockZToPixelZ((int) point.getY());
        if (z < 0 || z > 127) continue;
        // Only add cursors to the portion of the map that has been discovered
        if (canvas.getBasePixel(x, z) != 0) {
            x = x * 2 - 128; // Pixels range from 0 to 127, but cursors range from -128 to 127. (wtf)
            z = z * 2 - 128;
            int color = 16;
            if (team != null) {
                Scorecard sc = beaconz.getGameMgr().getSC(point);
                if (sc != null && sc.getBlockID(team) != null) {
                    color = sc.getBlockID(team).getData();
                }
            }
            TeamCursor teamCursor = TEAM_CURSORS[color];
            MapCursor cursor = cursors.addCursor(x, z, (byte)0);
            cursor.setDirection(teamCursor.direction);
            cursor.setType(teamCursor.type);
        }
    }
}
项目:Craftbukkit    文件:CraftMapRenderer.java   
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
    // Map
    for (int x = 0; x < 128; ++x) {
        for (int y = 0; y < 128; ++y) {
            canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
        }
    }

    // Cursors
    MapCursorCollection cursors = canvas.getCursors();
    while (cursors.size() > 0) {
        cursors.removeCursor(cursors.getCursor(0));
    }

    for (Object key : worldMap.decorations.keySet()) {
        // If this cursor is for a player check visibility with vanish system
        Player other = Bukkit.getPlayerExact((String) key);
        if (other != null && !player.canSee(other)) {
            continue;
        }


        MapIcon decoration = (MapIcon) worldMap.decorations.get(key);
        cursors.addCursor(decoration.getX(), decoration.getY(), (byte) (decoration.getRotation() & 15), decoration.getType());
    }
}
项目:Uranium    文件:CraftMapCanvas.java   
public MapCursorCollection getCursors() {
    return cursors;
}
项目:Uranium    文件:CraftMapCanvas.java   
public void setCursors(MapCursorCollection cursors) {
    this.cursors = cursors;
}
项目:ThermosRebased    文件:CraftMapCanvas.java   
public MapCursorCollection getCursors() {
    return cursors;
}
项目:ThermosRebased    文件:CraftMapCanvas.java   
public void setCursors(MapCursorCollection cursors) {
    this.cursors = cursors;
}
项目:Thermos    文件:CraftMapCanvas.java   
public MapCursorCollection getCursors() {
    return cursors;
}
项目:Thermos    文件:CraftMapCanvas.java   
public void setCursors(MapCursorCollection cursors) {
    this.cursors = cursors;
}
项目:KCauldron    文件:CraftMapCanvas.java   
public MapCursorCollection getCursors() {
    return cursors;
}
项目:KCauldron    文件:CraftMapCanvas.java   
public void setCursors(MapCursorCollection cursors) {
    this.cursors = cursors;
}
项目:CauldronGit    文件:CraftMapCanvas.java   
public MapCursorCollection getCursors() {
    return cursors;
}
项目:CauldronGit    文件:CraftMapCanvas.java   
public void setCursors(MapCursorCollection cursors) {
    this.cursors = cursors;
}
项目:Cauldron-Old    文件:CraftMapCanvas.java   
public MapCursorCollection getCursors() {
    return cursors;
}
项目:Cauldron-Old    文件:CraftMapCanvas.java   
public void setCursors(MapCursorCollection cursors) {
    this.cursors = cursors;
}
项目:Cauldron-Reloaded    文件:CraftMapCanvas.java   
public MapCursorCollection getCursors() {
    return cursors;
}
项目:Cauldron-Reloaded    文件:CraftMapCanvas.java   
public void setCursors(MapCursorCollection cursors) {
    this.cursors = cursors;
}
项目:FFoKC    文件:CraftMapCanvas.java   
public MapCursorCollection getCursors() {
    return cursors;
}
项目:FFoKC    文件:CraftMapCanvas.java   
public void setCursors(MapCursorCollection cursors) {
    this.cursors = cursors;
}
项目:CraftBukkit    文件:CraftMapCanvas.java   
public MapCursorCollection getCursors() {
    return cursors;
}
项目:CraftBukkit    文件:CraftMapCanvas.java   
public void setCursors(MapCursorCollection cursors) {
    this.cursors = cursors;
}
项目:Craftbukkit    文件:CraftMapCanvas.java   
public MapCursorCollection getCursors() {
    return cursors;
}
项目:Craftbukkit    文件:CraftMapCanvas.java   
public void setCursors(MapCursorCollection cursors) {
    this.cursors = cursors;
}
项目:Almura-Server    文件:CraftMapCanvas.java   
public MapCursorCollection getCursors() {
    return cursors;
}
项目:Almura-Server    文件:CraftMapCanvas.java   
public void setCursors(MapCursorCollection cursors) {
    this.cursors = cursors;
}