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


Java NBTTagCompound.setInteger方法代码示例

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


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

示例1: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to write subclass entity data to NBT.
 */
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
    Block block = this.fallTile != null ? this.fallTile.getBlock() : Blocks.air;
    ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(block);
    tagCompound.setString("Block", resourcelocation == null ? "" : resourcelocation.toString());
    tagCompound.setByte("Data", (byte)block.getMetaFromState(this.fallTile));
    tagCompound.setByte("Time", (byte)this.fallTime);
    tagCompound.setBoolean("DropItem", this.shouldDropItem);
    tagCompound.setBoolean("HurtEntities", this.hurtEntities);
    tagCompound.setFloat("FallHurtAmount", this.fallHurtAmount);
    tagCompound.setInteger("FallHurtMax", this.fallHurtMax);

    if (this.tileEntityData != null)
    {
        tagCompound.setTag("TileEntityData", this.tileEntityData);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:21,代码来源:EntityFallingBlock.java

示例2: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public void writeToNBT(NBTTagCompound compound)
{
    String s = (String)classToNameMap.get(this.getClass());

    if (s == null)
    {
        throw new RuntimeException(this.getClass() + " is missing a mapping! This is a bug!");
    }
    else
    {
        compound.setString("id", s);
        compound.setInteger("x", this.pos.getX());
        compound.setInteger("y", this.pos.getY());
        compound.setInteger("z", this.pos.getZ());
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:17,代码来源:TileEntity.java

示例3: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Nonnull
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
	compound = super.writeToNBT(compound);
	if (sapInBucket != null) {
		sapInBucket.writeToNBT(compound);
		compound.setInteger("direction", direction.getIndex());
		compound.setInteger("sappertick", LIQUID_AMOUNT);
	}
	return compound;
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:Got-Wood,代码行数:12,代码来源:TileEntityTreeTap.java

示例4: checkedReadChunkFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Wraps readChunkFromNBT. Checks the coordinates and several NBT tags.
 */
protected Chunk checkedReadChunkFromNBT(World worldIn, int x, int z, NBTTagCompound p_75822_4_)
{
    if (!p_75822_4_.hasKey("Level", 10))
    {
        logger.error("Chunk file at " + x + "," + z + " is missing level data, skipping");
        return null;
    }
    else
    {
        NBTTagCompound nbttagcompound = p_75822_4_.getCompoundTag("Level");

        if (!nbttagcompound.hasKey("Sections", 9))
        {
            logger.error("Chunk file at " + x + "," + z + " is missing block data, skipping");
            return null;
        }
        else
        {
            Chunk chunk = this.readChunkFromNBT(worldIn, nbttagcompound);

            if (!chunk.isAtLocation(x, z))
            {
                logger.error("Chunk file at " + x + "," + z + " is in the wrong location; relocating. (Expected " + x + ", " + z + ", got " + chunk.xPosition + ", " + chunk.zPosition + ")");
                nbttagcompound.setInteger("xPos", x);
                nbttagcompound.setInteger("zPos", z);
                chunk = this.readChunkFromNBT(worldIn, nbttagcompound);
            }

            return chunk;
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:36,代码来源:AnvilChunkLoader.java

示例5: saveFlags

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Save flags to file
 * @throws IOException If flags failed to save
 */
private void saveFlags() throws IOException {
    NBTTagCompound tag = new NBTTagCompound();
    tag.setInteger("Version", VERSION);
    tag.setShort("Width", (short)getWidth());
    tag.setShort("Height", (short)getHeight());
    tag.setShort("Length", (short)getLength());
    tag.setLong("SchemaLen", getSchemaLen());
    tag.setInteger("Lift", getLift());
    tag.setInteger("Method", getMethod().getValue());
    tag.setInteger("Biome", getBiomus().getValue());
    Utils.writeTags(getFileFlag(), tag);
}
 
开发者ID:ternsip,项目名称:StructPro,代码行数:17,代码来源:Structure.java

示例6: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to write subclass entity data to NBT.
 */
protected void writeEntityToNBT(NBTTagCompound compound)
{
    if (this.hasDisplayTile())
    {
        compound.setBoolean("CustomDisplayTile", true);
        IBlockState iblockstate = this.getDisplayTile();
        ResourceLocation resourcelocation = (ResourceLocation)Block.REGISTRY.getNameForObject(iblockstate.getBlock());
        compound.setString("DisplayTile", resourcelocation == null ? "" : resourcelocation.toString());
        compound.setInteger("DisplayData", iblockstate.getBlock().getMetaFromState(iblockstate));
        compound.setInteger("DisplayOffset", this.getDisplayTileOffset());
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:16,代码来源:EntityMinecart.java

示例7: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to write subclass entity data to NBT.
 */
protected void writeEntityToNBT(NBTTagCompound compound)
{
    super.writeEntityToNBT(compound);
    compound.setInteger("TransferCooldown", this.transferTicker);
    compound.setBoolean("Enabled", this.isBlocked);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:EntityMinecartHopper.java

示例8: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeToNBT(NBTTagCompound tag) {
    NBTTagCompound pneumaticTag = new NBTTagCompound();
    pneumaticTag.setInteger("air", air);
    pneumaticTag.setInteger("volume", volume);
    pneumaticTag.setFloat("maxPressure", maxPressure);
    tag.setTag("pneumatic", pneumaticTag);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:9,代码来源:AirHandler.java

示例9: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeEntityToNBT(NBTTagCompound compound)
{
    super.writeEntityToNBT(compound);
    compound.setTag("animalData", this.animalCapability.serializeNBT());
    compound.setLong("age", this.getDataManager().get(PARAM_AGE));
    compound.setBoolean("gender", this.getDataManager().get(PARAM_GENDER));
    compound.setInteger("pregnancy", this.getDataManager().get(PARAM_PREGNANCY));
    compound.setBoolean("domesticated", this.getDataManager().get(PARAM_DOMESTICATED));
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:11,代码来源:EntityAnimal.java

示例10: writeStructureToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
protected void writeStructureToNBT(NBTTagCompound tagCompound)
{
    tagCompound.setBoolean("hr", this.hasRails);
    tagCompound.setBoolean("sc", this.hasSpiders);
    tagCompound.setBoolean("hps", this.spawnerPlaced);
    tagCompound.setInteger("Num", this.sectionCount);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:StructureMineshaftPieces.java

示例11: getTabIconItem

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public ItemStack getTabIconItem()
{
	NBTTagCompound tags =  new NBTTagCompound();
	tags.setInteger("pos1_x", 1);
	ItemStack stack = new ItemStack(AnimaItems.LINKER);
	stack.setTagCompound(tags);
	return stack;
}
 
开发者ID:Lemonszz,项目名称:Anima-Mundi,代码行数:10,代码来源:AnimaTab.java

示例12: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeEntityToNBT(NBTTagCompound compound) {
    super.writeEntityToNBT(compound);
    NBTTagCompound sub = new NBTTagCompound();
    sub.setUniqueId("id", this.id);
    sub.setInteger("index", this.index);
    sub.setBoolean("hadEffect", this.hadEffect);
    sub.setBoolean("hasEffect", this.hasEffect);
    compound.setTag("randores", sub);
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:11,代码来源:RandoresArrow.java

示例13: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound writeToNBT() {
    NBTTagCompound tag = new NBTTagCompound();
    tag.setInteger("type", type.ordinal());
    tag.setInteger("facing", facing.ordinal());
    tag.setString("ioInfo", ioInfo.name());
    return tag;
}
 
开发者ID:jaredlll08,项目名称:Machines-and-Stuff,代码行数:8,代码来源:AccumulatorInfo.java

示例14: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities
 */
public void writeToNBT(NBTTagCompound nbt)
{
    nbt.setByte("dimension", this.dimension);
    nbt.setInteger("xCenter", this.xCenter);
    nbt.setInteger("zCenter", this.zCenter);
    nbt.setByte("scale", this.scale);
    nbt.setShort("width", (short)128);
    nbt.setShort("height", (short)128);
    nbt.setByteArray("colors", this.colors);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:14,代码来源:MapData.java

示例15: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
{
    Template.BasicPalette template$basicpalette = new Template.BasicPalette();
    NBTTagList nbttaglist = new NBTTagList();

    for (Template.BlockInfo template$blockinfo : this.blocks)
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        nbttagcompound.setTag("pos", this.writeInts(new int[] {template$blockinfo.pos.getX(), template$blockinfo.pos.getY(), template$blockinfo.pos.getZ()}));
        nbttagcompound.setInteger("state", template$basicpalette.idFor(template$blockinfo.blockState));

        if (template$blockinfo.tileentityData != null)
        {
            nbttagcompound.setTag("nbt", template$blockinfo.tileentityData);
        }

        nbttaglist.appendTag(nbttagcompound);
    }

    NBTTagList nbttaglist1 = new NBTTagList();

    for (Template.EntityInfo template$entityinfo : this.entities)
    {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound1.setTag("pos", this.writeDoubles(new double[] {template$entityinfo.pos.xCoord, template$entityinfo.pos.yCoord, template$entityinfo.pos.zCoord}));
        nbttagcompound1.setTag("blockPos", this.writeInts(new int[] {template$entityinfo.blockPos.getX(), template$entityinfo.blockPos.getY(), template$entityinfo.blockPos.getZ()}));

        if (template$entityinfo.entityData != null)
        {
            nbttagcompound1.setTag("nbt", template$entityinfo.entityData);
        }

        nbttaglist1.appendTag(nbttagcompound1);
    }

    NBTTagList nbttaglist2 = new NBTTagList();

    for (IBlockState iblockstate : template$basicpalette)
    {
        nbttaglist2.appendTag(NBTUtil.writeBlockState(new NBTTagCompound(), iblockstate));
    }

    nbt.setTag("palette", nbttaglist2);
    nbt.setTag("blocks", nbttaglist);
    nbt.setTag("entities", nbttaglist1);
    nbt.setTag("size", this.writeInts(new int[] {this.size.getX(), this.size.getY(), this.size.getZ()}));
    nbt.setString("author", this.author);
    nbt.setInteger("DataVersion", 922);
    return nbt;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:51,代码来源:Template.java


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