parent
e13d5097b3
commit
3c8c773e2f
1 changed files with 26 additions and 21 deletions
|
@ -3,8 +3,8 @@ package appeng.me.storage;
|
|||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.NavigableMap;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.NavigableMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -30,7 +30,8 @@ public class MEMonitorIInventory implements IMEInventory<IAEItemStack>, IMEMonit
|
|||
class CachedItemStack
|
||||
{
|
||||
|
||||
public CachedItemStack(ItemStack is) {
|
||||
public CachedItemStack(ItemStack is)
|
||||
{
|
||||
if ( is == null )
|
||||
{
|
||||
itemStack = null;
|
||||
|
@ -68,7 +69,8 @@ public class MEMonitorIInventory implements IMEInventory<IAEItemStack>, IMEMonit
|
|||
listeners.remove( l );
|
||||
}
|
||||
|
||||
public MEMonitorIInventory(InventoryAdaptor adaptor) {
|
||||
public MEMonitorIInventory(InventoryAdaptor adaptor)
|
||||
{
|
||||
this.adaptor = adaptor;
|
||||
memory = new TreeMap();
|
||||
}
|
||||
|
@ -222,18 +224,21 @@ public class MEMonitorIInventory implements IMEInventory<IAEItemStack>, IMEMonit
|
|||
}
|
||||
|
||||
// detect dropped items; should fix non IISided Inventory Changes.
|
||||
NavigableMap<Integer,CachedItemStack> end = memory.tailMap( high, false );
|
||||
if ( ! end.isEmpty() )
|
||||
{
|
||||
for ( CachedItemStack cis : end.values() )
|
||||
NavigableMap<Integer, CachedItemStack> end = memory.tailMap( high, false );
|
||||
if ( !end.isEmpty() )
|
||||
{
|
||||
for (CachedItemStack cis : end.values())
|
||||
{
|
||||
IAEItemStack a = cis.aeStack.copy();
|
||||
a.setStackSize( - a.getStackSize() );
|
||||
changes.add( a );
|
||||
changed = true;
|
||||
if ( cis != null )
|
||||
{
|
||||
IAEItemStack a = cis.aeStack.copy();
|
||||
a.setStackSize( -a.getStackSize() );
|
||||
changes.add( a );
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
end.clear();
|
||||
}
|
||||
}
|
||||
|
||||
if ( !changes.isEmpty() )
|
||||
postDiffrence( changes );
|
||||
|
|
Loading…
Reference in a new issue