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


Java NBTTagCompound.setDouble方法代码示例

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


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

示例1: writeAttributeInstanceToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Creates an NBTTagCompound from an AttributeInstance, including its AttributeModifiers
 */
private static NBTTagCompound writeAttributeInstanceToNBT(IAttributeInstance instance)
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    IAttribute iattribute = instance.getAttribute();
    nbttagcompound.setString("Name", iattribute.getAttributeUnlocalizedName());
    nbttagcompound.setDouble("Base", instance.getBaseValue());
    Collection<AttributeModifier> collection = instance.getModifiers();

    if (collection != null && !collection.isEmpty())
    {
        NBTTagList nbttaglist = new NBTTagList();

        for (AttributeModifier attributemodifier : collection)
        {
            if (attributemodifier.isSaved())
            {
                nbttaglist.appendTag(writeAttributeModifierToNBT(attributemodifier));
            }
        }

        nbttagcompound.setTag("Modifiers", nbttaglist);
    }

    return nbttagcompound;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:29,代码来源:SharedMonsterAttributes.java

示例2: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Forward for the base TileEntity's writeToNBT(), used for saving the state.
 *
 * @param tag Compound tag as supplied by TileEntity.writeToNBT()
 */
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
	try {
		super.writeToNBT(tag);
	} catch (RuntimeException e) {
		// happens if this is a delegate, ignore
	}

	NBTTagCompound data = new NBTTagCompound();

	data.setDouble("energy", energyStored);

	tag.setTag("IC2BasicSink", data);

	return tag;
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:22,代码来源:BasicSink.java

示例3: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Forward for the base TileEntity's writeToNBT(), used for saving the state.
 *
 * @param tag Compound tag as supplied by TileEntity.writeToNBT()
 */
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
	try {
		super.writeToNBT(tag);
	} catch (RuntimeException e) {
		// happens if this is a delegate, ignore
	}

	NBTTagCompound data = new NBTTagCompound();

	data.setDouble("energy", energyStored);

	tag.setTag("IC2BasicSource", data);

	return tag;
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:22,代码来源:BasicSource.java

示例4: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
protected void writeEntityToNBT(NBTTagCompound tag) 
{
	tag.setShort("xTile", (short)this.stuckBlockX);
       tag.setShort("yTile", (short)this.stuckBlockY);
       tag.setShort("zTile", (short)this.stuckBlockY);
       
       tag.setShort("life", (short) this.ticksInGround);
       tag.setShort("lifeMax", (short) this.ticksInGroundMax);
       tag.setShort("lifeInAirMax", (short) this.ticksInAirMax);
       
       tag.setByte("inTile", (byte)Block.getIdFromBlock(this.stuckBlock));
       
       tag.setByte("inData", (byte)this.inData);
       
       tag.setByte("shake", (byte)this.arrowShake);
       
       tag.setByte("inGround", (byte)(this.inGround ? 1 : 0));
       
       tag.setBoolean("pickup", (boolean)this.canBePickedUp);
       
       tag.setDouble("damage", this.damage);
}
 
开发者ID:Domochevsky,项目名称:minecraft-quiverbow,代码行数:24,代码来源:_ProjectileBase.java

示例5: writeAttributeModifierToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Helper method for writing new attribute modifiers.
 * @param attribute
 * @param modifier
 * @param slot
 * @return
 */
public static NBTTagCompound writeAttributeModifierToNBT(IAttribute attribute, AttributeModifier modifier, EntityEquipmentSlot slot) 
{
	NBTTagCompound nbt = new NBTTagCompound();
	
	nbt.setString("AttributeName", attribute.getName());
	nbt.setString("Name", modifier.getName());
	nbt.setString("Slot", slot.getName());
	nbt.setDouble("Amount", modifier.getAmount());
	nbt.setInteger("Operation", modifier.getOperation());
	nbt.setLong("UUIDMost", modifier.getID().getMostSignificantBits());
	nbt.setLong("UUIDLeast", modifier.getID().getLeastSignificantBits());
	
	return nbt;
}
 
开发者ID:TheXFactor117,项目名称:Loot-Slash-Conquer,代码行数:22,代码来源:ItemGeneratorHelper.java

示例6: createMagical

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/** Creates a magical weapon with randomized stats. */
public static void createMagical(ItemStack stack, NBTTagCompound nbt, World world, ChunkPos pos)
{
	if (Rarity.getRarity(nbt) != Rarity.DEFAULT && stack.getItem() instanceof ItemLEMagical)
	{
		IChunkLevelHolder chunkLevelHolder = world.getCapability(CapabilityChunkLevel.CHUNK_LEVEL, null);
		IChunkLevel chunkLevel = chunkLevelHolder.getChunkLevel(pos);
		int level = chunkLevel.getChunkLevel();
		ItemLEMagical wand = (ItemLEMagical) stack.getItem();
		
		ItemGeneratorHelper.setTypes(stack, nbt);
		Rarity.setRarity(nbt, Rarity.getRandomRarity(nbt, ItemGeneratorHelper.rand));
		nbt.setInteger("Level", level);
		ItemGeneratorHelper.setRandomAttributes(stack, nbt, Rarity.getRarity(nbt));
		
		// handles setting weighted damage/attack speed and min/max damage
		double baseDamage = wand.getBaseDamage();
		double baseAttackSpeed = wand.getBaseAttackSpeed();
		double weightedDamage = ItemGeneratorHelper.getWeightedDamage(nbt, Rarity.getRarity(nbt), baseDamage);
		double weightedAttackSpeed = ItemGeneratorHelper.getWeightedAttackSpeed(Rarity.getRarity(nbt), baseAttackSpeed);
		
		ItemGeneratorHelper.setMinMaxDamage(nbt, weightedDamage);
		nbt.setDouble("AttackSpeed", weightedAttackSpeed);
		ItemGeneratorHelper.setRune(nbt);
		nbt.setInteger("HideFlags", 6); // hides Attribute Modifier and Unbreakable tags
	}
}
 
