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


Java RenderData类代码示例

本文整理汇总了Java中org.bukkit.craftbukkit.map.RenderData的典型用法代码示例。如果您正苦于以下问题:Java RenderData类的具体用法?Java RenderData怎么用?Java RenderData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RenderData类属于org.bukkit.craftbukkit.map包,在下文中一共展示了RenderData类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendMap

import org.bukkit.craftbukkit.map.RenderData; //导入依赖的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: sendMap

import org.bukkit.craftbukkit.map.RenderData; //导入依赖的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

示例3: sendMap

import org.bukkit.craftbukkit.map.RenderData; //导入依赖的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

示例4: sendMap

import org.bukkit.craftbukkit.map.RenderData; //导入依赖的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

示例5: sendMap

import org.bukkit.craftbukkit.map.RenderData; //导入依赖的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(), true, icons, data.buffer, 0, 0, 0, 0);
    getHandle().playerConnection.sendPacket(packet);
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:16,代码来源:CraftPlayer.java

示例6: sendMap

import org.bukkit.craftbukkit.map.RenderData; //导入依赖的package包/类
public void sendMap(MapView map) {
    if (getHandle().field_71135_a == 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.packet.Packet131MapData packet = new net.minecraft.network.packet.Packet131MapData((short) Material.MAP.getId(), map.getId(), bytes);
        getHandle().field_71135_a.func_72567_b(packet);
    }
}
 
开发者ID:agaricusb,项目名称:MCPBukkit,代码行数:15,代码来源:CraftPlayer.java


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