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


Java ByteBufUtils.readItemStack方法代码示例

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


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

示例1: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
	slotCount = (short) ByteBufUtils.readVarShort(buf);
	itemStacks = new ItemStack[slotCount];
	stackSizes = new int[slotCount];
	for (int i = 0; i < slotCount; i++) {
		itemStacks[i] = ByteBufUtils.readItemStack(buf);
		stackSizes[i] = ByteBufUtils.readVarInt(buf, 5);
		if (itemStacks[i] != null)
			itemStacks[i].stackSize = stackSizes[i];
	}
}
 
开发者ID:WanionCane,项目名称:Avaritiaddons,代码行数:14,代码来源:InfinityChestSyncAllSlots.java

示例2: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(final ByteBuf buf)
{
	windowId = ByteBufUtils.readVarInt(buf, 4);
	slotNumber = ByteBufUtils.readVarShort(buf);
	if (slotNumber < 0 || slotNumber > 279)
		slotNumber = -999;
	mouseButton = ByteBufUtils.readVarInt(buf, 4);
	modifier = ByteBufUtils.readVarInt(buf, 4);
	itemStack = ByteBufUtils.readItemStack(buf);
	stackSize = ByteBufUtils.readVarInt(buf, 5);
	if (itemStack != null)
		itemStack.stackSize = stackSize;
	transactionID = (short) ByteBufUtils.readVarShort(buf);
}
 
开发者ID:WanionCane,项目名称:Avaritiaddons,代码行数:16,代码来源:InfinityChestClick.java

示例3: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(final ByteBuf buf)
{
	itemStack = ByteBufUtils.readItemStack(buf);
	slot = ByteBufUtils.readVarShort(buf);
	stackSize = ByteBufUtils.readVarInt(buf, 5);
}
 
开发者ID:WanionCane,项目名称:Avaritiaddons,代码行数:8,代码来源:InfinityChestSlotSync.java

示例4: readFromGui

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readFromGui(ByteBuf buffer) {
    if (buffer.readBoolean())
        stack = ByteBufUtils.readItemStack(buffer);
    else
        stack = null;
}
 
开发者ID:enhancedportals,项目名称:enhancedportals,代码行数:8,代码来源:TileTransferItem.java

示例5: usePacket

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
public void usePacket(ByteBuf buffer) {
    frameColour = buffer.readInt();
    portalColour = buffer.readInt();
    particleColour = buffer.readInt();
    particleType = buffer.readInt();
    customFrameTexture = buffer.readInt();
    customPortalTexture = buffer.readInt();

    for (int i = 0; i < inventory.length; i++)
        inventory[i] = ByteBufUtils.readItemStack(buffer);
}
 
开发者ID:enhancedportals,项目名称:enhancedportals,代码行数:12,代码来源:PortalTextureManager.java

示例6: readSpawnData

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readSpawnData(ByteBuf buffer) {
	stack = ByteBufUtils.readItemStack(buffer);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:5,代码来源:EntityLingeringEffect.java

示例7: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
  super.fromBytes(buf);
  slot = buf.readShort();
  stack = ByteBufUtils.readItemStack(buf);
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:7,代码来源:PacketGhostSlot.java

示例8: readStack

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
public static ItemStack readStack(ByteBuf input)
	    throws IOException{
	return ByteBufUtils.readItemStack(input);
}
 
开发者ID:MHuanterAxe,项目名称:MHuanterMod,代码行数:5,代码来源:DataUtil.java


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