Adds improved tooltip to invalid encodedPattern (#2992)

* Adds improved tooltip to invalid encodedPattern

This also fixes that encodedPattern might be shown as valid,
even though one or more input or output item is missing.
This commit is contained in:
tyra
2017-08-04 21:17:35 +02:00
committed by yueh
parent 5abb8bf886
commit 8d5cc916e0
4 changed files with 213 additions and 4 deletions
@@ -85,7 +85,13 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
for( int x = 0; x < inTag.tagCount(); x++ )
{
final ItemStack gs = new ItemStack( inTag.getCompoundTagAt( x ) );
NBTTagCompound ingredient = inTag.getCompoundTagAt( x );
final ItemStack gs = new ItemStack( ingredient );
if( !ingredient.hasNoTags() && gs.isEmpty() )
{
throw new IllegalArgumentException( "No pattern here!" );
}
this.crafting.setInventorySlotContents( x, gs );
@@ -119,7 +125,13 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
for( int x = 0; x < outTag.tagCount(); x++ )
{
final ItemStack gs = new ItemStack( outTag.getCompoundTagAt( x ) );
NBTTagCompound resultItemTag = outTag.getCompoundTagAt( x );
final ItemStack gs = new ItemStack( resultItemTag );
if( !resultItemTag.hasNoTags() && gs.isEmpty() )
{
throw new IllegalArgumentException( "No pattern here!" );
}
if( !gs.isEmpty() )
{