diff options
Diffstat (limited to 'src/Java/gtPlusPlus')
12 files changed, 298 insertions, 108 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus_Secondary.java b/src/Java/gtPlusPlus/GTplusplus_Secondary.java index f69a5f2881..0c83df1b5c 100644 --- a/src/Java/gtPlusPlus/GTplusplus_Secondary.java +++ b/src/Java/gtPlusPlus/GTplusplus_Secondary.java @@ -63,9 +63,6 @@ public class GTplusplus_Secondary { @EventHandler public void load(final FMLInitializationEvent e) { Logger.INFO("Begin resource allocation for " + MODID2 + " V" + VERSION2); - - //Run Ore Material Handler - GenerateOreMaterials(); //Load Dark World and Biome //GameRegistry.registerFuelHandler(this); @@ -75,13 +72,13 @@ public class GTplusplus_Secondary { } - private void GenerateOreMaterials() { - MaterialGenerator.generate(ORES.CROCROITE); - MaterialGenerator.generate(ORES.GEIKIELITE); - MaterialGenerator.generate(ORES.NICHROMITE); - MaterialGenerator.generate(ORES.TITANITE); - MaterialGenerator.generate(ORES.ZIMBABWEITE); - MaterialGenerator.generate(ORES.ZIRCONILITE); + public static void GenerateOreMaterials() { + MaterialGenerator.generateOreMaterial(ORES.CROCROITE); + MaterialGenerator.generateOreMaterial(ORES.GEIKIELITE); + MaterialGenerator.generateOreMaterial(ORES.NICHROMITE); + MaterialGenerator.generateOreMaterial(ORES.TITANITE); + MaterialGenerator.generateOreMaterial(ORES.ZIMBABWEITE); + MaterialGenerator.generateOreMaterial(ORES.ZIRCONILITE); } void setVars(){ diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java index 285f394971..bc0c12fd2f 100644 --- a/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java +++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java @@ -2,9 +2,10 @@ package gtPlusPlus.core.block.base; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.math.MathUtils; -import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EnumCreatureType; import net.minecraft.util.IIcon; @@ -22,12 +23,28 @@ public class BlockBaseOre extends BlockBaseModular{ return true; }*/ + protected Material blockMaterial; + + protected int blockColour; + protected BlockTypes thisBlock; + protected String thisBlockMaterial; + protected final String thisBlockType; + + public BlockBaseOre(final Material material, final BlockTypes blockType, final int colour) { + this(material.getUnlocalizedName(), material.getLocalizedName(), net.minecraft.block.material.Material.iron, blockType, colour, 3); + } + + public BlockBaseOre(final String unlocalizedName, final String blockMaterial, final BlockTypes blockType, final int colour) { - this(unlocalizedName, blockMaterial, Material.iron, blockType, colour, 2); + this(unlocalizedName, blockMaterial, net.minecraft.block.material.Material.iron, blockType, colour, 2); } - public BlockBaseOre(final String unlocalizedName, final String blockMaterial, final Material vanillaMaterial, final BlockTypes blockType, final int colour, final int miningLevel) { + public BlockBaseOre(final String unlocalizedName, final String blockMaterial, final net.minecraft.block.material.Material vanillaMaterial, final BlockTypes blockType, final int colour, final int miningLevel) { super(unlocalizedName, blockMaterial, vanillaMaterial, blockType, colour, miningLevel); + this.blockColour = colour; + this.thisBlock = blockType; + this.thisBlockMaterial = blockMaterial; + this.thisBlockType = blockType.name().toUpperCase(); } /** diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index b9b204cc3b..54236365f2 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -6,6 +6,7 @@ import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Materials; import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.GTplusplus_Secondary; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.common.compat.COMPAT_Baubles; import gtPlusPlus.core.creative.AddToCreativeTab; @@ -500,6 +501,10 @@ public final class ModItems { //Must be the final Alloy to Generate MaterialGenerator.generate(ALLOY.QUANTUM); + + + //Ores + GTplusplus_Secondary.GenerateOreMaterials(); } catch (final Throwable r){ diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseItemCentrifugedCrushedOre.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemCentrifugedCrushedOre.java new file mode 100644 index 0000000000..73a13f568d --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemCentrifugedCrushedOre.java @@ -0,0 +1,10 @@ +package gtPlusPlus.core.item.base.ore; + +import gtPlusPlus.core.material.Material; + +public class BaseItemCentrifugedCrushedOre extends BaseOreComponent{ + + public BaseItemCentrifugedCrushedOre(final Material material) { + super(material, BaseOreComponent.ComponentTypes.CRUSHEDCENTRIFUGED); + } +} diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseItemImpureDust.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemImpureDust.java new file mode 100644 index 0000000000..45dc4f4402 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemImpureDust.java @@ -0,0 +1,10 @@ +package gtPlusPlus.core.item.base.ore; + +import gtPlusPlus.core.material.Material; + +public class BaseItemImpureDust extends BaseOreComponent{ + + public BaseItemImpureDust(final Material material) { + super(material, BaseOreComponent.ComponentTypes.DUSTIMPURE); + } +} diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedCrushedOre.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedCrushedOre.java new file mode 100644 index 0000000000..3f2a1c23e6 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedCrushedOre.java @@ -0,0 +1,10 @@ +package gtPlusPlus.core.item.base.ore; + +import gtPlusPlus.core.material.Material; + +public class BaseItemPurifiedCrushedOre extends BaseOreComponent{ + + public BaseItemPurifiedCrushedOre(final Material material) { + super(material, BaseOreComponent.ComponentTypes.CRUSHEDPURIFIED); + } +} diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedDust.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedDust.java new file mode 100644 index 0000000000..0c9816fb56 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedDust.java @@ -0,0 +1,10 @@ +package gtPlusPlus.core.item.base.ore; + +import gtPlusPlus.core.material.Material; + +public class BaseItemPurifiedDust extends BaseOreComponent{ + + public BaseItemPurifiedDust(final Material material) { + super(material, BaseOreComponent.ComponentTypes.DUSTPURE); + } +} diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java index d06f1c912a..7812b14e1d 100644 --- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java @@ -3,6 +3,8 @@ package gtPlusPlus.core.item.base.ore; import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; @@ -11,14 +13,21 @@ import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.entity.EntityUtils; import gtPlusPlus.core.util.item.ItemUtils; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import net.minecraft.world.World; public class BaseOreComponent extends Item{ + @SideOnly(Side.CLIENT) + private IIcon base; + @SideOnly(Side.CLIENT) + private IIcon overlay; + public final Material componentMaterial; public final String materialName; public final String unlocalName; @@ -28,7 +37,7 @@ public class BaseOreComponent extends Item{ public BaseOreComponent(final Material material, final ComponentTypes componentType) { this.componentMaterial = material; - this.unlocalName = "item"+componentType.COMPONENT_NAME+material.getUnlocalizedName(); + this.unlocalName = componentType.COMPONENT_NAME+material.getUnlocalizedName(); this.materialName = material.getLocalizedName(); this.componentType = componentType; this.setCreativeTab(AddToCreativeTab.tabMisc); @@ -44,15 +53,15 @@ public class BaseOreComponent extends Item{ if (!CORE.ConfigSwitches.useGregtechTextures){ return CORE.MODID + ":" + "item"+this.componentType.COMPONENT_NAME; } - + /*if (this.componentType == ComponentTypes.GEAR){ return "gregtech" + ":" + "materialicons/METALLIC/" + "gearGt"; } else if (this.componentType == ComponentTypes.SMALLGEAR){ return "gregtech" + ":" + "materialicons/METALLIC/" + "gearGtSmall"; }*/ - - return "gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME.toLowerCase(); + + return "gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME; } @Override @@ -107,29 +116,61 @@ public class BaseOreComponent extends Item{ + /** + * Rendering Related + * @author Alkalus + * + */ + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses(){ + if (this.componentType.hasOverlay()){ + return true; + } + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(final IIconRegister par1IconRegister){ + if (CORE.ConfigSwitches.useGregtechTextures){ + this.base = par1IconRegister.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "cell"); + if (this.componentType.hasOverlay()){ + this.overlay = par1IconRegister.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "cell_OVERLAY"); + } + } + else { + this.base = par1IconRegister.registerIcon(CORE.MODID + ":" + "item"+this.componentType.getComponent()); + if (this.componentType.hasOverlay()){ + this.overlay = par1IconRegister.registerIcon(CORE.MODID + ":" + "item"+this.componentType.getComponent()+"_Overlay"); + } + } + } - public static enum ComponentTypes { - DUST("Dust", " Dust", "dust"), - DUSTDIRTY("Ingot", " Ingot", "ingot"), - DUSTIMPURE("Ingot", " Ingot", "ingot"), - DUSTPURE("Ingot", " Ingot", "ingot"), - DUSTREFINED("Ingot", " Ingot", "ingot"), - CRUSHED("Ingot", " Ingot", "ingot"), - CRUSHEDCENTRIFUGED("Ingot", " Ingot", "ingot"), - CRUSHEDPURIFIED("Ingot", " Ingot", "ingot"); + DUST("dust", "", " Dust", "dust", true), + DUSTIMPURE("dustImpure", "Impure ", " Dust", "dustImpure", true), + DUSTPURE("dustPure", "Purified ", " Dust", "dustPure", true), + CRUSHED("crushed", "Crushed ", " Ore", "crushed", true), + CRUSHEDCENTRIFUGED("crushedCentrifuged", "Centrifuged "," Ore", "crushedCentrifuged", true), + CRUSHEDPURIFIED("crushedPurified", "Purified", " Ore", "crushedPurified", true); private String COMPONENT_NAME; + private String PREFIX; private String DISPLAY_NAME; private String OREDICT_NAME; - private ComponentTypes (final String LocalName, final String DisplayName, final String OreDictName){ + private boolean HAS_OVERLAY; + private ComponentTypes (final String LocalName, final String prefix, final String DisplayName, final String OreDictName, final boolean overlay){ this.COMPONENT_NAME = LocalName; + this.PREFIX = prefix; this.DISPLAY_NAME = DisplayName; this.OREDICT_NAME = OreDictName; + this.HAS_OVERLAY = overlay; // dust + Dirty, Impure, Pure, Refined // crushed + centrifuged, purified } @@ -146,6 +187,10 @@ public class BaseOreComponent extends Item{ return this.OREDICT_NAME; } + public boolean hasOverlay(){ + return this.HAS_OVERLAY; + } + } } diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index c8637f5aeb..1ebd335031 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -22,44 +22,44 @@ import net.minecraftforge.fluids.FluidStack; public class Material { - private final String unlocalizedName; - private final String localizedName; + private String unlocalizedName; + private String localizedName; - private final MaterialState materialState; + private MaterialState materialState; - private final Fluid vMoltenFluid; - private final Fluid vPlasma; + private Fluid vMoltenFluid; + private Fluid vPlasma; - private final boolean vGenerateCells; + private boolean vGenerateCells; protected Object dataVar = MathUtils.generateSingularRandomHexValue(); private ArrayList<MaterialStack> vMaterialInput = new ArrayList<>(); - public final long[] vSmallestRatio; - public final short vComponentCount; + public long[] vSmallestRatio; + public short vComponentCount; - private final short[] RGBA; + private short[] RGBA; - private final boolean usesBlastFurnace; - public final boolean isRadioactive; - public final byte vRadiationLevel; + private boolean usesBlastFurnace; + public boolean isRadioactive; + public byte vRadiationLevel; - 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; + private int meltingPointK; + private int boilingPointK; + private int meltingPointC; + private int boilingPointC; + private long vProtons; + private long vNeutrons; + private long vMass; + public int smallestStackSizeWhenProcessing; //Add a check for <=0 || > 64 + public int vTier; + public int vVoltageMultiplier; + public String vChemicalFormula; + public String vChemicalSymbol; - public final long vDurability; - public final int vToolQuality; - public final int vHarvestLevel; + public long vDurability; + public int vToolQuality; + public int vHarvestLevel; public static Map<Integer, Materials> invalidMaterials = new HashMap<Integer, Materials>(); @@ -68,6 +68,10 @@ public class Material { this (materialName, defaultState, 0, rgba, -1, -1, -1, -1, false, "", radiationLevel, false, materialStacks); } + public Material(String materialName, MaterialState defaultState, short[] rgba, int radiationLevel, int j, int k, int l, int m, MaterialStack[] materialStacks){ + this (materialName, defaultState, 0, rgba, j, k, l, m, false, "", radiationLevel, false, materialStacks); + } + public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final MaterialStack... inputs){ this(materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", 0, inputs); } @@ -97,7 +101,7 @@ public class Material { } public Material(final String materialName, final MaterialState defaultState, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean generateCells, final MaterialStack... inputs){ - + try { this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; this.materialState = defaultState; @@ -251,11 +255,11 @@ public class Material { this.vChemicalFormula = this.getToolTip(chemicalSymbol, OrePrefixes.dust.mMaterialAmount / M, true); } else if (!this.vChemicalSymbol.equals("")){ - Logger.WARNING("materialInput is null, using a valid chemical symbol."); + Logger.INFO("materialInput is null, using a valid chemical symbol."); this.vChemicalFormula = this.vChemicalSymbol; } else{ - Logger.WARNING("MaterialInput == null && chemicalSymbol probably equals nothing"); + Logger.INFO("MaterialInput == null && chemicalSymbol probably equals nothing"); this.vChemicalFormula = "??"; } @@ -293,15 +297,21 @@ public class Material { } } - Logger.WARNING("Creating a Material instance for "+materialName); - Logger.WARNING("Formula: "+this.vChemicalFormula + " Smallest Stack: "+this.smallestStackSizeWhenProcessing+" Smallest Ratio:"+ratio); - Logger.WARNING("Protons: "+this.vProtons); - Logger.WARNING("Neutrons: "+this.vNeutrons); - Logger.WARNING("Mass: "+this.vMass+"/units"); - Logger.WARNING("Melting Point: "+this.meltingPointC+"C."); - Logger.WARNING("Boiling Point: "+this.boilingPointC+"C."); + Logger.INFO("Creating a Material instance for "+materialName); + Logger.INFO("Formula: "+this.vChemicalFormula + " Smallest Stack: "+this.smallestStackSizeWhenProcessing+" Smallest Ratio:"+ratio); + Logger.INFO("Protons: "+this.vProtons); + Logger.INFO("Neutrons: "+this.vNeutrons); + Logger.INFO("Mass: "+this.vMass+"/units"); + Logger.INFO("Melting Point: "+this.meltingPointC+"C."); + Logger.INFO("Boiling Point: "+this.boilingPointC+"C."); + } + catch (Throwable t){ + t.printStackTrace(); + } } + + public final String getLocalizedName(){ if (this.localizedName != null) { return this.localizedName; @@ -453,21 +463,21 @@ public class Material { if (!this.vMaterialInput.isEmpty()){ final ItemStack[] temp = new ItemStack[this.vMaterialInput.size()]; for (int i=0;i<this.vMaterialInput.size();i++){ - //Utils.LOG_WARNING("i:"+i); + //Utils.LOG_INFO("i:"+i); ItemStack testNull = null; try { testNull = this.vMaterialInput.get(i).getValidStack(); } catch (final Throwable r){ - Logger.WARNING("Failed gathering material stack for "+this.localizedName+"."); - Logger.WARNING("What Failed: Length:"+this.vMaterialInput.size()+" current:"+i); + Logger.INFO("Failed gathering material stack for "+this.localizedName+"."); + Logger.INFO("What Failed: Length:"+this.vMaterialInput.size()+" current:"+i); } try { if (testNull != null){ - //Utils.LOG_WARNING("not null"); + //Utils.LOG_INFO("not null"); temp[i] = this.vMaterialInput.get(i).getValidStack(); } } catch (final Throwable r){ - Logger.WARNING("Failed setting slot "+i+", using "+this.localizedName); + Logger.INFO("Failed setting slot "+i+", using "+this.localizedName); } } return temp; @@ -515,9 +525,9 @@ public class Material { public final long[] getSmallestRatio(final ArrayList<MaterialStack> tempInput){ if (tempInput != null){ if (!tempInput.isEmpty()){ - Logger.WARNING("length: "+tempInput.size()); - Logger.WARNING("(inputs != null): "+(tempInput != null)); - //Utils.LOG_WARNING("length: "+inputs.length); + Logger.INFO("length: "+tempInput.size()); + Logger.INFO("(inputs != null): "+(tempInput != null)); + //Utils.LOG_INFO("length: "+inputs.length); final long[] tempRatio = new long[tempInput.size()]; for (int x=0;x<tempInput.size();x++){ //tempPercentage = tempPercentage+inputs[x].percentageToUse; @@ -534,7 +544,7 @@ public class Material { for (int r=0;r<tempRatio.length;r++){ tempRatioStringThing1 = tempRatioStringThing1 + tempRatio[r] +" : "; } - Logger.WARNING("Default Ratio: "+tempRatioStringThing1); + Logger.INFO("Default Ratio: "+tempRatioStringThing1); String tempRatioStringThing = ""; int tempSmallestCraftingUseSize = 0; @@ -543,7 +553,7 @@ public class Material { tempSmallestCraftingUseSize = (int) (tempSmallestCraftingUseSize + smallestRatio[r]); } //this.smallestStackSizeWhenProcessing = tempSmallestCraftingUseSize; - Logger.WARNING("Smallest Ratio: "+tempRatioStringThing); + Logger.INFO("Smallest Ratio: "+tempRatioStringThing); return smallestRatio; } } @@ -555,7 +565,7 @@ public class Material { if (!aShowQuestionMarks && (this.vChemicalFormula.equals("?")||this.vChemicalFormula.equals("??"))) { return ""; } - Logger.WARNING("===============| Calculating Atomic Formula for "+this.localizedName+" |==============="); + Logger.INFO("===============| Calculating Atomic Formula for "+this.localizedName+" |==============="); if (!chemSymbol.equals("")) { return chemSymbol; } @@ -598,13 +608,13 @@ public class Material { return StringUtils.subscript(dummyFormula); //return dummyFormula; } - Logger.WARNING("dummyFormulaArray <= 0"); + Logger.INFO("dummyFormulaArray <= 0"); } - Logger.WARNING("dummyFormulaArray == null"); + Logger.INFO("dummyFormulaArray == null"); } - Logger.WARNING("tempInput.length <= 0"); + Logger.INFO("tempInput.length <= 0"); } - Logger.WARNING("tempInput == null"); + Logger.INFO("tempInput == null"); return "??"; } @@ -612,37 +622,37 @@ public class Material { public final Fluid generateFluid(){ final Materials isValid = Materials.get(this.getLocalizedName()); - Logger.WARNING("Is "+this.getLocalizedName()+" a Gregtech material? "+(isValid != null && isValid != Materials._NULL)+" | Found "+isValid.mDefaultLocalName); + Logger.INFO("Is "+this.getLocalizedName()+" a Gregtech material? "+(isValid != null && isValid != Materials._NULL)+" | Found "+isValid.mDefaultLocalName); if (isValid != Materials._NULL){ for (Materials m : invalidMaterials.values()){ if (isValid == m){ - Logger.WARNING("Trying to generate a fluid for blacklisted material: "+m.mDefaultLocalName); + Logger.INFO("Trying to generate a fluid for blacklisted material: "+m.mDefaultLocalName); FluidStack a1 = m.getFluid(1); FluidStack a2 = m.getGas(1); FluidStack a3 = m.getMolten(1); FluidStack a4 = m.getSolid(1); FluidStack a5 = m.getPlasma(1); if (a1 != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. Fluid."); + Logger.INFO("Using a pre-defined Fluid from GT. Fluid."); return a1.getFluid(); } if (a2 != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. Gas."); + Logger.INFO("Using a pre-defined Fluid from GT. Gas."); return a2.getFluid(); } if (a3 != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. Molten."); + Logger.INFO("Using a pre-defined Fluid from GT. Molten."); return a3.getFluid(); } if (a4 != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. Solid."); + Logger.INFO("Using a pre-defined Fluid from GT. Solid."); return a4.getFluid(); } if (a5 != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. Plasma."); + Logger.INFO("Using a pre-defined Fluid from GT. Plasma."); return a5.getFluid(); } - Logger.WARNING("Using null."); + Logger.INFO("Using null."); return null; } } @@ -650,44 +660,44 @@ public class Material { if (this.materialState == MaterialState.SOLID){ if (isValid.mFluid != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. mFluid."); + Logger.INFO("Using a pre-defined Fluid from GT. mFluid."); return isValid.mFluid; } else if (isValid.mStandardMoltenFluid != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); + Logger.INFO("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); return isValid.mStandardMoltenFluid; } } else if (this.materialState == MaterialState.GAS){ if (isValid.mGas != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. mGas."); + Logger.INFO("Using a pre-defined Fluid from GT. mGas."); return isValid.mGas; } } else if (this.materialState == MaterialState.LIQUID || this.materialState == MaterialState.PURE_LIQUID){ if (isValid.mFluid != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. mFluid."); + Logger.INFO("Using a pre-defined Fluid from GT. mFluid."); return isValid.mFluid; } else if (isValid.mGas != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. mGas."); + Logger.INFO("Using a pre-defined Fluid from GT. mGas."); return isValid.mGas; } else if (isValid.mStandardMoltenFluid != null){ - Logger.WARNING("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); + Logger.INFO("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); return isValid.mStandardMoltenFluid; } } - Logger.WARNING("Generating our own fluid."); + Logger.INFO("Generating our own fluid."); //Generate a Cell if we need to if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){ if (this.vGenerateCells){ final Item temp = new BaseItemCell(this); - Logger.WARNING("Generated a cell for "+this.getUnlocalizedName()); + Logger.INFO("Generated a cell for "+this.getUnlocalizedName()); } else { - Logger.WARNING("Did not generate a cell for "+this.getUnlocalizedName()); + Logger.INFO("Did not generate a cell for "+this.getUnlocalizedName()); } } @@ -741,11 +751,11 @@ public class Material { } } if (isValid.mPlasma != null){ - Logger.WARNING("Using a pre-defined Plasma from GT."); + Logger.INFO("Using a pre-defined Plasma from GT."); return isValid.mPlasma; } - Logger.WARNING("Generating our own Plasma."); + Logger.INFO("Generating our own Plasma."); return FluidUtils.addGTPlasma(this); } @@ -767,14 +777,14 @@ public class Material { if (part != null){ int incrementor = part.getStackMaterial().getMeltingPointC(); meltingPoint += incrementor; - Logger.WARNING("Melting Point for "+this.getLocalizedName()+" increased to "+ incrementor); + Logger.INFO("Melting Point for "+this.getLocalizedName()+" increased to "+ incrementor); } else { Logger.MATERIALS(this.getLocalizedName()+" has a really invalid composition."); } } int divisor = (this.vMaterialInput.size()>0 ? this.vMaterialInput.size() : 1); - Logger.WARNING("Dividing "+meltingPoint+" / "+divisor+" to get average melting point."); + Logger.INFO("Dividing "+meltingPoint+" / "+divisor+" to get average melting point."); meltingPoint = (meltingPoint/divisor); return meltingPoint; } diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index 727f929036..33bddd3a4f 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -3,13 +3,18 @@ package gtPlusPlus.core.material; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; import gtPlusPlus.core.block.base.BlockBaseModular; +import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.item.base.bolts.BaseItemBolt; import gtPlusPlus.core.item.base.dusts.BaseItemDust; import gtPlusPlus.core.item.base.gears.BaseItemGear; import gtPlusPlus.core.item.base.ingots.BaseItemIngot; import gtPlusPlus.core.item.base.ingots.BaseItemIngotHot; import gtPlusPlus.core.item.base.nugget.BaseItemNugget; +import gtPlusPlus.core.item.base.ore.BaseItemCentrifugedCrushedOre; import gtPlusPlus.core.item.base.ore.BaseItemCrushedOre; +import gtPlusPlus.core.item.base.ore.BaseItemImpureDust; +import gtPlusPlus.core.item.base.ore.BaseItemPurifiedCrushedOre; +import gtPlusPlus.core.item.base.ore.BaseItemPurifiedDust; import gtPlusPlus.core.item.base.plates.BaseItemPlate; import gtPlusPlus.core.item.base.plates.BaseItemPlateDouble; import gtPlusPlus.core.item.base.rings.BaseItemRing; @@ -130,7 +135,9 @@ public class MaterialGenerator { if (sRadiation >= 1){ Item temp; Block tempBlock; - tempBlock = new BlockBaseModular(matInfo ,BlockTypes.ORE, Colour); + //tempBlock = new BlockBaseModular(matInfo ,BlockTypes.ORE, Colour); + tempBlock = new BlockBaseOre(matInfo ,BlockTypes.ORE, Colour); + temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation); temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation); @@ -230,6 +237,50 @@ public class MaterialGenerator { Logger.WARNING(""+matInfo.getLocalizedName()+" failed to generate."); } } + + + public static void generateOreMaterial(final Material matInfo){ + generateOreMaterial(matInfo, true); + } + + @SuppressWarnings("unused") + public static void generateOreMaterial(final Material matInfo, final boolean generatePlates){ + try { + final String unlocalizedName = matInfo.getUnlocalizedName(); + final String materialName = matInfo.getLocalizedName(); + final short[] C = matInfo.getRGBA(); + final int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]); + + int sRadiation = 0; + if (matInfo.vRadiationLevel != 0){ + sRadiation = matInfo.vRadiationLevel; + } + + Item temp; + Block tempBlock; + + tempBlock = new BlockBaseOre(matInfo ,BlockTypes.ORE, Colour); + + temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", matInfo.vTier, sRadiation); + temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", matInfo.vTier, sRadiation); + temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", matInfo.vTier, sRadiation); + temp = new BaseItemCrushedOre(matInfo); + temp = new BaseItemCentrifugedCrushedOre(matInfo); + temp = new BaseItemPurifiedCrushedOre(matInfo); + temp = new BaseItemImpureDust(matInfo); + temp = new BaseItemPurifiedDust(matInfo); + + RecipeGen_Plates.generateRecipes(matInfo); + RecipeGen_Extruder.generateRecipes(matInfo); + RecipeGen_ShapedCrafting.generateRecipes(matInfo); + RecipeGen_Fluids.generateRecipes(matInfo); + RecipeGen_Assembler.generateRecipes(matInfo); + RecipeGen_DustGeneration.generateRecipes(matInfo, true); + new RecipeGen_Recycling(matInfo); + } catch (final Throwable t){ + Logger.WARNING(""+matInfo.getLocalizedName()+" failed to generate."); + } + } } diff --git a/src/Java/gtPlusPlus/core/material/MaterialStack.java b/src/Java/gtPlusPlus/core/material/MaterialStack.java index ad7af2052f..b0d37ac2d4 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialStack.java +++ b/src/Java/gtPlusPlus/core/material/MaterialStack.java @@ -16,6 +16,7 @@ public class MaterialStack { public MaterialStack(final Material inputs, final double partOutOf100){ this.stackMaterial = inputs; + //Logger.INFO("Tried getting MaterialStack for "+inputs.getLocalizedName()); this.vPercentageToUse = partOutOf100; this.vAmount = this.math(partOutOf100); } diff --git a/src/Java/gtPlusPlus/core/material/ORES.java b/src/Java/gtPlusPlus/core/material/ORES.java index 4057092a48..346934060f 100644 --- a/src/Java/gtPlusPlus/core/material/ORES.java +++ b/src/Java/gtPlusPlus/core/material/ORES.java @@ -6,8 +6,12 @@ public final class ORES { public static final Material GEIKIELITE = new Material( "Geikielite", //Material Name - MaterialState.ORE, //State + MaterialState.SOLID, //State new short[]{187, 193, 204, 0}, //Material Colour + 500, + 1500, + 50, + 75, 0, //Radiation new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 1), @@ -17,11 +21,15 @@ public final class ORES { public static final Material ZIMBABWEITE = new Material( "Zimbabweite", //Material Name - MaterialState.ORE, //State + MaterialState.SOLID, //State new short[]{193, 187, 131, 0}, //Material Colour + 500, + 1500, + 50, + 75, 0, //Radiation new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().SODIUM, 2), + new MaterialStack(ELEMENT.getInstance().CALCIUM, 2), new MaterialStack(ELEMENT.getInstance().POTASSIUM, 2), new MaterialStack(ELEMENT.getInstance().LEAD, 1), new MaterialStack(ELEMENT.getInstance().ARSENIC, 4), @@ -33,8 +41,12 @@ public final class ORES { public static final Material TITANITE = new Material( "Titanite", //Material Name - MaterialState.ORE, //State + MaterialState.SOLID, //State new short[]{184, 198, 105, 0}, //Material Colour + 500, + 1500, + 50, + 75, 0, //Radiation new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().CALCIUM, 2), @@ -46,8 +58,12 @@ public final class ORES { public static final Material ZIRCONILITE = new Material( "Zirconolite", //Material Name - MaterialState.ORE, //State + MaterialState.SOLID, //State new short[]{45, 26, 0, 0}, //Material Colour + 500, + 1500, + 50, + 75, 0, //Radiation new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().CALCIUM, 2), @@ -59,8 +75,12 @@ public final class ORES { public static final Material CROCROITE = new Material( "Crocoite", //Material Name - MaterialState.ORE, //State + MaterialState.SOLID, //State new short[]{255, 143, 84, 0}, //Material Colour + 500, + 1500, + 50, + 75, 0, //Radiation new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().LEAD, 1), @@ -70,8 +90,12 @@ public final class ORES { public static final Material NICHROMITE = new Material( "Nichromite", //Material Name - MaterialState.ORE, //State + MaterialState.SOLID, //State new short[]{22, 19, 19, 0}, //Material Colour + 500, + 1500, + 50, + 75, 0, //Radiation new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().NICKEL, 1), |