开发者ID:TheXFactor117,项目名称:Loot-Slash-Conquer,代码行数:28,代码来源:ItemGenerator.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)
{
    if (this.owner != null)
    {
        BlockPos blockpos = new BlockPos(this.owner);
        NBTTagCompound nbttagcompound = NBTUtil.createUUIDTag(this.owner.getUniqueID());
        nbttagcompound.setInteger("X", blockpos.getX());
        nbttagcompound.setInteger("Y", blockpos.getY());
        nbttagcompound.setInteger("Z", blockpos.getZ());
        compound.setTag("Owner", nbttagcompound);
    }

    if (this.target != null)
    {
        BlockPos blockpos1 = new BlockPos(this.target);
        NBTTagCompound nbttagcompound1 = NBTUtil.createUUIDTag(this.target.getUniqueID());
        nbttagcompound1.setInteger("X", blockpos1.getX());
        nbttagcompound1.setInteger("Y", blockpos1.getY());
        nbttagcompound1.setInteger("Z", blockpos1.getZ());
        compound.setTag("Target", nbttagcompound1);
    }

    if (this.direction != null)
    {
        compound.setInteger("Dir", this.direction.getIndex());
    }

    compound.setInteger("Steps", this.steps);
    compound.setDouble("TXD", this.targetDeltaX);
    compound.setDouble("TYD", this.targetDeltaY);
    compound.setDouble("TZD", this.targetDeltaZ);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:36,代码来源:EntityShulkerBullet.java

示例8: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
	tag.setDouble("x", x);
	tag.setDouble("y", y);
	tag.setDouble("z", z);

	return tag;
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:8,代码来源:Vector3.java

示例9: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeEntityToNBT(NBTTagCompound compound)
{
	compound.setDouble("constantRot", constantRot);
	compound.setDouble("edgeRot", edgeRot);
	compound.setDouble("circleX", circlePos.x);
	compound.setDouble("circleY", circlePos.y);
	compound.setDouble("circleZ", circlePos.z);
	compound.setBoolean("hasBook", this.hasBook);
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:11,代码来源:EntityMagicCircles.java

示例10: 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:SkidJava,项目名称:BaseClient,代码行数:14,代码来源:SharedMonsterAttributes.java

示例11: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public void writeToNBT(NBTTagCompound tag) {
    tag.setDouble("posX", posX);
    tag.setDouble("posY", posY);
    tag.setDouble("width", width);
    tag.setDouble("height", height);
    tag.setString("buttonText", buttonText);
    tag.setInteger("floorNumber", floorNumber);
    tag.setInteger("floorHeight", floorHeight);
    tag.setFloat("red", red);
    tag.setFloat("green", green);
    tag.setFloat("blue", blue);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:13,代码来源:TileEntityElevatorCaller.java

示例12: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to write subclass entity data to NBT.
 */
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
    tagCompound.setShort("xTile", (short)this.xTile);
    tagCompound.setShort("yTile", (short)this.yTile);
    tagCompound.setShort("zTile", (short)this.zTile);
    tagCompound.setShort("life", (short)this.ticksInGround);
    ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(this.inTile);
    tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString());
    tagCompound.setByte("inData", (byte)this.inData);
    tagCompound.setByte("shake", (byte)this.arrowShake);
    tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0));
    tagCompound.setByte("pickup", (byte)this.canBePickedUp);
    tagCompound.setDouble("damage", this.damage);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:EntityArrow.java

示例13: writeAttributeModifierToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Creates an NBTTagCompound from an AttributeModifier
 */
public static NBTTagCompound writeAttributeModifierToNBT(AttributeModifier modifier)
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    nbttagcompound.setString("Name", modifier.getName());
    nbttagcompound.setDouble("Amount", modifier.getAmount());
    nbttagcompound.setInteger("Operation", modifier.getOperation());
    nbttagcompound.setUniqueId("UUID", modifier.getID());
    return nbttagcompound;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:SharedMonsterAttributes.java

示例14: writeNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Nullable
@Override
public NBTBase writeNBT(Capability<IFaerieInformation> capability, IFaerieInformation instance, EnumFacing side) {
    NBTTagCompound comp = new NBTTagCompound();
    comp.setInteger("type", instance.getType());
    comp.setFloat("size", instance.getSize());
    comp.setDouble("max_health", instance.getMaxHealth());
    comp.setInteger("level", instance.getLevel());
    comp.setInteger("current_exp", instance.getCurrentExp());

    return comp;
}
 
开发者ID:BenjaminSutter,项目名称:genera,代码行数:13,代码来源:FaerieInformationStorage.java

示例15: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to write subclass entity data to NBT.
 */
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
    super.writeEntityToNBT(tagCompound);
    tagCompound.setDouble("PushX", this.pushX);
    tagCompound.setDouble("PushZ", this.pushZ);
    tagCompound.setShort("Fuel", (short)this.fuel);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:11,代码来源:EntityMinecartFurnace.java


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