Fixed brewery recipes

This commit is contained in:
marcin212 committed 2017-07-07 13:41:45 +02:00
1 parent f3d93b47b9
commit 83fd00cad5
2 files changed
+9 -1

No files matched your search

@@ -35,6 +35,14 @@ public class BreweryCrafting implements INbtWritable {
ItemStack yeast = new ItemStack(nbt.getCompoundTag("yeast"));
return new BreweryCrafting(inputFluid, ingredient, inputGrains, yeast);
}
public boolean hasInputGrainsEmpty(){
return inputGrains == null || (isEmptyStack(inputGrains[0]) && isEmptyStack(inputGrains[1]) && isEmptyStack(inputGrains[2]));
}
private boolean isEmptyStack(ItemStack stack){
return stack == null || stack.isEmpty();
}
@Override
public NBTTagCompound writeToNBT(final NBTTagCompound nbt) {
@@ -31,7 +31,7 @@ public class BreweryRecipe implements IBreweryRecipe {
if (!this.yeast.isItemEqual(crafting.yeast)) {
return null;
}
if(crafting.inputGrains != null && crafting.inputGrains.length > 0){
if(!crafting.hasInputGrainsEmpty()){
return null;
}
if(!crafting.ingredient.isEmpty()){