Fixed Anti-Recursive Crafting Check
This commit is contained in:
@@ -49,7 +49,7 @@ public class CraftingTreeNode
|
|||||||
|
|
||||||
for (ICraftingPatternDetails details : cc.getCraftingFor( what ))// in order.
|
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 ) );
|
nodes.add( new CraftingTreeProcess( cc, job, details, this, depth + 1, world ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,13 +63,18 @@ public class CraftingTreeNode
|
|||||||
|
|
||||||
boolean notRecurive(ICraftingPatternDetails details)
|
boolean notRecurive(ICraftingPatternDetails details)
|
||||||
{
|
{
|
||||||
IAEItemStack[] o = details.getOutputs();
|
IAEItemStack[] o = details.getCondencedOutputs();
|
||||||
for (IAEItemStack i : o)
|
for (IAEItemStack i : o)
|
||||||
if ( i.equals( what ) )
|
if ( i.equals( what ) )
|
||||||
return true;
|
return false;
|
||||||
|
|
||||||
|
o = details.getCondencedInputs();
|
||||||
|
for (IAEItemStack i : o)
|
||||||
|
if ( i.equals( what ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
if ( parent == null )
|
if ( parent == null )
|
||||||
return false;
|
return true;
|
||||||
|
|
||||||
return parent.notRecurive( details );
|
return parent.notRecurive( details );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class CraftingTreeProcess
|
|||||||
|
|
||||||
public boolean notRecurive(ICraftingPatternDetails details)
|
public boolean notRecurive(ICraftingPatternDetails details)
|
||||||
{
|
{
|
||||||
return parent.notRecurive( details );
|
return parent == null || parent.notRecurive( details );
|
||||||
}
|
}
|
||||||
|
|
||||||
long getTimes(long remaining, long stackSize)
|
long getTimes(long remaining, long stackSize)
|
||||||
|
|||||||
Reference in New Issue
Block a user