ItemStack input = getStackInSlot(SLOT_INPUT);
if (input != null && input.stackSize > 0) {
ItemStack output = getStackInSlot(SLOT_OUTPUT);
IBlastFurnaceRecipe recipe = RailcraftCraftingManager.blastFurnace.getRecipe(input);
if (recipe != null && recipe.isRoomForOutput(output)) {
if (paused) return;
if (burnTime <= FUEL_PER_TICK * 2) {
ItemStack fuel = getStackInSlot(SLOT_FUEL);
if (FUEL_FILTER.matches(fuel)) {
int itemBurnTime = FuelPlugin.getBurnTime(fuel);
if (itemBurnTime > 0) {
currentItemBurnTime = itemBurnTime + burnTime;
burnTime = currentItemBurnTime;
setInventorySlotContents(SLOT_FUEL, InvTools.depleteItem(fuel));
}
}
}
if (isBurning()) {
cookTime++;
setCooking(true);
if (cookTime >= recipe.getCookTime()) {
cookTime = 0;
finishedAt = clock;
if (output == null)
setInventorySlotContents(SLOT_OUTPUT, recipe.getOutput());
else
output.stackSize += recipe.getOutputStackSize();
decrStackSize(SLOT_INPUT, 1);
}
}
} else {
cookTime = 0;