@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); } }
@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; }
@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; }
@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; }
@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; }
@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; }
@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); } }
public WorldMap(String s) { super(s); // CraftBukkit start mapView = new CraftMapView(this); server = (CraftServer) org.bukkit.Bukkit.getServer(); // CraftBukkit end }
@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); }
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); } }
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; }
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; }