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


Java ByteBufUtils.readItemStack方法代码示例

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


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

示例1: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	this.playerId = ByteBufUtils.readUTF8String(buf);
	this.x = buf.readInt();
	this.y = buf.readInt();
	this.z = buf.readInt();
	this.slot = buf.readInt();
	this.stack = ByteBufUtils.readItemStack(buf);
	
}
 
开发者ID:astronautlabs,项目名称:rezolve,代码行数:11,代码来源:GhostSlotUpdateMessage.java

示例2: getFluidOrItemStack

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
public static Object getFluidOrItemStack(ByteBuf buf) {
    if (buf.readByte() == 0) {
        return ByteBufUtils.readItemStack(buf);
    } else {
        return new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(buf)), buf.readInt(), ByteBufUtils.readTag(buf));
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:8,代码来源:PacketSyncAmadronOffers.java

示例3: readField

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
public static Object readField(ByteBuf buf, int type) {
    switch (type) {
        case 0:
            return buf.readInt();
        case 1:
            return buf.readFloat();
        case 2:
            return buf.readDouble();
        case 3:
            return buf.readBoolean();
        case 4:
            return ByteBufUtils.readUTF8String(buf);
        case 5:
            return buf.readByte();
        case 6:
            return ByteBufUtils.readItemStack(buf);
        case 7:
            if (!buf.readBoolean()) return null;
            return new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(buf)), buf.readInt(), ByteBufUtils.readTag(buf));
        case 8:
            try {
                PacketBuffer packetBuffer = new PacketBuffer(buf);
                NBTTagCompound tag = packetBuffer.readCompoundTag();
                if (tag == null) return EmptyHandler.INSTANCE;
                ItemStackHandler handler = new ItemStackHandler();
                handler.deserializeNBT(tag);
                return handler;
            } catch (IOException e) {
                return EmptyHandler.INSTANCE;
            }
    }
    throw new IllegalArgumentException("Invalid sync type! " + type);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:34,代码来源:PacketUpdateGui.java

示例4: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {		
	this.position = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble());
	this.directionSpeed = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble());
	this.stack = ByteBufUtils.readItemStack(buf);
	this.scale = buf.readFloat();
	this.disableMoving = buf.readBoolean();
	this.timesSpawn = buf.readInt();
	this.tag = ByteBufUtils.readUTF8String(buf);

}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:12,代码来源:MessagePacketSpawnItemParticles.java

示例5: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
    player = buf.readInt();
    where = ContainingInventory.VALUES[buf.readByte()];
    slot = buf.readByte();
    stack = ByteBufUtils.readItemStack(buf);
}
 
开发者ID:gigaherz,项目名称:ToolBelt,代码行数:9,代码来源:BeltContentsChange.java

示例6: onMessage

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void onMessage(MalmoMessageType messageType, Map<String, String> data) 
{
    String bufstring = data.get("message");
    ByteBuf buf = Unpooled.copiedBuffer(DatatypeConverter.parseBase64Binary(bufstring));
    ItemStack itemStack = ByteBufUtils.readItemStack(buf);
    if (itemStack != null && itemStack.getItem() != null)
    {
        accumulateReward(this.params.getDimension(), itemStack);
    }
    else
    {
        System.out.println("Error - couldn't understand the itemstack we received.");
    }
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:16,代码来源:RewardForDiscardingItemImplementation.java

示例7: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
    this.pos = new BlockPos( buf.readInt(), buf.readInt(), buf.readInt() );
    this.itemStack = ByteBufUtils.readItemStack(buf);
    this.face = EnumFacing.values()[buf.readInt()];
    this.standOnPlacedBlock = buf.readBoolean();
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:9,代码来源:DiscreteMovementCommandsImplementation.java

示例8: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	int dim = buf.readInt();
	BlockPos pos = BlockPos.fromLong(buf.readLong());

	World world = SimpleTubes.proxy.getWorld(dim);
	this.tile = world.getTileEntity(pos);

	this.id = buf.readInt();
	this.stack = ByteBufUtils.readItemStack(buf);
	this.progress = buf.readFloat();
	this.direction = buf.readByte();
	this.color = buf.readInt();
}
 
开发者ID:oMilkyy,项目名称:SimpleTubes,代码行数:15,代码来源:PacketItemAdd.java

示例9: readSpawnData

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readSpawnData(ByteBuf additionalData) 
{
	knife = ByteBufUtils.readItemStack(additionalData);
	baseDamage = additionalData.readFloat();
	force = additionalData.readFloat();
}
 
开发者ID:einsteinsci,项目名称:BetterBeginningsReborn,代码行数:8,代码来源:EntityThrownKnife.java

示例10: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
    super.fromBytes(buf);
    settingStack = ByteBufUtils.readItemStack(buf);
    settingIndex = buf.readInt();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:7,代码来源:PacketSetLogisticsFilterStack.java

示例11: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buffer) {
    ItemStack stack = ByteBufUtils.readItemStack(buffer);
    item = stack.getItem();
    amount = stack.getCount();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:7,代码来源:PacketUseItem.java

示例12: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
    varName = ByteBufUtils.readUTF8String(buf);
    pos = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt());
    stack = ByteBufUtils.readItemStack(buf);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:7,代码来源:PacketCommandGetGlobalVariableOutput.java

示例13: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
    stack = ByteBufUtils.readItemStack(buf);
    pos = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt());
}
 
开发者ID:BenjaminSutter,项目名称:genera,代码行数:6,代码来源:MessageGlassJarUpdateStats.java

示例14: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {		
	slotId = buf.readInt();
	stack = ByteBufUtils.readItemStack(buf);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:6,代码来源:MessagePacketSetItemInSlot.java

示例15: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	this.entityId = buf.readInt();
	this.slot = buf.readInt();
	this.stack = ByteBufUtils.readItemStack(buf);
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:7,代码来源:MessageSyncCartItem.java


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