Added Errors for shape recipes with more then 3 columns.

This commit is contained in:
AlgorithmX2
2014-02-26 21:56:33 -06:00
parent 076ddd548f
commit 7f908441ee
2 changed files with 11 additions and 6 deletions
+1 -1
Submodule api updated: 0ea16a10fc...8c7e3f1c77
+5
View File
@@ -31,6 +31,8 @@ public class Shaped implements ICraftHandler
if ( rows > 0 && input.size() <= 3 ) if ( rows > 0 && input.size() <= 3 )
{ {
cols = input.get( 0 ).size(); cols = input.get( 0 ).size();
if ( cols <= 3 && cols >= 1 )
{
for (int x = 0; x < input.size(); x++) for (int x = 0; x < input.size(); x++)
if ( input.get( x ).size() != cols ) if ( input.get( x ).size() != cols )
throw new RecipeError( "all rows in a shaped crafting recipe must contain the same number of ingredients." ); throw new RecipeError( "all rows in a shaped crafting recipe must contain the same number of ingredients." );
@@ -38,6 +40,9 @@ public class Shaped implements ICraftHandler
inputs = input; inputs = input;
this.output = output.get( 0 ).get( 0 ); this.output = output.get( 0 ).get( 0 );
} }
else
throw new RecipeError( "Crafting recipes must have 1-3 columns." );
}
else else
throw new RecipeError( "shaped crafting recpies must have 1-3 rows." ); throw new RecipeError( "shaped crafting recpies must have 1-3 rows." );
} }