public static void setByte(ItemStack stack, String tag, byte b) { getNBT(stack).setByte(tag, b); }
@Override public NBTTagCompound writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() ); return data; }
@Override public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); data.setByte( "spin", this.getSpin() ); }
@Override public NBTTagCompound writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); this.config.writeToNBT( data ); data.setInteger( "priority", this.priority ); data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() ); return data; }
/** * (abstract) Protected helper method to write subclass entity data to NBT. */ public void writeEntityToNBT(NBTTagCompound compound) { compound.setInteger("xTile", this.xTile); compound.setInteger("yTile", this.yTile); compound.setInteger("zTile", this.zTile); ResourceLocation resourcelocation = Block.REGISTRY.getNameForObject(this.inTile); compound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); compound.setByte("shake", (byte)this.throwableShake); compound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); if ((this.throwerName == null || this.throwerName.isEmpty()) && this.thrower instanceof EntityPlayer) { this.throwerName = this.thrower.getName(); } compound.setString("ownerName", this.throwerName == null ? "" : this.throwerName); }
@Override public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); if( Platform.isServer() ) { final IGridNode node = this.getGridNode(); if( node != null ) { int howMany = 0; for( final IGridConnection gc : node.getConnections() ) { howMany = Math.max( gc.getUsedChannels(), howMany ); } data.setByte( "usedChannels", (byte) howMany ); } } }
d.setByte( "Count", (byte) 0 );
tag.setByte( ID_USED_CHANNELS, usedChannels );
@Override public NBTTagCompound writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); this.cm.writeToNBT( data ); data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() ); data.setLong( "securityKey", this.securityKey ); this.getConfigSlot().writeToNBT( data, "config" ); final NBTTagCompound storedItems = new NBTTagCompound(); int offset = 0; for( final IAEItemStack ais : this.inventory.getStoredItems() ) { final NBTTagCompound it = new NBTTagCompound(); ais.createItemStack().writeToNBT( it ); storedItems.setTag( String.valueOf( offset ), it ); offset++; } data.setTag( "storedItems", storedItems ); return data; }
@Override public void writeToNBT( final NBTTagCompound data ) { data.setString( "FluidName", this.fluid.getName() ); data.setByte( "Count", (byte) 0 ); data.setLong( "Cnt", this.getStackSize() ); data.setLong( "Req", this.getCountRequestable() ); data.setBoolean( "Craft", this.isCraftable() ); if( this.hasTagCompound() ) { data.setTag( "Tag", this.tagCompound ); } else { data.removeTag( "Tag" ); } }
@Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); nbt.setByte("front", (byte) (front.toInt() << 0)); }
protected void changeMode(ItemStack stack) { byte newMode = (byte) (getMode(stack) + 1); stack.getTagCompound().setByte(TAG_MODE, (newMode > numModes - 1 ? 0 : newMode)); }
protected void writeSettingToNBT(NBTTagCompound nbtRoot) { nbtRoot.setByte("mode", (byte) mode.ordinal()); nbtRoot.setShort("level", (short) level); nbtRoot.setBoolean("sticky", sticky); }
@Override public void writeEntityToNBT(@Nonnull NBTTagCompound root) { super.writeEntityToNBT(root); root.setFloat("scale", getScale()); root.setByte("growthMode", (byte) getGrowthMode().ordinal()); }
@Override public void writeToNBT(@Nonnull NBTTagCompound nbtRoot) { nbtRoot.setBoolean("isBlacklist", isBlacklist); nbtRoot.setBoolean("sticky", sticky); nbtRoot.setByte("speciesMode", (byte) speciesMode.ordinal()); int i = 0; for (ItemStack item : items) { if (item != null) { nbtRoot.setTag("item" + i, item.serializeNBT()); } i++; } }
public NBTTagCompound writeToNBT(NBTTagCompound compound) { if (this.researcher != null) { NBTTagCompound nbt = new NBTTagCompound(); PlayerUtil.writeGameProfile(nbt, researcher); compound.setTag("res", nbt); } compound.setByte("TYP", (byte) type.ordinal()); compound.setTag("INN", inner); return compound; }
@Override public void writeToNBT(NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); dummyInventory.writeToNBT(nbttagcompound, ""); nbttagcompound.setBoolean("requestpartials", _requestPartials); nbttagcompound.setInteger("amount", amount); nbttagcompound.setByte("_bucketMinimum", (byte) _bucketMinimum.ordinal()); }
@Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); nbt.setByte("front", (byte) (front.toInt() << 0)); nbt.setDouble("timeToNextSample", timeToNextSample); nbt.setBoolean("pause", pause); logs.writeToNBT(nbt, "logs"); nbt.setInteger("sampleStack", sampleStack); nbt.setInteger("sampleStackNbr", sampleStackNbr); }