Fix some small issues

This commit is contained in:
modmuss50 2017-06-21 16:35:15 +01:00
parent 6982342dc0
commit 944d2b7b5c
No known key found for this signature in database
GPG key ID: 203A5ED4D3E48BEA
3 changed files with 20 additions and 15 deletions

View file

@ -59,7 +59,6 @@ public class TileAutoCraftingTable extends TilePowerAcceptor implements IContain
IRecipe recipe = getIRecipe();
if (recipe != null) {
if (progress >= maxProgress) {
//TODO make the thing
if (make(recipe)) {
progress = 0;
}
@ -77,15 +76,21 @@ public class TileAutoCraftingTable extends TilePowerAcceptor implements IContain
public boolean canMake(IRecipe recipe) {
if (recipe.canFit(3, 3)) {
boolean missingOutput = false;
int[] stacksInSlots = new int[9];
for (int i = 0; i < 9; i++) {
stacksInSlots[i] = inventory.getStackInSlot(i).getCount();
}
for (Ingredient ingredient : recipe.getIngredients()) {
if (ingredient != Ingredient.EMPTY) {
boolean foundIngredient = false;
for (int i = 0; i < 9; i++) {
ItemStack stack = inventory.getStackInSlot(i);
//TODO count if items are used more than once, like 8 wooden planks for a chest
if (ingredient.apply(stack)) {
foundIngredient = true;
break;
if(stacksInSlots[i] > 0){
if (ingredient.apply(stack)) {
foundIngredient = true;
stacksInSlots[i] --;
break;
}
}
}
if(!foundIngredient){