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


Java NBTTagCompound.getFloat方法代码示例

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


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

示例1: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
@Override
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
	this.metadata = p_70037_1_.getByte("Data") & 255;
	this.block = Block.getBlockById(p_70037_1_.getInteger("TileID")).getStateFromMeta(metadata);
	this.sticky = p_70037_1_.getInteger("Sticky");
	this.nogravity = p_70037_1_.getBoolean("NoGravity");

	this.field_145812_b = p_70037_1_.getByte("Time") & 255;

	if (p_70037_1_.hasKey("HurtEntities", 99)) {
		this.field_145809_g = p_70037_1_.getBoolean("HurtEntities");
		this.field_145816_i = p_70037_1_.getFloat("FallHurtAmount");
		this.field_145815_h = p_70037_1_.getInteger("FallHurtMax");
	} else if (this.block == Blocks.ANVIL)
		this.field_145809_g = true;

	if (p_70037_1_.hasKey("DropItem", 99))
		this.dropItems = p_70037_1_.getBoolean("DropItem");

	if (p_70037_1_.hasKey("TileEntityData", 10))
		this.dataTag = p_70037_1_.getCompoundTag("TileEntityData");

	if (this.block.getMaterial() == Material.AIR)
		this.setDead();
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:29,代码来源:EntityFallingEnchantedBlock.java

示例2: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    NBTTagCompound nbttagcompound = tagCompund.getCompoundTag("Item");

    if (nbttagcompound != null && !nbttagcompound.hasNoTags())
    {
        this.setDisplayedItemWithUpdate(ItemStack.loadItemStackFromNBT(nbttagcompound), false);
        this.func_174865_a(tagCompund.getByte("ItemRotation"), false);

        if (tagCompund.hasKey("ItemDropChance", 99))
        {
            this.itemDropChance = tagCompund.getFloat("ItemDropChance");
        }

        if (tagCompund.hasKey("Direction"))
        {
            this.func_174865_a(this.getRotation() * 2, false);
        }
    }

    super.readEntityFromNBT(tagCompund);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:26,代码来源:EntityItemFrame.java

