本文整理汇总了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);
}
}
示例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);
}
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例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());
}
}
示例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);
}