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


Java PacketBuffer.readInt方法代码示例

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


在下文中一共展示了PacketBuffer.readInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.isOverworld = buf.readBoolean();
    int i = buf.readVarIntFromBuffer();
    this.xPositions = new int[i];
    this.zPositions = new int[i];
    this.chunksData = new S21PacketChunkData.Extracted[i];

    for (int j = 0; j < i; ++j)
    {
        this.xPositions[j] = buf.readInt();
        this.zPositions[j] = buf.readInt();
        this.chunksData[j] = new S21PacketChunkData.Extracted();
        this.chunksData[j].dataSize = buf.readShort() & 65535;
        this.chunksData[j].data = new byte[S21PacketChunkData.func_180737_a(Integer.bitCount(this.chunksData[j].dataSize), this.isOverworld, true)];
    }

    for (int k = 0; k < i; ++k)
    {
        buf.readBytes(this.chunksData[k].data);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:26,代码来源:S26PacketMapChunkBulk.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.posX = (double)buf.readFloat();
    this.posY = (double)buf.readFloat();
    this.posZ = (double)buf.readFloat();
    this.strength = buf.readFloat();
    int i = buf.readInt();
    this.affectedBlockPositions = Lists.<BlockPos>newArrayListWithCapacity(i);
    int j = (int)this.posX;
    int k = (int)this.posY;
    int l = (int)this.posZ;

    for (int i1 = 0; i1 < i; ++i1)
    {
        int j1 = buf.readByte() + j;
        int k1 = buf.readByte() + k;
        int l1 = buf.readByte() + l;
        this.affectedBlockPositions.add(new BlockPos(j1, k1, l1));
    }

    this.field_149152_f = buf.readFloat();
    this.field_149153_g = buf.readFloat();
    this.field_149159_h = buf.readFloat();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:28,代码来源:S27PacketExplosion.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();
    int i = buf.readInt();

    for (int j = 0; j < i; ++j)
    {
        String s = buf.readStringFromBuffer(64);
        double d0 = buf.readDouble();
        List<AttributeModifier> list = Lists.<AttributeModifier>newArrayList();
        int k = buf.readVarIntFromBuffer();

        for (int l = 0; l < k; ++l)
        {
            UUID uuid = buf.readUuid();
            list.add(new AttributeModifier(uuid, "Unknown synced attribute modifier", buf.readDouble(), buf.readByte()));
        }

        this.snapshots.add(new SPacketEntityProperties.Snapshot(s, d0, list));
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:SPacketEntityProperties.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.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:F1r3w477,项目名称:CustomWorldGen,代码行数:29,代码来源:SPacketChunkData.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.posX = (double)buf.readFloat();
    this.posY = (double)buf.readFloat();
    this.posZ = (double)buf.readFloat();
    this.strength = buf.readFloat();
    int i = buf.readInt();
    this.affectedBlockPositions = Lists.<BlockPos>newArrayListWithCapacity(i);
    int j = (int)this.posX;
    int k = (int)this.posY;
    int l = (int)this.posZ;

    for (int i1 = 0; i1 < i; ++i1)
    {
        int j1 = buf.readByte() + j;
        int k1 = buf.readByte() + k;
        int l1 = buf.readByte() + l;
        this.affectedBlockPositions.add(new BlockPos(j1, k1, l1));
    }

    this.motionX = buf.readFloat();
    this.motionY = buf.readFloat();
    this.motionZ = buf.readFloat();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:SPacketExplosion.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.windowId = buf.readUnsignedByte();
    this.inventoryType = buf.readStringFromBuffer(32);
    this.windowTitle = buf.readChatComponent();
    this.slotCount = buf.readUnsignedByte();

    if (this.inventoryType.equals("EntityHorse"))
    {
        this.entityId = buf.readInt();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:16,代码来源:S2DPacketOpenWindow.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.chunkPosCoord = new ChunkCoordIntPair(buf.readInt(), buf.readInt());
    this.changedBlocks = new S22PacketMultiBlockChange.BlockUpdateData[buf.readVarIntFromBuffer()];

    for (int i = 0; i < this.changedBlocks.length; ++i)
    {
        this.changedBlocks[i] = new S22PacketMultiBlockChange.BlockUpdateData(buf.readShort(), (IBlockState)Block.BLOCK_STATE_IDS.getByValue(buf.readVarIntFromBuffer()));
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:14,代码来源:S22PacketMultiBlockChange.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.sound = (SoundEvent)SoundEvent.REGISTRY.getObjectById(buf.readVarIntFromBuffer());
    this.category = (SoundCategory)buf.readEnumValue(SoundCategory.class);
    this.posX = buf.readInt();
    this.posY = buf.readInt();
    this.posZ = buf.readInt();
    this.soundVolume = buf.readFloat();
    this.soundPitch = buf.readFloat();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:SPacketSoundEffect.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
{
    this.soundName = buf.readStringFromBuffer(256);
    this.category = (SoundCategory)buf.readEnumValue(SoundCategory.class);
    this.x = buf.readInt();
    this.y = buf.readInt();
    this.z = buf.readInt();
    this.volume = buf.readFloat();
    this.pitch = buf.readFloat();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:SPacketCustomSound.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.readInt();
    this.posY = buf.readInt();
    this.posZ = buf.readInt();
    this.xpValue = buf.readShort();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:S11PacketSpawnExperienceOrb.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.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

示例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.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:SkidJava,项目名称:BaseClient,代码行数:16,代码来源:S0CPacketSpawnPlayer.java

示例13: readWatchedListFromPacketBuffer

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public static List<DataWatcher.WatchableObject> readWatchedListFromPacketBuffer(PacketBuffer buffer) throws IOException
{
    List<DataWatcher.WatchableObject> list = null;

    for (int i = buffer.readByte(); i != 127; i = buffer.readByte())
    {
        if (list == null)
        {
            list = Lists.<DataWatcher.WatchableObject>newArrayList();
        }

        int j = (i & 224) >> 5;
        int k = i & 31;
        DataWatcher.WatchableObject datawatcher$watchableobject = null;

        switch (j)
        {
            case 0:
                datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, Byte.valueOf(buffer.readByte()));
                break;

            case 1:
                datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, Short.valueOf(buffer.readShort()));
                break;

            case 2:
                datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, Integer.valueOf(buffer.readInt()));
                break;

            case 3:
                datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, Float.valueOf(buffer.readFloat()));
                break;

            case 4:
                datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, buffer.readStringFromBuffer(32767));
                break;

            case 5:
                datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, buffer.readItemStackFromBuffer());
                break;

            case 6:
                int l = buffer.readInt();
                int i1 = buffer.readInt();
                int j1 = buffer.readInt();
                datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, new BlockPos(l, i1, j1));
                break;

            case 7:
                float f = buffer.readFloat();
                float f1 = buffer.readFloat();
                float f2 = buffer.readFloat();
                datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, new Rotations(f, f1, f2));
        }

        list.add(datawatcher$watchableobject);
    }

    return list;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:61,代码来源:DataWatcher.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.entityId = buf.readInt();
    this.logicOpcode = buf.readByte();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:SPacketEntityStatus.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.entityId = buf.readInt();
    this.vehicleEntityId = buf.readInt();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:SPacketEntityAttach.java


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