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


Java NBTTagCompound.setBoolean方法代码示例

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


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

示例1: writeEntityToNBT

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

    if (this.getOwnerId() == null)
    {
        tagCompound.setString("OwnerUUID", "");
    }
    else
    {
        tagCompound.setString("OwnerUUID", this.getOwnerId());
    }

    tagCompound.setBoolean("Sitting", this.isSitting());
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:19,代码来源:EntityTameable.java

示例2: writeEntityToNBT

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

    if (this.getOwnerId() == null)
    {
        compound.setString("OwnerUUID", "");
    }
    else
    {
        compound.setString("OwnerUUID", this.getOwnerId().toString());
    }

    compound.setBoolean("Sitting", this.isSitting());
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:19,代码来源:EntityTameable.java

示例3: writeNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public void writeNBT(NBTTagCompound cmp) {
	NBTTagCompound tag = new NBTTagCompound();
	tag.setString("ritual", RitualRegistry.getRitualResource(ritual).toString());
	tag.setInteger("energy_left", energy_left);
	tag.setInteger("ticks", ticks);
	tag.setBoolean("fail", fail);
	cmp.setTag("ritual_data", tag);
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:9,代码来源:CauldronRitualHolder.java

示例4: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);
    tag.setBoolean("laser", isLaserOn);
    tag.setInteger("laserStep", laserStep);
    return tag;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:8,代码来源:TileEntityAssemblyLaser.java

示例5: writeStructureToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
protected void writeStructureToNBT(NBTTagCompound tagCompound)
{
    super.writeStructureToNBT(tagCompound);
    tagCompound.setBoolean("hasPlacedChest0", this.field_74940_h[0]);
    tagCompound.setBoolean("hasPlacedChest1", this.field_74940_h[1]);
    tagCompound.setBoolean("hasPlacedChest2", this.field_74940_h[2]);
    tagCompound.setBoolean("hasPlacedChest3", this.field_74940_h[3]);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:9,代码来源:ComponentScatteredFeaturePieces.java

示例6: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to write subclass entity data to NBT.
 */
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
    super.writeEntityToNBT(tagCompound);
    tagCompound.setBoolean("Sheared", this.getSheared());
    tagCompound.setByte("Color", (byte)this.getFleeceColor().getMetadata());
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:EntitySheep.java

示例7: writeStructureToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Helper method to write subclass data to NBT
 */
protected void writeStructureToNBT(NBTTagCompound tagCompound)
{
    super.writeStructureToNBT(tagCompound);
    tagCompound.setBoolean("hr", this.hasRails);
    tagCompound.setBoolean("sc", this.hasSpiders);
    tagCompound.setBoolean("hps", this.spawnerPlaced);
    tagCompound.setInteger("Num", this.sectionCount);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:StructureMineshaftPieces.java

示例8: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);
    tag.setFloat("clawProgress", clawProgress);
    tag.setBoolean("clawClosing", shouldClawClose);
    tag.setByte("state", state);
    tag.setBoolean("exporting", exporting);
    tag.setTag("Items", inventory.serializeNBT());
    return tag;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:11,代码来源:TileEntityAssemblyIOUnit.java

示例9: writeStructureToNBT

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

示例10: writeNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
void writeNBT(NBTTagCompound compound) {
	super.writeNBT(compound);
	compound.setBoolean("powered", powered);
	compound.setInteger("index", index);
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:7,代码来源:TileMechanicalTranslocator.java

示例11: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Save the entity to NBT (calls an abstract helper method to write extra data)
 */
public void writeToNBT(NBTTagCompound tagCompund)
{
    try
    {
        tagCompund.setTag("Pos", this.newDoubleNBTList(new double[] {this.posX, this.posY, this.posZ}));
        tagCompund.setTag("Motion", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ}));
        tagCompund.setTag("Rotation", this.newFloatNBTList(new float[] {this.rotationYaw, this.rotationPitch}));
        tagCompund.setFloat("FallDistance", this.fallDistance);
        tagCompund.setShort("Fire", (short)this.fire);
        tagCompund.setShort("Air", (short)this.getAir());
        tagCompund.setBoolean("OnGround", this.onGround);
        tagCompund.setInteger("Dimension", this.dimension);
        tagCompund.setBoolean("Invulnerable", this.invulnerable);
        tagCompund.setInteger("PortalCooldown", this.timeUntilPortal);
        tagCompund.setLong("UUIDMost", this.getUniqueID().getMostSignificantBits());
        tagCompund.setLong("UUIDLeast", this.getUniqueID().getLeastSignificantBits());

        if (this.getCustomNameTag() != null && this.getCustomNameTag().length() > 0)
        {
            tagCompund.setString("CustomName", this.getCustomNameTag());
            tagCompund.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag());
        }

        this.cmdResultStats.writeStatsToNBT(tagCompund);

        if (this.isSilent())
        {
            tagCompund.setBoolean("Silent", this.isSilent());
        }

        this.writeEntityToNBT(tagCompund);

        if (this.ridingEntity != null)
        {
            NBTTagCompound nbttagcompound = new NBTTagCompound();

            if (this.ridingEntity.writeMountToNBT(nbttagcompound))
            {
                tagCompund.setTag("Riding", nbttagcompound);
            }
        }
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Saving entity NBT");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being saved");
        this.addEntityCrashInfo(crashreportcategory);
        throw new ReportedException(crashreport);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:54,代码来源:Entity.java

