本文整理汇总了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();
}
示例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);
}
示例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");
}
}
}
示例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;
}
示例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");
}
示例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"));
}
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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"));
}
示例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;
}
}
示例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();
}
}
示例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);
}
示例15: deserializeNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void deserializeNBT(NBTTagCompound nbt)
{
this.min = nbt.getFloat("min");
this.max = nbt.getFloat("max");
}