本文整理匯總了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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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));
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
}
示例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);
}
}
示例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;
}