From 9b6383a548bf5f43b7eb59dc9b08171afe5d3f49 Mon Sep 17 00:00:00 2001 From: Modmuss50 Date: Wed, 11 Nov 2015 18:38:43 +0000 Subject: [PATCH] fixes #251 --- src/main/java/techreborn/api/recipe/RecipeCrafter.java | 6 +++--- .../java/techreborn/client/container/ContainerCrafting.java | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/techreborn/api/recipe/RecipeCrafter.java b/src/main/java/techreborn/api/recipe/RecipeCrafter.java index fee2c862d..f6fbcbb2e 100644 --- a/src/main/java/techreborn/api/recipe/RecipeCrafter.java +++ b/src/main/java/techreborn/api/recipe/RecipeCrafter.java @@ -134,14 +134,14 @@ public class RecipeCrafter { this.currentTickTime = -1; setIsActive(); } else { - this.currentTickTime = -0; + this.currentTickTime = -1; } } } } else { if (inventory.hasChanged && !hasAllInputs()) {//If it doesn't have all the inputs reset currentRecipe = null; - currentTickTime = 0; + currentTickTime = -1; setIsActive(); } if (currentRecipe != null && currentTickTime >= currentNeededTicks) {//If it has reached the recipe tick time @@ -161,7 +161,7 @@ public class RecipeCrafter { } useAllInputs();//this uses all the inputs currentRecipe = null;//resets - currentTickTime = 0; + currentTickTime = -1; setIsActive(); } } else if (currentRecipe != null && currentTickTime < currentNeededTicks) { diff --git a/src/main/java/techreborn/client/container/ContainerCrafting.java b/src/main/java/techreborn/client/container/ContainerCrafting.java index 5c8b3c899..b57575da9 100644 --- a/src/main/java/techreborn/client/container/ContainerCrafting.java +++ b/src/main/java/techreborn/client/container/ContainerCrafting.java @@ -23,7 +23,7 @@ public abstract class ContainerCrafting extends RebornContainer { super.detectAndSendChanges(); for (int i = 0; i < this.crafters.size(); i++) { ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.currentTickTime != crafter.currentTickTime) { + if (this.currentTickTime != crafter.currentTickTime || crafter.currentTickTime == -1) { icrafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime); } if (this.currentNeededTicks != crafter.currentNeededTicks) { @@ -48,6 +48,9 @@ public abstract class ContainerCrafting extends RebornContainer { public void updateProgressBar(int id, int value) { if (id == 0) { this.currentTickTime = value; + if(this.currentTickTime == -1){ + this.currentTickTime = 0; + } } else if (id == 1) { this.currentNeededTicks = value; } else if (id == 2) {