From 7f908441ee1c3484f139ed3dbc06125b065a9734 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Wed, 26 Feb 2014 21:56:33 -0600 Subject: [PATCH] Added Errors for shape recipes with more then 3 columns. --- api | 2 +- recipes/handlers/Shaped.java | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/api b/api index 0ea16a10f..8c7e3f1c7 160000 --- a/api +++ b/api @@ -1 +1 @@ -Subproject commit 0ea16a10fc3038230f09e42de0c08a24da2d8096 +Subproject commit 8c7e3f1c77f3175da5e82bcdf9187e5dc5b6e0b0 diff --git a/recipes/handlers/Shaped.java b/recipes/handlers/Shaped.java index 69242d942..72d54557c 100644 --- a/recipes/handlers/Shaped.java +++ b/recipes/handlers/Shaped.java @@ -31,12 +31,17 @@ public class Shaped implements ICraftHandler if ( rows > 0 && input.size() <= 3 ) { cols = input.get( 0 ).size(); - for (int x = 0; x < input.size(); x++) - if ( input.get( x ).size() != cols ) - throw new RecipeError( "all rows in a shaped crafting recipe must contain the same number of ingredients." ); + if ( cols <= 3 && cols >= 1 ) + { + for (int x = 0; x < input.size(); x++) + if ( input.get( x ).size() != cols ) + throw new RecipeError( "all rows in a shaped crafting recipe must contain the same number of ingredients." ); - inputs = input; - this.output = output.get( 0 ).get( 0 ); + inputs = input; + this.output = output.get( 0 ).get( 0 ); + } + else + throw new RecipeError( "Crafting recipes must have 1-3 columns." ); } else throw new RecipeError( "shaped crafting recpies must have 1-3 rows." );