本文整理汇总了Java中org.bukkit.map.MapCanvas.getCursors方法的典型用法代码示例。如果您正苦于以下问题:Java MapCanvas.getCursors方法的具体用法?Java MapCanvas.getCursors怎么用?Java MapCanvas.getCursors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.map.MapCanvas
的用法示例。
在下文中一共展示了MapCanvas.getCursors方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@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);
}
}
示例2: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@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);
}
}
示例3: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@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);
}
}
示例4: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@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);
}
}
示例5: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@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);
}
}
示例6: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@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());
}
}
示例7: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@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));
}
}
示例8: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@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);
}
}
示例9: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@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());
}
}