Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ public void update() {
boolean mark = false;

if (!this.getWorld().isRemote) {
CompressorRecipe recipe = this.getRecipe();
CompressorRecipe recipe = null;
ItemStack output = this.getStackInSlot(0);
ItemStack input = this.getStackInSlot(1);

if (!input.isEmpty()) {
if (this.materialStack.isEmpty()) {
this.materialStack = input.copy();
mark = true;
//Retrieve new recipe upon non-null item detected
recipe = getRecipe();
}

if (!this.inputLimit || (recipe != null && this.materialCount < recipe.getInputCount())) {
Expand All @@ -83,6 +85,11 @@ public void update() {
mark = true;
}
}
//Invalidate the cached item and marked state on unsuccessful recipe retrieval
else if(mark) {
this.materialStack = ItemStack.EMPTY;
mark = false;
}
}

if (recipe != null && this.getEnergy().getEnergyStored() > 0) {
Expand Down