當前位置: 首頁>>代碼示例>>Java>>正文


Java NBTTagCompound.setFloat方法代碼示例

本文整理匯總了Java中net.minecraft.nbt.NBTTagCompound.setFloat方法的典型用法代碼示例。如果您正苦於以下問題:Java NBTTagCompound.setFloat方法的具體用法?Java NBTTagCompound.setFloat怎麽用?Java NBTTagCompound.setFloat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.nbt.NBTTagCompound的用法示例。


在下文中一共展示了NBTTagCompound.setFloat方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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:sudofox,項目名稱:Backmemed,代碼行數:24,代碼來源:TileEntityStructure.java

示例2: getChargedDispenserUpgradeDrone

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
private static EntityDrone getChargedDispenserUpgradeDrone(World world) {
    EntityDrone drone = new EntityDrone(world);

    NBTTagCompound tag = new NBTTagCompound();
    drone.writeEntityToNBT(tag);

    ItemStackHandler upgrades = new ItemStackHandler(9);
    upgrades.setStackInSlot(0, new ItemStack(ItemRegistry.getInstance().getUpgrade(EnumUpgrade.DISPENSER), 64));
    upgrades.setStackInSlot(1, new ItemStack(ItemRegistry.getInstance().getUpgrade(EnumUpgrade.SPEED), 10));
    tag.setTag(ChargeableItemHandler.NBT_UPGRADE_TAG, upgrades.serializeNBT());
    tag.setTag("Inventory", new NBTTagCompound());
    tag.setFloat("currentAir", 100000);

    drone.readEntityFromNBT(tag);
    // FIXME: we really need to get a clientside localization here (on the server side)
    drone.setCustomNameTag(net.minecraft.util.text.translation.I18n.translateToLocal("drone.amadronDeliveryDrone"));

    drone.naturallySpawned = true; // Don't let the drone be dropped when wrenching it.

    return drone;
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:22,代碼來源:ProgrammedDroneUtils.java

示例3: serializePartialNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
public NBTTagCompound serializePartialNBT()
{
    NBTTagCompound ret = new NBTTagCompound();
    if (this.dormantOre_IsDirty)
    {
        ret.setByte("oreID", (byte) this.dormantOre.ordinal());
        this.dormantOre_IsDirty = false;
    }

    if (this.dormantOreAmount_IsDirty)
    {
        ret.setFloat("oreAmount", this.dormantOreAmount);
        this.dormantOreAmount_IsDirty = false;
    }

    if (this.temperatureData_IsDirty)
    {
        NBTTagList list = new NBTTagList();
        this.temperatureData.forEach((BlockPos pos, Float f) -> list.appendTag(NBTChain.startChain().withLong("key", pos.toLong()).withFloat("value", f).endChain()));
        ret.setTag("temperatureData", list);
        this.temperatureData_IsDirty = false;
    }

    this.isDirty = false;
    return ret;
}
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:27,代碼來源:ExPChunk.java

示例4: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
public NBTTagCompound writeToNBT() {
	NBTTagCompound tag = new NBTTagCompound();
	
	tag.setFloat("Base", this.baseStability);
	tag.setFloat("Stability", this.stability);
	
	return tag;
}
 
開發者ID:the-realest-stu,項目名稱:Etheric,代碼行數:9,代碼來源:StabilityData.java

示例5: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
/**
 * (abstract) Protected helper method to write subclass entity data to NBT.
 */
public void writeEntityToNBT(NBTTagCompound compound)
{
    if (this.getDisplayedItem() != null)
    {
        compound.setTag("Item", this.getDisplayedItem().writeToNBT(new NBTTagCompound()));
        compound.setByte("ItemRotation", (byte)this.getRotation());
        compound.setFloat("ItemDropChance", this.itemDropChance);
    }

    super.writeEntityToNBT(compound);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:15,代碼來源:EntityItemFrame.java

示例6: 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.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList()));
    tagCompound.setInteger("SelectedItemSlot", this.inventory.currentItem);
    tagCompound.setBoolean("Sleeping", this.sleeping);
    tagCompound.setShort("SleepTimer", (short)this.sleepTimer);
    tagCompound.setFloat("XpP", this.experience);
    tagCompound.setInteger("XpLevel", this.experienceLevel);
    tagCompound.setInteger("XpTotal", this.experienceTotal);
    tagCompound.setInteger("XpSeed", this.xpSeed);
    tagCompound.setInteger("Score", this.getScore());

    if (this.spawnChunk != null)
    {
        tagCompound.setInteger("SpawnX", this.spawnChunk.getX());
        tagCompound.setInteger("SpawnY", this.spawnChunk.getY());
        tagCompound.setInteger("SpawnZ", this.spawnChunk.getZ());
        tagCompound.setBoolean("SpawnForced", this.spawnForced);
    }

    this.foodStats.writeNBT(tagCompound);
    this.capabilities.writeCapabilitiesToNBT(tagCompound);
    tagCompound.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT());
    ItemStack itemstack = this.inventory.getCurrentItem();

    if (itemstack != null && itemstack.getItem() != null)
    {
        tagCompound.setTag("SelectedItem", itemstack.writeToNBT(new NBTTagCompound()));
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:35,代碼來源:EntityPlayer.java

示例7: serializeNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public NBTTagCompound serializeNBT() {
	NBTTagCompound compound = new NBTTagCompound();
	NBTTagList items = new NBTTagList();

	for (int i = 0; i < getSizeInventory(); ++i) {
		if (!getStackInSlot(i).isEmpty()) {
			NBTTagCompound item = new NBTTagCompound();
			item.setInteger("Slot", i);
			getStackInSlot(i).writeToNBT(item);

			items.appendTag(item);
		}
	}
	compound.setTag("ItemInventory", items);

	NBTTagList pricesList = new NBTTagList();

	if (prices != null && !prices.isEmpty()) {
		for (int i = 0; i < getSizeInventory(); ++i) {
			if (prices.get(i) != null) {
				NBTTagCompound price = new NBTTagCompound();
				price.setInteger("Slot", i);
				price.setFloat("price", prices.get(i));

				pricesList.appendTag(price);
			}
		}
	}
	compound.setTag("Prices", pricesList);

	return compound;
}
 
開發者ID:Zundrel,項目名稱:Never-Enough-Currency,代碼行數:34,代碼來源:CartCapability.java

示例8: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);
    tag.setFloat("clawProgress", clawProgress);
    tag.setBoolean("clawClosing", shouldClawClose);
    tag.setByte("state", state);
    tag.setBoolean("exporting", exporting);
    tag.setTag("Items", inventory.serializeNBT());
    return tag;
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:11,代碼來源:TileEntityAssemblyIOUnit.java

