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));
}
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;
}
}
}
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;
}
}
}
}
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));
}
Aggregations