本文整理汇总了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;
}
示例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;
}