Search in sources :

Example 1 with FusionReactorRecipe

use of techreborn.api.reactor.FusionReactorRecipe in project TechReborn by TechReborn.

the class CTFusionReactor method addRecipe.

@ZenMethod
public static void addRecipe(IIngredient topInput, IIngredient bottomInput, IItemStack output, int startEU, int euTick, int tickTime) {
    FusionReactorRecipe reactorRecipe = new FusionReactorRecipe((ItemStack) CraftTweakerCompat.toObject(topInput), (ItemStack) CraftTweakerCompat.toObject(bottomInput), CraftTweakerCompat.toStack(output), startEU, euTick, tickTime);
    CraftTweakerAPI.apply(new Add(reactorRecipe));
}
Also used : FusionReactorRecipe(techreborn.api.reactor.FusionReactorRecipe) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 2 with FusionReactorRecipe

use of techreborn.api.reactor.FusionReactorRecipe in project TechReborn by TechReborn.

the class TileFusionControlComputer method updateCurrentRecipe.

/**
 * Tries to set current recipe based in inputs in reactor
 */
private void updateCurrentRecipe() {
    for (final FusionReactorRecipe reactorRecipe : FusionReactorRecipeHelper.reactorRecipes) {
        if (validateReactorRecipe(reactorRecipe)) {
            this.currentRecipe = reactorRecipe;
            this.crafingTickTime = 0;
            this.finalTickTime = this.currentRecipe.getTickTime();
            this.neededPower = (int) this.currentRecipe.getStartEU();
            this.hasStartedCrafting = false;
            break;
        }
    }
}
Also used : FusionReactorRecipe(techreborn.api.reactor.FusionReactorRecipe)

Example 3 with FusionReactorRecipe

use of techreborn.api.reactor.FusionReactorRecipe in project TechReborn by TechReborn.

the class TileFusionControlComputer method readFromNBT.

@Override
public void readFromNBT(final NBTTagCompound tagCompound) {
    super.readFromNBT(tagCompound);
    this.crafingTickTime = tagCompound.getInteger("crafingTickTime");
    this.finalTickTime = tagCompound.getInteger("finalTickTime");
    this.neededPower = tagCompound.getInteger("neededPower");
    this.hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting");
    if (tagCompound.hasKey("hasActiveRecipe") && tagCompound.getBoolean("hasActiveRecipe") && this.currentRecipe == null) {
        for (final FusionReactorRecipe reactorRecipe : FusionReactorRecipeHelper.reactorRecipes) {
            if (validateReactorRecipe(reactorRecipe)) {
                this.currentRecipe = reactorRecipe;
            }
        }
    }
}
Also used : FusionReactorRecipe(techreborn.api.reactor.FusionReactorRecipe)

Example 4 with FusionReactorRecipe

use of techreborn.api.reactor.FusionReactorRecipe in project TechReborn by TechReborn.

the class FusionReactorRecipes method init.

public static void init() {
    FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("helium3"), ItemCells.getCellByName("deuterium"), ItemCells.getCellByName("heliumplasma"), 40000000, 32768, 1024));
    FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("tritium"), ItemCells.getCellByName("deuterium"), ItemCells.getCellByName("helium3"), 60000000, 32768, 2048));
    FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("wolframium"), ItemCells.getCellByName("Berylium"), ItemDusts.getDustByName("platinum"), 80000000, -2048, 1024));
    FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("wolframium"), ItemCells.getCellByName("lithium"), BlockOre.getOreByName("iridium"), 90000000, -2048, 1024));
}
Also used : FusionReactorRecipe(techreborn.api.reactor.FusionReactorRecipe)

Aggregations

FusionReactorRecipe (techreborn.api.reactor.FusionReactorRecipe)4 ZenMethod (stanhebben.zenscript.annotations.ZenMethod)1