Fixed some storage bus related crashes.

Fixed an issue where the storage might access inventories that have been removed from the world.
Fixed an issue caused by refactoring.
This commit is contained in:
AlgorithmX2
2014-07-23 23:20:16 -05:00
parent 42b6647ec3
commit 2b6cca0267
5 changed files with 22 additions and 14 deletions
+7 -2
View File
@@ -79,6 +79,8 @@ public class MEMonitorIInventory implements IMEInventory<IAEItemStack>, IMEMonit
else
out = adaptor.addItems( input.getItemStack() );
onTick();
if ( out == null )
return null;
@@ -127,8 +129,8 @@ public class MEMonitorIInventory implements IMEInventory<IAEItemStack>, IMEMonit
@Override
public IItemList<IAEItemStack> getAvailableItems(IItemList out)
{
for (ItemSlot is : adaptor)
out.addStorage( is.getAEItemStack() );
for (CachedItemStack is : memory.values())
out.addStorage( is.aeStack );
return out;
}
@@ -149,6 +151,9 @@ public class MEMonitorIInventory implements IMEInventory<IAEItemStack>, IMEMonit
// better then doing construction from scratch :3
IAEItemStack o = request.copy();
o.setStackSize( out.stackSize );
onTick();
return o;
}