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


Java ByteBufUtils.readTag方法代码示例

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


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

示例1: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
    healingCfg = new FirstAidConfig.ExternalHealing();
    healingCfg.allowNaturalRegeneration = buf.readBoolean();
    healingCfg.allowOtherHealingItems = buf.readBoolean();
    healingCfg.sleepHealing = buf.readFloat();
    healingCfg.otherRegenMultiplier = buf.readDouble();
    healingCfg.naturalRegenMultiplier = buf.readDouble();

    damageCfg = new FirstAidConfig.DamageSystem();
    damageCfg.maxHealthHead = buf.readByte();
    damageCfg.maxHealthLeftArm = buf.readByte();
    damageCfg.maxHealthLeftLeg = buf.readByte();
    damageCfg.maxHealthLeftFoot = buf.readByte();
    damageCfg.maxHealthBody = buf.readByte();
    damageCfg.maxHealthRightArm = buf.readByte();
    damageCfg.maxHealthRightLeg = buf.readByte();
    damageCfg.maxHealthRightFoot = buf.readByte();

    scaleMaxHealth = buf.readBoolean();

    playerDamageModel = ByteBufUtils.readTag(buf);
}
 
开发者ID:ichttt,项目名称:FirstAid,代码行数:24,代码来源:MessageReceiveConfiguration.java

示例2: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
    super.fromBytes(buf);
    type = IDescSynced.Type.values()[buf.readByte()];
    int dataAmount = buf.readInt();
    types = new byte[dataAmount];
    values = new Object[dataAmount];
    for (int i = 0; i < dataAmount; i++) {
        types[i] = buf.readByte();
        values[i] = PacketUpdateGui.readField(buf, types[i]);
    }
    extraData = ByteBufUtils.readTag(buf);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:14,代码来源:PacketDescription.java

示例3: fromBytes

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

示例4: 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

示例5: 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

示例6: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) 
{
	NBTTagCompound compound = ByteBufUtils.readTag(buf);
	for(int i = 0; i < compound.getInteger("size"); i++)
		objects[i] = HarshenUtils.deserialize(compound.getByteArray("byte" + i));
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:8,代码来源:BaseMessagePacketSendPackage.java

示例7: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf){
	this.x=buf.readInt();
	this.y=buf.readInt();
	this.z=buf.readInt();
	this.tag=ByteBufUtils.readTag(buf);
}
 
开发者ID:DonBruce64,项目名称:OpenFlexiTrack,代码行数:8,代码来源:TileEntitySyncPacket.java

示例8: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
    
    this.x = buf.readInt();
    this.y = buf.readInt();
    this.z = buf.readInt();
    this.energy = buf.readLong();
    NBTTagCompound tag = ByteBufUtils.readTag(buf);
    NBTTagList list = tag.getTagList("infos", Constants.NBT.TAG_COMPOUND);
    this.infos = new ArrayList<>();
    for(int i = 0; i < list.tagCount(); i++) {
        infos.add(AccumulatorInfo.readFromNBT(list.getCompoundTagAt(i)));
    }
}
 
开发者ID:jaredlll08,项目名称:Machines-and-Stuff,代码行数:15,代码来源:MessageAccumulator.java

示例9: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
    windowId = buf.readByte();
    tank = buf.readByte();

    NBTTagCompound fluidNbt = ByteBufUtils.readTag(buf);
    fluid = FluidStack.loadFluidStackFromNBT(fluidNbt);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:10,代码来源:PacketSyncContainerFluid.java

示例10: fromBytes

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

示例11: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
  processorData = ByteBufUtils.readTag(buf);
  pos = BlockPos.fromLong(buf.readLong());
  name = ByteBufUtils.readUTF8String(buf);
}
 
开发者ID:ToroCraft,项目名称:Minecoprocessors,代码行数:7,代码来源:MessageProcessorUpdate.java

示例12: fromBytes

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

示例13: fromBytes

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

示例14: fromBytes

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

示例15: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	NBTTagCompound nbt = ByteBufUtils.readTag(buf);
	handler = HarshenUtils.getHandler(nbt);
	handler.deserializeNBT(nbt);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:7,代码来源:MessageSendPlayerInvToClient.java


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