示例3: readCapabilitiesFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public void readCapabilitiesFromNBT(NBTTagCompound tagCompound)
{
    if (tagCompound.hasKey("abilities", 10))
    {
        NBTTagCompound nbttagcompound = tagCompound.getCompoundTag("abilities");
        this.disableDamage = nbttagcompound.getBoolean("invulnerable");
        this.isFlying = nbttagcompound.getBoolean("flying");
        this.allowFlying = nbttagcompound.getBoolean("mayfly");
        this.isCreativeMode = nbttagcompound.getBoolean("instabuild");

        if (nbttagcompound.hasKey("flySpeed", 99))
        {
            this.flySpeed = nbttagcompound.getFloat("flySpeed");
            this.walkSpeed = nbttagcompound.getFloat("walkSpeed");
        }

        if (nbttagcompound.hasKey("mayBuild", 1))
        {
            this.allowEdit = nbttagcompound.getBoolean("mayBuild");
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:23,代码来源:PlayerCapabilities.java

示例4: fixTagCompound

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound fixTagCompound(NBTTagCompound compound)
{
    if (ENTITY_LIST.contains(compound.getString("id")))
    {
        float f;

        if (compound.hasKey("HealF", 99))
        {
            f = compound.getFloat("HealF");
            compound.removeTag("HealF");
        }
        else
        {
            if (!compound.hasKey("Health", 99))
            {
                return compound;
            }

            f = compound.getFloat("Health");
        }

        compound.setFloat("Health", f);
    }

    return compound;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:27,代码来源:EntityHealth.java

示例5: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound nbtTagCompound) {
    super.readFromNBT(nbtTagCompound);

    redstoneMode = nbtTagCompound.getInteger("redstoneMode");
    outputTimer = nbtTagCompound.getBoolean("outputTimer") ? 20 : 0;
    turbineSpeed = nbtTagCompound.getFloat("turbineSpeed");
    lastEnergyProduction = nbtTagCompound.getInteger("energyProduction");
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:10,代码来源:TileEntityElectricCompressor.java

示例6: deserializeNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void deserializeNBT(NBTTagCompound nbt)
{
	this.moistureLevel = nbt.getFloat("moisture");
	for (NBTBase tag : nbt.getTagList("nutrientData", NBT.TAG_COMPOUND))
	{
		NBTTagCompound tagCompound = (NBTTagCompound) tag;
		this.nutrientData.put(EnumPlantNutrient.values()[tagCompound.getByte("key")], tagCompound.getFloat("value"));
	}
	
	if (nbt.hasKey("calendar"))
	{
		this.timeKeeper.deserializeNBT((NBTTagLong) nbt.getTag("calendar"));
	}
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:16,代码来源:ExPFarmland.java

示例7: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public void readFromNBT(NBTTagCompound nbt) {
    dir = EnumFacing.getFront(nbt.getInteger("dir"));
    upgraded = nbt.getBoolean("upgraded");
    lowerBound = nbt.getFloat("lowerBound");
    higherBound = nbt.getFloat("higherBound");
    advancedConfig = !nbt.hasKey("advancedConfig") || nbt.getBoolean("advancedConfig");
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:8,代码来源:TubeModule.java

示例8: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public void readFromNBT(NBTTagCompound compound)
{
    super.readFromNBT(compound);
    this.pistonState = Block.getBlockById(compound.getInteger("blockId")).getStateFromMeta(compound.getInteger("blockData"));
    this.pistonFacing = EnumFacing.getFront(compound.getInteger("facing"));
    this.lastProgress = this.progress = compound.getFloat("progress");
    this.extending = compound.getBoolean("extending");
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:9,代码来源:TileEntityPiston.java

示例9: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
protected void readEntityFromNBT(NBTTagCompound compound)
{
	if (compound.hasKey("data", NBT.TAG_LIST))
	{
		deserializeDataFromNBT(compound);
	}
	
	this.isDataConstructed = compound.getBoolean("isDataConstructed");
	this.isDataSent = compound.getBoolean("isDataSent");
	NBTTagCompound pTag = compound.getCompoundTag("brokenAt");
	this.brokenAt = new BlockPos(pTag.getInteger("X"), pTag.getInteger("Y"), pTag.getInteger("Z"));
	this.fallAngle = compound.getFloat("fallAngle");
	this.fallProgress = compound.getFloat("fallProgress");
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:16,代码来源:EntityFallingTree.java

示例10: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readEntityFromNBT(NBTTagCompound compound)
{
	super.readEntityFromNBT(compound);
	moveAngle = compound.getFloat("MoveAngle");
	moveSpeed = compound.getFloat("MoveSpeed");
	moveCurve = compound.getFloat("MoveCurve");
	this.setOpacity(compound.getFloat("Opacity"));
	this.setCycleVisibility(compound.getInteger("CycleVisibility"));
	this.dronesProduced = compound.getInteger("DronesProduced");
}
 
开发者ID:crazysnailboy,项目名称:Halloween,代码行数:12,代码来源:EntityHaunter.java

示例11: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound compound) {
	super.readFromNBT(compound);
	noClip = compound.getBoolean("clip");
	rest = compound.getFloat("rest");
	despawn = compound.getInteger("despawn");
	setPickupDelay(compound.getInteger("pickup"));
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:9,代码来源:EntityStaticItem.java

示例12: StabilityData

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public StabilityData(NBTTagCompound tag) {
	if (tag.hasKey("Base", 5)) {
		this.baseStability = tag.getFloat("Base");
	} else {
		this.baseStability = 0.5F;
	}
	if (tag.hasKey("Stability", 5)) {
		this.stability = tag.getFloat("Stability");
	} else {
		this.stability = 0.5F;
	}
}
 
开发者ID:the-realest-stu,项目名称:Etheric,代码行数:13,代码来源:StabilityData.java

示例13: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
    int i = tagCompund.getByte("Data") & 255;

    if (tagCompund.hasKey("Block", 8))
    {
        this.fallTile = Block.getBlockFromName(tagCompund.getString("Block")).getStateFromMeta(i);
    }
    else if (tagCompund.hasKey("TileID", 99))
    {
        this.fallTile = Block.getBlockById(tagCompund.getInteger("TileID")).getStateFromMeta(i);
    }
    else
    {
        this.fallTile = Block.getBlockById(tagCompund.getByte("Tile") & 255).getStateFromMeta(i);
    }

    this.fallTime = tagCompund.getByte("Time") & 255;
    Block block = this.fallTile.getBlock();

    if (tagCompund.hasKey("HurtEntities", 99))
    {
        this.hurtEntities = tagCompund.getBoolean("HurtEntities");
        this.fallHurtAmount = tagCompund.getFloat("FallHurtAmount");
        this.fallHurtMax = tagCompund.getInteger("FallHurtMax");
    }
    else if (block == Blocks.anvil)
    {
        this.hurtEntities = true;
    }

    if (tagCompund.hasKey("DropItem", 99))
    {
        this.shouldDropItem = tagCompund.getBoolean("DropItem");
    }

    if (tagCompund.hasKey("TileEntityData", 10))
    {
        this.tileEntityData = tagCompund.getCompoundTag("TileEntityData");
    }

    if (block == null || block.getMaterial() == Material.air)
    {
        this.fallTile = Blocks.sand.getDefaultState();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:50,代码来源:EntityFallingBlock.java

示例14: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound compound) {
	super.readFromNBT(compound);

	ownerUUID = UUID.fromString(compound.getString("ownerUUID"));

	amount = compound.getFloat("amount");

	shopControllerPos = new BlockPos(compound.getInteger("shopx"), compound.getInteger("shopy"), compound.getInteger("shopz"));

	NBTTagList items = compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);

	for (int i = 0; i < items.tagCount(); ++i) {
		NBTTagCompound item = items.getCompoundTagAt(i);
		int slot = item.getInteger("Slot");

		if (slot >= 0 && slot < getSizeInventory()) {
			inventory.set(slot, new ItemStack(item));
		}
	}

	NBTTagCompound type = compound.getCompoundTag("type");

	this.type = new ItemStack(type);
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:26,代码来源:TileEntityStockCrate.java

示例15: deserializeNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void deserializeNBT(NBTTagCompound nbt)
{
	this.min = nbt.getFloat("min");
	this.max = nbt.getFloat("max");
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:7,代码来源:TemperatureRange.java


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