fix: improve pattern encoder GUI

fixes #5
This commit is contained in:
Timo Ley 2023-01-28 21:20:31 +01:00
parent 55eec4d290
commit 8f69574500
1 changed files with 13 additions and 1 deletions

View File

@ -65,6 +65,8 @@ public class TilePatternEncoder extends AEBaseInvTile {
ItemStack is = Platform.findMatchingRecipeOutput(ci, this.worldObj);
if (is != null) {
this.storage.setInventorySlotContents(9, is);
} else {
this.storage.setInventorySlotContents(9, null);
}
}
@ -74,7 +76,7 @@ public class TilePatternEncoder extends AEBaseInvTile {
public void encodePattern() {
ItemStack fish = this.storage.getStackInSlot(11);
if (this.storage.getStackInSlot(9) != null) {
if (this.storage.getStackInSlot(9) != null && !this.craftingGridEmpty()) {
if (fish == null) {
fish = this.storage.decrStackSize(10, 1);
}
@ -310,4 +312,14 @@ public class TilePatternEncoder extends AEBaseInvTile {
}
}
}
public boolean craftingGridEmpty() {
for(int i = 0; i < 9; i++) {
ItemStack stack = this.storage.getStackInSlot(i);
if (stack != null) {
return false;
}
}
return true;
}
}