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