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


Java PacketBuffer.writeShort方法代码示例

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


在下文中一共展示了PacketBuffer.writeShort方法的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.entityId);
    buf.writeUuid(this.uniqueId);
    buf.writeByte(this.type & 255);
    buf.writeDouble(this.x);
    buf.writeDouble(this.y);
    buf.writeDouble(this.z);
    buf.writeByte(this.yaw);
    buf.writeByte(this.pitch);
    buf.writeByte(this.headPitch);
    buf.writeShort(this.velocityX);
    buf.writeShort(this.velocityY);
    buf.writeShort(this.velocityZ);
    this.dataManager.writeEntries(buf);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:SPacketSpawnMob.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:Notoh,项目名称:DecompiledMinecraft,代码行数: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.writeVarIntToBuffer(this.protocolVersion);
    buf.writeString(this.ip);
    buf.writeShort(this.port);
    buf.writeVarIntToBuffer(this.requestedState.getId());
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:11,代码来源:C00Handshake.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.writeShort(this.equipmentSlot);
    buf.writeItemStackToBuffer(this.itemStack);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:S04PacketEntityEquipment.java

示例5: 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);
    buf.writeShort(this.actionNumber);
    buf.writeBoolean(this.accepted);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:SPacketConfirmTransaction.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.writeByte(this.windowId);
    buf.writeShort(this.varIndex);
    buf.writeShort(this.varValue);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:S31PacketWindowProperty.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.writeVarIntToBuffer(this.entityId);
    buf.writeUuid(this.playerId);
    buf.writeInt(this.x);
    buf.writeInt(this.y);
    buf.writeInt(this.z);
    buf.writeByte(this.yaw);
    buf.writeByte(this.pitch);
    buf.writeShort(this.currentItem);
    this.watcher.writeTo(buf);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:16,代码来源:S0CPacketSpawnPlayer.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.writeByte(this.windowId);
    buf.writeShort(this.itemStacks.length);

    for (ItemStack itemstack : this.itemStacks)
    {
        buf.writeItemStackToBuffer(itemstack);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:SPacketWindowItems.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.writeByte(this.windowId);
    buf.writeShort(this.slot);
    buf.writeItemStackToBuffer(this.item);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:10,代码来源:S2FPacketSetSlot.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.writeVarIntToBuffer(this.entityID);
    buf.writeShort(this.motionX);
    buf.writeShort(this.motionY);
    buf.writeShort(this.motionZ);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:11,代码来源:S12PacketEntityVelocity.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.writeByte(this.windowId);
    buf.writeShort(this.actionNumber);
    buf.writeBoolean(this.field_148893_c);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:S32PacketConfirmTransaction.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.writeVarIntToBuffer(this.protocolVersion);
    buf.writeString(this.ip + "\0FML\0");
    buf.writeShort(this.port);
    buf.writeVarIntToBuffer(this.requestedState.getId());
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:C00Handshake.java

示例13: 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.chunkPos.chunkXPos);
    buf.writeInt(this.chunkPos.chunkZPos);
    buf.writeVarIntToBuffer(this.changedBlocks.length);

    for (SPacketMultiBlockChange.BlockUpdateData spacketmultiblockchange$blockupdatedata : this.changedBlocks)
    {
        buf.writeShort(spacketmultiblockchange$blockupdatedata.getOffset());
        buf.writeVarIntToBuffer(Block.BLOCK_STATE_IDS.get(spacketmultiblockchange$blockupdatedata.getBlockState()));
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:SPacketMultiBlockChange.java

示例14: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeShort(this.slotId);
    buf.writeItemStackToBuffer(this.stack);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:9,代码来源:C10PacketCreativeInventoryAction.java

示例15: 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


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