当前位置: 首页>>代码示例>>Java>>正文


Java CraftMapView类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:16,代码来源:CraftPlayer.java

示例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;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:11,代码来源:CraftServer.java

示例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;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:9,代码来源:CraftServer.java

示例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;
}
 
开发者ID:Techcable,项目名称:DiffUtils,代码行数:11,代码来源:CraftServer_188.java

示例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;
}
 
开发者ID:Techcable,项目名称:DiffUtils,代码行数:9,代码来源:CraftServer_188.java

示例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;
}
 
开发者ID:Techcable,项目名称:DiffUtils,代码行数:9,代码来源:CraftServer_1710.java

示例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);
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:16,代码来源:CraftPlayer.java

示例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
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:8,代码来源:WorldMap.java

示例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);
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:16,代码来源:CraftPlayer.java

示例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);
    }
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:15,代码来源:CraftPlayer.java

示例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;
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:9,代码来源:CraftServer.java

示例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;
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:8,代码来源:CraftServer.java


注:本文中的org.bukkit.craftbukkit.map.CraftMapView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。