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


Java PacketBuffer.writeByte方法代码示例

本文整理汇总了Java中net.minecraft.network.PacketBuffer.writeByte方法的典型用法代码示例。如果您正苦于以下问题:Java PacketBuffer.writeByte方法的具体用法?Java PacketBuffer.writeByte怎么用?Java PacketBuffer.writeByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.network.PacketBuffer的用法示例。


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

示例1: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeVarIntToBuffer(this.mapId);
    buf.writeByte(this.mapScale);
    buf.writeVarIntToBuffer(this.mapVisiblePlayersVec4b.length);

    for (Vec4b vec4b : this.mapVisiblePlayersVec4b)
    {
        buf.writeByte((vec4b.func_176110_a() & 15) << 4 | vec4b.func_176111_d() & 15);
        buf.writeByte(vec4b.func_176112_b());
        buf.writeByte(vec4b.func_176113_c());
    }

    buf.writeByte(this.mapMaxX);

    if (this.mapMaxX > 0)
    {
        buf.writeByte(this.mapMaxY);
        buf.writeByte(this.mapMinX);
        buf.writeByte(this.mapMinY);
        buf.writeByteArray(this.mapDataBytes);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:S34PacketMaps.java

示例2: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeVarIntToBuffer(this.entityId);
    buf.writeByte(this.type);
    buf.writeInt(this.x);
    buf.writeInt(this.y);
    buf.writeInt(this.z);
    buf.writeByte(this.pitch);
    buf.writeByte(this.yaw);
    buf.writeInt(this.field_149020_k);

    if (this.field_149020_k > 0)
    {
        buf.writeShort(this.speedX);
        buf.writeShort(this.speedY);
        buf.writeShort(this.speedZ);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:S0EPacketSpawnObject.java

示例3: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeInt(this.dimensionID);
    buf.writeByte(this.difficulty.getDifficultyId());
    buf.writeByte(this.gameType.getID());
    buf.writeString(this.worldType.getWorldTypeName());
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:SPacketRespawn.java

示例4: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeVarIntToBuffer(this.entityId);
    buf.writeUuid(this.uniqueId);
    buf.writeDouble(this.x);
    buf.writeDouble(this.y);
    buf.writeDouble(this.z);
    buf.writeByte(this.yaw);
    buf.writeByte(this.pitch);
    this.watcher.writeEntries(buf);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:SPacketSpawnPlayer.java

示例5: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public void writePacketData(PacketBuffer buf) throws IOException
{
    super.writePacketData(buf);
    buf.writeByte(this.yaw);
    buf.writeByte(this.pitch);
    buf.writeBoolean(this.onGround);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:8,代码来源:S14PacketEntity.java

示例6: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeBlockPos(this.blockPos);
    buf.writeByte((byte)this.metadata);
    buf.writeNBTTagCompoundToBuffer(this.nbt);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:SPacketUpdateTileEntity.java

示例7: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeString(this.lang);
    buf.writeByte(this.view);
    buf.writeByte(this.chatVisibility.getChatVisibility());
    buf.writeBoolean(this.enableColors);
    buf.writeByte(this.modelPartFlags);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:12,代码来源:C15PacketClientSettings.java

示例8: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeEnumValue(this.status);
    buf.writeBlockPos(this.position);
    buf.writeByte(this.facing.getIndex());
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:10,代码来源:C07PacketPlayerDigging.java

示例9: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeVarIntToBuffer(this.entityID);
    buf.writeString(this.title);
    buf.writeBlockPos(this.position);
    buf.writeByte(this.facing.getHorizontalIndex());
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:11,代码来源:S10PacketSpawnPainting.java

示例10: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeDouble(this.x);
    buf.writeDouble(this.y);
    buf.writeDouble(this.z);
    buf.writeFloat(this.yaw);
    buf.writeFloat(this.pitch);
    buf.writeByte(SPacketPlayerPosLook.EnumFlags.pack(this.flags));
    buf.writeVarIntToBuffer(this.teleportId);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:SPacketPlayerPosLook.java

示例11: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeVarIntToBuffer(this.entityId);
    buf.writeByte(this.type);
    buf.writeInt(this.x);
    buf.writeInt(this.y);
    buf.writeInt(this.z);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:S2CPacketSpawnGlobalEntity.java

示例12: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeBlockPos(this.position);
    buf.writeByte(this.placedBlockDirection);
    buf.writeItemStackToBuffer(this.stack);
    buf.writeByte((int)(this.facingX * 16.0F));
    buf.writeByte((int)(this.facingY * 16.0F));
    buf.writeByte((int)(this.facingZ * 16.0F));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:13,代码来源:C08PacketPlayerBlockPlacement.java

示例13: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
@Override
public void writePacketData(PacketBuffer buf) throws IOException
{
	buf.writeByte(0);
	buf.writeVarIntToBuffer(0);
	buf.writeBoolean(false);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:8,代码来源:CPacketSomethingNew.java

示例14: writeWatchableObjectToPacketBuffer

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes a watchable object (entity attribute of type {byte, short, int, float, string, ItemStack,
 * ChunkCoordinates}) to the specified PacketBuffer
 */
private static void writeWatchableObjectToPacketBuffer(PacketBuffer buffer, DataWatcher.WatchableObject object) throws IOException
{
    int i = (object.getObjectType() << 5 | object.getDataValueId() & 31) & 255;
    buffer.writeByte(i);

    switch (object.getObjectType())
    {
        case 0:
            buffer.writeByte(((Byte)object.getObject()).byteValue());
            break;

        case 1:
            buffer.writeShort(((Short)object.getObject()).shortValue());
            break;

        case 2:
            buffer.writeInt(((Integer)object.getObject()).intValue());
            break;

        case 3:
            buffer.writeFloat(((Float)object.getObject()).floatValue());
            break;

        case 4:
            buffer.writeString((String)object.getObject());
            break;

        case 5:
            ItemStack itemstack = (ItemStack)object.getObject();
            buffer.writeItemStackToBuffer(itemstack);
            break;

        case 6:
            BlockPos blockpos = (BlockPos)object.getObject();
            buffer.writeInt(blockpos.getX());
            buffer.writeInt(blockpos.getY());
            buffer.writeInt(blockpos.getZ());
            break;

        case 7:
            Rotations rotations = (Rotations)object.getObject();
            buffer.writeFloat(rotations.getX());
            buffer.writeFloat(rotations.getY());
            buffer.writeFloat(rotations.getZ());
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:51,代码来源:DataWatcher.java

示例15: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeByte(this.windowId);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:CPacketCloseWindow.java


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