Fix a few issues when dealing with NBT items during crafting calculation.
This commit is contained in:
@@ -49,7 +49,8 @@ public class CraftingTreeNode
|
||||
this.job = job;
|
||||
sim = false;
|
||||
|
||||
for (ICraftingPatternDetails details : cc.getCraftingFor( what ))// in order.
|
||||
for (ICraftingPatternDetails details : cc.getCraftingFor( what, parent == null ? null : parent.details, slot, world ))// in
|
||||
// order.
|
||||
{
|
||||
if ( parent == null || parent.notRecurive( details ) )
|
||||
nodes.add( new CraftingTreeProcess( cc, job, details, this, depth + 1, world ) );
|
||||
@@ -151,10 +152,12 @@ public class CraftingTreeNode
|
||||
|
||||
while (pro.possible && l > 0)
|
||||
{
|
||||
pro.request( inv, pro.getTimes( l, pro.getAmountCrafted( what ).getStackSize() ), src );
|
||||
IAEItemStack madeWhat = pro.getAmountCrafted( what );
|
||||
|
||||
what.setStackSize( l );
|
||||
IAEItemStack available = inv.extractItems( what, Actionable.MODULATE, src );
|
||||
pro.request( inv, pro.getTimes( l, madeWhat.getStackSize() ), src );
|
||||
|
||||
madeWhat.setStackSize( l );
|
||||
IAEItemStack available = inv.extractItems( madeWhat, Actionable.MODULATE, src );
|
||||
|
||||
if ( available != null )
|
||||
{
|
||||
|
||||
@@ -137,6 +137,17 @@ public class CraftingTreeProcess
|
||||
}
|
||||
}
|
||||
|
||||
// more fuzzy!
|
||||
for (IAEItemStack is : details.getCondencedOutputs())
|
||||
{
|
||||
if ( is.getItem() == what2.getItem() && (is.getItem().isDamageable() || is.getItemDamage() == what2.getItemDamage()) )
|
||||
{
|
||||
what2 = is.copy();
|
||||
what2.setStackSize( is.getStackSize() );
|
||||
return what2;
|
||||
}
|
||||
}
|
||||
|
||||
throw new RuntimeException( "Crafting Tree construction failed." );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user