本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例11: read
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public ItemStack read(PacketBuffer buf) throws IOException
{
return buf.readItemStackFromBuffer();
}
示例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;
}