@Override public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.lastReportedValue = data.getLong( "lastReportedValue" ); this.reportingValue = data.getLong( "reportingValue" ); this.prevState = data.getBoolean( "prevState" ); this.config.readFromNBT( data, "config" ); }
@Override public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.lastReportedValue = data.getLong( "lastReportedValue" ); this.reportingValue = data.getLong( "reportingValue" ); this.prevState = data.getBoolean( "prevState" ); this.config.readFromNBT( data, "config" ); }
public static long getLong(ItemStack stack, String tag, long defaultExpected) { return verifyExistance(stack, tag) ? getNBT(stack).getLong(tag) : defaultExpected; }
public long getQEFrequency() { final ItemStack is = this.internalInventory.getStackInSlot( 0 ); if( !is.isEmpty() ) { final NBTTagCompound c = is.getTagCompound(); if( c != null ) { return c.getLong( "freq" ); } } return 0; }
@Override public void loadFromNBT( final String name, final NBTTagCompound nodeData ) { if( this.myGrid == null ) { final NBTTagCompound node = nodeData.getCompoundTag( name ); this.playerID = node.getInteger( "p" ); this.setLastSecurityKey( node.getLong( "k" ) ); final long storageID = node.getLong( "g" ); final GridStorage gridStorage = WorldData.instance().storageData().getGridStorage( storageID ); this.setGridStorage( gridStorage ); } else { throw new IllegalStateException( "Loading data after part of a grid, this is invalid." ); } }
public static IAEItemStack fromNBT( final NBTTagCompound i ) { if( i == null ) { return null; } final ItemStack itemstack = new ItemStack( i ); if( itemstack.isEmpty() ) { return null; } final AEItemStack item = AEItemStack.fromItemStack( itemstack ); item.setStackSize( i.getLong( "Cnt" ) ); item.setCountRequestable( i.getLong( "Req" ) ); item.setCraftable( i.getBoolean( "Craft" ) ); return item; }
public static IAEFluidStack fromNBT( final NBTTagCompound data ) { final FluidStack fluidStack = FluidStack.loadFluidStackFromNBT( data ); if( fluidStack == null ) { return null; } final AEFluidStack fluid = AEFluidStack.fromFluidStack( fluidStack ); fluid.setStackSize( data.getLong( "Cnt" ) ); fluid.setCountRequestable( data.getLong( "Req" ) ); fluid.setCraftable( data.getBoolean( "Craft" ) ); if( fluid.hasTagCompound() ) { fluid.tagCompound = fluid.tagCompound.copy(); } return fluid; }
internalCurrentPower = tag.getLong( ID_CURRENT_POWER ); this.cache.put( te, internalCurrentPower );
final ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) );
@Override public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.cm.readFromNBT( data ); if( data.hasKey( "paintedColor" ) ) { this.paintedColor = AEColor.values()[data.getByte( "paintedColor" )]; } this.securityKey = data.getLong( "securityKey" ); this.getConfigSlot().readFromNBT( data, "config" ); final NBTTagCompound storedItems = data.getCompoundTag( "storedItems" ); for( final Object key : storedItems.getKeySet() ) { final NBTBase obj = storedItems.getTag( (String) key ); if( obj instanceof NBTTagCompound ) { this.inventory.getStoredItems().add( AEItemStack.fromItemStack( new ItemStack( (NBTTagCompound) obj ) ) ); } } }
public long getLong(@Nullable NBTTagCompound tag, long _default) { if (tag != null && tag.hasKey(key)) { return tag.getLong(key); } return _default; }
public void readFromNBT(NBTTagCompound cmp) { name = cmp.getString(TAG_SPELL_NAME); if(cmp.hasKey(TAG_UUID_MOST)) { long uuidMost = cmp.getLong(TAG_UUID_MOST); long uuidLeast = cmp.getLong(TAG_UUID_LEAST); if(uuid.getMostSignificantBits() != uuidMost || uuid.getLeastSignificantBits() != uuidLeast) uuid = new UUID(uuidMost, uuidLeast); } grid.readFromNBT(cmp); }
@Override public void deserializeNBT(NBTTagCompound nbt) { this.dim = nbt.getInteger("dim"); this.pos = BlockPos.fromLong(nbt.getLong("pos")); }
@Override public void onEntityCollidedWithBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull Entity entity) { if (!world.isRemote && entity instanceof EntityPlayerMP) { long time = entity.world.getTotalWorldTime(); EntityPlayerMP player = (EntityPlayerMP) entity; if (time % FluidConfig.nutrientFoodBoostDelay.get() == 0 && player.getEntityData().getLong("eioLastFoodBoost") != time) { player.getFoodStats().addStats(1, 0.1f); player.getEntityData().setLong("eioLastFoodBoost", time); } } super.onEntityCollidedWithBlock(world, pos, state, entity); }
@SuppressWarnings("null") public long getLong(@Nonnull ItemStack stack, long _default) { if (Prep.isValid(stack) && stack.hasTagCompound() && stack.getTagCompound().hasKey(key)) { return stack.getTagCompound().getLong(key); } return _default; }
@Override public void readFromNBT(NBTTagCompound nbt) { bountyLevel = nbt.getInteger("bountyLevel"); lastUpdate = nbt.getLong("lastUpdate"); gameBoard = new EscritoireGameBoard(nbt); if (nbt.hasKey("Status")) { int statusOrdinal = nbt.getInteger("Status"); status = Status.values()[statusOrdinal]; } lastUpdate = System.currentTimeMillis(); }