本文整理汇总了Java中org.bukkit.craftbukkit.map.CraftMapView类的典型用法代码示例。如果您正苦于以下问题:Java CraftMapView类的具体用法?Java CraftMapView怎么用?Java CraftMapView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CraftMapView类属于org.bukkit.craftbukkit.map包,在下文中一共展示了CraftMapView类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendMap
import org.bukkit.craftbukkit.map.CraftMapView; //导入依赖的package包/类
@Override
public void sendMap(MapView map) {
if (getHandle().playerNetServerHandler == null) return;
RenderData data = ((CraftMapView) map).render(this);
for (int x = 0; x < 128; ++x) {
byte[] bytes = new byte[131];
bytes[1] = (byte) x;
for (int y = 0; y < 128; ++y) {
bytes[y + 3] = data.buffer[y * 128 + x];
}
net.minecraft.network.play.server.S34PacketMaps packet = new net.minecraft.network.play.server.S34PacketMaps(map.getId(), bytes);
getHandle().playerNetServerHandler.sendPacket(packet);
}
}
示例2: getMap
import org.bukkit.craftbukkit.map.CraftMapView; //导入依赖的package包/类
@Override
@Deprecated
public CraftMapView getMap(short id) {
net.minecraft.world.storage.MapStorage collection = console.worlds.get(0).mapStorage;
net.minecraft.world.storage.MapData worldmap = (net.minecraft.world.storage.MapData) collection.loadData(net.minecraft.world.storage.MapData.class, "map_" + id);
if (worldmap == null) {
return null;
}
return worldmap.mapView;
}
示例3: createMap
import org.bukkit.craftbukkit.map.CraftMapView; //导入依赖的package包/类
@Override
public CraftMapView createMap(World world) {
Validate.notNull(world, "World cannot be null");
net.minecraft.item.ItemStack stack = new net.minecraft.item.ItemStack(net.minecraft.init.Items.filled_map, 1, -1);
net.minecraft.world.storage.MapData worldmap = net.minecraft.init.Items.filled_map.getMapData(stack, ((CraftWorld) world).getHandle());
return worldmap.mapView;
}
示例4: getMap
import org.bukkit.craftbukkit.map.CraftMapView; //导入依赖的package包/类
@Override
@Deprecated
public CraftMapView getMap(short id) {
PersistentCollection collection = console.worlds.get(0).worldMaps;
WorldMap worldmap = (WorldMap) collection.get(WorldMap.class, "map_" + id);
if (worldmap == null) {
return null;
}
return worldmap.mapView;
}
示例5: createMap
import org.bukkit.craftbukkit.map.CraftMapView; //导入依赖的package包/类
@Override
public CraftMapView createMap(World world) {
Validate.notNull(world, "World cannot be null");
net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(Items.MAP, 1, -1);
WorldMap worldmap = Items.FILLED_MAP.getSavedMap(stack, ((CraftWorld) world).getHandle());
return worldmap.mapView;
}
示例6: createMap
import org.bukkit.craftbukkit.map.CraftMapView; //导入依赖的package包/类
@Override
public CraftMapView createMap(World world) {
Validate.notNull(world, "World cannot be null");
net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(Items.MAP, 1, -1);
WorldMap worldmap = Items.MAP.getSavedMap(stack, ((CraftWorld) world).getHandle());
return worldmap.mapView;
}
示例7: sendMap
import org.bukkit.craftbukkit.map.CraftMapView; //导入依赖的package包/类
@Override
public void sendMap(MapView map) {
if (getHandle().playerConnection == null) return;
RenderData data = ((CraftMapView) map).render(this);
for (int x = 0; x < 128; ++x) {
byte[] bytes = new byte[131];
bytes[1] = (byte) x;
for (int y = 0; y < 128; ++y) {
bytes[y + 3] = data.buffer[y * 128 + x];
}
PacketPlayOutMap packet = new PacketPlayOutMap(map.getId(), bytes);
getHandle().playerConnection.sendPacket(packet);
}
}
示例8: WorldMap
import org.bukkit.craftbukkit.map.CraftMapView; //导入依赖的package包/类
public WorldMap(String s) {
super(s);
// CraftBukkit start
mapView = new CraftMapView(this);
server = (CraftServer) org.bukkit.Bukkit.getServer();
// CraftBukkit end
}
示例9: sendMap
import org.bukkit.craftbukkit.map.CraftMapView; //导入依赖的package包/类
@Override
public void sendMap(MapView map) {
if (getHandle().playerConnection == null) return;
RenderData data = ((CraftMapView) map).render(this);
Collection<MapIcon> icons = new ArrayList<MapIcon>();
for (MapCursor cursor : data.cursors) {
if (cursor.isVisible()) {
icons.add(new MapIcon(cursor.getRawType(), cursor.getX(), cursor.getY(), cursor.getDirection()));
}
}
PacketPlayOutMap packet = new PacketPlayOutMap(map.getId(), map.getScale().getValue(), icons, data.buffer, 0, 0, 0, 0);
getHandle().playerConnection.sendPacket(packet);
}
示例10: sendMap
import org.bukkit.craftbukkit.map.CraftMapView; //导入依赖的package包/类
public void sendMap(MapView map) {
if (getHandle().playerConnection == null) return;
RenderData data = ((CraftMapView) map).render(this);
for (int x = 0; x < 128; ++x) {
byte[] bytes = new byte[131];
bytes[1] = (byte) x;
for (int y = 0; y < 128; ++y) {
bytes[y + 3] = data.buffer[y * 128 + x];
}
Packet131ItemData packet = new Packet131ItemData((short) Material.MAP.getId(), map.getId(), bytes);
getHandle().playerConnection.sendPacket(packet);
}
}
示例11: getMap
import org.bukkit.craftbukkit.map.CraftMapView; //导入依赖的package包/类
public CraftMapView getMap(short id) {
WorldMapCollection collection = console.worlds.get(0).worldMaps;
WorldMap worldmap = (WorldMap) collection.get(WorldMap.class, "map_" + id);
if (worldmap == null) {
return null;
}
return worldmap.mapView;
}
示例12: createMap
import org.bukkit.craftbukkit.map.CraftMapView; //导入依赖的package包/类
public CraftMapView createMap(World world) {
Validate.notNull(world, "World cannot be null");
net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(Item.MAP, 1, -1);
WorldMap worldmap = Item.MAP.getSavedMap(stack, ((CraftWorld) world).getHandle());
return worldmap.mapView;
}