From f2a89339d7f6f875d34d4a7bb1868a1d4a3cf644 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Tue, 25 Oct 2016 23:47:58 +1000 Subject: + Tried improving the handling of Blast Smelting. + Tried adding shapeless dust recipes for all of my alloys. (The shapeless recipe system is dumb) + Added a custom GUI for NEI recipes for the Blast Smelter. % Refactored some Utils classes. --- src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java') diff --git a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java index ebd84f9654..703256267b 100644 --- a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java +++ b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java @@ -28,7 +28,7 @@ public class BlockFluidBase extends BlockFluidClassic { @SuppressWarnings("deprecation") public BlockFluidBase(Fluid fluid, Material material) { - super(fluid, net.minecraft.block.material.Material.water); + super(fluid, net.minecraft.block.material.Material.lava); short[] tempColour = material.getRGBA(); this.colour = Utils.rgbtoHexValue(tempColour[0], tempColour[1], tempColour[2]); this.fluidMaterial = material; @@ -40,7 +40,7 @@ public class BlockFluidBase extends BlockFluidClassic { @SuppressWarnings("deprecation") public BlockFluidBase(String fluidName, Fluid fluid, short[] colour) { - super(fluid, net.minecraft.block.material.Material.water); + super(fluid, net.minecraft.block.material.Material.lava); short[] tempColour = colour; this.colour = Utils.rgbtoHexValue(tempColour[0], tempColour[1], tempColour[2]); setCreativeTab(AddToCreativeTab.tabOther); -- cgit From b074293f70fec5df93a6d0610d99a5183dd2cbfd Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Thu, 27 Oct 2016 01:47:39 +1000 Subject: % Cleaned up material/Material.java using PMD to a rather decent level. > Inadvertently this refactored things in other classes. % Changed the Blast Smelter Casing Block textures. --- .../gtPlusPlus/core/fluids/BlockFluidBase.java | 2 +- .../core/item/base/itemblock/ItemBlockFluid.java | 2 +- src/Java/gtPlusPlus/core/material/ALLOY.java | 66 ++--- src/Java/gtPlusPlus/core/material/ELEMENT.java | 4 +- src/Java/gtPlusPlus/core/material/Material.java | 310 +++++++-------------- .../gtPlusPlus/core/util/fluid/FluidUtils.java | 2 +- .../core/util/materials/MaterialUtils.java | 38 ++- .../blocks/textures/CasingTextureHandler.java | 2 +- .../GregtechMetaTileEntity_AlloyBlastSmelter.java | 3 + .../gregtech/loaders/RecipeGen_BlastSmelter.java | 19 +- .../gregtech/loaders/RecipeGen_DustGeneration.java | 61 ++-- .../xmod/gregtech/loaders/RecipeGen_Extruder.java | 2 +- .../xmod/gregtech/loaders/RecipeGen_Plates.java | 2 +- 13 files changed, 230 insertions(+), 283 deletions(-) (limited to 'src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java') diff --git a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java index 703256267b..52bfa7d2d9 100644 --- a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java +++ b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java @@ -34,7 +34,7 @@ public class BlockFluidBase extends BlockFluidClassic { this.fluidMaterial = material; setCreativeTab(AddToCreativeTab.tabOther); this.displayName = material.getLocalizedName(); - LanguageRegistry.addName(this, "Molten "+displayName+" ["+MathUtils.celsiusToKelvin(fluidMaterial.getBoilingPoint_C())+"K]"); + LanguageRegistry.addName(this, "Molten "+displayName+" ["+MathUtils.celsiusToKelvin(fluidMaterial.getBoilingPointC())+"K]"); this.setBlockName(GetProperName()); } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java index 8d3871187a..2e39a47f81 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java @@ -60,7 +60,7 @@ public class ItemBlockFluid extends ItemBlock{ @Override public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - list.add("Temperature: "+MathUtils.celsiusToKelvin(thisFluid.getMeltingPoint_C())+"K"); + list.add("Temperature: "+MathUtils.celsiusToKelvin(thisFluid.getMeltingPointC())+"K"); if (sRadiation > 0){ list.add(CORE.GT_Tooltip_Radioactive); } diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index 975a035628..052eaf6a9a 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -29,7 +29,7 @@ public final class ALLOY { "Staballoy", //Material Name new short[]{68, 75, 66, 0}, //Material Colour 3450, //Melting Point in C - ((ELEMENT.URANIUM.getBoilingPoint_C()*9)+(ELEMENT.TITANIUM.getBoilingPoint_C()*1))/10, //Boiling Point in C + ((ELEMENT.URANIUM.getBoilingPointC()*9)+(ELEMENT.TITANIUM.getBoilingPointC()*1))/10, //Boiling Point in C ((ELEMENT.URANIUM.getProtons()*9)+ELEMENT.TITANIUM.getProtons())/10, //Protons ((ELEMENT.URANIUM.getNeutrons()*9)+ELEMENT.TITANIUM.getNeutrons())/10, //Neutrons true, //Uses Blast furnace? @@ -43,7 +43,7 @@ public final class ALLOY { "Tantalloy-60", //Material Name new short[]{213, 231, 237, 0}, //Material Colour 3025, //Melting Point in C - ((ELEMENT.TUNGSTEN.getBoilingPoint_C()*1)+(ELEMENT.TANTALUM.getBoilingPoint_C()*8)+(ELEMENT.TITANIUM.getBoilingPoint_C()*1))/10, //Boiling Point in C + ((ELEMENT.TUNGSTEN.getBoilingPointC()*1)+(ELEMENT.TANTALUM.getBoilingPointC()*8)+(ELEMENT.TITANIUM.getBoilingPointC()*1))/10, //Boiling Point in C ((ELEMENT.TUNGSTEN.getProtons()*1)+(ELEMENT.TANTALUM.getProtons()*8)+(ELEMENT.TITANIUM.getProtons()*1))/10, //Protons ((ELEMENT.TUNGSTEN.getNeutrons()*1)+(ELEMENT.TANTALUM.getNeutrons()*8)+(ELEMENT.TITANIUM.getNeutrons()*1))/10, //Neutrons true, //Uses Blast furnace? @@ -57,7 +57,7 @@ public final class ALLOY { "Tantalloy-61", //Material Name new short[]{193, 211, 217, 0}, //Material Colour 3030, //Melting Point in C - ((ELEMENT.TUNGSTEN.getBoilingPoint_C()*1)+(ELEMENT.TANTALUM.getBoilingPoint_C()*7)+(ELEMENT.TITANIUM.getBoilingPoint_C()*1)+(ELEMENT.YTTRIUM.getBoilingPoint_C()*1))/10, //Boiling Point in C + ((ELEMENT.TUNGSTEN.getBoilingPointC()*1)+(ELEMENT.TANTALUM.getBoilingPointC()*7)+(ELEMENT.TITANIUM.getBoilingPointC()*1)+(ELEMENT.YTTRIUM.getBoilingPointC()*1))/10, //Boiling Point in C ((ELEMENT.TUNGSTEN.getProtons()*1)+(ELEMENT.TANTALUM.getProtons()*7)+(ELEMENT.TITANIUM.getProtons()*1)+(ELEMENT.YTTRIUM.getProtons()*1))/10, //Protons ((ELEMENT.TUNGSTEN.getNeutrons()*1)+(ELEMENT.TANTALUM.getNeutrons()*7)+(ELEMENT.TITANIUM.getNeutrons()*1)+(ELEMENT.YTTRIUM.getNeutrons()*1))/10, //Neutrons true, //Uses Blast furnace? @@ -71,8 +71,8 @@ public final class ALLOY { public static final Material BRONZE = new Material( "Bronze", //Material Name new short[]{128, 128, 128, 0}, //Material Colour - ((ELEMENT.TIN.getMeltingPoint_C()*1)+(ELEMENT.COPPER.getMeltingPoint_C()*3))/4, //Melting point in C - ((ELEMENT.TIN.getBoilingPoint_C()*1)+(ELEMENT.COPPER.getBoilingPoint_C()*3))/4, //Boiling Point in C + ((ELEMENT.TIN.getMeltingPointC()*1)+(ELEMENT.COPPER.getMeltingPointC()*3))/4, //Melting point in C + ((ELEMENT.TIN.getBoilingPointC()*1)+(ELEMENT.COPPER.getBoilingPointC()*3))/4, //Boiling Point in C ((ELEMENT.TIN.getProtons()*1)+(ELEMENT.COPPER.getProtons()*3))/4, //Protons ((ELEMENT.TIN.getNeutrons()*1)+(ELEMENT.COPPER.getNeutrons()*3))/4, //Neutrons false, //Uses Blast furnace? @@ -86,8 +86,8 @@ public final class ALLOY { public static final Material TUMBAGA = new Material( "Tumbaga", //Material Name new short[]{255,178,15, 0}, //Material Colour - ((ELEMENT.GOLD.getMeltingPoint_C()*7)+(ELEMENT.COPPER.getMeltingPoint_C()*3))/10, //Melting point in C - ((ELEMENT.GOLD.getBoilingPoint_C()*7)+(ELEMENT.COPPER.getBoilingPoint_C()*3))/10, //Boiling Point in C + ((ELEMENT.GOLD.getMeltingPointC()*7)+(ELEMENT.COPPER.getMeltingPointC()*3))/10, //Melting point in C + ((ELEMENT.GOLD.getBoilingPointC()*7)+(ELEMENT.COPPER.getBoilingPointC()*3))/10, //Boiling Point in C ((ELEMENT.GOLD.getProtons()*7)+(ELEMENT.COPPER.getProtons()*3))/10, //Protons ((ELEMENT.GOLD.getNeutrons()*7)+(ELEMENT.COPPER.getNeutrons()*3))/10, //Neutrons false, //Uses Blast furnace? @@ -101,8 +101,8 @@ public final class ALLOY { public static final Material POTIN = new Material( "Potin", //Material Name new short[]{201,151,129, 0}, //Material Colour - ((ELEMENT.LEAD.getMeltingPoint_C()*4)+(ALLOY.BRONZE.getMeltingPoint_C()*4)+(ELEMENT.TIN.getMeltingPoint_C()*2))/10, //Melting point in C - ((ELEMENT.LEAD.getBoilingPoint_C()*4)+(ALLOY.BRONZE.getBoilingPoint_C()*4)+(ELEMENT.TIN.getBoilingPoint_C()*2))/10, //Boiling Point in C + ((ELEMENT.LEAD.getMeltingPointC()*4)+(ALLOY.BRONZE.getMeltingPointC()*4)+(ELEMENT.TIN.getMeltingPointC()*2))/10, //Melting point in C + ((ELEMENT.LEAD.getBoilingPointC()*4)+(ALLOY.BRONZE.getBoilingPointC()*4)+(ELEMENT.TIN.getBoilingPointC()*2))/10, //Boiling Point in C ((ELEMENT.LEAD.getProtons()*4)+(ALLOY.BRONZE.getProtons()*4)+(ELEMENT.TIN.getProtons()*2))/10, //Protons ((ELEMENT.LEAD.getNeutrons()*4)+(ALLOY.BRONZE.getNeutrons()*4)+(ELEMENT.TIN.getNeutrons()*2))/10, //Neutrons false, //Uses Blast furnace? @@ -128,7 +128,7 @@ public final class ALLOY { "Inconel-625", //Material Name new short[]{128, 200, 128, 0}, //Material Colour 1425, //Melting Point in C - ((ELEMENT.NICKEL.getBoilingPoint_C()*6)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*2)+(ELEMENT.IRON.getBoilingPoint_C()*1)+(ELEMENT.MOLYBDENUM.getBoilingPoint_C()*1))/10, //Boiling Point in C + ((ELEMENT.NICKEL.getBoilingPointC()*6)+(ELEMENT.CHROMIUM.getBoilingPointC()*2)+(ELEMENT.IRON.getBoilingPointC()*1)+(ELEMENT.MOLYBDENUM.getBoilingPointC()*1))/10, //Boiling Point in C ((ELEMENT.NICKEL.getProtons()*6)+(ELEMENT.CHROMIUM.getProtons()*2)+(ELEMENT.IRON.getProtons()*1)+(ELEMENT.MOLYBDENUM.getProtons()*1))/10, //Protons ((ELEMENT.NICKEL.getNeutrons()*6)+(ELEMENT.CHROMIUM.getNeutrons()*2)+(ELEMENT.IRON.getNeutrons()*1)+(ELEMENT.MOLYBDENUM.getNeutrons()*1))/10, //Neutrons true, //Uses Blast furnace? @@ -144,7 +144,7 @@ public final class ALLOY { "Inconel-690", //Material Name new short[]{118, 220, 138, 0}, //Material Colour 1425, //Melting Point in C - ((ELEMENT.NICKEL.getBoilingPoint_C()*6)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*2)+(ELEMENT.NIOBIUM.getBoilingPoint_C()*1)+(ELEMENT.MOLYBDENUM.getBoilingPoint_C()*1))/10, //Boiling Point in C + ((ELEMENT.NICKEL.getBoilingPointC()*6)+(ELEMENT.CHROMIUM.getBoilingPointC()*2)+(ELEMENT.NIOBIUM.getBoilingPointC()*1)+(ELEMENT.MOLYBDENUM.getBoilingPointC()*1))/10, //Boiling Point in C ((ELEMENT.NICKEL.getProtons()*6)+(ELEMENT.CHROMIUM.getProtons()*2)+(ELEMENT.NIOBIUM.getProtons()*1)+(ELEMENT.MOLYBDENUM.getProtons()*1))/10, //Protons ((ELEMENT.NICKEL.getNeutrons()*6)+(ELEMENT.CHROMIUM.getNeutrons()*2)+(ELEMENT.NIOBIUM.getNeutrons()*1)+(ELEMENT.MOLYBDENUM.getNeutrons()*1))/10, //Neutrons true, //Uses Blast furnace? @@ -160,7 +160,7 @@ public final class ALLOY { "Inconel-792", //Material Name new short[]{108, 240, 118, 0}, //Material Colour 1425, //Melting Point in C - ((ELEMENT.NICKEL.getBoilingPoint_C()*6)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*1)+(ELEMENT.IRON.getBoilingPoint_C()*1)+(ELEMENT.ALUMINIUM.getBoilingPoint_C()*2))/10, //Boiling Point in C + ((ELEMENT.NICKEL.getBoilingPointC()*6)+(ELEMENT.CHROMIUM.getBoilingPointC()*1)+(ELEMENT.IRON.getBoilingPointC()*1)+(ELEMENT.ALUMINIUM.getBoilingPointC()*2))/10, //Boiling Point in C ((ELEMENT.NICKEL.getProtons()*6)+(ELEMENT.CHROMIUM.getProtons()*1)+(ELEMENT.IRON.getProtons()*1)+(ELEMENT.ALUMINIUM.getProtons()*2))/10, //Protons ((ELEMENT.NICKEL.getNeutrons()*6)+(ELEMENT.CHROMIUM.getNeutrons()*1)+(ELEMENT.IRON.getNeutrons()*1)+(ELEMENT.ALUMINIUM.getNeutrons()*2))/10, //Neutrons true, //Uses Blast furnace? @@ -175,8 +175,8 @@ public final class ALLOY { public static final Material STEEL = new Material( "Steel", //Material Name new short[]{180, 180, 20, 0}, //Material Colour - ((ELEMENT.CARBON.getMeltingPoint_C()*5)+(ELEMENT.IRON.getMeltingPoint_C()*95))/100, //Melting point in C - ((ELEMENT.CARBON.getBoilingPoint_C()*5)+(ELEMENT.IRON.getBoilingPoint_C()*95))/100, //Boiling Point in C + ((ELEMENT.CARBON.getMeltingPointC()*5)+(ELEMENT.IRON.getMeltingPointC()*95))/100, //Melting point in C + ((ELEMENT.CARBON.getBoilingPointC()*5)+(ELEMENT.IRON.getBoilingPointC()*95))/100, //Boiling Point in C ((ELEMENT.CARBON.getProtons()*5)+(ELEMENT.IRON.getProtons()*95))/100, //Protons ((ELEMENT.CARBON.getNeutrons()*5)+(ELEMENT.IRON.getNeutrons()*95))/100, //Neutrons true, //Uses Blast furnace? @@ -191,8 +191,8 @@ public final class ALLOY { public static final Material ZERON_100 = new Material( "Zeron-100", //Material Name new short[]{180, 180, 20, 0}, //Material Colour - ((ELEMENT.CHROMIUM.getMeltingPoint_C()*25)+(ELEMENT.NICKEL.getMeltingPoint_C()*6)+(ELEMENT.COBALT.getMeltingPoint_C()*9)+(ALLOY.STEEL.getMeltingPoint_C()*60))/100, //Melting Point in C - ((ELEMENT.CHROMIUM.getBoilingPoint_C()*25)+(ELEMENT.NICKEL.getBoilingPoint_C()*6)+(ELEMENT.COBALT.getBoilingPoint_C()*9)+(ALLOY.STEEL.getBoilingPoint_C()*60))/100, //Boiling Point in C + ((ELEMENT.CHROMIUM.getMeltingPointC()*25)+(ELEMENT.NICKEL.getMeltingPointC()*6)+(ELEMENT.COBALT.getMeltingPointC()*9)+(ALLOY.STEEL.getMeltingPointC()*60))/100, //Melting Point in C + ((ELEMENT.CHROMIUM.getBoilingPointC()*25)+(ELEMENT.NICKEL.getBoilingPointC()*6)+(ELEMENT.COBALT.getBoilingPointC()*9)+(ALLOY.STEEL.getBoilingPointC()*60))/100, //Boiling Point in C ((ELEMENT.CHROMIUM.getProtons()*25)+(ELEMENT.NICKEL.getProtons()*6)+(ELEMENT.COBALT.getProtons()*9)+(ALLOY.STEEL.getProtons()*60))/100, //Protons ((ELEMENT.CHROMIUM.getNeutrons()*25)+(ELEMENT.NICKEL.getNeutrons()*6)+(ELEMENT.COBALT.getNeutrons()*9)+(ALLOY.STEEL.getNeutrons()*60))/100, //Neutrons true, //Uses Blast furnace? @@ -210,7 +210,7 @@ public final class ALLOY { "Maraging Steel 250", //Material Name new short[]{140, 140, 140, 0}, //Material Colour 1413, //Melting Point in C - ((ELEMENT.TITANIUM.getBoilingPoint_C()*5)+(ELEMENT.NICKEL.getBoilingPoint_C()*16)+(ELEMENT.COBALT.getBoilingPoint_C()*9)+(ALLOY.STEEL.getBoilingPoint_C()*70))/100, //Boiling Point in C + ((ELEMENT.TITANIUM.getBoilingPointC()*5)+(ELEMENT.NICKEL.getBoilingPointC()*16)+(ELEMENT.COBALT.getBoilingPointC()*9)+(ALLOY.STEEL.getBoilingPointC()*70))/100, //Boiling Point in C ((ELEMENT.TITANIUM.getProtons()*5)+(ELEMENT.NICKEL.getProtons()*16)+(ELEMENT.COBALT.getProtons()*9)+(ALLOY.STEEL.getProtons()*70))/100, //Protons ((ELEMENT.TITANIUM.getNeutrons()*5)+(ELEMENT.NICKEL.getNeutrons()*16)+(ELEMENT.COBALT.getNeutrons()*9)+(ALLOY.STEEL.getNeutrons()*70))/100, //Neutrons true, //Uses Blast furnace? @@ -227,7 +227,7 @@ public final class ALLOY { "Maraging Steel 300", //Material Name new short[]{150, 150, 150, 0}, //Material Colour 1413, //Melting Point in C - ((ELEMENT.TITANIUM.getBoilingPoint_C()*10)+(ELEMENT.NICKEL.getBoilingPoint_C()*21)+(ELEMENT.COBALT.getBoilingPoint_C()*14)+(ALLOY.STEEL.getBoilingPoint_C()*55))/100, //Boiling Point in C + ((ELEMENT.TITANIUM.getBoilingPointC()*10)+(ELEMENT.NICKEL.getBoilingPointC()*21)+(ELEMENT.COBALT.getBoilingPointC()*14)+(ALLOY.STEEL.getBoilingPointC()*55))/100, //Boiling Point in C ((ELEMENT.TITANIUM.getProtons()*10)+(ELEMENT.NICKEL.getProtons()*21)+(ELEMENT.COBALT.getProtons()*14)+(ALLOY.STEEL.getProtons()*55))/100, //Protons ((ELEMENT.TITANIUM.getNeutrons()*10)+(ELEMENT.NICKEL.getNeutrons()*21)+(ELEMENT.COBALT.getNeutrons()*14)+(ALLOY.STEEL.getNeutrons()*55))/100, //Neutrons true, //Uses Blast furnace? @@ -244,7 +244,7 @@ public final class ALLOY { "Maraging Steel 350", //Material Name new short[]{160, 160, 160, 0}, //Material Colour 1413, //Melting Point in C - ((ELEMENT.TITANIUM.getBoilingPoint_C()*15)+(ELEMENT.NICKEL.getBoilingPoint_C()*21)+(ELEMENT.COBALT.getBoilingPoint_C()*9)+(ALLOY.STEEL.getBoilingPoint_C()*55))/100, //Boiling Point in C + ((ELEMENT.TITANIUM.getBoilingPointC()*15)+(ELEMENT.NICKEL.getBoilingPointC()*21)+(ELEMENT.COBALT.getBoilingPointC()*9)+(ALLOY.STEEL.getBoilingPointC()*55))/100, //Boiling Point in C ((ELEMENT.TITANIUM.getProtons()*15)+(ELEMENT.NICKEL.getProtons()*21)+(ELEMENT.COBALT.getProtons()*9)+(ALLOY.STEEL.getProtons()*55))/100, //Protons ((ELEMENT.TITANIUM.getNeutrons()*15)+(ELEMENT.NICKEL.getNeutrons()*21)+(ELEMENT.COBALT.getNeutrons()*9)+(ALLOY.STEEL.getNeutrons()*55))/100, //Neutrons true, //Uses Blast furnace? @@ -261,7 +261,7 @@ public final class ALLOY { "Stellite", //Material Name new short[]{129, 75, 120, 0}, //Material Colour 1310, //Melting Point in C - ((ELEMENT.TITANIUM.getBoilingPoint_C()*10)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*35)+(ELEMENT.COBALT.getBoilingPoint_C()*35)+(ELEMENT.MANGANESE.getBoilingPoint_C()*20))/100, //Boiling Point in C + ((ELEMENT.TITANIUM.getBoilingPointC()*10)+(ELEMENT.CHROMIUM.getBoilingPointC()*35)+(ELEMENT.COBALT.getBoilingPointC()*35)+(ELEMENT.MANGANESE.getBoilingPointC()*20))/100, //Boiling Point in C ((ELEMENT.TITANIUM.getProtons()*10)+(ELEMENT.CHROMIUM.getProtons()*35)+(ELEMENT.COBALT.getProtons()*35)+(ELEMENT.MANGANESE.getProtons()*20))/100, //Protons ((ELEMENT.TITANIUM.getNeutrons()*10)+(ELEMENT.CHROMIUM.getNeutrons()*35)+(ELEMENT.COBALT.getNeutrons()*35)+(ELEMENT.MANGANESE.getNeutrons()*20))/100, //Neutrons true, //Uses Blast furnace? @@ -277,7 +277,7 @@ public final class ALLOY { "Talonite", //Material Name new short[]{228, 75, 120, 0}, //Material Colour 1454, //Melting Point in C - ((ELEMENT.MOLYBDENUM.getBoilingPoint_C()*10)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*30)+(ELEMENT.COBALT.getBoilingPoint_C()*40)+(ELEMENT.PHOSPHORUS.getBoilingPoint_C()*20))/100, //Boiling Point in C + ((ELEMENT.MOLYBDENUM.getBoilingPointC()*10)+(ELEMENT.CHROMIUM.getBoilingPointC()*30)+(ELEMENT.COBALT.getBoilingPointC()*40)+(ELEMENT.PHOSPHORUS.getBoilingPointC()*20))/100, //Boiling Point in C ((ELEMENT.MOLYBDENUM.getProtons()*10)+(ELEMENT.CHROMIUM.getProtons()*30)+(ELEMENT.COBALT.getProtons()*40)+(ELEMENT.PHOSPHORUS.getProtons()*20))/100, //Protons ((ELEMENT.MOLYBDENUM.getNeutrons()*10)+(ELEMENT.CHROMIUM.getNeutrons()*30)+(ELEMENT.COBALT.getNeutrons()*40)+(ELEMENT.PHOSPHORUS.getNeutrons()*20))/100, //Neutrons false, //Uses Blast furnace? @@ -293,7 +293,7 @@ public final class ALLOY { "Hastelloy-W", //Material Name new short[]{218, 165, 32, 0}, //Material Colour 1350, //Melting Point in C - ((ELEMENT.IRON.getBoilingPoint_C()*6)+(ELEMENT.MOLYBDENUM.getBoilingPoint_C()*24)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*5)+(ELEMENT.NICKEL.getBoilingPoint_C()*65))/100, //Boiling Point in C + ((ELEMENT.IRON.getBoilingPointC()*6)+(ELEMENT.MOLYBDENUM.getBoilingPointC()*24)+(ELEMENT.CHROMIUM.getBoilingPointC()*5)+(ELEMENT.NICKEL.getBoilingPointC()*65))/100, //Boiling Point in C ((ELEMENT.IRON.getProtons()*6)+(ELEMENT.MOLYBDENUM.getProtons()*24)+(ELEMENT.CHROMIUM.getProtons()*5)+(ELEMENT.NICKEL.getProtons()*65))/100, //Protons ((ELEMENT.IRON.getNeutrons()*6)+(ELEMENT.MOLYBDENUM.getNeutrons()*24)+(ELEMENT.CHROMIUM.getNeutrons()*5)+(ELEMENT.NICKEL.getNeutrons()*65))/100, //Neutrons false, //Uses Blast furnace? @@ -325,7 +325,7 @@ public final class ALLOY { "Hastelloy-X", //Material Name new short[]{255, 193, 37, 0}, //Material Colour 1350, //Melting Point in C - ((ELEMENT.IRON.getBoilingPoint_C()*18)+(ELEMENT.MOLYBDENUM.getBoilingPoint_C()*9)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*22)+(ELEMENT.NICKEL.getBoilingPoint_C()*51))/100, //Boiling Point in C + ((ELEMENT.IRON.getBoilingPointC()*18)+(ELEMENT.MOLYBDENUM.getBoilingPointC()*9)+(ELEMENT.CHROMIUM.getBoilingPointC()*22)+(ELEMENT.NICKEL.getBoilingPointC()*51))/100, //Boiling Point in C ((ELEMENT.IRON.getProtons()*18)+(ELEMENT.MOLYBDENUM.getProtons()*9)+(ELEMENT.CHROMIUM.getProtons()*22)+(ELEMENT.NICKEL.getProtons()*51))/100, //Protons ((ELEMENT.IRON.getNeutrons()*18)+(ELEMENT.MOLYBDENUM.getNeutrons()*9)+(ELEMENT.CHROMIUM.getNeutrons()*22)+(ELEMENT.NICKEL.getNeutrons()*51))/100, //Neutrons false, //Uses Blast furnace? @@ -341,7 +341,7 @@ public final class ALLOY { "Hastelloy-N", //Material Name new short[]{236, 213, 48, 0}, //Material Colour 1350, //Melting Point in C - ((ELEMENT.YTTRIUM.getBoilingPoint_C()*5)+(ELEMENT.MOLYBDENUM.getBoilingPoint_C()*16)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*7)+(ELEMENT.NICKEL.getBoilingPoint_C()*72))/100, //Boiling Point in C + ((ELEMENT.YTTRIUM.getBoilingPointC()*5)+(ELEMENT.MOLYBDENUM.getBoilingPointC()*16)+(ELEMENT.CHROMIUM.getBoilingPointC()*7)+(ELEMENT.NICKEL.getBoilingPointC()*72))/100, //Boiling Point in C ((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? @@ -357,7 +357,7 @@ public final class ALLOY { "Hastelloy-C276", //Material Name new short[]{238, 180, 34, 0}, //Material Colour 1350, //Melting Point in C - ((ELEMENT.COBALT.getBoilingPoint_C()*2)+(ELEMENT.MOLYBDENUM.getBoilingPoint_C()*16)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*16)+(ELEMENT.NICKEL.getBoilingPoint_C()*66))/100, //Boiling Point in C + ((ELEMENT.COBALT.getBoilingPointC()*2)+(ELEMENT.MOLYBDENUM.getBoilingPointC()*16)+(ELEMENT.CHROMIUM.getBoilingPointC()*16)+(ELEMENT.NICKEL.getBoilingPointC()*66))/100, //Boiling Point in C ((ELEMENT.COBALT.getProtons()*2)+(ELEMENT.MOLYBDENUM.getProtons()*16)+(ELEMENT.CHROMIUM.getProtons()*16)+(ELEMENT.NICKEL.getProtons()*66))/100, //Protons ((ELEMENT.COBALT.getNeutrons()*2)+(ELEMENT.MOLYBDENUM.getNeutrons()*16)+(ELEMENT.CHROMIUM.getNeutrons()*16)+(ELEMENT.NICKEL.getNeutrons()*66))/100, //Neutrons true, //Uses Blast furnace? @@ -373,7 +373,7 @@ public final class ALLOY { "Incoloy-020", //Material Name new short[]{101, 81, 71, 0}, //Material Colour 1425, //Melting Point in C - ((ELEMENT.IRON.getBoilingPoint_C()*40)+(ELEMENT.COPPER.getBoilingPoint_C()*4)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*20)+(ELEMENT.NICKEL.getBoilingPoint_C()*36))/100, //Boiling Point in C + ((ELEMENT.IRON.getBoilingPointC()*40)+(ELEMENT.COPPER.getBoilingPointC()*4)+(ELEMENT.CHROMIUM.getBoilingPointC()*20)+(ELEMENT.NICKEL.getBoilingPointC()*36))/100, //Boiling Point in C ((ELEMENT.IRON.getProtons()*40)+(ELEMENT.COPPER.getProtons()*4)+(ELEMENT.CHROMIUM.getProtons()*20)+(ELEMENT.NICKEL.getProtons()*36))/100, //Protons ((ELEMENT.IRON.getNeutrons()*40)+(ELEMENT.COPPER.getNeutrons()*4)+(ELEMENT.CHROMIUM.getNeutrons()*20)+(ELEMENT.NICKEL.getNeutrons()*36))/100, //Neutrons false, //Uses Blast furnace? @@ -389,7 +389,7 @@ public final class ALLOY { "Incoloy-DS", //Material Name new short[]{71, 101, 81, 0}, //Material Colour 1425, //Melting Point in C - ((ELEMENT.IRON.getBoilingPoint_C()*46)+(ELEMENT.COBALT.getBoilingPoint_C()*18)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*18)+(ELEMENT.NICKEL.getBoilingPoint_C()*18))/100, //Boiling Point in C + ((ELEMENT.IRON.getBoilingPointC()*46)+(ELEMENT.COBALT.getBoilingPointC()*18)+(ELEMENT.CHROMIUM.getBoilingPointC()*18)+(ELEMENT.NICKEL.getBoilingPointC()*18))/100, //Boiling Point in C ((ELEMENT.IRON.getProtons()*46)+(ELEMENT.COBALT.getProtons()*18)+(ELEMENT.CHROMIUM.getProtons()*18)+(ELEMENT.NICKEL.getProtons()*18))/100, //Protons ((ELEMENT.IRON.getNeutrons()*46)+(ELEMENT.COBALT.getNeutrons()*18)+(ELEMENT.CHROMIUM.getNeutrons()*18)+(ELEMENT.NICKEL.getNeutrons()*18))/100, //Neutrons false, //Uses Blast furnace? @@ -405,7 +405,7 @@ public final class ALLOY { "Incoloy-MA956", //Material Name new short[]{81, 71, 101, 0}, //Material Colour 1425, //Melting Point in C - ((ELEMENT.IRON.getBoilingPoint_C()*75)+(ELEMENT.ALUMINIUM.getBoilingPoint_C()*4)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*20)+(ELEMENT.YTTRIUM.getBoilingPoint_C()*1))/100, //Boiling Point in C + ((ELEMENT.IRON.getBoilingPointC()*75)+(ELEMENT.ALUMINIUM.getBoilingPointC()*4)+(ELEMENT.CHROMIUM.getBoilingPointC()*20)+(ELEMENT.YTTRIUM.getBoilingPointC()*1))/100, //Boiling Point in C ((ELEMENT.IRON.getProtons()*75)+(ELEMENT.ALUMINIUM.getProtons()*4)+(ELEMENT.CHROMIUM.getProtons()*20)+(ELEMENT.YTTRIUM.getProtons()*1))/100, //Protons ((ELEMENT.IRON.getNeutrons()*75)+(ELEMENT.ALUMINIUM.getNeutrons()*4)+(ELEMENT.CHROMIUM.getNeutrons()*20)+(ELEMENT.YTTRIUM.getNeutrons()*1))/100, //Neutrons true, //Uses Blast furnace? @@ -421,7 +421,7 @@ public final class ALLOY { "Tungsten Carbide", //Material Name new short[]{44, 44, 44, 0}, //Material Colour 3422, //Melting Point in C - ((ELEMENT.TUNGSTEN.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*5))/10, //Boiling Point in C + ((ELEMENT.TUNGSTEN.getBoilingPointC()*5)+(ELEMENT.CARBON.getBoilingPointC()*5))/10, //Boiling Point in C ((ELEMENT.TUNGSTEN.getProtons()*5)+(ELEMENT.CARBON.getProtons()*5))/10, //Protons ((ELEMENT.TUNGSTEN.getNeutrons()*5)+(ELEMENT.CARBON.getNeutrons()*5))/10, //Neutrons true, //Uses Blast furnace? @@ -435,7 +435,7 @@ public final class ALLOY { "Silicon Carbide", //Material Name new short[]{40, 48, 36, 0}, //Material Colour 1414, //Melting Point in C - ((ELEMENT.SILICON.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*5))/10, //Boiling Point in C + ((ELEMENT.SILICON.getBoilingPointC()*5)+(ELEMENT.CARBON.getBoilingPointC()*5))/10, //Boiling Point in C ((ELEMENT.SILICON.getProtons()*5)+(ELEMENT.CARBON.getProtons()*5))/10, //Protons ((ELEMENT.SILICON.getNeutrons()*5)+(ELEMENT.CARBON.getNeutrons()*5))/10, //Neutrons false, //Uses Blast furnace? @@ -450,7 +450,7 @@ public final class ALLOY { "Tantalum Carbide", //Material Name new short[]{139, 136, 120, 0}, //Material Colour 2980, //Melting Point in C - ((ELEMENT.TANTALUM.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*5))/10, //Boiling Point in C + ((ELEMENT.TANTALUM.getBoilingPointC()*5)+(ELEMENT.CARBON.getBoilingPointC()*5))/10, //Boiling Point in C ((ELEMENT.TANTALUM.getProtons()*5)+(ELEMENT.CARBON.getProtons()*5))/10, //Protons ((ELEMENT.TANTALUM.getNeutrons()*5)+(ELEMENT.CARBON.getNeutrons()*5))/10, //Neutrons true, //Uses Blast furnace? @@ -465,7 +465,7 @@ public final class ALLOY { "Zirconium Carbide", //Material Name new short[]{222, 202, 180, 0}, //Material Colour 1855, //Melting Point in C - ((ELEMENT.ZIRCONIUM.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*5))/10, //Boiling Point in C + ((ELEMENT.ZIRCONIUM.getBoilingPointC()*5)+(ELEMENT.CARBON.getBoilingPointC()*5))/10, //Boiling Point in C ((ELEMENT.ZIRCONIUM.getProtons()*5)+(ELEMENT.CARBON.getProtons()*5))/10, //Protons ((ELEMENT.ZIRCONIUM.getNeutrons()*5)+(ELEMENT.CARBON.getNeutrons()*5))/10, //Neutrons true, //Uses Blast furnace? @@ -480,7 +480,7 @@ public final class ALLOY { "Niobium Carbide", //Material Name new short[]{205, 197, 191, 0}, //Material Colour 2477, //Melting Point in C - ((ELEMENT.NIOBIUM.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*5))/10, //Boiling Point in C + ((ELEMENT.NIOBIUM.getBoilingPointC()*5)+(ELEMENT.CARBON.getBoilingPointC()*5))/10, //Boiling Point in C ((ELEMENT.NIOBIUM.getProtons()*5)+(ELEMENT.CARBON.getProtons()*5))/10, //Protons ((ELEMENT.NIOBIUM.getNeutrons()*5)+(ELEMENT.CARBON.getNeutrons()*5))/10, //Neutrons true, //Uses Blast furnace? diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index f4eb12ec46..1265905c24 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -46,7 +46,7 @@ public final class ELEMENT { public static final Material RUBIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubidium); public static final Material STRONTIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Strontium); public static final Material YTTRIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yttrium); - public static final Material ZIRCONIUM = new Material("Zirconium", new short[]{255, 250, 205}, 1855, 4377, 40, 51, false, null, "Zr", 0);//Not a GT Inherited Material + public static final Material ZIRCONIUM = new Material("Zirconium", new short[]{255, 250, 205}, 1855, 4377, 40, 51, false, "Zr", 0);//Not a GT Inherited Material public static final Material NIOBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Niobium); public static final Material MOLYBDENUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Molybdenum); //public static final Material TECHNETIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Technetium); @@ -79,7 +79,7 @@ public final class ELEMENT { public static final Material THORIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Thorium); public static final Material URANIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium); public static final Material PLUTONIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium); - public static final Material URANIUM233 = new Material("Uranium-233", new short[]{73, 220, 83, 0}, 1132, 4131, 92, 141, false, null, MaterialUtils.superscript("233U"), 2);//Not a GT Inherited Material + public static final Material URANIUM233 = new Material("Uranium-233", new short[]{73, 220, 83, 0}, 1132, 4131, 92, 141, false, MaterialUtils.superscript("233U"), 2);//Not a GT Inherited Material } diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index e8de7166c2..16c87c427a 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -10,6 +10,9 @@ import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.materials.MaterialUtils; import gtPlusPlus.core.util.math.MathUtils; + +import java.util.ArrayList; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; @@ -17,68 +20,61 @@ import net.minecraftforge.fluids.FluidStack; public class Material { - final String unlocalizedName; - final String localizedName; + private final String unlocalizedName; + private final String localizedName; - final Fluid vMoltenFluid; + private final Fluid vMoltenFluid; protected Object dataVar; - private MaterialStack[] vMaterialInput = new MaterialStack[9]; + private ArrayList vMaterialInput; public final long[] vSmallestRatio; - final short[] RGBA; + private final short[] RGBA; - final boolean usesBlastFurnace; + private final boolean usesBlastFurnace; public final boolean isRadioactive; public final byte vRadioationLevel; - final int meltingPointK; - final int boilingPointK; - final int meltingPointC; - final int boilingPointC; - final long vProtons; - final long vNeutrons; - final long vMass; + private final int meltingPointK; + private final int boilingPointK; + private final int meltingPointC; + private final int boilingPointC; + private final long vProtons; + private final long vNeutrons; + private final long vMass; public final int smallestStackSizeWhenProcessing; //Add a check for <=0 || > 64 public final int vTier; public final int vVoltageMultiplier; public final String vChemicalFormula; public final String vChemicalSymbol; - public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs){ - this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, inputs, "", 0); + public Material(final String materialName, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final MaterialStack... inputs){ + this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", 0, inputs); } - public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs, int radiationLevel){ - this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, inputs, "", radiationLevel); + public Material(final String materialName, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final int radiationLevel, MaterialStack... inputs){ + this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", radiationLevel, inputs); } - public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs, String chemicalSymbol, int radiationLevel){ + public Material(final String materialName, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){ this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; this.RGBA = rgba; this.meltingPointC = meltingPoint; - if (boilingPoint == 0){ - boilingPoint = meltingPoint*4; + if (boilingPoint != 0){ + this.boilingPointC = boilingPoint; + } + else { + this.boilingPointC = meltingPoint*4; } - this.boilingPointC = boilingPoint; this.meltingPointK = (int) MathUtils.celsiusToKelvin(meltingPointC); this.boilingPointK = (int) MathUtils.celsiusToKelvin(boilingPointC); this.vProtons = protons; this.vNeutrons = neutrons; this.vMass = getMass(); - /*//List inputArray = Arrays.asList(inputs); - int tempSmallestSize = getSmallestStackForCrafting(inputs); - if (tempSmallestSize <= 64 && tempSmallestSize >= 1){ - this.smallestStackSizeWhenProcessing = tempSmallestSize; //Valid stacksizes - } - else { - this.smallestStackSizeWhenProcessing = 50; //Can divide my math by 1/2 and round it~ - }*/ - //Sets the Rad level if (radiationLevel != 0){ this.isRadioactive = true; @@ -90,42 +86,10 @@ public class Material { } //Sets the materials 'tier'. Will probably replace this logic. - if (getMeltingPoint_K() >= 0 && getMeltingPoint_K() <= 750){ - this.vTier = 1; - } - else if(getMeltingPoint_K() >= 751 && getMeltingPoint_K() <= 1250){ - this.vTier = 2; - } - else if(getMeltingPoint_K() >= 1251 && getMeltingPoint_K() <= 1750){ - this.vTier = 3; - } - else if(getMeltingPoint_K() >= 1751 && getMeltingPoint_K() <= 2250){ - this.vTier = 4; - } - else if(getMeltingPoint_K() >= 2251 && getMeltingPoint_K() <= 2750){ - this.vTier = 5; - } - else if(getMeltingPoint_K() >= 2751 && getMeltingPoint_K() <= 3250){ - this.vTier = 6; - } - else if(getMeltingPoint_K() >= 3251 && getMeltingPoint_K() <= 3750){ - this.vTier = 7; - } - else if(getMeltingPoint_K() >= 3751 && getMeltingPoint_K() <= 4250){ - this.vTier = 8; - } - else if(getMeltingPoint_K() >= 4251 && getMeltingPoint_K() <= 4750){ - this.vTier = 9; - } - else if(getMeltingPoint_K() >= 4751 && getMeltingPoint_K() <= 9999){ - this.vTier = 10; - } - else { - this.vTier = 0; - } + this.vTier = MaterialUtils.getTierOfMaterial((int) MathUtils.celsiusToKelvin(meltingPoint)); this.usesBlastFurnace = blastFurnace; - this.vVoltageMultiplier = this.getMeltingPoint_K() >= 2800 ? 64 : 16; + this.vVoltageMultiplier = this.getMeltingPointK() >= 2800 ? 64 : 16; if (inputs == null){ this.vMaterialInput = null; @@ -134,7 +98,7 @@ public class Material { if (inputs.length != 0){ for (int i=0; i < inputs.length; i++){ if (inputs[i] != null){ - this.vMaterialInput[i] = inputs[i]; + this.vMaterialInput.set(i, inputs[i]); } } } @@ -186,8 +150,6 @@ public class Material { this.vMoltenFluid = generateFluid(); } } - - //dataVar = MathUtils.generateSingularRandomHexValue(); @@ -211,19 +173,19 @@ public class Material { Utils.LOG_INFO("Boiling Point: "+boilingPointC+"C."); } - public String getLocalizedName(){ + final public String getLocalizedName(){ return localizedName; } - public String getUnlocalizedName(){ + final public String getUnlocalizedName(){ return unlocalizedName; } - public short[] getRGBA(){ - return RGBA; + final public short[] getRGBA(){ + return this.RGBA; } - public int getRgbAsHex(){ + final public int getRgbAsHex(){ int returnValue = Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]); if (returnValue == 0){ @@ -232,115 +194,115 @@ public class Material { return Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]); } - public long getProtons() { + final public long getProtons() { return vProtons; } - public long getNeutrons() { + final public long getNeutrons() { return vNeutrons; } - public long getMass() { + final public long getMass() { return vProtons + vNeutrons; } - public int getMeltingPoint_C() { + final public int getMeltingPointC() { return meltingPointC; } - public int getBoilingPoint_C() { + final public int getBoilingPointC() { return boilingPointC; } - public int getMeltingPoint_K() { + final public int getMeltingPointK() { return meltingPointK; } - public int getBoilingPoint_K() { + final public int getBoilingPointK() { return boilingPointK; } - public boolean requiresBlastFurnace(){ + final public boolean requiresBlastFurnace(){ return usesBlastFurnace; } - public ItemStack getDust(int stacksize){ + final public ItemStack getDust(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, stacksize); } - public ItemStack getSmallDust(int stacksize){ + final public ItemStack getSmallDust(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSmall"+unlocalizedName, stacksize); } - public ItemStack getTinyDust(int stacksize){ + final public ItemStack getTinyDust(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+unlocalizedName, stacksize); } - public ItemStack[] getValidInputStacks(){ + final public ItemStack[] getValidInputStacks(){ return ItemUtils.validItemsForOreDict(unlocalizedName); } - public ItemStack getIngot(int stacksize){ + final public ItemStack getIngot(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingot"+unlocalizedName, stacksize); } - public ItemStack getPlate(int stacksize){ + final public ItemStack getPlate(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plate"+unlocalizedName, stacksize); } - public ItemStack getPlateDouble(int stacksize){ + final public ItemStack getPlateDouble(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDouble"+unlocalizedName, stacksize); } - public ItemStack getGear(int stacksize){ + final public ItemStack getGear(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("gear"+unlocalizedName, stacksize); } - public ItemStack getRod(int stacksize){ + final public ItemStack getRod(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("stick"+unlocalizedName, stacksize); } - public ItemStack getLongRod(int stacksize){ + final public ItemStack getLongRod(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("stickLong"+unlocalizedName, stacksize); } - public ItemStack getBolt(int stacksize){ + final public ItemStack getBolt(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("bolt"+unlocalizedName, stacksize); } - public ItemStack getScrew(int stacksize){ + final public ItemStack getScrew(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("screw"+unlocalizedName, stacksize); } - public ItemStack getRing(int stacksize){ + final public ItemStack getRing(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ring"+unlocalizedName, stacksize); } - public ItemStack getRotor(int stacksize){ + final public ItemStack getRotor(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("rotor"+unlocalizedName, stacksize); } - public ItemStack getFrameBox(int stacksize){ + final public ItemStack getFrameBox(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("frameGt"+unlocalizedName, stacksize); } - public ItemStack[] getMaterialComposites(){ + final public ItemStack[] getMaterialComposites(){ //Utils.LOG_WARNING("Something requested the materials needed for "+localizedName); - if (vMaterialInput != null && vMaterialInput.length >= 1){ - ItemStack[] temp = new ItemStack[vMaterialInput.length]; - for (int i=0;i getComposites(){ return this.vMaterialInput; } - public int[] getMaterialCompositeStackSizes(){ - if (vMaterialInput != null && vMaterialInput.length >= 1){ - int[] temp = new int[vMaterialInput.length]; - for (int i=0;i= 1){ - int f = getInputMaterialCount(materialInput); - String[] formulaComponents = new String[f]; - for (int i=0;i 0){ - Utils.LOG_WARNING("length: "+inputs.length); - Utils.LOG_WARNING("(inputs != null): "+(inputs != null)); + @SuppressWarnings("static-method") + final public long[] getSmallestRatio(ArrayList tempInput){ + if (tempInput != null){ + if (!tempInput.isEmpty()){ + Utils.LOG_WARNING("length: "+tempInput.size()); + Utils.LOG_WARNING("(inputs != null): "+(tempInput != null)); //Utils.LOG_WARNING("length: "+inputs.length); - double tempPercentage=0; - long[] tempRatio = new long[inputs.length]; - for (int x=0;x= 101){ - Utils.LOG_WARNING("The compound for "+localizedName+" doesn't equal 98-100%, this isn't good."); - }*/ long[] smallestRatio = MathUtils.simplifyNumbersToSmallestForm(tempRatio); @@ -463,59 +372,40 @@ public class Material { return null; } - private int getSmallestStackForCrafting(MaterialStack[] inputs){ - if (inputs != null){ - if (inputs.length != 0){ - long[] smallestRatio = getSmallestRatio(inputs); - if (smallestRatio.length > 0){ - int tempSmallestCraftingUseSize = 0; - for (int r=0;r tempInput = vMaterialInput; if (tempInput != null){ - if (tempInput.length >= 1){ + if (!tempInput.isEmpty()){ String dummyFormula = ""; long[] dummyFormulaArray = getSmallestRatio(tempInput); if (dummyFormulaArray != null){ if (dummyFormulaArray.length >= 1){ - for (int e=0;e 1){ - if (tempInput[e].stackMaterial.vChemicalFormula.length() > 3){ - dummyFormula = dummyFormula + "(" + tempInput[e].stackMaterial.vChemicalFormula + ")" + dummyFormulaArray[e]; + if (tempInput.get(e).stackMaterial.vChemicalFormula.length() > 3){ + dummyFormula = dummyFormula + "(" + tempInput.get(e).stackMaterial.vChemicalFormula + ")" + dummyFormulaArray[e]; } else { - dummyFormula = dummyFormula + tempInput[e].stackMaterial.vChemicalFormula + dummyFormulaArray[e]; + dummyFormula = dummyFormula + tempInput.get(e).stackMaterial.vChemicalFormula + dummyFormulaArray[e]; } } else if (dummyFormulaArray[e] == 1){ - if (tempInput[e].stackMaterial.vChemicalFormula.length() > 3){ - dummyFormula = dummyFormula + "(" +tempInput[e].stackMaterial.vChemicalFormula + ")"; + if (tempInput.get(e).stackMaterial.vChemicalFormula.length() > 3){ + dummyFormula = dummyFormula + "(" +tempInput.get(e).stackMaterial.vChemicalFormula + ")"; } else { - dummyFormula = dummyFormula + "" +tempInput[e].stackMaterial.vChemicalFormula + ""; + dummyFormula = dummyFormula +tempInput.get(e).stackMaterial.vChemicalFormula; } } - else if (dummyFormulaArray[e] <= 0){ - dummyFormula = dummyFormula+""; - } } else dummyFormula = dummyFormula + "??"; @@ -523,9 +413,6 @@ public class Material { else dummyFormula = dummyFormula + "▓▓"; } - else { - dummyFormula = dummyFormula+""; - } } return MaterialUtils.subscript(dummyFormula); //return dummyFormula; @@ -541,12 +428,13 @@ public class Material { } - Fluid generateFluid(){ + final Fluid generateFluid(){ if (Materials.get(localizedName).mFluid == null){ Utils.LOG_WARNING("Generating our own fluid."); //Generate a Cell if we need to if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+getUnlocalizedName(), 1) == null){ + @SuppressWarnings("unused") Item temp = new BaseItemCell(this); } return FluidUtils.addGTFluid( @@ -554,7 +442,7 @@ public class Material { "Molten "+this.getLocalizedName(), this.RGBA, 4, - this.getMeltingPoint_K(), + this.getMeltingPointK(), ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+getUnlocalizedName(), 1), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); @@ -563,7 +451,7 @@ public class Material { return Materials.get(localizedName).mFluid; } - public FluidStack getFluid(int fluidAmount) { + final public FluidStack getFluid(int fluidAmount) { Utils.LOG_WARNING("Attempting to get "+fluidAmount+"L of "+this.vMoltenFluid.getName()); FluidStack moltenFluid = new FluidStack(this.vMoltenFluid, fluidAmount); diff --git a/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java b/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java index 742c3c6e9f..83b0bfd65d 100644 --- a/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java +++ b/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java @@ -109,7 +109,7 @@ public class FluidUtils { * @return short[] */ public static Fluid generateFluid(Material material ,int aState){ - int tempK = material.getMeltingPoint_C(); + int tempK = material.getMeltingPointC(); Fluid generatedFluid = null; switch (aState) { case 0: { diff --git a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java index 35605169c5..dac1162357 100644 --- a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java @@ -62,7 +62,7 @@ public class MaterialUtils { if (hasValidRGBA(rgba) || element == Element.H){ //ModItems.itemBaseDecidust = UtilsItems.generateDecidust(material); //ModItems.itemBaseCentidust = UtilsItems.generateCentidust(material); - return new Material(name, rgba, melting, boiling, protons, neutrons, blastFurnace, null, chemicalFormula, radioactivity); + return new Material(name, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity); } return null; @@ -133,6 +133,42 @@ public class MaterialUtils { return str; } + public static int getTierOfMaterial(int M){ + if (M >= 0 && M <= 750){ + return 1; + } + else if(M >= 751 && M <= 1250){ + return 2; + } + else if(M >= 1251 && M <= 1750){ + return 3; + } + else if(M >= 1751 && M <= 2250){ + return 4; + } + else if(M >= 2251 && M <= 2750){ + return 5; + } + else if(M >= 2751 && M <= 3250){ + return 6; + } + else if(M >= 3251 && M <= 3750){ + return 7; + } + else if(M >= 3751 && M <= 4250){ + return 8; + } + else if(M >= 4251 && M <= 4750){ + return 9; + } + else if(M >= 4751 && M <= 9999){ + return 10; + } + else { + return 0; + } + } + /* * That's shown, many times, in the EnumHelper code, all the add functions just wrap the addEnum function. diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java index 4b8fff1cc3..7e1c79aae3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -59,7 +59,7 @@ public class CasingTextureHandler { case 14: return TexturesGtBlocks.Casing_Staballoy_Firebox.getIcon(); case 15: - return TexturesGtBlocks.Casing_Material_Grisium.getIcon(); + return TexturesGtBlocks.Casing_Material_ZirconiumCarbide.getIcon(); default: return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java index 408a3723e0..34b8dde304 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java @@ -11,6 +11,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.util.Utils; import java.util.ArrayList; import java.util.Arrays; @@ -112,6 +113,7 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter } FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1); if (tInputList.size() > 0) { + Utils.LOG_INFO("Found some Valid Inputs."); long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); @@ -138,6 +140,7 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter return true; } } + Utils.LOG_INFO("Failed to find some Valid Inputs."); return false; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java index bca7861d58..54a5614b80 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java @@ -11,6 +11,9 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; + +import java.util.ArrayList; + import net.minecraft.item.ItemStack; public class RecipeGen_BlastSmelter { @@ -173,7 +176,7 @@ public class RecipeGen_BlastSmelter { //Prepare some Variables ItemStack[] components; - gtPlusPlus.core.material.MaterialStack[] tMaterial; + ArrayList tMaterial; short counter=0; int inputStackCount=0; int fluidAmount=0; @@ -186,8 +189,8 @@ public class RecipeGen_BlastSmelter { //Set a duration int duration = 0; - if (M.getMeltingPoint_K() > 150){ - duration = (int) Math.max(M.getMass() / 50L, 1L) * M.getMeltingPoint_K(); + if (M.getMeltingPointK() > 150){ + duration = (int) Math.max(M.getMass() / 50L, 1L) * M.getMeltingPointK(); } else { duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; @@ -229,7 +232,7 @@ public class RecipeGen_BlastSmelter { if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, duration, 120)){ Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe."); } - if (GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nugget"+M.getLocalizedName(), 1), null, M.getFluid(16), 100, duration/9, 120)){ + if (GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nugget"+M.getUnlocalizedName(), 1), null, M.getFluid(16), 100, duration/9, 120)){ Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe."); } if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/4, 120)){ @@ -253,7 +256,7 @@ public class RecipeGen_BlastSmelter { if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, duration/2, 60)){ Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe."); } - ItemStack tempitem = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nugget"+M.getLocalizedName(), 1); + ItemStack tempitem = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nugget"+M.getUnlocalizedName(), 1); if (tempitem != null){ if (GT_Values.RA.addFluidExtractionRecipe(tempitem, null, M.getFluid(16), 100, duration/2/9, 60)){ Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe."); @@ -302,11 +305,11 @@ public class RecipeGen_BlastSmelter { //Builds me an ItemStack[] of the materials. - Without a circuit - this gets a good count for the 144L fluid multiplier components = new ItemStack[9]; inputStackCount=0; - for (int irc=0;irc= 2800 ? 64 : 16; + int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16; Utils.LOG_WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO //Ring Recipe @@ -80,30 +80,47 @@ public class RecipeGen_DustGeneration { Utils.LOG_WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); } - - if (inputStacks.length > 0 && inputStacks.length <= 4){ - Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks)); - long[] inputStackSize = material.vSmallestRatio; - if (inputStackSize != null){ - for (short x=0;x= 2800 ? 64 : 16; + int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16; ItemStack itemIngot = material.getIngot(1); ItemStack plate_Single = material.getPlate(1); ItemStack itemGear = material.getGear(1); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java index 16e0c90d07..add6cf41b4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java @@ -12,7 +12,7 @@ public class RecipeGen_Plates { public static void generateRecipes(Material material){ - int tVoltageMultiplier = material.getMeltingPoint_K() >= 2800 ? 64 : 16; + int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16; ItemStack ingotStackOne = material.getIngot(1); ItemStack ingotStackTwo = material.getIngot(2); ItemStack shape_Mold = ItemList.Shape_Mold_Plate.get(0); -- cgit