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


Java PacketBuffer.readBoolean方法代码示例

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


在下文中一共展示了PacketBuffer.readBoolean方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.chunkX = buf.readInt();
    this.chunkZ = buf.readInt();
    this.loadChunk = buf.readBoolean();
    this.availableSections = buf.readVarIntFromBuffer();
    int i = buf.readVarIntFromBuffer();

    if (i > 2097152)
    {
        throw new RuntimeException("Chunk Packet trying to allocate too much memory on read.");
    }
    else
    {
        this.buffer = new byte[i];
        buf.readBytes(this.buffer);
        int j = buf.readVarIntFromBuffer();
        this.tileEntityTags = Lists.<NBTTagCompound>newArrayList();

        for (int k = 0; k < j; ++k)
        {
            this.tileEntityTags.add(buf.readNBTTagCompoundFromBuffer());
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:29,代码来源:SPacketChunkData.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.lang = buf.readStringFromBuffer(7);
    this.view = buf.readByte();
    this.chatVisibility = (EntityPlayer.EnumChatVisibility)buf.readEnumValue(EntityPlayer.EnumChatVisibility.class);
    this.enableColors = buf.readBoolean();
    this.modelPartFlags = buf.readUnsignedByte();
    this.mainHand = (EnumHandSide)buf.readEnumValue(EnumHandSide.class);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:CPacketClientSettings.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
{
    super.readPacketData(buf);
    this.yaw = buf.readByte();
    this.pitch = buf.readByte();
    this.onGround = buf.readBoolean();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:SPacketEntity.java

示例5: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.message = buf.readStringFromBuffer(32767);
    boolean flag = buf.readBoolean();

    if (flag)
    {
        this.targetBlock = buf.readBlockPos();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:C14PacketTabComplete.java

示例6: 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.yaw = buf.readByte();
    this.pitch = buf.readByte();
    this.onGround = buf.readBoolean();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:11,代码来源:S14PacketEntity.java

示例7: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.particleType = EnumParticleTypes.getParticleFromId(buf.readInt());

    if (this.particleType == null)
    {
        this.particleType = EnumParticleTypes.BARRIER;
    }

    this.longDistance = buf.readBoolean();
    this.xCoord = buf.readFloat();
    this.yCoord = buf.readFloat();
    this.zCoord = buf.readFloat();
    this.xOffset = buf.readFloat();
    this.yOffset = buf.readFloat();
    this.zOffset = buf.readFloat();
    this.particleSpeed = buf.readFloat();
    this.particleCount = buf.readInt();
    int i = this.particleType.getArgumentCount();
    this.particleArguments = new int[i];

    for (int j = 0; j < i; ++j)
    {
        this.particleArguments[j] = buf.readVarIntFromBuffer();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:30,代码来源:S2APacketParticles.java

示例8: createFromBuffer

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public static PathPoint createFromBuffer(PacketBuffer buf)
{
    PathPoint pathpoint = new PathPoint(buf.readInt(), buf.readInt(), buf.readInt());
    pathpoint.distanceFromOrigin = buf.readFloat();
    pathpoint.cost = buf.readFloat();
    pathpoint.costMalus = buf.readFloat();
    pathpoint.visited = buf.readBoolean();
    pathpoint.nodeType = PathNodeType.values()[buf.readInt()];
    pathpoint.distanceToTarget = buf.readFloat();
    return pathpoint;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:12,代码来源:PathPoint.java

示例9: 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:Notoh,项目名称:DecompiledMinecraft,代码行数:9,代码来源:S14PacketEntity.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.entityId = buf.readVarIntFromBuffer();
    this.posX = buf.readDouble();
    this.posY = buf.readDouble();
    this.posZ = buf.readDouble();
    this.yaw = buf.readByte();
    this.pitch = buf.readByte();
    this.onGround = buf.readBoolean();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:SPacketEntityTeleport.java

示例11: readFromBuf

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public static MerchantRecipeList readFromBuf(PacketBuffer buffer) throws IOException
{
    MerchantRecipeList merchantrecipelist = new MerchantRecipeList();
    int i = buffer.readByte() & 255;

    for (int j = 0; j < i; ++j)
    {
        ItemStack itemstack = buffer.readItemStackFromBuffer();
        ItemStack itemstack1 = buffer.readItemStackFromBuffer();
        ItemStack itemstack2 = null;

        if (buffer.readBoolean())
        {
            itemstack2 = buffer.readItemStackFromBuffer();
        }

        boolean flag = buffer.readBoolean();
        int k = buffer.readInt();
        int l = buffer.readInt();
        MerchantRecipe merchantrecipe = new MerchantRecipe(itemstack, itemstack2, itemstack1, k, l);

        if (flag)
        {
            merchantrecipe.compensateToolUses();
        }

        merchantrecipelist.add(merchantrecipe);
    }

    return merchantrecipelist;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:32,代码来源:MerchantRecipeList.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.lang = buf.readStringFromBuffer(7);
    this.view = buf.readByte();
    this.chatVisibility = EntityPlayer.EnumChatVisibility.getEnumChatVisibility(buf.readByte());
    this.enableColors = buf.readBoolean();
    this.modelPartFlags = buf.readUnsignedByte();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:12,代码来源:C15PacketClientSettings.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.readUnsignedByte();
    this.actionNumber = buf.readShort();
    this.accepted = buf.readBoolean();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:SPacketConfirmTransaction.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.left = buf.readBoolean();
    this.right = buf.readBoolean();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:CPacketSteerBoat.java


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