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


Java PacketBuffer.readByte方法代码示例

本文整理汇总了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);
}
 
开发者ID:ScriptyMod,项目名称:Scripty,代码行数:18,代码来源:ScriptyPacketContent.java

示例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();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:26,代码来源:S34PacketMaps.java

示例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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:19,代码来源:S0FPacketSpawnMob.java

示例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();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:S2CPacketSpawnGlobalEntity.java

示例5: readPacketData

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

示例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();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:SPacketEntityEffect.java

示例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();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:9,代码来源:S14PacketEntity.java

示例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();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:SPacketSetSlot.java

示例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());
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:SPacketPlayerAbilities.java

示例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));
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:SPacketTeams.java

示例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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:16,代码来源:S0CPacketSpawnPlayer.java

示例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;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:CPacketConfirmTransaction.java

示例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();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:13,代码来源:C0EPacketClickWindow.java

示例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();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:SPacketHeldItemChange.java

示例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);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:SPacketDisplayObjective.java


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