示例9: writeNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public NBTBase writeNBT(Capability<IRotaryPowerSupply> capability, IRotaryPowerSupply instance, EnumFacing side) {
	NBTTagCompound tag = new NBTTagCompound();
	tag.setFloat("buffer", instance.getBufferedPower());
	tag.setFloat("torque", instance.getTorqueSetting());
	return tag;
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:8,代碼來源:DefaultRotaryPowerSerializer.java

示例10: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
public void writeToNBT(NBTTagCompound compound)
{
    super.writeToNBT(compound);
    compound.setInteger("blockId", Block.getIdFromBlock(this.pistonState.getBlock()));
    compound.setInteger("blockData", this.pistonState.getBlock().getMetaFromState(this.pistonState));
    compound.setInteger("facing", this.pistonFacing.getIndex());
    compound.setFloat("progress", this.lastProgress);
    compound.setBoolean("extending", this.extending);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:10,代碼來源:TileEntityPiston.java

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

示例12: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);
    tag.setFloat("extension", extension);
    tag.setFloat("targetExtension", targetExtension);
    tag.setInteger("redstoneMode", redstoneMode);
    tag.setInteger("maxFloorHeight", maxFloorHeight);
    for (int i = 0; i < 6; i++) {
        tag.setBoolean("sideConnected" + i, sidesConnected[i]);
    }
    ICamouflageableTE.writeCamoStackToNBT(camoStack, tag);
    return tag;
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:14,代碼來源:TileEntityElevatorBase.java

示例13: writeCapabilitiesToNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
public void writeCapabilitiesToNBT(NBTTagCompound tagCompound)
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    nbttagcompound.setBoolean("invulnerable", this.disableDamage);
    nbttagcompound.setBoolean("flying", this.isFlying);
    nbttagcompound.setBoolean("mayfly", this.allowFlying);
    nbttagcompound.setBoolean("instabuild", this.isCreativeMode);
    nbttagcompound.setBoolean("mayBuild", this.allowEdit);
    nbttagcompound.setFloat("flySpeed", this.flySpeed);
    nbttagcompound.setFloat("walkSpeed", this.walkSpeed);
    tagCompound.setTag("abilities", nbttagcompound);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:13,代碼來源:PlayerCapabilities.java

示例14: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
public void writeToNBT(NBTTagCompound tag) {
	NBTTagCompound sucTag = new NBTTagCompound();
	
	sucTag.setInteger("strength", this.strength);
	sucTag.setFloat("minPurity", this.minPurity);
	sucTag.setFloat("maxPurity", this.maxPurity);
	
	tag.setTag("Suction", sucTag);
}
 
開發者ID:the-realest-stu,項目名稱:Etheric,代碼行數:10,代碼來源:Suction.java

示例15: serializeNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public NBTTagCompound serializeNBT() {
	NBTTagCompound properties = new NBTTagCompound();
	properties.setFloat("amount", amount);
	return properties;
}
 
開發者ID:Zundrel,項目名稱:Never-Enough-Currency,代碼行數:7,代碼來源:AccountCapability.java


注:本文中的net.minecraft.nbt.NBTTagCompound.setFloat方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。