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


Java PacketBuffer.readItemStackFromBuffer方法代码示例

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


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

示例1: readFromBuf

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
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:F1r3w477,项目名称:CustomWorldGen,代码行数:33,代码来源:MerchantRecipeList.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.windowId = buf.readByte();
    this.slotId = buf.readShort();
    this.usedButton = buf.readByte();
    this.actionNumber = buf.readShort();
    this.mode = buf.readByte();
    this.clickedItem = buf.readItemStackFromBuffer();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:C0EPacketClickWindow.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.position = buf.readBlockPos();
    this.placedBlockDirection = buf.readUnsignedByte();
    this.stack = buf.readItemStackFromBuffer();
    this.facingX = (float)buf.readUnsignedByte() / 16.0F;
    this.facingY = (float)buf.readUnsignedByte() / 16.0F;
    this.facingZ = (float)buf.readUnsignedByte() / 16.0F;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:C08PacketPlayerBlockPlacement.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.equipmentSlot = buf.readShort();
    this.itemStack = buf.readItemStackFromBuffer();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:S04PacketEntityEquipment.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.windowId = buf.readUnsignedByte();
    int i = buf.readShort();
    this.itemStacks = new ItemStack[i];

    for (int j = 0; j < i; ++j)
    {
        this.itemStacks[j] = buf.readItemStackFromBuffer();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:SPacketWindowItems.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.readByte();
    this.slotId = buf.readShort();
    this.usedButton = buf.readByte();
    this.actionNumber = buf.readShort();
    this.mode = (ClickType)buf.readEnumValue(ClickType.class);
    this.clickedItem = buf.readItemStackFromBuffer();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:CPacketClickWindow.java

示例7: 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:Notoh,项目名称:DecompiledMinecraft,代码行数:32,代码来源:MerchantRecipeList.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
{
    this.entityID = buf.readVarIntFromBuffer();
    this.equipmentSlot = (EntityEquipmentSlot)buf.readEnumValue(EntityEquipmentSlot.class);
    this.itemStack = buf.readItemStackFromBuffer();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:SPacketEntityEquipment.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.slotId = buf.readShort();
    this.stack = buf.readItemStackFromBuffer();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:CPacketCreativeInventoryAction.java

示例11: read

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public ItemStack read(PacketBuffer buf) throws IOException
{
    return buf.readItemStackFromBuffer();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:DataSerializers.java

示例12: 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:Notoh,项目名称:DecompiledMinecraft,代码行数:61,代码来源:DataWatcher.java


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