* Fixes #3315: Slightly more permissive checks for autocrafting Also fixes a bug in the fallback for looking up patterns to only use ItemStack.EMPTY.
This commit is contained in:
+2
-1
@@ -489,7 +489,8 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
|||||||
if( ais.getItem() == whatToCraft.getItem() && ( !ais.getItem().getHasSubtypes() || ais.getItemDamage() == whatToCraft.getItemDamage() ) )
|
if( ais.getItem() == whatToCraft.getItem() && ( !ais.getItem().getHasSubtypes() || ais.getItemDamage() == whatToCraft.getItemDamage() ) )
|
||||||
{
|
{
|
||||||
// TODO: check if OK
|
// TODO: check if OK
|
||||||
if( details.isValidItemForSlot( slotIndex, ais.createItemStack(), world ) )
|
// TODO: this is slightly hacky, but fine as long as we only deal with itemstacks
|
||||||
|
if( details.isValidItemForSlot( slotIndex, ais.asItemStackRepresentation(), world ) )
|
||||||
{
|
{
|
||||||
return this.craftableItems.get( ais );
|
return this.craftableItems.get( ais );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,10 +180,25 @@ public class ItemComparisonHelper
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final boolean isLeftEmpty = left == null || left.hasNoTags();
|
||||||
|
final boolean isRightEmpty = right == null || right.hasNoTags();
|
||||||
|
|
||||||
|
if( isLeftEmpty && isRightEmpty )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( isLeftEmpty != isRightEmpty )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if( left != null )
|
if( left != null )
|
||||||
{
|
{
|
||||||
return left.equals( right );
|
return left.equals( right );
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user