From 54eb54d59a6a06cb2adf51759ccc765150d7fea4 Mon Sep 17 00:00:00 2001 From: Adrian Siekierka Date: Sat, 8 Apr 2017 10:10:34 +0200 Subject: [PATCH] fix #3498 --- common/buildcraft/factory/TileRefinery.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/buildcraft/factory/TileRefinery.java b/common/buildcraft/factory/TileRefinery.java index a1d0e993..ee81532a 100644 --- a/common/buildcraft/factory/TileRefinery.java +++ b/common/buildcraft/factory/TileRefinery.java @@ -101,11 +101,15 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IHasW return; } - if (getBattery().useEnergy(craftingResult.energyCost, craftingResult.energyCost, false) > 0) { - CraftingResult r = currentRecipe.craft(this, false); + if (getBattery().useEnergy(craftingResult.energyCost, craftingResult.energyCost, true) > 0) { + CraftingResult r = currentRecipe.craft(this, true); if (r != null && r.crafted != null) { - // Shouldn't really happen, but its not properly documented - result.fill(r.crafted.copy(), true); + getBattery().useEnergy(craftingResult.energyCost, craftingResult.energyCost, false); + r = currentRecipe.craft(this, false); + if (r != null && r.crafted != null) { + // Shouldn't really happen, but its not properly documented + result.fill(r.crafted.copy(), true); + } } } }