From 67be86a19ae0cd5e7f170c3e4c1a88f8548a04b2 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Thu, 13 Mar 2014 13:26:55 -0500 Subject: [PATCH] Inscriber Recipe Handler, + Fixed Potential ME Chest Crash. --- recipes/handlers/Inscribe.java | 9 ++++++--- tile/storage/TileChest.java | 35 +++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/recipes/handlers/Inscribe.java b/recipes/handlers/Inscribe.java index 9ea986396..208cfb3fc 100644 --- a/recipes/handlers/Inscribe.java +++ b/recipes/handlers/Inscribe.java @@ -105,10 +105,13 @@ public class Inscribe implements ICraftHandler, IWebsiteSeralizer o += h.getName( output ) + "\n"; - if ( plateB != null ) - o += h.getName( plateB ) + "\n"; + if ( plateA != null ) + o += h.getName( plateA )+"\n"; - o += h.getName( plateA ); + o += h.getName(imprintable); + + if ( plateB != null ) + o += "\n"+h.getName( plateB ); return o; } diff --git a/tile/storage/TileChest.java b/tile/storage/TileChest.java index 9c0b45f58..2a8b5a78c 100644 --- a/tile/storage/TileChest.java +++ b/tile/storage/TileChest.java @@ -356,26 +356,31 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { if ( !isCached ) { + icell = null; + fcell = null; + ItemStack is = inv.getStackInSlot( 1 ); if ( is != null ) { isCached = true; cellHandler = AEApi.instance().registries().cell().getHander( is ); - - double power = 1.0; - - IMEInventoryHandler itemCell = cellHandler.getCellInventory( is, StorageChannel.ITEMS ); - IMEInventoryHandler fluidCell = cellHandler.getCellInventory( is, StorageChannel.FLUIDS ); - - if ( itemCell != null ) - power += cellHandler.cellIdleDrain( is, itemCell ); - else if ( fluidCell != null ) - power += cellHandler.cellIdleDrain( is, fluidCell ); - - gridProxy.setIdlePowerUsage( power ); - - icell = wrap( itemCell ); - fcell = wrap( fluidCell ); + if ( cellHandler != null ) + { + double power = 1.0; + + IMEInventoryHandler itemCell = cellHandler.getCellInventory( is, StorageChannel.ITEMS ); + IMEInventoryHandler fluidCell = cellHandler.getCellInventory( is, StorageChannel.FLUIDS ); + + if ( itemCell != null ) + power += cellHandler.cellIdleDrain( is, itemCell ); + else if ( fluidCell != null ) + power += cellHandler.cellIdleDrain( is, fluidCell ); + + gridProxy.setIdlePowerUsage( power ); + + icell = wrap( itemCell ); + fcell = wrap( fluidCell ); + } } }