Fixed Anti-Recursive Crafting Check

This commit is contained in:
AlgorithmX2 2014-07-12 18:13:40 -05:00
parent 91051183ad
commit 98e4604690
2 changed files with 10 additions and 5 deletions

View file

@ -49,7 +49,7 @@ public class CraftingTreeNode
for (ICraftingPatternDetails details : cc.getCraftingFor( what ))// in order.
{
if ( notRecurive( details ) )
if ( parent == null || parent.notRecurive( details ) )
nodes.add( new CraftingTreeProcess( cc, job, details, this, depth + 1, world ) );
}
}
@ -63,13 +63,18 @@ public class CraftingTreeNode
boolean notRecurive(ICraftingPatternDetails details)
{
IAEItemStack[] o = details.getOutputs();
IAEItemStack[] o = details.getCondencedOutputs();
for (IAEItemStack i : o)
if ( i.equals( what ) )
return true;
return false;
o = details.getCondencedInputs();
for (IAEItemStack i : o)
if ( i.equals( what ) )
return false;
if ( parent == null )
return false;
return true;
return parent.notRecurive( details );
}

View file

@ -88,7 +88,7 @@ public class CraftingTreeProcess
public boolean notRecurive(ICraftingPatternDetails details)
{
return parent.notRecurive( details );
return parent == null || parent.notRecurive( details );
}
long getTimes(long remaining, long stackSize)