diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-09-14 04:35:19 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-09-14 04:35:19 +1000 |
commit | 3ebad08c9f1c0ebe1150e2a9db332f4ea476cc33 (patch) | |
tree | 31f1ced38c40358a54f1a994bc2850245633a8b9 /src | |
parent | 2d5bc4bf0e324979c58ed8b35283a2a78b50ad01 (diff) | |
download | GT5-Unofficial-3ebad08c9f1c0ebe1150e2a9db332f4ea476cc33.tar.gz GT5-Unofficial-3ebad08c9f1c0ebe1150e2a9db332f4ea476cc33.tar.bz2 GT5-Unofficial-3ebad08c9f1c0ebe1150e2a9db332f4ea476cc33.zip |
I think only shape(less) recipes for Small/Tiny dusts & implementing recipe cost based on mass, not just what I feel like. lol
Diffstat (limited to 'src')
-rw-r--r-- | src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java | 20 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/material/ALLOY.java | 6 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/material/ELEMENT.java | 2 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/material/Material.java | 29 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/material/MaterialStack.java | 14 |
5 files changed, 49 insertions, 22 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index b5e303ff7a..b94b7759da 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -136,21 +136,21 @@ public class BaseItemDust extends Item{ ItemStack tempStack = UtilsItems.getSimpleStack(this); ItemStack tempOutput = null; ItemStack[] inputStacks = dustInfo.getMaterialComposites(); - ItemStack[] outputStacks = {dustInfo.getDust()}; + ItemStack[] outputStacks = {dustInfo.getDust(10)}; String temp = ""; Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName()); - if (getUnlocalizedName().contains("item.")){ + if (getUnlocalizedName().toLowerCase().contains("item.")){ temp = getUnlocalizedName().replace("item.", ""); Utils.LOG_WARNING("Generating OreDict Name: "+temp); } else { temp = getUnlocalizedName(); } - if (temp.contains("DustTiny")){ + if (temp.toLowerCase().contains("dusttiny")){ temp = temp.replace("itemDustTiny", "dust"); Utils.LOG_WARNING("Generating OreDict Name: "+temp); } - else if (temp.contains("DustSmall")){ + else if (temp.toLowerCase().contains("dustsmall")){ temp = temp.replace("itemDustSmall", "dust"); Utils.LOG_WARNING("Generating OreDict Name: "+temp); } @@ -158,9 +158,9 @@ public class BaseItemDust extends Item{ temp = temp.replace("itemD", "d"); Utils.LOG_WARNING("Generating OreDict Name: "+temp); } - if (temp != null && temp != ""){ + if (temp != null && temp != "" && !temp.equals("")){ - if (getUnlocalizedName().contains("DustTiny") || getUnlocalizedName().contains("DustSmall")){ + if (getUnlocalizedName().toLowerCase().contains("dusttiny") || getUnlocalizedName().toLowerCase().contains("dustsmall")){ tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1); } else { @@ -175,6 +175,10 @@ public class BaseItemDust extends Item{ } } + + if (tempOutput == null){ + tempOutput = dustInfo.getDust(1); + } if (tempOutput != null){ if (getUnlocalizedName().contains("DustTiny")){ @@ -204,7 +208,7 @@ public class BaseItemDust extends Item{ ItemStack tempStackForAName = inputStacks[i]; String[] inputList = UtilsItems.getArrayStackNamesAsArray(dustInfo.getMaterialComposites()); int[] inputSizes = dustInfo.getMaterialCompositeStackSizes(); - inputStacks[i] = UtilsItems.getItemStackOfAmountFromOreDict(inputList[i], inputSizes[i]); + inputStacks[i] = UtilsItems.getItemStackOfAmountFromOreDict(inputList[i], 1); Utils.LOG_WARNING("Swapping input slot "+i+" which contains "+tempStackForAName.getDisplayName()+" with "+inputStacks[i].getDisplayName()+"."); } @@ -267,7 +271,7 @@ public class BaseItemDust extends Item{ tempIngot = tempIngot.replace("itemDust", "ingot"); Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot); - ItemStack[] outputStacks = {dustInfo.getDust()}; + ItemStack[] outputStacks = {dustInfo.getDust(1)}; if (tempIngot != null && tempIngot != ""){ tempInputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempDust, 1); diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index 3b203b037e..b46c84d2ba 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -330,12 +330,12 @@ public final class ALLOY { new short[]{236, 213, 48, 0}, //Material Colour 1350, //Melting Point in C 0, //Boiling Point in C - ((ELEMENT.IRON.getProtons()*5)+(ELEMENT.MOLYBDENUM.getProtons()*16)+(ELEMENT.CHROMIUM.getProtons()*7)+(ELEMENT.NICKEL.getProtons()*72))/100, //Protons - ((ELEMENT.IRON.getNeutrons()*5)+(ELEMENT.MOLYBDENUM.getNeutrons()*16)+(ELEMENT.CHROMIUM.getNeutrons()*7)+(ELEMENT.NICKEL.getNeutrons()*72))/100, //Neutrons + ((ELEMENT.YTTRIUM.getProtons()*5)+(ELEMENT.MOLYBDENUM.getProtons()*16)+(ELEMENT.CHROMIUM.getProtons()*7)+(ELEMENT.NICKEL.getProtons()*72))/100, //Protons + ((ELEMENT.YTTRIUM.getNeutrons()*5)+(ELEMENT.MOLYBDENUM.getNeutrons()*16)+(ELEMENT.CHROMIUM.getNeutrons()*7)+(ELEMENT.NICKEL.getNeutrons()*72))/100, //Neutrons true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.IRON, 05), + new MaterialStack(ELEMENT.YTTRIUM, 05), new MaterialStack(ELEMENT.MOLYBDENUM, 16), new MaterialStack(ELEMENT.CHROMIUM, 7), new MaterialStack(ELEMENT.NICKEL, 72) diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index 05d09e64de..307105eaf0 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -30,7 +30,7 @@ public final class ELEMENT { public static final Material SCANDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Scandium); public static final Material TITANIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Titanium); public static final Material VANADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Vanadium); - public static final Material CHROMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Chromium); + public static final Material CHROMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Chrome); public static final Material MANGANESE = MaterialUtils.generateMaterialFromGtENUM(Materials.Manganese); public static final Material IRON = MaterialUtils.generateMaterialFromGtENUM(Materials.Iron); public static final Material COBALT = MaterialUtils.generateMaterialFromGtENUM(Materials.Cobalt); diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 7085ec9329..857e403ada 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -25,7 +25,7 @@ public class Material { final long vMass; public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs){ - + this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; this.RGBA = rgba; @@ -53,6 +53,12 @@ public class Material { } } } + Utils.LOG_INFO("Creating a Material instance for "+materialName); + Utils.LOG_INFO("Protons: "+vProtons); + Utils.LOG_INFO("Neutrons: "+vNeutrons); + Utils.LOG_INFO("Mass: "+vMass+"/units"); + Utils.LOG_INFO("Melting Point: "+meltingPointC+"C."); + Utils.LOG_INFO("Boiling Point: "+boilingPointC+"C."); } public String getLocalizedName(){ @@ -91,8 +97,8 @@ public class Material { return usesBlastFurnace; } - public ItemStack getDust(){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, 1); + public ItemStack getDust(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, stacksize); } public ItemStack[] getValidInputStacks(){ @@ -100,15 +106,26 @@ public class Material { } public ItemStack[] getMaterialComposites(){ + //Utils.LOG_INFO("Something requested the materials needed for "+localizedName); if (materialInput != null && materialInput.length >= 1){ ItemStack[] temp = new ItemStack[materialInput.length]; for (int i=0;i<materialInput.length;i++){ - Utils.LOG_INFO("i:"+i); - ItemStack testNull = materialInput[i].getDustStack(); + //Utils.LOG_INFO("i:"+i); + ItemStack testNull = null; + try { + testNull = materialInput[i].getDustStack(); + } catch (Throwable r){ + Utils.LOG_INFO("Failed gathering material stack for "+localizedName+"."); + Utils.LOG_INFO("What Failed: Length:"+materialInput.length+" current:"+i); + } + try { if (testNull != null){ - Utils.LOG_INFO("not null"); + //Utils.LOG_INFO("not null"); temp[i] = materialInput[i].getDustStack(); } + } catch (Throwable r){ + Utils.LOG_INFO("Failed setting slot "+i+", using "+localizedName); + } } return temp; } diff --git a/src/Java/gtPlusPlus/core/material/MaterialStack.java b/src/Java/gtPlusPlus/core/material/MaterialStack.java index ad3aa2fa76..f8b9b35bd8 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialStack.java +++ b/src/Java/gtPlusPlus/core/material/MaterialStack.java @@ -8,7 +8,7 @@ public class MaterialStack { final Material materialInput; final double percentageToUse; - public MaterialStack(Material inputs, int percentage){ + public MaterialStack(Material inputs, double percentage){ this.materialInput = inputs; this.percentageToUse = percentage; @@ -21,20 +21,26 @@ public class MaterialStack { int amount = 0; if (percentageToUse >= 0 && percentageToUse <= 0.99){ caseStatus = 1; - amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(2)); + amount = (int) (1/percentageToUse); + //amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(2)); } else if (percentageToUse >= 1 && percentageToUse <= 9.99){ caseStatus = 2; - amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(0)); + amount = (int) (percentageToUse); + //amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(0)); } else if (percentageToUse >= 10 && percentageToUse <= 99.99){ caseStatus = 3; - amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(0)); + amount = (int) (percentageToUse/10); + //amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(0)); } else if (percentageToUse == 100){ caseStatus = 4; amount = 10; } + else { + amount = 0; + } switch (caseStatus) { case 1: { return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+materialInput.unlocalizedName, amount); |