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


Java NBTTagCompound.setLong方法代码示例

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


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

示例1: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound writeToNBT(NBTTagCompound compound)
{
    super.writeToNBT(compound);
    compound.setLong("Age", this.age);

    if (this.exitPortal != null)
    {
        compound.setTag("ExitPortal", NBTUtil.createPosTag(this.exitPortal));
    }

    if (this.exactTeleport)
    {
        compound.setBoolean("ExactTeleport", this.exactTeleport);
    }

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

示例2: writeCustomNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeCustomNBT(NBTTagCompound tag) {
	
	if (!beats.isEmpty() || beats.size() > 0)
	{
		NBTTagList taglist = new NBTTagList();
		for (int i = 0; i < beats.size(); i++) {
			Beat beat = beats.get(i);
			NBTTagCompound tag2 = new NBTTagCompound();
			tag2.setInteger(UCStrings.TAG_NOTE, beat.note);
			tag2.setInteger(UCStrings.TAG_INST, beat.instrument);
			tag2.setInteger(UCStrings.TAG_OCT, beat.octave);
			tag2.setLong(UCStrings.TAG_TIME, beat.worldtime);
			taglist.appendTag(tag2);
		}
		tag.setTag(UCStrings.TAG_BEATLIST, taglist);
	}
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:19,代码来源:TileMusicaPlant.java

示例3: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound writeToNBT(NBTTagCompound compound)
{
    super.writeToNBT(compound);
    compound.setString("name", this.name);
    compound.setString("author", this.author);
    compound.setString("metadata", this.metadata);
    compound.setInteger("posX", this.position.getX());
    compound.setInteger("posY", this.position.getY());
    compound.setInteger("posZ", this.position.getZ());
    compound.setInteger("sizeX", this.size.getX());
    compound.setInteger("sizeY", this.size.getY());
    compound.setInteger("sizeZ", this.size.getZ());
    compound.setString("rotation", this.rotation.toString());
    compound.setString("mirror", this.mirror.toString());
    compound.setString("mode", this.mode.toString());
    compound.setBoolean("ignoreEntities", this.ignoreEntities);
    compound.setBoolean("powered", this.powered);
    compound.setBoolean("showair", this.showAir);
    compound.setBoolean("showboundingbox", this.showBoundingBox);
    compound.setFloat("integrity", this.integrity);
    compound.setLong("seed", this.seed);
    return compound;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:TileEntityStructure.java

示例4: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
	super.writeToNBT(compound);
	compound.setTag("inv", inventory.serializeNBT());

	compound.setBoolean("cooking", isCooking);
	compound.setInteger("fuel", fuelTimer);
	compound.setInteger("max", maxFuelTimer);

	NBTTagCompound connections = new NBTTagCompound();
	int slot = 0;
	for(BlockPos pos : connected)
	{
		connections.setLong(Integer.toString(slot), pos.toLong());
		slot++;
	}
	compound.setTag("connections", (NBTTagCompound)connections);

	System.out.println("write "+connections);
	return compound;
}
 
开发者ID:ArtixAllMighty,项目名称:ExSartagine,代码行数:22,代码来源:TileEntityRange.java

示例5: writeNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public void writeNBT(NBTTagCompound nbt) {
	nbt.setInteger("id", id);
	nbt.setLong("ticksSync", ticksSinceSync);

	if (itemStack != null)
		itemStack.writeToNBT(nbt);

	nbt.setFloat("progress", progress);

	if (direction != null)
		nbt.setInteger("dir", direction.ordinal());

	if (this.color != null)
		nbt.setInteger("color", this.color.getMetadata());
	else
		nbt.setInteger("color", -1);
}
 
开发者ID:oMilkyy,项目名称:SimpleTubes,代码行数:18,代码来源:TubeItem.java

示例6: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);
    tag.setFloat("targetRotationAngle", targetRotationAngle);
    tag.setFloat("targetHeightAngle", targetHeightAngle);
    tag.setFloat("rotationAngle", rotationAngle);
    tag.setFloat("heightAngle", heightAngle);
    tag.setInteger("gpsX", gpsX);
    tag.setInteger("gpsY", gpsY);
    tag.setInteger("gpsZ", gpsZ);
    tag.setByte("redstoneMode", (byte) redstoneMode);
    tag.setBoolean("targetWithinReach", coordWithinReach);
    tag.setTag("Items", inventory.serializeNBT());

    NBTTagList tagList = new NBTTagList();
    for (EntityItem entity : trackedItems) {
        UUID uuid = entity.getUniqueID();
        NBTTagCompound t = new NBTTagCompound();
        t.setLong("UUIDMost", uuid.getMostSignificantBits());
        t.setLong("UUIDLeast", uuid.getLeastSignificantBits());
        tagList.appendTag(t);
    }
    tag.setTag("trackedItems", tagList);

    if (lastInsertingInventory != null) {
        tag.setInteger("inventoryX", lastInsertingInventory.getX());
        tag.setInteger("inventoryY", lastInsertingInventory.getY());
        tag.setInteger("inventoryZ", lastInsertingInventory.getZ());
        tag.setByte("inventorySide", (byte) lastInsertingInventorySide.ordinal());
    }

    return tag;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:34,代码来源:TileEntityAirCannon.java

示例7: 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

示例8: 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

示例9: onDrink

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void onDrink(World world, BlockPos pos, FluidStack stack, EntityPlayer player, boolean fromFluidContainer) {
    player.extinguish();
    NBTTagCompound tag = player.getEntityData();
    if (tag.hasKey("lavaDrink") && world.getTotalWorldTime() - tag.getLong("lavaDrink") < 120) { //6 Seconds to drink water after drinking lava to create obsidian
        player.entityDropItem(new ItemStack(Blocks.OBSIDIAN), player.getEyeHeight());

        tag.setLong("lavaDrink", 0);
        world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_PLAYER_BURP, SoundCategory.PLAYERS, 1.5F, world.rand.nextFloat() * 0.1F + 0.9F);
    }
}
 
