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:
@@ -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() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user