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


Java NBTTagCompound.getBoolean方法代码示例

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


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

示例1: readNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readNBT(Capability<FoodStats> capability, FoodStats instance, EnumFacing side, NBTBase nbt) {
    if (!(nbt instanceof NBTTagCompound))
        return;
    NBTTagCompound tagCompound = (NBTTagCompound) nbt;
    instance.setAmount(tagCompound.getInteger("amount"))
            .setSaturationModifier(tagCompound.getFloat("saturationModifier"))
            .setMaxItemUseDuration(tagCompound.getInteger("maxItemUseDuration"))
            .setAction(EnumAction.values()[tagCompound.getInteger("action")])
            .setPotion(PotionEffect.readCustomPotionEffectFromNBT(tagCompound.getCompoundTag("potion")))
            .setPotionEffectProbability(tagCompound.getFloat("potionEffectProbability"))
            .setUnlocalizedName(tagCompound.getString("unlocalizedName"));
    if (tagCompound.getBoolean("wolfFood"))
        instance.setWolfFood();
    if (tagCompound.getBoolean("alwaysEdible"))
        instance.setAlwaysEdible();
}
 
开发者ID:MinecraftPangu,项目名称:Pangu,代码行数:18,代码来源:CapabilityFood.java

示例2: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
@Override
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
	this.metadata = p_70037_1_.getByte("Data") & 255;
	this.block = Block.getBlockById(p_70037_1_.getInteger("TileID")).getStateFromMeta(metadata);
	this.sticky = p_70037_1_.getInteger("Sticky");
	this.nogravity = p_70037_1_.getBoolean("NoGravity");

	this.field_145812_b = p_70037_1_.getByte("Time") & 255;

	if (p_70037_1_.hasKey("HurtEntities", 99)) {
		this.field_145809_g = p_70037_1_.getBoolean("HurtEntities");
		this.field_145816_i = p_70037_1_.getFloat("FallHurtAmount");
		this.field_145815_h = p_70037_1_.getInteger("FallHurtMax");
	} else if (this.block == Blocks.ANVIL)
		this.field_145809_g = true;

	if (p_70037_1_.hasKey("DropItem", 99))
		this.dropItems = p_70037_1_.getBoolean("DropItem");

	if (p_70037_1_.hasKey("TileEntityData", 10))
		this.dataTag = p_70037_1_.getCompoundTag("TileEntityData");

	if (this.block.getMaterial() == Material.AIR)
		this.setDead();
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:29,代码来源:EntityFallingEnchantedBlock.java

