ItemStack input = getStackInSlot(SLOT_INPUT);
if (input != null && input.stackSize > 0 && !InvTools.isSynthetic(input)) {
if (!paused && clock % COOK_STEP_LENGTH == 0) {
ItemStack output = getStackInSlot(SLOT_OUTPUT);
ICokeOvenRecipe recipe = RailcraftCraftingManager.cokeOven.getRecipe(input);
if (recipe != null)
if ((output == null || (output.isItemEqual(recipe.getOutput()) && output.stackSize + recipe.getOutput().stackSize <= output.getMaxStackSize()))
&& tank.fill(recipe.getFluidOutput(), false) >= recipe.getFluidOutput().amount) {
cookTimeTotal = recipe.getCookTime();
cookTime += COOK_STEP_LENGTH;
setCooking(true);
if (cookTime >= recipe.getCookTime()) {
cookTime = 0;
finishedAt = clock;
decrStackSize(SLOT_INPUT, 1);
if (output == null)
setInventorySlotContents(SLOT_OUTPUT, recipe.getOutput());
else
output.stackSize += recipe.getOutput().stackSize;
tank.fill(recipe.getFluidOutput(), true);
sendUpdateToClient();
}
} else {
cookTime = 0;