本文整理匯總了Java中net.minecraft.nbt.NBTTagCompound.setInteger方法的典型用法代碼示例。如果您正苦於以下問題:Java NBTTagCompound.setInteger方法的具體用法?Java NBTTagCompound.setInteger怎麽用?Java NBTTagCompound.setInteger使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.nbt.NBTTagCompound
的用法示例。
在下文中一共展示了NBTTagCompound.setInteger方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: writeEntityToNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
Block block = this.fallTile != null ? this.fallTile.getBlock() : Blocks.air;
ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(block);
tagCompound.setString("Block", resourcelocation == null ? "" : resourcelocation.toString());
tagCompound.setByte("Data", (byte)block.getMetaFromState(this.fallTile));
tagCompound.setByte("Time", (byte)this.fallTime);
tagCompound.setBoolean("DropItem", this.shouldDropItem);
tagCompound.setBoolean("HurtEntities", this.hurtEntities);
tagCompound.setFloat("FallHurtAmount", this.fallHurtAmount);
tagCompound.setInteger("FallHurtMax", this.fallHurtMax);
if (this.tileEntityData != null)
{
tagCompound.setTag("TileEntityData", this.tileEntityData);
}
}
示例2: writeToNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
public void writeToNBT(NBTTagCompound compound)
{
String s = (String)classToNameMap.get(this.getClass());
if (s == null)
{
throw new RuntimeException(this.getClass() + " is missing a mapping! This is a bug!");
}
else
{
compound.setString("id", s);
compound.setInteger("x", this.pos.getX());
compound.setInteger("y", this.pos.getY());
compound.setInteger("z", this.pos.getZ());
}
}
示例3: writeToNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Nonnull
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
compound = super.writeToNBT(compound);
if (sapInBucket != null) {
sapInBucket.writeToNBT(compound);
compound.setInteger("direction", direction.getIndex());
compound.setInteger("sappertick", LIQUID_AMOUNT);
}
return compound;
}
示例4: checkedReadChunkFromNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
/**
* Wraps readChunkFromNBT. Checks the coordinates and several NBT tags.
*/
protected Chunk checkedReadChunkFromNBT(World worldIn, int x, int z, NBTTagCompound p_75822_4_)
{
if (!p_75822_4_.hasKey("Level", 10))
{
logger.error("Chunk file at " + x + "," + z + " is missing level data, skipping");
return null;
}
else
{
NBTTagCompound nbttagcompound = p_75822_4_.getCompoundTag("Level");
if (!nbttagcompound.hasKey("Sections", 9))
{
logger.error("Chunk file at " + x + "," + z + " is missing block data, skipping");
return null;
}
else
{
Chunk chunk = this.readChunkFromNBT(worldIn, nbttagcompound);
if (!chunk.isAtLocation(x, z))
{
logger.error("Chunk file at " + x + "," + z + " is in the wrong location; relocating. (Expected " + x + ", " + z + ", got " + chunk.xPosition + ", " + chunk.zPosition + ")");
nbttagcompound.setInteger("xPos", x);
nbttagcompound.setInteger("zPos", z);
chunk = this.readChunkFromNBT(worldIn, nbttagcompound);
}
return chunk;
}
}
}
示例5: saveFlags
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
/**
* Save flags to file
* @throws IOException If flags failed to save
*/
private void saveFlags() throws IOException {
NBTTagCompound tag = new NBTTagCompound();
tag.setInteger("Version", VERSION);
tag.setShort("Width", (short)getWidth());
tag.setShort("Height", (short)getHeight());
tag.setShort("Length", (short)getLength());
tag.setLong("SchemaLen", getSchemaLen());
tag.setInteger("Lift", getLift());
tag.setInteger("Method", getMethod().getValue());
tag.setInteger("Biome", getBiomus().getValue());
Utils.writeTags(getFileFlag(), tag);
}
示例6: 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.hasDisplayTile())
{
compound.setBoolean("CustomDisplayTile", true);
IBlockState iblockstate = this.getDisplayTile();
ResourceLocation resourcelocation = (ResourceLocation)Block.REGISTRY.getNameForObject(iblockstate.getBlock());
compound.setString("DisplayTile", resourcelocation == null ? "" : resourcelocation.toString());
compound.setInteger("DisplayData", iblockstate.getBlock().getMetaFromState(iblockstate));
compound.setInteger("DisplayOffset", this.getDisplayTileOffset());
}
}
示例7: writeEntityToNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
compound.setInteger("TransferCooldown", this.transferTicker);
compound.setBoolean("Enabled", this.isBlocked);
}
示例8: writeToNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public void writeToNBT(NBTTagCompound tag) {
NBTTagCompound pneumaticTag = new NBTTagCompound();
pneumaticTag.setInteger("air", air);
pneumaticTag.setInteger("volume", volume);
pneumaticTag.setFloat("maxPressure", maxPressure);
tag.setTag("pneumatic", pneumaticTag);
}
示例9: writeEntityToNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
compound.setTag("animalData", this.animalCapability.serializeNBT());
compound.setLong("age", this.getDataManager().get(PARAM_AGE));
compound.setBoolean("gender", this.getDataManager().get(PARAM_GENDER));
compound.setInteger("pregnancy", this.getDataManager().get(PARAM_PREGNANCY));
compound.setBoolean("domesticated", this.getDataManager().get(PARAM_DOMESTICATED));
}
示例10: writeStructureToNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
protected void writeStructureToNBT(NBTTagCompound tagCompound)
{
tagCompound.setBoolean("hr", this.hasRails);
tagCompound.setBoolean("sc", this.hasSpiders);
tagCompound.setBoolean("hps", this.spawnerPlaced);
tagCompound.setInteger("Num", this.sectionCount);
}
示例11: getTabIconItem
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public ItemStack getTabIconItem()
{
NBTTagCompound tags = new NBTTagCompound();
tags.setInteger("pos1_x", 1);
ItemStack stack = new ItemStack(AnimaItems.LINKER);
stack.setTagCompound(tags);
return stack;
}
示例12: writeEntityToNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public void writeEntityToNBT(NBTTagCompound compound) {
super.writeEntityToNBT(compound);
NBTTagCompound sub = new NBTTagCompound();
sub.setUniqueId("id", this.id);
sub.setInteger("index", this.index);
sub.setBoolean("hadEffect", this.hadEffect);
sub.setBoolean("hasEffect", this.hasEffect);
compound.setTag("randores", sub);
}
示例13: writeToNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
public NBTTagCompound writeToNBT() {
NBTTagCompound tag = new NBTTagCompound();
tag.setInteger("type", type.ordinal());
tag.setInteger("facing", facing.ordinal());
tag.setString("ioInfo", ioInfo.name());
return tag;
}
示例14: writeToNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
/**
* write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities
*/
public void writeToNBT(NBTTagCompound nbt)
{
nbt.setByte("dimension", this.dimension);
nbt.setInteger("xCenter", this.xCenter);
nbt.setInteger("zCenter", this.zCenter);
nbt.setByte("scale", this.scale);
nbt.setShort("width", (short)128);
nbt.setShort("height", (short)128);
nbt.setByteArray("colors", this.colors);
}
示例15: writeToNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
{
Template.BasicPalette template$basicpalette = new Template.BasicPalette();
NBTTagList nbttaglist = new NBTTagList();
for (Template.BlockInfo template$blockinfo : this.blocks)
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setTag("pos", this.writeInts(new int[] {template$blockinfo.pos.getX(), template$blockinfo.pos.getY(), template$blockinfo.pos.getZ()}));
nbttagcompound.setInteger("state", template$basicpalette.idFor(template$blockinfo.blockState));
if (template$blockinfo.tileentityData != null)
{
nbttagcompound.setTag("nbt", template$blockinfo.tileentityData);
}
nbttaglist.appendTag(nbttagcompound);
}
NBTTagList nbttaglist1 = new NBTTagList();
for (Template.EntityInfo template$entityinfo : this.entities)
{
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.setTag("pos", this.writeDoubles(new double[] {template$entityinfo.pos.xCoord, template$entityinfo.pos.yCoord, template$entityinfo.pos.zCoord}));
nbttagcompound1.setTag("blockPos", this.writeInts(new int[] {template$entityinfo.blockPos.getX(), template$entityinfo.blockPos.getY(), template$entityinfo.blockPos.getZ()}));
if (template$entityinfo.entityData != null)
{
nbttagcompound1.setTag("nbt", template$entityinfo.entityData);
}
nbttaglist1.appendTag(nbttagcompound1);
}
NBTTagList nbttaglist2 = new NBTTagList();
for (IBlockState iblockstate : template$basicpalette)
{
nbttaglist2.appendTag(NBTUtil.writeBlockState(new NBTTagCompound(), iblockstate));
}
nbt.setTag("palette", nbttaglist2);
nbt.setTag("blocks", nbttaglist);
nbt.setTag("entities", nbttaglist1);
nbt.setTag("size", this.writeInts(new int[] {this.size.getX(), this.size.getY(), this.size.getZ()}));
nbt.setString("author", this.author);
nbt.setInteger("DataVersion", 922);
return nbt;
}