示例12: writeStructureToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Helper method to write subclass data to NBT
 */
protected void writeStructureToNBT(NBTTagCompound tagCompound)
{
    super.writeStructureToNBT(tagCompound);
    tagCompound.setBoolean("Tall", this.isLargeRoom);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:StructureStrongholdPieces.java

示例13: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);
    tag.setBoolean("isAndFunction", isAndFunction);
    tag.setByte("operator", (byte) operator.ordinal());
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:7,代码来源:ProgWidgetCondition.java

示例14: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to write subclass entity data to NBT.
 */
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
    super.writeEntityToNBT(tagCompound);
    tagCompound.setBoolean("EatingHaystack", this.isEatingHaystack());
    tagCompound.setBoolean("ChestedHorse", this.isChested());
    tagCompound.setBoolean("HasReproduced", this.getHasReproduced());
    tagCompound.setBoolean("Bred", this.isBreeding());
    tagCompound.setInteger("Type", this.getHorseType());
    tagCompound.setInteger("Variant", this.getHorseVariant());
    tagCompound.setInteger("Temper", this.getTemper());
    tagCompound.setBoolean("Tame", this.isTame());
    tagCompound.setString("OwnerUUID", this.getOwnerId());

    if (this.isChested())
    {
        NBTTagList nbttaglist = new NBTTagList();

        for (int i = 2; i < this.horseChest.getSizeInventory(); ++i)
        {
            ItemStack itemstack = this.horseChest.getStackInSlot(i);

            if (itemstack != null)
            {
                NBTTagCompound nbttagcompound = new NBTTagCompound();
                nbttagcompound.setByte("Slot", (byte)i);
                itemstack.writeToNBT(nbttagcompound);
                nbttaglist.appendTag(nbttagcompound);
            }
        }

        tagCompound.setTag("Items", nbttaglist);
    }

    if (this.horseChest.getStackInSlot(1) != null)
    {
        tagCompound.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new NBTTagCompound()));
    }

    if (this.horseChest.getStackInSlot(0) != null)
    {
        tagCompound.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new NBTTagCompound()));
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:47,代码来源:EntityHorse.java

示例15: updateTagCompound

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
private void updateTagCompound(NBTTagCompound nbt, NBTTagCompound playerNbt)
{
    nbt.setLong("RandomSeed", this.randomSeed);
    nbt.setString("generatorName", this.terrainType.getWorldTypeName());
    nbt.setInteger("generatorVersion", this.terrainType.getGeneratorVersion());
    nbt.setString("generatorOptions", this.generatorOptions);
    nbt.setInteger("GameType", this.theGameType.getID());
    nbt.setBoolean("MapFeatures", this.mapFeaturesEnabled);
    nbt.setInteger("SpawnX", this.spawnX);
    nbt.setInteger("SpawnY", this.spawnY);
    nbt.setInteger("SpawnZ", this.spawnZ);
    nbt.setLong("Time", this.totalTime);
    nbt.setLong("DayTime", this.worldTime);
    nbt.setLong("SizeOnDisk", this.sizeOnDisk);
    nbt.setLong("LastPlayed", MinecraftServer.getCurrentTimeMillis());
    nbt.setString("LevelName", this.levelName);
    nbt.setInteger("version", this.saveVersion);
    nbt.setInteger("clearWeatherTime", this.cleanWeatherTime);
    nbt.setInteger("rainTime", this.rainTime);
    nbt.setBoolean("raining", this.raining);
    nbt.setInteger("thunderTime", this.thunderTime);
    nbt.setBoolean("thundering", this.thundering);
    nbt.setBoolean("hardcore", this.hardcore);
    nbt.setBoolean("allowCommands", this.allowCommands);
    nbt.setBoolean("initialized", this.initialized);
    nbt.setDouble("BorderCenterX", this.borderCenterX);
    nbt.setDouble("BorderCenterZ", this.borderCenterZ);
    nbt.setDouble("BorderSize", this.borderSize);
    nbt.setLong("BorderSizeLerpTime", this.borderSizeLerpTime);
    nbt.setDouble("BorderSafeZone", this.borderSafeZone);
    nbt.setDouble("BorderDamagePerBlock", this.borderDamagePerBlock);
    nbt.setDouble("BorderSizeLerpTarget", this.borderSizeLerpTarget);
    nbt.setDouble("BorderWarningBlocks", (double)this.borderWarningDistance);
    nbt.setDouble("BorderWarningTime", (double)this.borderWarningTime);

    if (this.difficulty != null)
    {
        nbt.setByte("Difficulty", (byte)this.difficulty.getDifficultyId());
    }

    nbt.setBoolean("DifficultyLocked", this.difficultyLocked);
    nbt.setTag("GameRules", this.theGameRules.writeToNBT());

    if (playerNbt != null)
    {
        nbt.setTag("Player", playerNbt);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:49,代码来源:WorldInfo.java


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