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