开发者ID:Buuz135,项目名称:Industrial-Foregoing,代码行数:12,代码来源:WaterStrawHandler.java

示例10: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
	super.writeToNBT(compound);
	compound.setBoolean("cooking", isCooking);
	compound.setLong("parent", parentRange.toLong());
	return compound;
}
 
开发者ID:ArtixAllMighty,项目名称:ExSartagine,代码行数:8,代码来源:TileEntityRangeExtension.java

示例11: getNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public NBTTagCompound getNBT() {
	NBTTagCompound tag = new NBTTagCompound();
	tag.setInteger("progress", te.getProgress());
	tag.setInteger("rfusage", te.rfUsage);
	tag.setInteger("maxprogress", te.max_progress);
	tag.setLong("rf", te.rf.getEnergyStored());
	return tag;
}
 
开发者ID:tiffit,项目名称:Defier,代码行数:10,代码来源:CompressorContainer.java

示例12: writeAttributeModifierToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Creates an NBTTagCompound from an AttributeModifier
 */
private static NBTTagCompound writeAttributeModifierToNBT(AttributeModifier p_111262_0_)
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    nbttagcompound.setString("Name", p_111262_0_.getName());
    nbttagcompound.setDouble("Amount", p_111262_0_.getAmount());
    nbttagcompound.setInteger("Operation", p_111262_0_.getOperation());
    nbttagcompound.setLong("UUIDMost", p_111262_0_.getID().getMostSignificantBits());
    nbttagcompound.setLong("UUIDLeast", p_111262_0_.getID().getLeastSignificantBits());
    return nbttagcompound;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:SharedMonsterAttributes.java

示例13: 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("CanPickUpLoot", this.canPickUpLoot());
    tagCompound.setBoolean("PersistenceRequired", this.persistenceRequired);
    NBTTagList nbttaglist = new NBTTagList();

    for (int i = 0; i < this.equipment.length; ++i)
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();

        if (this.equipment[i] != null)
        {
            this.equipment[i].writeToNBT(nbttagcompound);
        }

        nbttaglist.appendTag(nbttagcompound);
    }

    tagCompound.setTag("Equipment", nbttaglist);
    NBTTagList nbttaglist1 = new NBTTagList();

    for (int j = 0; j < this.equipmentDropChances.length; ++j)
    {
        nbttaglist1.appendTag(new NBTTagFloat(this.equipmentDropChances[j]));
    }

    tagCompound.setTag("DropChances", nbttaglist1);
    tagCompound.setBoolean("Leashed", this.isLeashed);

    if (this.leashedToEntity != null)
    {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();

        if (this.leashedToEntity instanceof EntityLivingBase)
        {
            nbttagcompound1.setLong("UUIDMost", this.leashedToEntity.getUniqueID().getMostSignificantBits());
            nbttagcompound1.setLong("UUIDLeast", this.leashedToEntity.getUniqueID().getLeastSignificantBits());
        }
        else if (this.leashedToEntity instanceof EntityHanging)
        {
            BlockPos blockpos = ((EntityHanging)this.leashedToEntity).getHangingPosition();
            nbttagcompound1.setInteger("X", blockpos.getX());
            nbttagcompound1.setInteger("Y", blockpos.getY());
            nbttagcompound1.setInteger("Z", blockpos.getZ());
        }

        tagCompound.setTag("Leash", nbttagcompound1);
    }

    if (this.isAIDisabled())
    {
        tagCompound.setBoolean("NoAI", this.isAIDisabled());
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:59,代码来源:EntityLiving.java

示例14: updateTagCompound

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
private void updateTagCompound(NBTTagCompound nbt, NBTTagCompound playerNbt)
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    nbttagcompound.setString("Name", "1.10.2");
    nbttagcompound.setInteger("Id", 512);
    nbttagcompound.setBoolean("Snapshot", false);
    nbt.setTag("Version", nbttagcompound);
    nbt.setInteger("DataVersion", 512);
    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());
    NBTTagCompound nbttagcompound1 = new NBTTagCompound();

    for (Entry<DimensionType, NBTTagCompound> entry : this.dimensionData.entrySet())
    {
        nbttagcompound1.setTag(String.valueOf(((DimensionType)entry.getKey()).getId()), (NBTBase)entry.getValue());
    }

    nbt.setTag("DimensionData", nbttagcompound1);

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

示例15: createUUIDTag

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public static NBTTagCompound createUUIDTag(UUID uuid) {
	NBTTagCompound nbttagcompound = new NBTTagCompound();
	nbttagcompound.setLong("M", uuid.getMostSignificantBits());
	nbttagcompound.setLong("L", uuid.getLeastSignificantBits());
	return nbttagcompound;
}
 
开发者ID:TominoCZ,项目名称:PAYDAY,代码行数:7,代码来源:LobbyTileEntity.java


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