本文整理汇总了Java中net.minecraft.network.PacketBuffer.readByte方法的典型用法代码示例。如果您正苦于以下问题:Java PacketBuffer.readByte方法的具体用法?Java PacketBuffer.readByte怎么用?Java PacketBuffer.readByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.network.PacketBuffer
的用法示例。
在下文中一共展示了PacketBuffer.readByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fromBytes
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
PacketBuffer buffer = new PacketBuffer(buf);
int x = buffer.readVarInt();
int y = buffer.readVarInt();
int z = buffer.readVarInt();
BlockPos pos = new BlockPos(x, y, z);
int contentLength = buffer.readVarInt();
String content = buffer.readString(contentLength);
int languageId = buffer.readByte();
boolean parsing = buffer.readBoolean();
ScriptLanguage language = ScriptLanguage.values()[languageId];
setContent(content);
setLanguage(language);
setPos(pos);
setParsing(parsing);
}
示例2: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.mapId = buf.readVarIntFromBuffer();
this.mapScale = buf.readByte();
this.mapVisiblePlayersVec4b = new Vec4b[buf.readVarIntFromBuffer()];
for (int i = 0; i < this.mapVisiblePlayersVec4b.length; ++i)
{
short short1 = (short)buf.readByte();
this.mapVisiblePlayersVec4b[i] = new Vec4b((byte)(short1 >> 4 & 15), buf.readByte(), buf.readByte(), (byte)(short1 & 15));
}
this.mapMaxX = buf.readUnsignedByte();
if (this.mapMaxX > 0)
{
this.mapMaxY = buf.readUnsignedByte();
this.mapMinX = buf.readUnsignedByte();
this.mapMinY = buf.readUnsignedByte();
this.mapDataBytes = buf.readByteArray();
}
}
示例3: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.entityId = buf.readVarIntFromBuffer();
this.type = buf.readByte() & 255;
this.x = buf.readInt();
this.y = buf.readInt();
this.z = buf.readInt();
this.yaw = buf.readByte();
this.pitch = buf.readByte();
this.headPitch = buf.readByte();
this.velocityX = buf.readShort();
this.velocityY = buf.readShort();
this.velocityZ = buf.readShort();
this.watcher = DataWatcher.readWatchedListFromPacketBuffer(buf);
}
示例4: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.entityId = buf.readVarIntFromBuffer();
this.type = buf.readByte();
this.x = buf.readInt();
this.y = buf.readInt();
this.z = buf.readInt();
}
示例5: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
@Override
public void readPacketData(PacketBuffer buf) throws IOException
{
buf.readByte();
buf.readVarIntFromBuffer();
buf.readBoolean();
}
示例6: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.entityId = buf.readVarIntFromBuffer();
this.effectId = buf.readByte();
this.amplifier = buf.readByte();
this.duration = buf.readVarIntFromBuffer();
this.flags = buf.readByte();
}
示例7: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public void readPacketData(PacketBuffer buf) throws IOException
{
super.readPacketData(buf);
this.posX = buf.readByte();
this.posY = buf.readByte();
this.posZ = buf.readByte();
this.onGround = buf.readBoolean();
}
示例8: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.windowId = buf.readByte();
this.slot = buf.readShort();
this.item = buf.readItemStackFromBuffer();
}
示例9: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
byte b0 = buf.readByte();
this.setInvulnerable((b0 & 1) > 0);
this.setFlying((b0 & 2) > 0);
this.setAllowFlying((b0 & 4) > 0);
this.setCreativeMode((b0 & 8) > 0);
this.setFlySpeed(buf.readFloat());
this.setWalkSpeed(buf.readFloat());
}
示例10: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.name = buf.readStringFromBuffer(16);
this.action = buf.readByte();
if (this.action == 0 || this.action == 2)
{
this.displayName = buf.readStringFromBuffer(32);
this.prefix = buf.readStringFromBuffer(16);
this.suffix = buf.readStringFromBuffer(16);
this.friendlyFlags = buf.readByte();
this.nameTagVisibility = buf.readStringFromBuffer(32);
this.collisionRule = buf.readStringFromBuffer(32);
this.color = buf.readByte();
}
if (this.action == 0 || this.action == 3 || this.action == 4)
{
int i = buf.readVarIntFromBuffer();
for (int j = 0; j < i; ++j)
{
this.players.add(buf.readStringFromBuffer(40));
}
}
}
示例11: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.entityId = buf.readVarIntFromBuffer();
this.playerId = buf.readUuid();
this.x = buf.readInt();
this.y = buf.readInt();
this.z = buf.readInt();
this.yaw = buf.readByte();
this.pitch = buf.readByte();
this.currentItem = buf.readShort();
this.field_148958_j = DataWatcher.readWatchedListFromPacketBuffer(buf);
}
示例12: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.windowId = buf.readByte();
this.uid = buf.readShort();
this.accepted = buf.readByte() != 0;
}
示例13: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.windowId = buf.readByte();
this.slotId = buf.readShort();
this.usedButton = buf.readByte();
this.actionNumber = buf.readShort();
this.mode = buf.readByte();
this.clickedItem = buf.readItemStackFromBuffer();
}
示例14: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.heldItemHotbarIndex = buf.readByte();
}
示例15: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.position = buf.readByte();
this.scoreName = buf.readStringFromBuffer(16);
}