本文整理汇总了Java中net.minecraft.nbt.NBTTagCompound.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java NBTTagCompound.getBoolean方法的具体用法?Java NBTTagCompound.getBoolean怎么用?Java NBTTagCompound.getBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.nbt.NBTTagCompound
的用法示例。
在下文中一共展示了NBTTagCompound.getBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readNBT(Capability<FoodStats> capability, FoodStats instance, EnumFacing side, NBTBase nbt) {
if (!(nbt instanceof NBTTagCompound))
return;
NBTTagCompound tagCompound = (NBTTagCompound) nbt;
instance.setAmount(tagCompound.getInteger("amount"))
.setSaturationModifier(tagCompound.getFloat("saturationModifier"))
.setMaxItemUseDuration(tagCompound.getInteger("maxItemUseDuration"))
.setAction(EnumAction.values()[tagCompound.getInteger("action")])
.setPotion(PotionEffect.readCustomPotionEffectFromNBT(tagCompound.getCompoundTag("potion")))
.setPotionEffectProbability(tagCompound.getFloat("potionEffectProbability"))
.setUnlocalizedName(tagCompound.getString("unlocalizedName"));
if (tagCompound.getBoolean("wolfFood"))
instance.setWolfFood();
if (tagCompound.getBoolean("alwaysEdible"))
instance.setAlwaysEdible();
}
示例2: 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();
}
示例3: readFromNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound compound) {
fluid = CauldronLiquid.getFromName(compound.getString("cauldronType"));
level = compound.getInteger("cauldronLevel");
isActive = compound.getBoolean("isActive");
switchedItem = new ItemStack(compound.getCompoundTag("switchedItemStack"));
super.readFromNBT(compound);
}
示例4: StarterFX
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public StarterFX(World p_i46464_1_, double p_i46464_2_, double p_i46464_4_, double p_i46464_6_, double p_i46464_8_, double p_i46464_10_, double p_i46464_12_, EffectRenderer p_i46464_14_, NBTTagCompound p_i46464_15_)
{
super(p_i46464_1_, p_i46464_2_, p_i46464_4_, p_i46464_6_, 0.0D, 0.0D, 0.0D);
this.motionX = p_i46464_8_;
this.motionY = p_i46464_10_;
this.motionZ = p_i46464_12_;
this.theEffectRenderer = p_i46464_14_;
this.particleMaxAge = 8;
if (p_i46464_15_ != null)
{
this.fireworkExplosions = p_i46464_15_.getTagList("Explosions", 10);
if (this.fireworkExplosions.tagCount() == 0)
{
this.fireworkExplosions = null;
}
else
{
this.particleMaxAge = this.fireworkExplosions.tagCount() * 2 - 1;
for (int i = 0; i < this.fireworkExplosions.tagCount(); ++i)
{
NBTTagCompound nbttagcompound = this.fireworkExplosions.getCompoundTagAt(i);
if (nbttagcompound.getBoolean("Flicker"))
{
this.twinkle = true;
this.particleMaxAge += 15;
break;
}
}
}
}
}
示例5: readEntityFromNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.chickenJockey = tagCompund.getBoolean("IsChickenJockey");
if (tagCompund.hasKey("EggLayTime"))
{
this.timeUntilNextEgg = tagCompund.getInteger("EggLayTime");
}
}
示例6: fixTagCompound
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound fixTagCompound(NBTTagCompound compound)
{
if ("Zombie".equals(compound.getString("id")) && compound.getBoolean("IsVillager"))
{
if (!compound.hasKey("ZombieType", 99))
{
int i = -1;
if (compound.hasKey("VillagerProfession", 99))
{
try
{
i = this.func_191277_a(compound.getInteger("VillagerProfession"));
}
catch (RuntimeException var4)
{
;
}
}
if (i == -1)
{
i = this.func_191277_a(RANDOM.nextInt(6));
}
compound.setInteger("ZombieType", i);
}
compound.removeTag("IsVillager");
}
return compound;
}
示例7: deserializeNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void deserializeNBT(NBTTagCompound nbt)
{
this.stats = new CropStats();
this.stats.deserializeNBT(nbt.getCompoundTag("stats"));
this.isSick = nbt.getBoolean("eaten");
this.timeKeeper.deserializeNBT((NBTTagLong) nbt.getTag("calendar"));
}
示例8: readStructureFromNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
protected void readStructureFromNBT(NBTTagCompound tagCompound)
{
super.readStructureFromNBT(tagCompound);
this.field_74947_h = tagCompound.getBoolean("placedMainChest");
this.field_74948_i = tagCompound.getBoolean("placedHiddenChest");
this.field_74945_j = tagCompound.getBoolean("placedTrap1");
this.field_74946_k = tagCompound.getBoolean("placedTrap2");
}
示例9: readStructureFromNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
protected void readStructureFromNBT(NBTTagCompound tagCompound)
{
super.readStructureFromNBT(tagCompound);
this.hasSpawner = tagCompound.getBoolean("Mob");
}
示例10: readEntityFromNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.setUniqueId(getUUID(this.gameProfile));
NBTTagList nbttaglist = compound.getTagList("Inventory", 10);
this.inventory.readFromNBT(nbttaglist);
this.inventory.currentItem = compound.getInteger("SelectedItemSlot");
this.sleeping = compound.getBoolean("Sleeping");
this.sleepTimer = compound.getShort("SleepTimer");
this.experience = compound.getFloat("XpP");
this.experienceLevel = compound.getInteger("XpLevel");
this.experienceTotal = compound.getInteger("XpTotal");
this.xpSeed = compound.getInteger("XpSeed");
if (this.xpSeed == 0)
{
this.xpSeed = this.rand.nextInt();
}
this.setScore(compound.getInteger("Score"));
if (this.sleeping)
{
this.bedLocation = new BlockPos(this);
this.wakeUpPlayer(true, true, false);
}
if (compound.hasKey("SpawnX", 99) && compound.hasKey("SpawnY", 99) && compound.hasKey("SpawnZ", 99))
{
this.spawnChunk = new BlockPos(compound.getInteger("SpawnX"), compound.getInteger("SpawnY"), compound.getInteger("SpawnZ"));
this.spawnForced = compound.getBoolean("SpawnForced");
}
this.foodStats.readNBT(compound);
this.capabilities.readCapabilitiesFromNBT(compound);
if (compound.hasKey("EnderItems", 9))
{
NBTTagList nbttaglist1 = compound.getTagList("EnderItems", 10);
this.theInventoryEnderChest.loadInventoryFromNBT(nbttaglist1);
}
}
示例11: readDataNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
void readDataNBT(NBTTagCompound cmp) {
lit = cmp.getBoolean("lit");
color = EnumDyeColor.byMetadata(cmp.getInteger("color"));
}
示例12: readEntityFromNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.entityUniqueID = getUUID(this.gameProfile);
NBTTagList nbttaglist = tagCompund.getTagList("Inventory", 10);
this.inventory.readFromNBT(nbttaglist);
this.inventory.currentItem = tagCompund.getInteger("SelectedItemSlot");
this.sleeping = tagCompund.getBoolean("Sleeping");
this.sleepTimer = tagCompund.getShort("SleepTimer");
this.experience = tagCompund.getFloat("XpP");
this.experienceLevel = tagCompund.getInteger("XpLevel");
this.experienceTotal = tagCompund.getInteger("XpTotal");
this.xpSeed = tagCompund.getInteger("XpSeed");
if (this.xpSeed == 0)
{
this.xpSeed = this.rand.nextInt();
}
this.setScore(tagCompund.getInteger("Score"));
if (this.sleeping)
{
this.playerLocation = new BlockPos(this);
this.wakeUpPlayer(true, true, false);
}
if (tagCompund.hasKey("SpawnX", 99) && tagCompund.hasKey("SpawnY", 99) && tagCompund.hasKey("SpawnZ", 99))
{
this.spawnChunk = new BlockPos(tagCompund.getInteger("SpawnX"), tagCompund.getInteger("SpawnY"), tagCompund.getInteger("SpawnZ"));
this.spawnForced = tagCompund.getBoolean("SpawnForced");
}
this.foodStats.readNBT(tagCompund);
this.capabilities.readCapabilitiesFromNBT(tagCompund);
if (tagCompund.hasKey("EnderItems", 9))
{
NBTTagList nbttaglist1 = tagCompund.getTagList("EnderItems", 10);
this.theInventoryEnderChest.loadInventoryFromNBT(nbttaglist1);
}
}
示例13: readEntityFromNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
if (tagCompund.hasKey("CanPickUpLoot", 1))
{
this.setCanPickUpLoot(tagCompund.getBoolean("CanPickUpLoot"));
}
this.persistenceRequired = tagCompund.getBoolean("PersistenceRequired");
if (tagCompund.hasKey("Equipment", 9))
{
NBTTagList nbttaglist = tagCompund.getTagList("Equipment", 10);
for (int i = 0; i < this.equipment.length; ++i)
{
this.equipment[i] = ItemStack.loadItemStackFromNBT(nbttaglist.getCompoundTagAt(i));
}
}
if (tagCompund.hasKey("DropChances", 9))
{
NBTTagList nbttaglist1 = tagCompund.getTagList("DropChances", 5);
for (int j = 0; j < nbttaglist1.tagCount(); ++j)
{
this.equipmentDropChances[j] = nbttaglist1.getFloatAt(j);
}
}
this.isLeashed = tagCompund.getBoolean("Leashed");
if (this.isLeashed && tagCompund.hasKey("Leash", 10))
{
this.leashNBTTag = tagCompund.getCompoundTag("Leash");
}
this.setNoAI(tagCompund.getBoolean("NoAI"));
}
示例14: readFromNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readFromNBT(@NotNull NBTTagCompound compound) {
exactCopy = compound.getBoolean("ExactCopy");
super.readFromNBT(compound);
}
示例15: readNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readNBT(NBTTagCompound nbt, NBTType type) {
super.readNBT(nbt, type);
this.isWorking = nbt.getBoolean("Working");
}