Added documentation for forestry

This commit is contained in:
Jaredlll08 2017-06-09 01:24:25 +02:00
parent 54bec4d7a2
commit de5f7d5536
7 changed files with 25 additions and 10 deletions

View file

@ -1,6 +1,6 @@
package com.blamejared.compat.forestry;
import com.blamejared.api.annotations.Handler;
import com.blamejared.api.annotations.*;
import com.blamejared.compat.forestry.util.*;
import com.blamejared.mtlib.helpers.LogHelper;
import forestry.api.recipes.*;
@ -23,11 +23,13 @@ import static com.blamejared.mtlib.helpers.StackHelper.matches;
public class Carpenter {
@ZenMethod
@Document({"output", "ingredients", "packagingTime", "fluidInput", "box"})
public static void addRecipe(IItemStack output, IIngredient[][] ingredients, int packagingTime, @Optional ILiquidStack fluidInput, @Optional IItemStack box) {
MineTweakerAPI.apply(new Add(new CarpenterRecipe(packagingTime, toFluid(fluidInput), toStack(box), new ShapedRecipeCustom(toStack(output), toShapedObjects(ingredients)))));
}
@ZenMethod
@Document({"output", "fluidInput"})
public static void removeRecipe(IIngredient output, @Optional IIngredient fluidInput) {
List<ICarpenterRecipe> recipes = new LinkedList<>();

View file

@ -1,6 +1,6 @@
package com.blamejared.compat.forestry;
import com.blamejared.api.annotations.Handler;
import com.blamejared.api.annotations.*;
import com.blamejared.compat.forestry.util.*;
import com.blamejared.mtlib.helpers.LogHelper;
import forestry.api.recipes.*;
@ -32,6 +32,7 @@ public class Centrifuge {
* @param packagingTime amount of ticks per crafting operation
*/
@ZenMethod
@Document({"output", "ingredients", "packagingTime"})
public static void addRecipe(WeightedItemStack[] output, IItemStack ingredients, int packagingTime) {
Map<ItemStack, Float> products = new HashMap<ItemStack, Float>();
for(WeightedItemStack product : output) {
@ -66,6 +67,7 @@ public class Centrifuge {
* @param input type of item in input
*/
@ZenMethod
@Document({"input"})
public static void removeRecipe(IIngredient input) {
List<ICentrifugeRecipe> recipes = new LinkedList<ICentrifugeRecipe>();

View file

@ -1,14 +1,12 @@
package com.blamejared.compat.forestry;
import com.blamejared.api.annotations.Handler;
import com.blamejared.api.annotations.*;
import com.blamejared.compat.forestry.util.*;
import com.blamejared.mtlib.helpers.LogHelper;
import com.blamejared.mtlib.utils.*;
import forestry.api.fuels.*;
import forestry.api.recipes.*;
import forestry.factory.recipes.FermenterRecipe;
import forestry.factory.recipes.jei.fermenter.FermenterRecipeWrapper;
import mezz.jei.api.recipe.IRecipeWrapper;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.*;
import minetweaker.api.liquid.ILiquidStack;
@ -42,6 +40,7 @@ public class Fermenter {
* @param fluidOutputModifier Output multiplier (this is usually a from the input fluid)
*/
@ZenMethod
@Document({"fluidOutput", "resource", "fluidInput", "fermentationValue", "fluidOutputModifier"})
public static void addRecipe(ILiquidStack fluidOutput, IItemStack resource, ILiquidStack fluidInput, int fermentationValue, float fluidOutputModifier) {
MineTweakerAPI.apply(new Add(new FermenterRecipe(toStack(resource), fermentationValue, fluidOutputModifier, getFluid(fluidOutput), toFluid(fluidInput))));
}
@ -72,6 +71,7 @@ public class Fermenter {
* @param input type of item in input
*/
@ZenMethod
@Document({"input"})
public static void removeRecipe(IIngredient input) {
List<IFermenterRecipe> recipes = new LinkedList<IFermenterRecipe>();
@ -122,6 +122,7 @@ public class Fermenter {
* @param burnDuration Amount of work cycles a single item of this fuel lasts before expiring.
*/
@ZenMethod
@Document({"item", " fermentPerCycle", "burnDuration"})
public static void addFuel(IItemStack item, int fermentPerCycle, int burnDuration) {
MineTweakerAPI.apply(new AddFuel(new FermenterFuel(toStack(item), fermentPerCycle, burnDuration)));
}
@ -147,6 +148,7 @@ public class Fermenter {
* @param fermenterItem Item that is a valid fuel for the fermenter
*/
@ZenMethod
@Document({"fermenterItem"})
public static void removeFuel(IIngredient fermenterItem) {
Map<ItemStack, FermenterFuel> fuelItems = new HashMap<ItemStack, FermenterFuel>();

View file

@ -1,13 +1,12 @@
package com.blamejared.compat.forestry;
import com.blamejared.api.annotations.Handler;
import com.blamejared.api.annotations.*;
import com.blamejared.compat.forestry.util.*;
import com.blamejared.mtlib.helpers.LogHelper;
import com.blamejared.mtlib.utils.*;
import forestry.api.fuels.*;
import forestry.api.recipes.*;
import forestry.factory.recipes.MoistenerRecipe;
import mezz.jei.api.recipe.IRecipeWrapper;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.*;
import net.minecraft.item.ItemStack;
@ -36,6 +35,7 @@ public class Moistener {
* @param packagingTime amount of ticks per crafting operation
*/
@ZenMethod
@Document({"output", "input", "packagingTime"})
public static void addRecipe(IItemStack output, IItemStack input, int packagingTime) {
MineTweakerAPI.apply(new Add(new MoistenerRecipe(toStack(input), toStack(output), packagingTime)));
}
@ -66,6 +66,7 @@ public class Moistener {
* @param output recipe product
*/
@ZenMethod
@Document({"output"})
public static void removeRecipe(IIngredient output) {
List<IMoistenerRecipe> recipes = new LinkedList<IMoistenerRecipe>();
for(IMoistenerRecipe recipe : RecipeManagers.moistenerManager.recipes()) {
@ -109,6 +110,7 @@ public class Moistener {
* @param stage What stage this product represents. Resources with lower stage value will be consumed first. (First Stage is 0)
*/
@ZenMethod
@Document({"item", "product", "moistenerValue", "stage"})
public static void addFuel(IItemStack item, IItemStack product, int moistenerValue, int stage) {
if(stage >= 0) {
MineTweakerAPI.apply(new AddFuel(new MoistenerFuel(toStack(item), toStack(product), moistenerValue, stage)));
@ -138,6 +140,7 @@ public class Moistener {
* @param moistenerItem Item that is a valid fuel for the moistener
*/
@ZenMethod
@Document({"moistenerItem"})
public static void removeFuel(IIngredient moistenerItem) {
Map<ItemStack, MoistenerFuel> fuelItems = new HashMap<ItemStack, MoistenerFuel>();

View file

@ -1,6 +1,6 @@
package com.blamejared.compat.forestry;
import com.blamejared.api.annotations.Handler;
import com.blamejared.api.annotations.*;
import com.blamejared.compat.forestry.util.*;
import com.blamejared.mtlib.helpers.LogHelper;
import forestry.api.recipes.*;
@ -38,6 +38,7 @@ public class Squeezer {
* * @param itemOutput recipe output (optional)
*/
@ZenMethod
@Document({"fluidOutput", "ingredients", "timePerItem", "itemOutput"})
public static void addRecipe(ILiquidStack fluidOutput, IItemStack[] ingredients, int timePerItem, @Optional WeightedItemStack itemOutput) {
if(itemOutput == null) {
itemOutput = new WeightedItemStack(new MCItemStack(new ItemStack(Blocks.AIR)), 0);
@ -77,6 +78,7 @@ public class Squeezer {
* * @param ingredients list of ingredients (optional)
*/
@ZenMethod
@Document({"liquid", "ingredients"})
public static void removeRecipe(IIngredient liquid, @Optional IIngredient[] ingredients) {
List<ISqueezerRecipe> recipes = new LinkedList<ISqueezerRecipe>();

View file

@ -1,6 +1,6 @@
package com.blamejared.compat.forestry;
import com.blamejared.api.annotations.Handler;
import com.blamejared.api.annotations.*;
import com.blamejared.compat.forestry.util.*;
import com.blamejared.mtlib.helpers.LogHelper;
import forestry.api.recipes.*;
@ -32,6 +32,7 @@ public class Still {
* @param timePerUnit time per crafting operation
*/
@ZenMethod
@Document({"fluidOutput", "fluidInput", "timePerUnit"})
public static void addRecipe(ILiquidStack fluidOutput, ILiquidStack fluidInput, int timePerUnit) {
fluidOutput.amount(fluidOutput.getAmount() / 100);
fluidInput.amount(fluidInput.getAmount() / 100);
@ -66,6 +67,7 @@ public class Still {
* * @param fluidInput = liquid input (optional)
*/
@ZenMethod
@Document({"output", "fluidInput"})
public static void removeRecipe(IIngredient output, @Optional ILiquidStack fluidInput) {
List<IStillRecipe> recipes = new LinkedList<IStillRecipe>();

View file

@ -1,6 +1,6 @@
package com.blamejared.compat.forestry;
import com.blamejared.api.annotations.Handler;
import com.blamejared.api.annotations.*;
import com.blamejared.compat.forestry.util.*;
import com.blamejared.mtlib.helpers.LogHelper;
import forestry.api.recipes.*;
@ -32,6 +32,7 @@ public class ThermionicFabricator {
* @param meltingPoint point at where itemInput melts down
*/
@ZenMethod
@Document({"fluidOutput", "itemInput", "meltingPoint"})
public static void addSmelting(int fluidOutput, IItemStack itemInput, int meltingPoint) {
//The machines internal tank accept only liquid glass, therefor this function only accept the amount and hardcode the fluid to glass
MineTweakerAPI.apply(new AddSmelting(new FabricatorSmeltingRecipe(toStack(itemInput), FluidRegistry.getFluidStack("glass", fluidOutput), meltingPoint)));
@ -70,6 +71,7 @@ public class ThermionicFabricator {
* @param itemInput = item input
*/
@ZenMethod
@Document({"itemInput"})
public static void removeSmelting(IIngredient itemInput) {
List<IFabricatorSmeltingRecipe> recipes = new LinkedList<IFabricatorSmeltingRecipe>();