Search in sources :

Example 1 with CokeOvenRecipe

use of gregtech.api.recipes.recipes.CokeOvenRecipe in project GregTech by GregTechCE.

the class MetaTileEntityCokeOven method tryPickNewRecipe.

private boolean tryPickNewRecipe() {
    ItemStack inputStack = importItems.getStackInSlot(0);
    if (inputStack.isEmpty()) {
        return false;
    }
    CokeOvenRecipe currentRecipe = getOrRefreshRecipe(inputStack);
    if (currentRecipe != null && setupRecipe(inputStack, currentRecipe)) {
        inputStack.shrink(currentRecipe.getInput().getCount());
        this.maxProgressDuration = currentRecipe.getDuration();
        this.currentProgress = 0;
        this.outputStack = currentRecipe.getOutput().copy();
        this.outputFluid = currentRecipe.getFluidOutput().copy();
        markDirty();
        return true;
    }
    return false;
}
Also used : ItemStack(net.minecraft.item.ItemStack) CokeOvenRecipe(gregtech.api.recipes.recipes.CokeOvenRecipe)

Example 2 with CokeOvenRecipe

use of gregtech.api.recipes.recipes.CokeOvenRecipe in project GregTech by GregTechCE.

the class CokeOvenRecipeBuilder method buildAndRegister.

@ZenMethod
public void buildAndRegister() {
    ValidationResult<CokeOvenRecipe> result = build();
    if (result.getType() == EnumValidationResult.VALID) {
        CokeOvenRecipe recipe = result.getResult();
        RecipeMaps.COKE_OVEN_RECIPES.add(recipe);
    }
}
Also used : CokeOvenRecipe(gregtech.api.recipes.recipes.CokeOvenRecipe) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Aggregations

CokeOvenRecipe (gregtech.api.recipes.recipes.CokeOvenRecipe)2 ItemStack (net.minecraft.item.ItemStack)1 ZenMethod (stanhebben.zenscript.annotations.ZenMethod)1