當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。