aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTechnus <daniel112092@gmail.com>2017-08-14 13:36:24 +0200
committerTechnus <daniel112092@gmail.com>2017-08-14 13:36:24 +0200
commit4f730afe0631fe9bd2a52b164461be497da66f98 (patch)
tree9d1c57f4c163d21a79cf456cc4528794517cfa44
parent123fefb4a3159428e763bafb8c24723ad5b6f7de (diff)
downloadGT5-Unofficial-4f730afe0631fe9bd2a52b164461be497da66f98.tar.gz
GT5-Unofficial-4f730afe0631fe9bd2a52b164461be497da66f98.tar.bz2
GT5-Unofficial-4f730afe0631fe9bd2a52b164461be497da66f98.zip
Change to int to reduce casting needs
-rw-r--r--src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java
index d87ef5ed63..460a9aa056 100644
--- a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java
+++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java
@@ -8,7 +8,7 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class TT_recipeAdder extends GT_RecipeAdder {
- public static boolean addResearchableAssemblylineRecipe(ItemStack aResearchItem, int totalComputationRequired, short computationRequiredPerSec, int researchEUt, short researchAmperage, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int assDuration, int assEUt) {
+ public static boolean addResearchableAssemblylineRecipe(ItemStack aResearchItem, int totalComputationRequired, int computationRequiredPerSec, int researchEUt, int researchAmperage, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int assDuration, int assEUt) {
if(aInputs==null)aInputs=new ItemStack[0];
if(aFluidInputs==null)aFluidInputs=new FluidStack[0];
if ((aResearchItem==null)||(totalComputationRequired<=0)||(aOutput == null) || aInputs.length>15) {
@@ -23,7 +23,9 @@ public class TT_recipeAdder extends GT_RecipeAdder {
}
}
if(researchAmperage<=0) researchAmperage=1;
+ else if(researchAmperage > Short.MAX_VALUE) researchAmperage=Short.MAX_VALUE;
if(computationRequiredPerSec<=0) computationRequiredPerSec=1;
+ else if(computationRequiredPerSec > Short.MAX_VALUE) computationRequiredPerSec=Short.MAX_VALUE;
TT_recipe.TT_Recipe_Map.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result")}, null, null, totalComputationRequired, researchEUt, researchAmperage|(computationRequiredPerSec<<16));
GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result")}, aFluidInputs, null, assDuration, assEUt, 0,true);
GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe.GT_Recipe_AssemblyLine( aResearchItem, 0/*ignored*/, aInputs, aFluidInputs, aOutput, assDuration, assEUt));