Separated Crafting job into a worker thread.
Crafting calculation can be canceled. Hooked up a crafting calculation launch and the confirmation GUI.
This commit is contained in:
@@ -86,8 +86,11 @@ public class CraftingTreeProcess
|
||||
throw new RuntimeException( "Crafting Tree construction failed." );
|
||||
}
|
||||
|
||||
public void request(MECraftingInventory inv, long i, BaseActionSource src) throws CraftBranchFailure
|
||||
public void request(MECraftingInventory inv, long i, BaseActionSource src) throws CraftBranchFailure, InterruptedException
|
||||
{
|
||||
if ( Thread.interrupted() )
|
||||
throw new InterruptedException();
|
||||
|
||||
// request and remove inputs...
|
||||
for (Entry<CraftingTreeNode, Long> entry : nodes.entrySet())
|
||||
{
|
||||
@@ -129,4 +132,12 @@ public class CraftingTreeProcess
|
||||
for (CraftingTreeNode pro : nodes.keySet())
|
||||
pro.dive( job );
|
||||
}
|
||||
|
||||
public void setSimulate()
|
||||
{
|
||||
crafts = 0;
|
||||
|
||||
for (CraftingTreeNode pro : nodes.keySet())
|
||||
pro.setSimulate();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user