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


Java Packet.readItemStack方法代码示例

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


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

示例1: readRecipiesFromStream

import net.minecraft.network.packet.Packet; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static MerchantRecipeList readRecipiesFromStream(DataInputStream par0DataInputStream) throws IOException
{
    MerchantRecipeList merchantrecipelist = new MerchantRecipeList();
    int i = par0DataInputStream.readByte() & 255;

    for (int j = 0; j < i; ++j)
    {
        ItemStack itemstack = Packet.readItemStack(par0DataInputStream);
        ItemStack itemstack1 = Packet.readItemStack(par0DataInputStream);
        ItemStack itemstack2 = null;

        if (par0DataInputStream.readBoolean())
        {
            itemstack2 = Packet.readItemStack(par0DataInputStream);
        }

        boolean flag = par0DataInputStream.readBoolean();
        MerchantRecipe merchantrecipe = new MerchantRecipe(itemstack, itemstack2, itemstack1);

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

        merchantrecipelist.add(merchantrecipe);
    }

    return merchantrecipelist;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:31,代码来源:MerchantRecipeList.java

示例2: readWatchableObjects

import net.minecraft.network.packet.Packet; //导入方法依赖的package包/类
public static List readWatchableObjects(DataInput par0DataInput) throws IOException
{
    ArrayList arraylist = null;

    for (byte b0 = par0DataInput.readByte(); b0 != 127; b0 = par0DataInput.readByte())
    {
        if (arraylist == null)
        {
            arraylist = new ArrayList();
        }

        int i = (b0 & 224) >> 5;
        int j = b0 & 31;
        WatchableObject watchableobject = null;

        switch (i)
        {
            case 0:
                watchableobject = new WatchableObject(i, j, Byte.valueOf(par0DataInput.readByte()));
                break;
            case 1:
                watchableobject = new WatchableObject(i, j, Short.valueOf(par0DataInput.readShort()));
                break;
            case 2:
                watchableobject = new WatchableObject(i, j, Integer.valueOf(par0DataInput.readInt()));
                break;
            case 3:
                watchableobject = new WatchableObject(i, j, Float.valueOf(par0DataInput.readFloat()));
                break;
            case 4:
                watchableobject = new WatchableObject(i, j, Packet.readString(par0DataInput, 64));
                break;
            case 5:
                watchableobject = new WatchableObject(i, j, Packet.readItemStack(par0DataInput));
                break;
            case 6:
                int k = par0DataInput.readInt();
                int l = par0DataInput.readInt();
                int i1 = par0DataInput.readInt();
                watchableobject = new WatchableObject(i, j, new ChunkCoordinates(k, l, i1));
        }

        arraylist.add(watchableobject);
    }

    return arraylist;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:48,代码来源:DataWatcher.java


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