Fixes #1601: Do not allow 0 as stacksize for recipes

This commit is contained in:
yueh
2015-08-06 22:45:16 +02:00
committed by thatsIch
parent b0504f4141
commit d26caa5f8b
9 changed files with 82 additions and 43 deletions
+13 -9
View File
@@ -21,6 +21,8 @@ package appeng.recipes;
import java.util.List;
import com.google.common.base.Preconditions;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -39,17 +41,19 @@ import appeng.api.recipes.ResolverResultSet;
public class Ingredient implements IIngredient
{
public final boolean isAir;
public final String nameSpace;
public final String itemName;
public final int meta;
public final int qty;
NBTTagCompound nbt = null;
ItemStack[] baked;
private final boolean isAir;
private final String nameSpace;
private final String itemName;
private final int meta;
private final int qty;
private NBTTagCompound nbt = null;
private ItemStack[] baked;
public Ingredient( RecipeHandler handler, String input, int qty ) throws RecipeError, MissedIngredientSet
{
Preconditions.checkNotNull( handler );
Preconditions.checkNotNull( input );
Preconditions.checkState( qty > 0 );
// works no matter wat!
this.qty = qty;
@@ -132,7 +136,7 @@ public class Ingredient implements IIngredient
throw new RecipeError( input + " : Needs at least Namespace and Name." );
}
handler.data.knownItem.add( this.toString() );
handler.getData().knownItem.add( this.toString() );
}
@Override