示例3: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound compound) {
	fluid = CauldronLiquid.getFromName(compound.getString("cauldronType"));
	level = compound.getInteger("cauldronLevel");
	isActive = compound.getBoolean("isActive");
	switchedItem = new ItemStack(compound.getCompoundTag("switchedItemStack"));
	super.readFromNBT(compound);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:9,代码来源:TileEntityHereticCauldron.java

示例4: StarterFX

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public StarterFX(World p_i46464_1_, double p_i46464_2_, double p_i46464_4_, double p_i46464_6_, double p_i46464_8_, double p_i46464_10_, double p_i46464_12_, EffectRenderer p_i46464_14_, NBTTagCompound p_i46464_15_)
{
    super(p_i46464_1_, p_i46464_2_, p_i46464_4_, p_i46464_6_, 0.0D, 0.0D, 0.0D);
    this.motionX = p_i46464_8_;
    this.motionY = p_i46464_10_;
    this.motionZ = p_i46464_12_;
    this.theEffectRenderer = p_i46464_14_;
    this.particleMaxAge = 8;

    if (p_i46464_15_ != null)
    {
        this.fireworkExplosions = p_i46464_15_.getTagList("Explosions", 10);

        if (this.fireworkExplosions.tagCount() == 0)
        {
            this.fireworkExplosions = null;
        }
        else
        {
            this.particleMaxAge = this.fireworkExplosions.tagCount() * 2 - 1;

            for (int i = 0; i < this.fireworkExplosions.tagCount(); ++i)
            {
                NBTTagCompound nbttagcompound = this.fireworkExplosions.getCompoundTagAt(i);

                if (nbttagcompound.getBoolean("Flicker"))
                {
                    this.twinkle = true;
                    this.particleMaxAge += 15;
                    break;
                }
            }
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:36,代码来源:EntityFirework.java

示例5: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    super.readEntityFromNBT(tagCompund);
    this.chickenJockey = tagCompund.getBoolean("IsChickenJockey");

    if (tagCompund.hasKey("EggLayTime"))
    {
        this.timeUntilNextEgg = tagCompund.getInteger("EggLayTime");
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:EntityChicken.java

示例6: fixTagCompound

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound fixTagCompound(NBTTagCompound compound)
{
    if ("Zombie".equals(compound.getString("id")) && compound.getBoolean("IsVillager"))
    {
        if (!compound.hasKey("ZombieType", 99))
        {
            int i = -1;

            if (compound.hasKey("VillagerProfession", 99))
            {
                try
                {
                    i = this.func_191277_a(compound.getInteger("VillagerProfession"));
                }
                catch (RuntimeException var4)
                {
                    ;
                }
            }

            if (i == -1)
            {
                i = this.func_191277_a(RANDOM.nextInt(6));
            }

            compound.setInteger("ZombieType", i);
        }

        compound.removeTag("IsVillager");
    }

    return compound;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:34,代码来源:ZombieProfToType.java

示例7: deserializeNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void deserializeNBT(NBTTagCompound nbt)
{
	this.stats = new CropStats();
	this.stats.deserializeNBT(nbt.getCompoundTag("stats"));
	this.isSick = nbt.getBoolean("eaten");
	this.timeKeeper.deserializeNBT((NBTTagLong) nbt.getTag("calendar"));
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:9,代码来源:ExPCrop.java

示例8: readStructureFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
protected void readStructureFromNBT(NBTTagCompound tagCompound)
{
    super.readStructureFromNBT(tagCompound);
    this.field_74947_h = tagCompound.getBoolean("placedMainChest");
    this.field_74948_i = tagCompound.getBoolean("placedHiddenChest");
    this.field_74945_j = tagCompound.getBoolean("placedTrap1");
    this.field_74946_k = tagCompound.getBoolean("placedTrap2");
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:9,代码来源:ComponentScatteredFeaturePieces.java

示例9: readStructureFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
protected void readStructureFromNBT(NBTTagCompound tagCompound)
{
    super.readStructureFromNBT(tagCompound);
    this.hasSpawner = tagCompound.getBoolean("Mob");
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:6,代码来源:StructureStrongholdPieces.java

示例10: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound compound)
{
    super.readEntityFromNBT(compound);
    this.setUniqueId(getUUID(this.gameProfile));
    NBTTagList nbttaglist = compound.getTagList("Inventory", 10);
    this.inventory.readFromNBT(nbttaglist);
    this.inventory.currentItem = compound.getInteger("SelectedItemSlot");
    this.sleeping = compound.getBoolean("Sleeping");
    this.sleepTimer = compound.getShort("SleepTimer");
    this.experience = compound.getFloat("XpP");
    this.experienceLevel = compound.getInteger("XpLevel");
    this.experienceTotal = compound.getInteger("XpTotal");
    this.xpSeed = compound.getInteger("XpSeed");

    if (this.xpSeed == 0)
    {
        this.xpSeed = this.rand.nextInt();
    }

    this.setScore(compound.getInteger("Score"));

    if (this.sleeping)
    {
        this.bedLocation = new BlockPos(this);
        this.wakeUpPlayer(true, true, false);
    }

    if (compound.hasKey("SpawnX", 99) && compound.hasKey("SpawnY", 99) && compound.hasKey("SpawnZ", 99))
    {
        this.spawnChunk = new BlockPos(compound.getInteger("SpawnX"), compound.getInteger("SpawnY"), compound.getInteger("SpawnZ"));
        this.spawnForced = compound.getBoolean("SpawnForced");
    }

    this.foodStats.readNBT(compound);
    this.capabilities.readCapabilitiesFromNBT(compound);

    if (compound.hasKey("EnderItems", 9))
    {
        NBTTagList nbttaglist1 = compound.getTagList("EnderItems", 10);
        this.theInventoryEnderChest.loadInventoryFromNBT(nbttaglist1);
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:46,代码来源:EntityPlayer.java

示例11: readDataNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
void readDataNBT(NBTTagCompound cmp) {
	lit = cmp.getBoolean("lit");
	color = EnumDyeColor.byMetadata(cmp.getInteger("color"));
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:6,代码来源:TileCandle.java

示例12: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    super.readEntityFromNBT(tagCompund);
    this.entityUniqueID = getUUID(this.gameProfile);
    NBTTagList nbttaglist = tagCompund.getTagList("Inventory", 10);
    this.inventory.readFromNBT(nbttaglist);
    this.inventory.currentItem = tagCompund.getInteger("SelectedItemSlot");
    this.sleeping = tagCompund.getBoolean("Sleeping");
    this.sleepTimer = tagCompund.getShort("SleepTimer");
    this.experience = tagCompund.getFloat("XpP");
    this.experienceLevel = tagCompund.getInteger("XpLevel");
    this.experienceTotal = tagCompund.getInteger("XpTotal");
    this.xpSeed = tagCompund.getInteger("XpSeed");

    if (this.xpSeed == 0)
    {
        this.xpSeed = this.rand.nextInt();
    }

    this.setScore(tagCompund.getInteger("Score"));

    if (this.sleeping)
    {
        this.playerLocation = new BlockPos(this);
        this.wakeUpPlayer(true, true, false);
    }

    if (tagCompund.hasKey("SpawnX", 99) && tagCompund.hasKey("SpawnY", 99) && tagCompund.hasKey("SpawnZ", 99))
    {
        this.spawnChunk = new BlockPos(tagCompund.getInteger("SpawnX"), tagCompund.getInteger("SpawnY"), tagCompund.getInteger("SpawnZ"));
        this.spawnForced = tagCompund.getBoolean("SpawnForced");
    }

    this.foodStats.readNBT(tagCompund);
    this.capabilities.readCapabilitiesFromNBT(tagCompund);

    if (tagCompund.hasKey("EnderItems", 9))
    {
        NBTTagList nbttaglist1 = tagCompund.getTagList("EnderItems", 10);
        this.theInventoryEnderChest.loadInventoryFromNBT(nbttaglist1);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:46,代码来源:EntityPlayer.java

示例13: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    super.readEntityFromNBT(tagCompund);

    if (tagCompund.hasKey("CanPickUpLoot", 1))
    {
        this.setCanPickUpLoot(tagCompund.getBoolean("CanPickUpLoot"));
    }

    this.persistenceRequired = tagCompund.getBoolean("PersistenceRequired");

    if (tagCompund.hasKey("Equipment", 9))
    {
        NBTTagList nbttaglist = tagCompund.getTagList("Equipment", 10);

        for (int i = 0; i < this.equipment.length; ++i)
        {
            this.equipment[i] = ItemStack.loadItemStackFromNBT(nbttaglist.getCompoundTagAt(i));
        }
    }

    if (tagCompund.hasKey("DropChances", 9))
    {
        NBTTagList nbttaglist1 = tagCompund.getTagList("DropChances", 5);

        for (int j = 0; j < nbttaglist1.tagCount(); ++j)
        {
            this.equipmentDropChances[j] = nbttaglist1.getFloatAt(j);
        }
    }

    this.isLeashed = tagCompund.getBoolean("Leashed");

    if (this.isLeashed && tagCompund.hasKey("Leash", 10))
    {
        this.leashNBTTag = tagCompund.getCompoundTag("Leash");
    }

    this.setNoAI(tagCompund.getBoolean("NoAI"));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:44,代码来源:EntityLiving.java

示例14: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readFromNBT(@NotNull NBTTagCompound compound) {
    exactCopy = compound.getBoolean("ExactCopy");
    super.readFromNBT(compound);
}
 
开发者ID:Buuz135,项目名称:Industrial-Foregoing,代码行数:6,代码来源:MobDuplicatorTile.java

示例15: readNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readNBT(NBTTagCompound nbt, NBTType type) {
    super.readNBT(nbt, type);
    this.isWorking = nbt.getBoolean("Working");
}
 
开发者ID:canitzp,项目名称:Metalworks,代码行数:6,代码来源:TileSuperCharger.java


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