From 7bcc793d1224afaa57d70a6475440c2e9edfe1c2 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 22 Nov 2015 16:24:50 +0000 Subject: [PATCH] Added javaDoc and updated deps --- build.gradle | 44 +++++++++++++------ .../api/power/IEnergyInterfaceItem.java | 10 +++++ .../api/power/IEnergyInterfaceTile.java | 4 +- .../techreborn/api/power/IEnergyItemInfo.java | 17 ++++++- .../reactor/FusionReactorRecipeHelper.java | 5 ++- .../api/recipe/IBaseRecipeType.java | 4 +- .../techreborn/api/recipe/RecipeCrafter.java | 14 +++--- 7 files changed, 72 insertions(+), 26 deletions(-) diff --git a/build.gradle b/build.gradle index e25767eac..bec115699 100644 --- a/build.gradle +++ b/build.gradle @@ -97,27 +97,29 @@ dependencies { if (!f.exists()) { f.mkdir() } - compile 'net.industrial-craft:industrialcraft-2:2.2.782-experimental:dev' - shade 'net.industrial-craft:industrialcraft-2:2.2.782-experimental:api' - compile "codechicken:CodeChickenLib:1.7.10-1.1.3.136:dev" - compile "codechicken:CodeChickenCore:1.7.10-1.0.6.+:dev" - compile "codechicken:NotEnoughItems:1.7.10-1.0.4.+:dev" + compile 'net.industrial-craft:industrialcraft-2:2.2.796-experimental:dev' + shade 'net.industrial-craft:industrialcraft-2:2.2.796-experimental:api' + compile "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev" + compile "codechicken:CodeChickenCore:1.7.10-1.0.7.+:dev" + compile "codechicken:NotEnoughItems:1.7.10-1.0.5.+:dev" compile "codechicken:ForgeMultipart:1.7.10-1.2.0.345:dev" - compile "mcp.mobius.waila:Waila:1.5.10_1.7.10:dev" - compile name: 'buildcraft', version: '7.0.25', classifier: "dev", ext: 'jar' + compile ("mcp.mobius.waila:Waila:1.5.10_1.7.10:dev") { + exclude group: 'mcp.mobius.waila' + } + compile name: 'buildcraft', version: '7.1.13', classifier: "dev", ext: 'jar' compile "qmunity:QmunityLib:0.2.+:deobf" compile "com.pahimar.ee3:EquivalentExchange3:1.7.10-0.3.507:dev" - compile "net.sengir.forestry:forestry_1.7.10:4.0.5.33:dev" - shade "net.sengir.forestry:forestry_1.7.10:4.0.5.33:api" - compile "tconstruct:TConstruct:1.7.10-1.8.5.build958:deobf" - compile "mods.natura:natura:1.7.10-98.6a6cca1:deobf" - compile "mantle:Mantle:1.7.10-0.3.2.jenkins187:deobf" - compile "com.github.glitchfiend.biomesoplenty:BiomesOPlenty:1.7.10-2.1.0.1396:deobf" + compile "net.sengir.forestry:forestry_1.7.10:4.2.0.47:dev" + shade "net.sengir.forestry:forestry_1.7.10:4.2.0.47:api" + compile "tconstruct:TConstruct:1.7.10-1.8.8.build988:deobf" + compile "mods.natura:natura:1.7.10-107.779621d:deobf" + compile "mantle:Mantle:1.7.10-0.3.2.jenkins192:deobf" + compile "com.github.glitchfiend.biomesoplenty:BiomesOPlenty:1.7.10-2.1.0.1465:deobf" compile 'Azanor:Thaumcraft:4.2.3.5:deobf@jar' compile "com.github.azanor:baubles:1.0.1.10:deobf@jar" compile name: "MineTweaker3", version: "1.7.10-3.0.9C", classifier: "Dev" shade 'IC2-Classic-API-STANDALONE:IC2-Classic-API-STANDALONE:1.1.0.19-5:api' - compile 'RebornCore:RebornCore:0.0.0.+:dev' + compile 'RebornCore:RebornCore:1.0.0.+:dev' testCompile 'junit:junit:4.12' } @@ -171,14 +173,28 @@ task apiJar(type: Jar) { classifier = "api" } +javadoc { + source += sourceSets.api.allSource + include 'techreborn/api/**/*' +} + +// add a javadoc jar +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from 'build/docs/javadoc' +} + apiJar.mustRunAfter deobfJar artifacts { archives sourceJar archives deobfJar archives apiJar + archives javadocJar } +build.dependsOn sourceJar, javadocJar, deobfJar, apiJar + uploadArchives { repositories { mavenDeployer { diff --git a/src/main/java/techreborn/api/power/IEnergyInterfaceItem.java b/src/main/java/techreborn/api/power/IEnergyInterfaceItem.java index 41489c784..571b194f5 100644 --- a/src/main/java/techreborn/api/power/IEnergyInterfaceItem.java +++ b/src/main/java/techreborn/api/power/IEnergyInterfaceItem.java @@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack; public interface IEnergyInterfaceItem extends IEnergyItemInfo{ /** * @return Amount of energy in the tile + * + * @param stack The {@link ItemStack} that contains the power */ public double getEnergy(ItemStack stack); @@ -12,12 +14,14 @@ public interface IEnergyInterfaceItem extends IEnergyItemInfo{ * Sets the energy in the tile * * @param energy the amount of energy to set. + * @param stack The {@link ItemStack} that contains the power */ public void setEnergy(double energy, ItemStack stack); /** * @param energy amount of energy to add to the tile + * @param stack The {@link ItemStack} that contains the power * @return will return true if can fit all */ public boolean canAddEnergy(double energy, ItemStack stack); @@ -26,6 +30,7 @@ public interface IEnergyInterfaceItem extends IEnergyItemInfo{ * Will try add add the full amount of energy. * * @param energy amount to add + * @param stack The {@link ItemStack} that contains the power * @return The amount of energy that was added. */ public double addEnergy(double energy, ItemStack stack); @@ -34,6 +39,7 @@ public interface IEnergyInterfaceItem extends IEnergyItemInfo{ * Will try add add the full amount of energy, if simulate is true it wont add the energy * * @param energy amount to add + * @param stack The {@link ItemStack} that contains the power * @return The amount of energy that was added. */ public double addEnergy(double energy, boolean simulate, ItemStack stack); @@ -42,6 +48,7 @@ public interface IEnergyInterfaceItem extends IEnergyItemInfo{ * Returns true if it can use the full amount of energy * * @param energy amount of energy to use from the tile. + * @param stack The {@link ItemStack} that contains the power * @return if all the energy can be used. */ public boolean canUseEnergy(double energy, ItemStack stack); @@ -50,6 +57,7 @@ public interface IEnergyInterfaceItem extends IEnergyItemInfo{ * Will try and use the full amount of energy * * @param energy energy to use + * @param stack The {@link ItemStack} that contains the power * @return the amount of energy used */ public double useEnergy(double energy, ItemStack stack); @@ -59,6 +67,8 @@ public interface IEnergyInterfaceItem extends IEnergyItemInfo{ * Will try and use the full amount of energy, if simulate is true it wont add the energy * * @param energy energy to use + * @param simulate if true it will not use the item, it will only simulate it. + * @param stack The {@link ItemStack} that contains the power * @return the amount of energy used */ public double useEnergy(double energy, boolean simulate, ItemStack stack); diff --git a/src/main/java/techreborn/api/power/IEnergyInterfaceTile.java b/src/main/java/techreborn/api/power/IEnergyInterfaceTile.java index f2829f773..12492c68b 100644 --- a/src/main/java/techreborn/api/power/IEnergyInterfaceTile.java +++ b/src/main/java/techreborn/api/power/IEnergyInterfaceTile.java @@ -41,6 +41,7 @@ public interface IEnergyInterfaceTile { * Will try add add the full amount of energy, if simulate is true it wont add the energy * * @param energy amount to add + * @param simulate set to true to simulate not perform the action. * @return The amount of energy that was added. */ public double addEnergy(double energy, boolean simulate); @@ -66,6 +67,7 @@ public interface IEnergyInterfaceTile { * Will try and use the full amount of energy, if simulate is true it wont add the energy * * @param energy energy to use + * @param simulate set to true to simulate not perform the action. * @return the amount of energy used */ public double useEnergy(double energy, boolean simulate); @@ -78,7 +80,7 @@ public interface IEnergyInterfaceTile { /** * @param direction The direction to provide energy from - * @return + * @return true if the tile can provide energy to that direction */ public boolean canProvideEnergy(ForgeDirection direction); diff --git a/src/main/java/techreborn/api/power/IEnergyItemInfo.java b/src/main/java/techreborn/api/power/IEnergyItemInfo.java index ad3f45e57..3856cba0c 100644 --- a/src/main/java/techreborn/api/power/IEnergyItemInfo.java +++ b/src/main/java/techreborn/api/power/IEnergyItemInfo.java @@ -6,23 +6,38 @@ import net.minecraft.item.ItemStack; public interface IEnergyItemInfo { /** - * Gets the max stored energy in the tile + * Gets the max stored energy in the item * + * @param stack The {@link ItemStack} that contains the power * @return The max energy */ double getMaxPower(ItemStack stack); /** + * Can the item accept energy. + * @param stack The {@link ItemStack} that contains the power * @return if it can accept energy */ boolean canAcceptEnergy(ItemStack stack); /** + * Can the item recieve energy + * @param stack The {@link ItemStack} that contains the power * @return if it can provide energy */ boolean canProvideEnergy(ItemStack stack); + /** + * + * @param stack The {@link ItemStack} that contains the power + * @return Max amout of energy that can be transfured in one tick. + */ double getMaxTransfer(ItemStack stack); + /** + * + * @param stack The {@link ItemStack} that contains the power + * @return The ic2 teir that the stack should be. + */ int getStackTeir(ItemStack stack); } diff --git a/src/main/java/techreborn/api/reactor/FusionReactorRecipeHelper.java b/src/main/java/techreborn/api/reactor/FusionReactorRecipeHelper.java index 5f2181f74..1a23ce006 100644 --- a/src/main/java/techreborn/api/reactor/FusionReactorRecipeHelper.java +++ b/src/main/java/techreborn/api/reactor/FusionReactorRecipeHelper.java @@ -5,12 +5,15 @@ import java.util.ArrayList; public class FusionReactorRecipeHelper { + /** + * This is the list of all the recipes + */ public static ArrayList reactorRecipes = new ArrayList(); /** * Register your reactor recipe here * - * @param reactorRecipe + * @param reactorRecipe the recipe you want to add */ public static void registerRecipe(FusionReactorRecipe reactorRecipe){ reactorRecipes.add(reactorRecipe); diff --git a/src/main/java/techreborn/api/recipe/IBaseRecipeType.java b/src/main/java/techreborn/api/recipe/IBaseRecipeType.java index ae0fbb3c1..cd47e0dfe 100644 --- a/src/main/java/techreborn/api/recipe/IBaseRecipeType.java +++ b/src/main/java/techreborn/api/recipe/IBaseRecipeType.java @@ -19,7 +19,7 @@ public interface IBaseRecipeType { /** * This gets the output form the array list - * + * @param i get output form position in arraylist * @return the output */ public ItemStack getOutput(int i); @@ -45,7 +45,7 @@ public interface IBaseRecipeType { /** * This should be a user friendly name * - * @return + * @return The user friendly name of the recipe. */ public String getUserFreindlyName(); diff --git a/src/main/java/techreborn/api/recipe/RecipeCrafter.java b/src/main/java/techreborn/api/recipe/RecipeCrafter.java index f6fbcbb2e..d7d82c0da 100644 --- a/src/main/java/techreborn/api/recipe/RecipeCrafter.java +++ b/src/main/java/techreborn/api/recipe/RecipeCrafter.java @@ -57,13 +57,13 @@ public class RecipeCrafter { /** * This is the constructor, not a lot to say here :P * - * @param recipeName - * @param parentTile - * @param inputs - * @param outputs - * @param inventory - * @param inputSlots - * @param outputSlots + * @param recipeName The recipe name that should be crafted + * @param parentTile The tile that wil be using this recipe crafter + * @param inputs The amount of input slots + * @param outputs The amount of output slots + * @param inventory The inventory of the machine + * @param inputSlots A list of the input slot ids + * @param outputSlots A list of output slot ids */ public RecipeCrafter(String recipeName, TileMachineBase parentTile, int inputs, int outputs, Inventory inventory, int[] inputSlots, int[] outputSlots) { this.recipeName = recipeName;