Start of making CraftTweaker documentation a bit clearer.

This commit is contained in:
modmuss50 2018-04-02 00:12:31 +01:00
parent 087a2226d6
commit 980db3cd60
18 changed files with 43 additions and 0 deletions

View file

@ -41,6 +41,7 @@ import techreborn.api.recipe.machines.AlloySmelterRecipe;
public class CTAlloySmelter extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick)")
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);

View file

@ -36,6 +36,7 @@ import techreborn.api.recipe.machines.AssemblingMachineRecipe;
public class CTAssemblingMachine extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);

View file

@ -36,6 +36,7 @@ import techreborn.api.recipe.machines.BlastFurnaceRecipe;
public class CTBlastFurnace extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);

View file

@ -36,6 +36,7 @@ import techreborn.api.recipe.machines.CentrifugeRecipe;
public class CTCentrifuge extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);

View file

@ -36,6 +36,7 @@ import techreborn.api.recipe.machines.ChemicalReactorRecipe;
public class CTChemicalReactor extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);

View file

@ -40,6 +40,7 @@ import techreborn.api.recipe.machines.CompressorRecipe;
public class CTCompressor extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IIngredient input1, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IIngredient input1, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
CompressorRecipe r = new CompressorRecipe(oInput1, CraftTweakerCompat.toStack(output1), ticktime, euTick);

View file

@ -40,6 +40,7 @@ import techreborn.api.recipe.machines.DistillationTowerRecipe;
public class CTDistillationTower extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);

View file

@ -38,6 +38,7 @@ import techreborn.api.recipe.machines.ExtractorRecipe;
@ZenClass("mods.techreborn.extractor")
public class CTExtractor extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient input1, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);

View file

@ -34,26 +34,31 @@ import techreborn.api.generator.GeneratorRecipeHelper;
public class CTFluidGen {
@ZenMethod
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
public static void addThermalFluid(ILiquidStack fluid, int energyPerMb) {
addFluid(EFluidGenerator.THERMAL, fluid, energyPerMb);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
public static void addGasFluid(ILiquidStack fluid, int energyPerMb) {
addFluid(EFluidGenerator.GAS, fluid, energyPerMb);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
public static void addSemiFluid(ILiquidStack fluid, int energyPerMb) {
addFluid(EFluidGenerator.SEMIFLUID, fluid, energyPerMb);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
public static void addDieselFluid(ILiquidStack fluid, int energyPerMb) {
addFluid(EFluidGenerator.DIESEL, fluid, energyPerMb);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
public static void addPlasmaFluid(ILiquidStack fluid, int energyPerMb) {
addFluid(EFluidGenerator.PLASMA, fluid, energyPerMb);
}

View file

@ -43,6 +43,7 @@ import java.util.List;
public class CTFusionReactor {
@ZenMethod
@ZenDocumentation("IIngredient topInput, IIngredient bottomInput, IItemStack output, int startEU, int euTick, int tickTime")
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));

View file

@ -40,6 +40,7 @@ import techreborn.api.recipe.machines.GrinderRecipe;
public class CTGrinder extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient input1, int ticktime, int euTick")
public static void addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);

View file

@ -36,6 +36,7 @@ import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
public class CTImplosionCompressor extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);

View file

@ -36,6 +36,7 @@ import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
public class CTIndustrialElectrolyzer extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(cells);
Object oInput2 = CraftTweakerCompat.toObject(input2);

View file

@ -52,6 +52,7 @@ public class CTIndustrialGrinder extends CTGeneric {
* @param euTick Amount of EU per tick consumed during crafting
*/
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
return addRecipe(output1, output2, output3, output4, input1, input2, null, ticktime, euTick);
}
@ -69,6 +70,7 @@ public class CTIndustrialGrinder extends CTGeneric {
* @param euTick Amount of EU per tick consumed during crafting
*/
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);

View file

@ -38,21 +38,25 @@ import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
public class CTIndustrialSawmill extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick) {
return addRecipe(output1, output2, output3, input1, fluid, ticktime, euTick, true);
}
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick) {
return addRecipe(output1, output2, output3, input1, null, ticktime, euTick, true);
}
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick, boolean useOreDic")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick, boolean useOreDic) {
return addRecipe(output1, output2, output3, input1, null, ticktime, euTick, useOreDic);
}
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic) {
Object oInput1 = CraftTweakerCompat.toObject(input1);

View file

@ -46,11 +46,13 @@ import java.util.Map;
public class CTRollingMachine {
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient[][] ingredients")
public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
TechRebornAPI.addRollingOreMachinceRecipe(RollingMachineRecipe.getNameForRecipe(CraftTweakerCompat.toStack(output)), CraftTweakerCompat.toStack(output), toShapedObjects(ingredients));
}
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient[] ingredients")
public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
TechRebornAPI.addShapelessOreRollingMachinceRecipe(RollingMachineRecipe.getNameForRecipe(CraftTweakerCompat.toStack(output)), CraftTweakerCompat.toStack(output), toObjects(ingredients));
}

View file

@ -36,6 +36,7 @@ import techreborn.api.recipe.machines.VacuumFreezerRecipe;
public class CTVacuumFreezer extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient input, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output, IIngredient input, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input);

View file

@ -0,0 +1,17 @@
package techreborn.compat.crafttweaker;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This is used to give better detail for a method's parameters when generating the crafttweaker documentation.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ZenDocumentation {
String value();
}