Fixed Bug: #0613 - interface bug when crafting large quantities of items
This commit is contained in:
@@ -33,8 +33,8 @@ public class CraftingJob implements Runnable, ICraftingJob
|
||||
|
||||
boolean simulate = false;
|
||||
final MECraftingInventory original;
|
||||
final MECraftingInventory availableCheck;
|
||||
|
||||
MECraftingInventory availableCheck;
|
||||
public CraftingTreeNode tree;
|
||||
private BaseActionSource actionSrc;
|
||||
private ICraftingCallback callback;
|
||||
@@ -71,8 +71,8 @@ public class CraftingJob implements Runnable, ICraftingJob
|
||||
ICraftingGrid cc = grid.getCache( ICraftingGrid.class );
|
||||
IStorageGrid sg = grid.getCache( IStorageGrid.class );
|
||||
original = new MECraftingInventory( sg.getItemInventory(), false, false, false );
|
||||
availableCheck = new MECraftingInventory( sg.getItemInventory(), false, false, false );
|
||||
tree = getCraftingTree( cc, what );
|
||||
availableCheck = null;
|
||||
}
|
||||
|
||||
private World wrapWorld(World w)
|
||||
@@ -138,6 +138,7 @@ public class CraftingJob implements Runnable, ICraftingJob
|
||||
MECraftingInventory meci = new MECraftingInventory( original, true, false, true );
|
||||
meci.ignore( output );
|
||||
|
||||
availableCheck = new MECraftingInventory( original, false, false, false );
|
||||
tree.request( meci, output.getStackSize(), actionSrc );
|
||||
tree.dive( this );
|
||||
|
||||
@@ -161,6 +162,8 @@ public class CraftingJob implements Runnable, ICraftingJob
|
||||
MECraftingInventory meci = new MECraftingInventory( original, true, false, true );
|
||||
meci.ignore( output );
|
||||
|
||||
availableCheck = new MECraftingInventory( original, false, false, false );
|
||||
|
||||
tree.setSimulate();
|
||||
tree.request( meci, output.getStackSize(), actionSrc );
|
||||
tree.dive( this );
|
||||
@@ -216,6 +219,8 @@ public class CraftingJob implements Runnable, ICraftingJob
|
||||
if ( callback != null )
|
||||
callback.calculationComplete( this );
|
||||
|
||||
availableCheck = null;
|
||||
|
||||
synchronized (monitor)
|
||||
{
|
||||
running = false;
|
||||
|
||||
@@ -188,7 +188,9 @@ public class CraftingTreeNode
|
||||
{
|
||||
missing += l;
|
||||
bytes += l;
|
||||
return what;
|
||||
IAEItemStack rv = what.copy();
|
||||
rv.setStackSize( l );
|
||||
return rv;
|
||||
}
|
||||
|
||||
throw new CraftBranchFailure( what, l );
|
||||
|
||||
Reference in New Issue
Block a user