diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-10-26 15:46:55 +0100 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-10-26 15:46:55 +0100 |
commit | 2cf05c4deaf3a26626853431f725d0ca375ffec3 (patch) | |
tree | 025ae135b88af6b9a0437a3721bcc2dec9ccc3e3 /src/Java/gtPlusPlus/core/item | |
parent | e9dbe58c39b56d562bcdc17b1100a7c26ce7c10e (diff) | |
download | GT5-Unofficial-2cf05c4deaf3a26626853431f725d0ca375ffec3.tar.gz GT5-Unofficial-2cf05c4deaf3a26626853431f725d0ca375ffec3.tar.bz2 GT5-Unofficial-2cf05c4deaf3a26626853431f725d0ca375ffec3.zip |
+ Added 4 new High-Tier Alloys. Lafium, Cinobite, Pikyonite & Abyssal.
+ Added missing Germanium Dust.
+ Added compatibility for Witchery.
- Removed portability of Tanks for GTNH, tanks are still portable otherwise.
$ Fixed calculations for automatic recipe generation, EBF and ABS recipe requirements for GT++ Alloys are now significantly increased.
$ Fixed missing Control Core textures.
% Cleaned up some recipe generation.
% Improved Material.java.
Diffstat (limited to 'src/Java/gtPlusPlus/core/item')
5 files changed, 88 insertions, 153 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index eda11d2a38..5b8e8ab2a1 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -2,6 +2,8 @@ package gtPlusPlus.core.item; import static gtPlusPlus.core.creative.AddToCreativeTab.*; import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT; +import com.ibm.icu.util.RangeValueIterator.Element; + import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.item.*; @@ -368,9 +370,9 @@ public final class ModItems { if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustLanthanum", 1) == null){ ItemUtils.generateSpecialUseDusts("Lanthanum", "Lanthanum", Materials.Lanthanum.mElement.name(), Utils.rgbtoHexValue(106, 127, 163)); } - /*if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGadolinium", 1) == null){ - ItemUtils.generateSpecialUseDusts("Gadolinium", "Gadolinium", "", Utils.rgbtoHexValue(Materials.Gadolinium.mRGBa[0], Materials.Gadolinium.mRGBa[1], Materials.Gadolinium.mRGBa[2])); - }*/ + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGermanium", 1) == null){ + ItemUtils.generateSpecialUseDusts("Germanium", "Germanium", "Ge", ELEMENT.getInstance().GERMANIUM.getRgbAsHex()); + } //Elements generate first so they can be used in compounds. @@ -527,13 +529,20 @@ public final class ModItems { } MaterialGenerator.generate(ALLOY.TRINIUM_TITANIUM); MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH, false); - MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH_CARBON); - + MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH_CARBON); + + //Top Tier Alloys + MaterialGenerator.generate(ALLOY.LAFIUM); + MaterialGenerator.generate(ALLOY.CINOBITE); + MaterialGenerator.generate(ALLOY.PIKYONIUM); + MaterialGenerator.generate(ALLOY.ABYSSAL); + //Must be the final Alloy to Generate MaterialGenerator.generate(ALLOY.QUANTUM); //Ores MaterialGenerator.generateOreMaterial(FLUORIDES.FLUORITE); + MaterialGenerator.generateOreMaterial(ALLOY.KOBOLDITE); GTplusplus_Everglades.GenerateOreMaterials(); diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index 6b4e3d8f4e..2be7b76f6c 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -123,22 +123,21 @@ public class BaseItemDust extends Item{ protected final int sRadiation; @Override public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) { - EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding); + + if (this.dustInfo != null){ + if (entityHolding instanceof EntityPlayer){ + if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){ + EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.dustInfo.vRadiationLevel, world, entityHolding); + } + } + } + } @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - //if (pileType != null && materialName != null && pileType != "" && materialName != "" && !pileType.equals("") && !materialName.equals("")){ - /*if (getUnlocalizedName().contains("DustTiny")){ - list.add(EnumChatFormatting.GRAY+"A tiny pile of " + materialName + " dust."); - } - else if (getUnlocalizedName().contains("DustSmall")){ - list.add(EnumChatFormatting.GRAY+"A small pile of " + materialName + " dust."); - } - else { - list.add(EnumChatFormatting.GRAY+"A pile of " + materialName + " dust."); - }*/ + if (stack.getDisplayName().equalsIgnoreCase("fluorite")){ list.add("Mined from Sandstone and Limestone."); } @@ -167,143 +166,61 @@ public class BaseItemDust extends Item{ } - private void addMacerationRecipe(){ - Logger.WARNING("Adding recipe for "+this.materialName+" Dusts"); - - String tempIngot = this.getUnlocalizedName().replace("item.itemDust", "ingot"); - final String tempDust = this.getUnlocalizedName().replace("item.itemDust", "dust"); - ItemStack tempInputStack; - ItemStack tempOutputStack; + private void addMacerationRecipe(){ - if (this.getUnlocalizedName().contains("DustSmall") || this.getUnlocalizedName().contains("DustTiny")){ - return; - } + Logger.MATERIALS("Adding Maceration recipe for "+this.materialName+" Ingot -> Dusts"); + final int chance = (this.mTier*10)/MathUtils.randInt(10, 20); + GT_ModHandler.addPulverisationRecipe(dustInfo.getIngot(1), dustInfo.getDust(1), null, chance); + + } - Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); - if (this.getUnlocalizedName().contains("item.")){ - tempIngot = this.getUnlocalizedName().replace("item.", ""); - Logger.WARNING("Generating OreDict Name: "+tempIngot); - } - else { - tempIngot = this.getUnlocalizedName(); - } + private void addFurnaceRecipe(){ - tempIngot = tempIngot.replace("itemDust", "ingot"); - Logger.WARNING("Generating OreDict Name: "+tempIngot); - final ItemStack[] outputStacks = {this.dustInfo.getDust(1)}; - if ((tempIngot != null) && !tempIngot.equals("")){ - tempInputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1); - tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempDust, 1); - ItemStack tempStackOutput2 = null; - final int chance = (this.mTier*10)/MathUtils.randInt(10, 20); - if (outputStacks.length != 0){ - if (outputStacks.length == 1){ - tempStackOutput2 = null; - } - else { - if (!outputStacks[1].getUnlocalizedName().toLowerCase().contains("aaa_broken")){ - tempStackOutput2 = outputStacks[1]; - tempOutputStack = outputStacks[0]; - } - else { - tempStackOutput2 = null; - } - } + ItemStack aDust = dustInfo.getDust(1); + ItemStack aOutput; + + if (this.dustInfo.requiresBlastFurnace()) { + aOutput = dustInfo.getHotIngot(1); + if (addBlastFurnaceRecipe(aDust, null, aOutput, null, dustInfo.getMeltingPointK())){ + Logger.MATERIALS("Successfully added a blast furnace recipe for "+this.materialName); } else { - tempStackOutput2 = null; - } - if ((null != tempOutputStack) && (null != tempInputStack)){ - if (ItemUtils.checkForInvalidItems(tempOutputStack) && ItemUtils.checkForInvalidItems(tempStackOutput2) && ItemUtils.checkForInvalidItems(tempInputStack)) { - GT_ModHandler.addPulverisationRecipe(tempInputStack, tempOutputStack.splitStack(1), tempStackOutput2, chance); - } + Logger.MATERIALS("Failed to add a blast furnace recipe for "+this.materialName); } } - } - - private void addFurnaceRecipe(){ - - String temp = ""; - if (this.getUnlocalizedName().contains("item.")){ - temp = this.getUnlocalizedName().replace("item.", ""); - } else { - temp = this.getUnlocalizedName(); - } - if (temp.contains("DustTiny") || temp.contains("DustSmall")){ - return; - } - temp = temp.replace("itemDust", "ingot"); - if ((temp != null) && !temp.equals("")){ - ItemStack mThisStack = ItemUtils.getSimpleStack(this); - if (this.dustInfo.requiresBlastFurnace()){ - Logger.WARNING("Adding recipe for Hot "+this.materialName+" Ingots in a Blast furnace."); - final String tempIngot = temp.replace("ingot", "ingotHot"); - final ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1); - if (null != tempOutputStack && tempOutputStack != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){ - Logger.WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot); - if (ItemUtils.checkForInvalidItems(tempOutputStack) && ItemUtils.checkForInvalidItems(mThisStack)) { - this.addBlastFurnaceRecipe(mThisStack, null, tempOutputStack, null, 350*this.mTier); - } - } - return; + aOutput = dustInfo.getIngot(1); + if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(aDust, aOutput)){ + Logger.MATERIALS("Successfully added a furnace recipe for "+this.materialName); } - Logger.WARNING("Adding recipe for "+this.materialName+" Ingots in a furnace."); - final ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1); - //Utils.LOG_WARNING("This will produce an ingot of "+tempOutputStack.getDisplayName() + " Debug: "+temp); - if (null != tempOutputStack && tempOutputStack != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){ - if ((this.mTier < 5) || !this.dustInfo.requiresBlastFurnace()){ - if (ItemUtils.checkForInvalidItems(tempOutputStack) && ItemUtils.checkForInvalidItems(mThisStack)) { - if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(ItemUtils.getSimpleStack(this), tempOutputStack)){ - Logger.WARNING("Successfully added a furnace recipe for "+this.materialName); - } - else { - Logger.WARNING("Failed to add a furnace recipe for "+this.materialName); - } - } - } - else if ((this.mTier >= 5) || this.dustInfo.requiresBlastFurnace()){ - Logger.WARNING("Adding recipe for "+this.materialName+" Ingots in a Blast furnace."); - Logger.WARNING("This will produce "+tempOutputStack.getDisplayName()); - if (null != tempOutputStack && tempOutputStack != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){ - if (ItemUtils.checkForInvalidItems(tempOutputStack) && ItemUtils.checkForInvalidItems(mThisStack)) { - this.addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*this.mTier); - } - } - return; - } + else { + Logger.MATERIALS("Failed to add a furnace recipe for "+this.materialName); } - } + } - private void addBlastFurnaceRecipe(final ItemStack input1, final ItemStack input2, final ItemStack output1, final ItemStack output2, final int tempRequired){ - //Special Cases - /*if (input1.getUnlocalizedName().toLowerCase().contains("tantalloy61")){ - Utils.LOG_INFO("Adding Special handler for Staballoy-61 in the Blast Furnace"); - input2 = UtilsItems.getItemStackOfAmountFromOreDict("dustTantalloy60", 2); - if (input2 == null){ - Utils.LOG_INFO("invalid itemstack."); - } - else { - Utils.LOG_INFO("Found "+input2.getDisplayName()); - } - }*/ + private boolean addBlastFurnaceRecipe(final ItemStack input1, final ItemStack input2, final ItemStack output1, final ItemStack output2, final int tempRequired){ - int timeTaken = 250*this.mTier*20; + int timeTaken = 125*this.mTier*20; if (this.mTier <= 4){ - timeTaken = 50*this.mTier*20; + timeTaken = 25*this.mTier*20; + } + int aSlot = mTier - 2; + if (aSlot < 2) { + aSlot = 2; } + long aVoltage = GT_Values.V[aSlot >= 2 ? aSlot : 2]; - GT_Values.RA.addBlastRecipe( + return GT_Values.RA.addBlastRecipe( input1, input2, GT_Values.NF, GT_Values.NF, output1, output2, timeTaken, - this.mTier*60, + (int) aVoltage, tempRequired); diff --git a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java index 3da3c18836..eea1aed49f 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java @@ -47,23 +47,37 @@ public class CoalTar { Coal_Gas = FluidUtils.generateFluidNonMolten("CoalGas", "Coal Gas", 500, new short[]{48, 48, 48, 100}, null, null); //Ethanol // v - Dehydrate cells to remove water + + //Create Ethylene - Ethylene = FluidUtils.generateFluidNonMolten("Ethylene", "Ethylene", -103, new short[]{255, 255, 255, 100}, null, null); + if (!FluidUtils.doesFluidExist("Ethylene")){ + Ethylene = FluidUtils.generateFluidNonMolten("Ethylene", "Ethylene", -103, new short[]{255, 255, 255, 100}, null, null); + } + else { + Ethylene = FluidUtils.getWildcardFluidStack("Ethylene", 1).getFluid(); + } + //Create Benzene - (Toluene + Hydrogen | 95% Benzene / 5% methane) - Benzene = FluidUtils.generateFluidNonMolten("Benzene", "Benzene", 81, new short[]{150, 75, 0, 100}, null, null); + if (!FluidUtils.doesFluidExist("NitrousOxide")){ + Benzene = FluidUtils.generateFluidNonMolten("Benzene", "Benzene", 81, new short[]{150, 75, 0, 100}, null, null); + } + else { + Benzene = FluidUtils.getWildcardFluidStack("Benzene", 1).getFluid(); + } + //Create Ethylbenzene - Ethylbenzene is produced in on a large scale by combining benzene and ethylene in an acid-catalyzed chemical reaction //Use Chemical Reactor Ethylbenzene = FluidUtils.generateFluidNonMolten("Ethylbenzene", "Ethylbenzene", 136, new short[]{255, 255, 255, 100}, null, null); //Create Anthracene Anthracene = FluidUtils.generateFluidNonMolten("Anthracene", "Anthracene", 340, new short[]{255, 255, 255, 100}, null, null); - //Toluene - if (FluidUtils.getFluidStack("liquid_toluene", 1) == null){ + //Toluene + if (!FluidUtils.doesFluidExist("Toluene")){ Toluene = FluidUtils.generateFluidNonMolten("Toluene", "Toluene", -95, new short[]{140, 70, 20, 100}, null, null); } else { - Toluene = FluidUtils.getFluidStack("liquid_toluene", 1000).getFluid(); + Toluene = FluidUtils.getWildcardFluidStack("Toluene", 1).getFluid(); Item itemCellToluene = new BaseItemComponent("Toluene", "Toluene", new short[]{140, 70, 20, 100}); - MaterialGenerator.addFluidCannerRecipe(ItemUtils.getEmptyCell(), ItemUtils.getSimpleStack(itemCellToluene), FluidUtils.getFluidStack("liquid_toluene", 1000), null); + MaterialGenerator.addFluidCannerRecipe(ItemUtils.getEmptyCell(), ItemUtils.getSimpleStack(itemCellToluene), FluidUtils.getFluidStack(Toluene, 1000), null); } //Create Coal Tar diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java index 7b5a90a64e..9bd8a521ab 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -67,16 +67,11 @@ public class RocketFuels { Nitrous_Oxide = FluidUtils.generateFluidNonMolten("NitrousOxide", "Nitrous Oxide", -91, new short[]{255, 255, 255, 100}, null, null); //Nos - if (FluidUtils.getFluidStack("NitrousOxide", 1) == null && FluidUtils.getFluidStack("nitrousoxide", 1) == null){ + if (!FluidUtils.doesFluidExist("NitrousOxide")){ Nitrous_Oxide = FluidUtils.generateFluidNoPrefix("NitrousOxide", "Nitrous Oxide", -91, new short[]{255, 255, 255, 100}); } else { - if (FluidUtils.getFluidStack("NitrousOxide", 1) != null ) { - Nitrous_Oxide = FluidUtils.getFluidStack("NitrousOxide", 1).getFluid(); - } - else { - Nitrous_Oxide = FluidUtils.getFluidStack("nitrousoxide", 1).getFluid(); - } + Nitrous_Oxide = FluidUtils.getWildcardFluidStack("NitrousOxide", 1).getFluid(); if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellNitrousOxide", 1) == null){ new BaseItemComponent("NitrousOxide", "Nitrous Oxide", new short[] {10, 10, 175}); } diff --git a/src/Java/gtPlusPlus/core/item/general/ItemControlCore.java b/src/Java/gtPlusPlus/core/item/general/ItemControlCore.java index d8ec8944e9..8ad87c0ea8 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemControlCore.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemControlCore.java @@ -10,7 +10,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; public class ItemControlCore extends Item { @@ -29,16 +28,16 @@ public class ItemControlCore extends Item { @Override public void registerIcons(IIconRegister reg) { - this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "controlcore/core_0"); - this.icons[1] = reg.registerIcon(CORE.MODID + ":" + "controlcore/core_1"); - this.icons[2] = reg.registerIcon(CORE.MODID + ":" + "controlcore/core_2"); - this.icons[3] = reg.registerIcon(CORE.MODID + ":" + "controlcore/core_3"); - this.icons[4] = reg.registerIcon(CORE.MODID + ":" + "controlcore/core_4"); - this.icons[5] = reg.registerIcon(CORE.MODID + ":" + "controlcore/core_5"); - this.icons[6] = reg.registerIcon(CORE.MODID + ":" + "controlcore/core_6"); - this.icons[7] = reg.registerIcon(CORE.MODID + ":" + "controlcore/core_7"); - this.icons[8] = reg.registerIcon(CORE.MODID + ":" + "controlcore/core_8"); - this.icons[9] = reg.registerIcon(CORE.MODID + ":" + "controlcore/core_9"); + this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_0"); + this.icons[1] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_1"); + this.icons[2] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_2"); + this.icons[3] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_3"); + this.icons[4] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_4"); + this.icons[5] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_5"); + this.icons[6] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_6"); + this.icons[7] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_7"); + this.icons[8] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_8"); + this.icons[9] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_9"); } @Override @@ -46,6 +45,7 @@ public class ItemControlCore extends Item { return this.icons[meta]; } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void getSubItems(Item item, CreativeTabs tab, List list) { for (int i = 0; i < 10; i ++) { |