Skip to content

Commit

Permalink
Prevent storage of null ingredients.
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWoodworth committed May 9, 2016
1 parent fe4a6cc commit db3f080
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>co.kepler.fastcraftplus</groupId>
<artifactId>fastcraftplus</artifactId>
<version>0.20.2</version>
<version>0.20.3</version>

<build>
<plugins>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/co/kepler/fastcraftplus/recipes/FastRecipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public final ItemStack[] getMatrix(int multiplier) {
* @return Returns the ingredients required to craft this recipe.
*/
public final Map<Ingredient, Integer> getIngredients() {
return new HashMap<>(getIngredientsInternal());
HashMap<Ingredient, Integer> result = new HashMap<>(getIngredientsInternal());
result.remove(null);
return result;
}

/**
Expand Down Expand Up @@ -114,7 +116,6 @@ public Set<ItemStack> getByproducts() {
// Count the number of buckets to be returned
int buckets = 0;
for (Ingredient i : getIngredients().keySet()) {
if (i == null) continue;
switch (i.getMaterial()) {
case LAVA_BUCKET:
case MILK_BUCKET:
Expand Down

0 comments on commit db3f080

Please sign in to comment.