From 75d5897f4db4e97feca4fe4d978cc5823cbbb150 Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Sat, 12 May 2018 17:00:15 +1000 Subject: % Initial Commit --- src/Java/gtPlusPlus/core/commands/CommandMath.java | 13 +-- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 1 - .../general/rfchargingpack/ChargingPackBase.java | 84 ++++++++++++++++ src/Java/gtPlusPlus/core/material/Material.java | 110 ++++++++++----------- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 36 ++++++- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 48 +++++++-- src/Java/gtPlusPlus/core/recipe/common/CI.java | 1 - .../core/util/minecraft/MaterialUtils.java | 32 +++--- 8 files changed, 234 insertions(+), 91 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/item/general/rfchargingpack/ChargingPackBase.java (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/commands/CommandMath.java b/src/Java/gtPlusPlus/core/commands/CommandMath.java index 6ab0b2cbc6..9c51aa7a9b 100644 --- a/src/Java/gtPlusPlus/core/commands/CommandMath.java +++ b/src/Java/gtPlusPlus/core/commands/CommandMath.java @@ -56,7 +56,7 @@ public class CommandMath implements ICommand final World W = S.getEntityWorld(); final EntityPlayer P = CommandUtils.getPlayer(S); if (!W.isRemote && P != null){ - if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1")) { + if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1")) { String[] prefixes = new String[] { "ingot", "plate", @@ -83,8 +83,8 @@ public class CommandMath implements ICommand "Silver", "Lead", "Aluminium" - }; - AutoMap itemEntities = new AutoMap(); + }; + AutoMap itemEntities = new AutoMap(); for (String g : prefixes) { for (String s : loots) { itemEntities.put(new EntityItem(W, P.posX, P.posY, P.posZ, ItemUtils.getItemStackOfAmountFromOreDictNoBroken(g+s, 64))); @@ -92,7 +92,7 @@ public class CommandMath implements ICommand for (EntityItem e : itemEntities.values()) { e.lifespan = 30000; } - + } } @@ -195,7 +195,7 @@ public class CommandMath implements ICommand public boolean canCommandSenderUseCommand(final ICommandSender var1){ final EntityPlayer P = CommandUtils.getPlayer(var1); if (P == null){ - return false; + return false; } if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1")) { return true; @@ -220,4 +220,5 @@ public class CommandMath implements ICommand return true; } -} \ No newline at end of file +} + diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index d34e1a1856..2c09ba1f03 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -58,7 +58,6 @@ public class COMPAT_HANDLER { new RECIPES_LaserEngraver(); new RECIPES_Extruder(); - GregtechGeneratorsULV.run(); GregtechEnergyBuffer.run(); GregtechLFTR.run(); GregtechSteamCondenser.run(); diff --git a/src/Java/gtPlusPlus/core/item/general/rfchargingpack/ChargingPackBase.java b/src/Java/gtPlusPlus/core/item/general/rfchargingpack/ChargingPackBase.java new file mode 100644 index 0000000000..d4d3a07e6f --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/general/rfchargingpack/ChargingPackBase.java @@ -0,0 +1,84 @@ +package gtPlusPlus.core.item.general.rfchargingpack; + +import java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +import cofh.energy.ItemEnergyContainer; +import gtPlusPlus.core.util.math.MathUtils; + +public class ChargingPackBase extends ItemEnergyContainer { + + protected final int mCapacityMax; + protected final byte mTier; + + public ChargingPackBase(byte tier) { + this(tier, (tier == 1 ? 4000000 : tier == 2 ? 8000000 : tier == 3 ? 16000000 : tier == 4 ? 32000000 : 64000000)); + } + + private ChargingPackBase(byte tier, int maxStorage) { + super(maxStorage); + mTier = tier; + mCapacityMax = maxStorage; + } + + public int getMaxEnergyInput(ItemStack container) + { + return this.maxReceive; + } + + public int getMaxEnergyExtracted(ItemStack container) + { + return this.maxExtract; + } + + @Override + public void onUpdate(ItemStack aStack, World aWorld, Entity aEnt, int p_77663_4_, boolean p_77663_5_) { + super.onUpdate(aStack, aWorld, aEnt, p_77663_4_, p_77663_5_); + + ItemEnergyContainer current = this; + int currentStored = 0; + if (current != null) { + currentStored = current.getEnergyStored(aStack); + } + if (currentStored > 0) { + if (aEnt instanceof EntityPlayer) { + if (((EntityPlayer) aEnt).inventory != null) { + for (ItemStack invStack : ((EntityPlayer) aEnt).inventory.mainInventory) { + if (invStack != null) { + if (invStack.getItem() instanceof ItemEnergyContainer) { + if (current != null) { + currentStored = current.getEnergyStored(aStack); + if (currentStored > 0) { + int mTransLimit; + int mMaxStorage; + int mCurrent; + mTransLimit = getMaxEnergyInput(invStack); + mMaxStorage = current.getMaxEnergyStored(invStack); + mCurrent = current.getEnergyStored(invStack); + if (mCurrent+mTransLimit <= mMaxStorage) { + current.extractEnergy(aStack, current.receiveEnergy(invStack, mTransLimit, false), false); + } + } + } + } + } + } + } + } + } + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List list, boolean p_77624_4_) { + list.add(EnumChatFormatting.RED+"RF Information"); + list.add(EnumChatFormatting.GRAY+"Extraction Rate: [" +EnumChatFormatting.RED+ this.maxExtract + EnumChatFormatting.GRAY + "Rf/t]" + " Insert Rate: [" +EnumChatFormatting.RED+ this.maxReceive+EnumChatFormatting.GRAY+"Rf/t]"); + list.add(EnumChatFormatting.GRAY+"Current Charge: ["+EnumChatFormatting.RED+this.getEnergyStored(stack) + EnumChatFormatting.GRAY + "Rf / " + this.getMaxEnergyStored(stack)+"Rf] "+EnumChatFormatting.RED+MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack))+EnumChatFormatting.GRAY+"%"); + super.addInformation(stack, p_77624_2_, list, p_77624_4_); + } + +} diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 1b2ef19b53..fe8b638d5b 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -76,7 +76,7 @@ public class Material { public Material(String materialName, MaterialState defaultState, short[] rgba, int radiationLevel, MaterialStack[] materialStacks) { this(materialName, defaultState, null, 0, rgba, -1, -1, -1, -1, false, "", radiationLevel, false, materialStacks); - } + } public Material(String materialName, MaterialState defaultState, short[] rgba, int j, int k, int l, int m, int radiationLevel, MaterialStack[] materialStacks){ this(materialName, defaultState, null, 0, rgba, j, k, l, m, false, "", radiationLevel, false, materialStacks); @@ -104,7 +104,7 @@ public class Material { 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 String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){ this(materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, inputs); - } + } 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 String chemicalSymbol, final int radiationLevel, boolean addCells,final MaterialStack... inputs) { this (materialName, defaultState, null, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, addCells, true, inputs); @@ -113,7 +113,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, final MaterialStack... inputs){ this (materialName, defaultState, null, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs); } - + public Material(final String materialName, final MaterialState defaultState, final TextureSet set, 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){ this (materialName, defaultState, null, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs); } @@ -289,33 +289,33 @@ public class Material { this.vChemicalFormula = "??"; } - if (generateFluid){ - final Materials isValid = Materials.get(this.getLocalizedName()); - if (FluidUtils.getFluidStack(localizedName, 1) != null){ - this.vMoltenFluid = FluidUtils.getFluidStack(localizedName, 1).getFluid(); + if (generateFluid){ + final Materials isValid = Materials.get(this.getLocalizedName()); + if (FluidUtils.getFluidStack(localizedName, 1) != null){ + this.vMoltenFluid = FluidUtils.getFluidStack(localizedName, 1).getFluid(); + } + else if (isValid == null || isValid == Materials._NULL){ + this.vMoltenFluid = this.generateFluid(); + } + else { + if (isValid.mFluid != null){ + this.vMoltenFluid = isValid.mFluid; } - else if (isValid == null || isValid == Materials._NULL){ - this.vMoltenFluid = this.generateFluid(); + else if (isValid.mGas != null){ + this.vMoltenFluid = isValid.mGas; } else { - if (isValid.mFluid != null){ - this.vMoltenFluid = isValid.mFluid; - } - else if (isValid.mGas != null){ - this.vMoltenFluid = isValid.mGas; - } - else { - this.vMoltenFluid = this.generateFluid(); - } + this.vMoltenFluid = this.generateFluid(); } - - this.vPlasma = this.generatePlasma(); - } - else { - this.vMoltenFluid = null; - this.vPlasma = null; } + this.vPlasma = this.generatePlasma(); + } + else { + this.vMoltenFluid = null; + this.vPlasma = null; + } + String ratio = ""; if (this.vSmallestRatio != null) { for (int hu=0;hu sets = new AutoMap(); - if (this.vMaterialInput != null) { + if (this.vMaterialInput != null) { for (MaterialStack r : this.vMaterialInput) { if (r.getStackMaterial().getTextureSet().mSetName.toLowerCase().contains("fluid")) { sets.put(ELEMENT.getInstance().GOLD); @@ -362,16 +362,16 @@ public class Material { else { sets.put(r.getStackMaterial()); } - } - TextureSet mostUsedTypeTextureSet = (TextureSet) MaterialUtils.getMostCommonTextureSet(new ArrayList(sets.values())); + } + TextureSet mostUsedTypeTextureSet = (TextureSet) MaterialUtils.getMostCommonTextureSet(new ArrayList(sets.values())); if (mostUsedTypeTextureSet != null && mostUsedTypeTextureSet instanceof TextureSet) { Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+mostUsedTypeTextureSet.mSetName+"."); return mostUsedTypeTextureSet; - } + } } } Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+Materials.Iron.mIconSet.mSetName+". [Fallback]"); - return Materials.Iron.mIconSet; + return Materials.Iron.mIconSet; } public final String getLocalizedName(){ @@ -402,7 +402,7 @@ public class Material { final public short[] getRGBA(){ if (this.RGBA != null) { if (this.RGBA.length == 4){ - return this.RGBA; + return this.RGBA; } else { return new short[]{this.RGBA[0], this.RGBA[1], this.RGBA[2], 0}; @@ -570,17 +570,17 @@ public class Material { } public final ItemStack getCrushedCentrifuged(final int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("crushedCentrifuged"+this.unlocalizedName, stacksize); - } + } public final ItemStack getDustPurified(final int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustPure"+this.unlocalizedName, stacksize); } public final ItemStack getDustImpure(final int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustImpure"+this.unlocalizedName, stacksize); - } + } public final boolean hasSolidForm() { if (this.getDust(1) != null || this.getBlock(1) != null || this.getSmallDust(1) != null || this.getTinyDust(1) != null) { return true; - } + } return false; } @@ -605,7 +605,7 @@ public class Material { Logger.INFO("Failed setting slot "+i+", using "+this.localizedName); } } - return temp; + return temp; } return new ItemStack[]{}; } @@ -781,8 +781,8 @@ public class Material { if (a5 != null){ Logger.INFO("Using a pre-defined Fluid from GT. Plasma."); return a5.getFluid(); - } - Logger.INFO("Using null."); + } + Logger.INFO("Using null."); return null; } } @@ -791,37 +791,37 @@ public class Material { if (this.materialState == MaterialState.SOLID){ if (isValid.mFluid != null){ Logger.INFO("Using a pre-defined Fluid from GT. mFluid."); - return isValid.mFluid; - } + return isValid.mFluid; + } else if (isValid.mStandardMoltenFluid != null){ Logger.INFO("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); - return isValid.mStandardMoltenFluid; + return isValid.mStandardMoltenFluid; } } else if (this.materialState == MaterialState.GAS){ if (isValid.mGas != null){ Logger.INFO("Using a pre-defined Fluid from GT. mGas."); - return isValid.mGas; - } + return isValid.mGas; + } } else if (this.materialState == MaterialState.LIQUID || this.materialState == MaterialState.PURE_LIQUID){ if (isValid.mFluid != null){ Logger.INFO("Using a pre-defined Fluid from GT. mFluid."); - return isValid.mFluid; - } + return isValid.mFluid; + } else if (isValid.mGas != null){ Logger.INFO("Using a pre-defined Fluid from GT. mGas."); - return isValid.mGas; + return isValid.mGas; } else if (isValid.mStandardMoltenFluid != null){ Logger.INFO("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); - return isValid.mStandardMoltenFluid; + return isValid.mStandardMoltenFluid; } - } + } Logger.INFO("Generating our own fluid."); //Generate a Cell if we need to - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){ + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){ if (this.vGenerateCells){ new BaseItemCell(this); Logger.INFO("Generated a cell for "+this.getUnlocalizedName()); @@ -873,7 +873,7 @@ public class Material { if (this.materialState == MaterialState.ORE){ return null; } - final Materials isValid = Materials.get(this.getLocalizedName()); + final Materials isValid = Materials.get(this.getLocalizedName()); if (!this.vGenerateCells){ return null; @@ -885,8 +885,8 @@ public class Material { } if (isValid.mPlasma != null){ Logger.INFO("Using a pre-defined Plasma from GT."); - return isValid.mPlasma; - } + return isValid.mPlasma; + } Logger.INFO("Generating our own Plasma."); return FluidUtils.addGTPlasma(this); @@ -894,10 +894,10 @@ public class Material { - final public FluidStack getFluid(final int fluidAmount) { + final public FluidStack getFluid(final int fluidAmount) { if (this.vMoltenFluid == null){ return null; - } + } final FluidStack moltenFluid = new FluidStack(this.vMoltenFluid, fluidAmount); return moltenFluid; } @@ -987,4 +987,4 @@ public class Material { } } -} \ No newline at end of file +} diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index ba7e3246e6..bc3e67623d 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -961,11 +961,41 @@ public class RECIPES_GREGTECH { FluidUtils.getFluidStack("molten.tantalum", 144 * 4), ItemUtils.simpleMetaStack(ModItems.itemHalfCompleteCasings, 1, 8), 32, 120); addAR(ItemUtils.simpleMetaStack(ModItems.itemHalfCompleteCasings, 1, 1), - ItemUtils.getItemStackOfAmountFromOreDict("plateLead", 4), FluidUtils.getFluidStack("nitrogen", 1000), + ItemUtils.getItemStackOfAmountFromOreDict("plateLead", 4), FluidUtils.getFluidStack("oxygen", 1000), ItemUtils.getSimpleStack(GregtechItemList.Casing_Vanadium_Redox.get(1), 1), 64, 240); - addAR(ItemUtils.getItemStackOfAmountFromOreDict("plateIncoloy020", 16), + + //Tier 2-6 + ItemStack T1 = GregtechItemList.Casing_Vanadium_Redox.get(1); + ItemStack T2 = GregtechItemList.Casing_Vanadium_Redox_IV.get(1); + ItemStack T3 = GregtechItemList.Casing_Vanadium_Redox_LuV.get(1); + ItemStack T4 = GregtechItemList.Casing_Vanadium_Redox_ZPM.get(1); + ItemStack T5 = GregtechItemList.Casing_Vanadium_Redox_UV.get(1); + ItemStack T6 = GregtechItemList.Casing_Vanadium_Redox_MAX.get(1); + + addAR(T1, + ItemUtils.getItemStackOfAmountFromOreDict("plateStainlessSteel", 4), + FluidUtils.getFluidStack("nitrogen", 2000), + T2, 128, 2000); + addAR(T2, + ItemUtils.getItemStackOfAmountFromOreDict("plateTitanium", 4), + FluidUtils.getFluidStack("helium", 2000), + T3, 256, 8000); + addAR(T3, + ItemUtils.getItemStackOfAmountFromOreDict("plateTungsten", 4), + FluidUtils.getFluidStack("argon", 4000), + T4, 512, 32000); + addAR(T4, + ItemUtils.getItemStackOfAmountFromOreDict("plateTungstenSteel", 4), + FluidUtils.getFluidStack("radon", 4000), + T5, 1024, 128000); + addAR(T5, + ItemUtils.getItemStackOfAmountFromOreDict("plateIridium", 4), + FluidUtils.getFluidStack("krypton", 500), + T6, 2048, 512000); + + /*addAR(ItemUtils.getItemStackOfAmountFromOreDict("plateIncoloy020", 16), ItemUtils.getItemStackOfAmountFromOreDict("frameGtIncoloyMA956", 4), null, - GregtechItemList.Casing_Power_SubStation.get(4), 80, 120); + GregtechItemList.Casing_Power_SubStation.get(4), 80, 120);*/ } private static boolean addAR(final ItemStack inputA, final ItemStack inputB, final ItemStack outputA, diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 34653bf772..55b7793f93 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -141,7 +141,7 @@ public class RECIPES_Machines { public static String pipeTier10 = "pipeHuge"+"HastelloyX"; public static String pipeTier11 = "pipeHuge"+"Europium"; - //IV MACHINES + // EV/IV MACHINES public static ItemStack EV_MACHINE_Electrolyzer; public static ItemStack EV_MACHINE_Centrifuge; public static ItemStack EV_MACHINE_BendingMachine; @@ -151,6 +151,10 @@ public class RECIPES_Machines { public static ItemStack EV_MACHINE_Cutter; public static ItemStack EV_MACHINE_MassFabricator; public static ItemStack EV_MACHINE_Extruder; + public static ItemStack EV_MACHINE_Sifter; + public static ItemStack EV_MACHINE_ThermalCentrifuge; + public static ItemStack EV_MACHINE_OreWasher; + public static ItemStack EV_MACHINE_AlloySmelter; //Cables @@ -215,6 +219,8 @@ public class RECIPES_Machines { boiler_Coal = ItemList.Machine_Bronze_Boiler.get(1); //IV MACHINES + + if (!CORE.GTNH){ EV_MACHINE_Electrolyzer = ItemList.Machine_EV_Electrolyzer.get(1); EV_MACHINE_BendingMachine= ItemList.Machine_EV_Bender.get(1); EV_MACHINE_Wiremill= ItemList.Machine_EV_Wiremill.get(1); @@ -224,6 +230,28 @@ public class RECIPES_Machines { EV_MACHINE_Centrifuge= ItemList.Machine_EV_Centrifuge.get(1); EV_MACHINE_Cutter = ItemList.Machine_EV_Cutter.get(1); EV_MACHINE_Extruder = ItemList.Machine_EV_Extruder.get(1); + EV_MACHINE_Sifter = ItemList.Machine_EV_Sifter.get(1); + EV_MACHINE_ThermalCentrifuge = ItemList.Machine_EV_ThermalCentrifuge.get(1); + EV_MACHINE_OreWasher = ItemList.Machine_EV_OreWasher.get(1); + EV_MACHINE_AlloySmelter = ItemList.Machine_EV_AlloySmelter.get(1); + } + //Balance or some shit + else { + EV_MACHINE_Electrolyzer = ItemList.Machine_IV_Electrolyzer.get(1); + EV_MACHINE_BendingMachine= ItemList.Machine_IV_Bender.get(1); + EV_MACHINE_Wiremill= ItemList.Machine_IV_Wiremill.get(1); + HV_MACHINE_Macerator= ItemList.Machine_EV_Macerator.get(1); + EV_MACHINE_Macerator= ItemList.Machine_IV_Macerator.get(1); + EV_MACHINE_MassFabricator= ItemList.Machine_LuV_Massfab.get(1); + EV_MACHINE_Centrifuge= ItemList.Machine_IV_Centrifuge.get(1); + EV_MACHINE_Cutter = ItemList.Machine_IV_Cutter.get(1); + EV_MACHINE_Extruder = ItemList.Machine_IV_Extruder.get(1); + EV_MACHINE_Sifter = ItemList.Machine_IV_Sifter.get(1); + EV_MACHINE_ThermalCentrifuge = ItemList.Machine_IV_ThermalCentrifuge.get(1); + EV_MACHINE_OreWasher = ItemList.Machine_IV_OreWasher.get(1); + EV_MACHINE_AlloySmelter = ItemList.Machine_IV_AlloySmelter.get(1); + } + } @@ -277,7 +305,7 @@ public class RECIPES_Machines { //Buffer Core RecipeUtils.addShapedGregtechRecipe( CI.component_Plate[1], cableTier1, CI.component_Plate[1], - CI.circuitPrimitive, IC2MFE, CI.circuitPrimitive, + CI.circuitPrimitive, "plateStaballloy", CI.circuitPrimitive, CI.component_Plate[1], cableTier1, CI.component_Plate[1], RECIPE_BufferCore_ULV); RecipeUtils.addShapedGregtechRecipe( @@ -701,7 +729,7 @@ public class RECIPES_Machines { //Blast Smelter RecipeUtils.addShapedGregtechRecipe( "plateZirconiumCarbide", CI.circuitTier4, "plateZirconiumCarbide", - cableTier4, CI.machineCasing_EV, cableTier4, + cableTier4, EV_MACHINE_AlloySmelter, cableTier4, "plateZirconiumCarbide", CI.circuitTier3, "plateZirconiumCarbide", RECIPE_IndustrialBlastSmelterController); //Blast Smelter Frame Casing @@ -753,7 +781,7 @@ public class RECIPES_Machines { //Industrial Sieve RecipeUtils.addShapedGregtechRecipe( "plateEglinSteel", CI.circuitTier2, "plateEglinSteel", - cableTier3, CI.machineCasing_MV, cableTier3, + cableTier3, EV_MACHINE_Sifter, cableTier3, "plateEglinSteel", CI.circuitTier2, "plateEglinSteel", RECIPE_IndustrialSieveController); //Industrial Sieve Casing @@ -1061,15 +1089,15 @@ public class RECIPES_Machines { if (CORE.ConfigSwitches.enableMultiblock_PowerSubstation){ RecipeUtils.recipeBuilder( - null, "plateIncoloy020", null, + "screwTitanium", "plateIncoloy020", "screwTitanium", "plateIncoloy020", "frameGtIncoloyMA956", "plateIncoloy020", - null, "plateIncoloy020", null, + "screwTitanium", "plateIncoloy020", "screwTitanium", GregtechItemList.Casing_Power_SubStation.get(Casing_Amount)); - ItemStack mBattery = (!CORE.GTNH ? ItemList.Energy_LapotronicOrb2.get(1) : ItemList.ZPM2.get(1)); + ItemStack mBattery = ItemUtils.getSimpleStack(ModItems.itemCircuitLFTR); RecipeUtils.recipeBuilder( - "plateIncoloyMA956", GregtechItemList.Battery_RE_EV_Lithium.get(1), "plateIncoloyMA956", + "plateIncoloyMA956", mBattery, "plateIncoloyMA956", GregtechItemList.Casing_Power_SubStation.get(1), GregtechItemList.Casing_Vanadium_Redox.get(1), GregtechItemList.Casing_Power_SubStation.get(1), "plateIncoloy020", "plateIncoloyMA956", "plateIncoloy020", GregtechItemList.PowerSubStation.get(1)); @@ -1084,7 +1112,7 @@ public class RECIPES_Machines { RecipeUtils.recipeBuilder( "plateRedSteel","circuitData","plateRedSteel", - "stickTalonite",GregtechItemList.Casing_ThermalCentrifuge.get(1),"stickTalonite", + "stickTalonite",EV_MACHINE_ThermalCentrifuge,"stickTalonite", "plateRedSteel","gearGtTalonite","plateRedSteel", GregtechItemList.Industrial_ThermalCentrifuge.get(1)); } @@ -1098,7 +1126,7 @@ public class RECIPES_Machines { RecipeUtils.recipeBuilder( "plateGrisium",CI.electricPump_MV,"plateGrisium", - "plateTalonite",GregtechItemList.Casing_WashPlant.get(1),"plateTalonite", + "plateTalonite",EV_MACHINE_OreWasher,"plateTalonite", "plateGrisium","circuitData","plateGrisium", GregtechItemList.Industrial_WashPlant.get(1)); } diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java index c6dd1bfeb5..44db9cf284 100644 --- a/src/Java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java @@ -1,6 +1,5 @@ package gtPlusPlus.core.recipe.common; -import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java index 98b02078c6..e9d68ea864 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java @@ -27,11 +27,11 @@ public class MaterialUtils { @SuppressWarnings({ "rawtypes", "unused" }) private static Class[][] commonTypes = - {{Materials.class, int.class, TextureSet.class, float.class, int.class, - int.class, int.class, int.class, int.class, int.class, int.class, - String.class, int.class, int.class, int.class, int.class, boolean.class, - boolean.class, int.class, int.class, int.class, Dyes.class, int.class, - List.class , List.class}}; +{{Materials.class, int.class, TextureSet.class, float.class, int.class, + int.class, int.class, int.class, int.class, int.class, int.class, + String.class, int.class, int.class, int.class, int.class, boolean.class, + boolean.class, int.class, int.class, int.class, Dyes.class, int.class, + List.class , List.class}}; public static List oreDictValuesForEntry(final String oredictName){ List oredictItemNames; @@ -47,7 +47,7 @@ public class MaterialUtils { public static Material generateMaterialFromGtENUM(final Materials material){ return generateMaterialFromGtENUM(material, null); } - + public static Material generateMaterialFromGtENUM(final Materials material, short[] customRGB){ @SuppressWarnings("deprecation") String name = material.name(); @@ -68,12 +68,12 @@ public class MaterialUtils { if (material.isRadioactive()){ radioactivity = 1; } - + //Weird Blacklist of Bad Chemical Strings if (material.mElement == Element.Pb || material.mElement == Element.Na || material.mElement == Element.Ar){ chemicalFormula = StringUtils.subscript(Utils.sanitizeString(material.mElement.name())); } - + //Determine default state Logger.MATERIALS("[Debug] Setting State of GT generated material. "+material.mDefaultLocalName); if (material.getMolten(1) != null || material.getSolid(1) != null){ @@ -140,10 +140,10 @@ public class MaterialUtils { return temp; } - public static boolean hasValidRGBA(final short[] rgba){ + public static boolean hasValidRGBA(final short[] rgba){ if (rgba == null || rgba.length < 3 || rgba.length > 4){ return false; - } + } return true; } @@ -184,9 +184,9 @@ public class MaterialUtils { } public static Materials getMaterialByName(String materialName) { - + if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - return (Materials) EnumUtils.getValue(gregtech.api.enums.Materials.class, materialName, false); + return (Materials) EnumUtils.getValue(gregtech.api.enums.Materials.class, materialName, false); } else { for (Materials m : Materials.values()) { @@ -197,7 +197,7 @@ public class MaterialUtils { return null; } } - + @SuppressWarnings("deprecation") public static String getMaterialName(Materials mat){ String mName; @@ -212,12 +212,14 @@ public class MaterialUtils { } return mName; } - + public static TextureSet getMostCommonTextureSet(List list) { Optional r = list.stream().map(Material::getTextureSet).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey); TextureSet o = (r != null && r.isPresent() && r.get() != null) ? r.get() : null; return o; + } + + } -} \ No newline at end of file -- cgit From 54f1060e09e2210e345b082421f9e83df9dcfbc0 Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Sat, 12 May 2018 17:04:41 +1000 Subject: % More --- src/Java/gtPlusPlus/core/recipe/common/CI.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java index 44db9cf284..1f06c5befb 100644 --- a/src/Java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java @@ -18,6 +18,7 @@ import gtPlusPlus.core.recipe.LOADER_Machine_Components; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems; import ic2.core.Ic2Items; public class CI { -- cgit From d875764bcc49df6208f43a88147c4fdb563adba9 Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Sat, 12 May 2018 17:27:07 +1000 Subject: % Whitespace Fixes. $ Backported Changes from master branch. --- src/Java/gtPlusPlus/core/commands/CommandMath.java | 13 ++- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 1 + src/Java/gtPlusPlus/core/material/Material.java | 110 ++++++++++----------- .../core/util/minecraft/MaterialUtils.java | 32 +++--- 4 files changed, 77 insertions(+), 79 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/commands/CommandMath.java b/src/Java/gtPlusPlus/core/commands/CommandMath.java index 9c51aa7a9b..6ab0b2cbc6 100644 --- a/src/Java/gtPlusPlus/core/commands/CommandMath.java +++ b/src/Java/gtPlusPlus/core/commands/CommandMath.java @@ -56,7 +56,7 @@ public class CommandMath implements ICommand final World W = S.getEntityWorld(); final EntityPlayer P = CommandUtils.getPlayer(S); if (!W.isRemote && P != null){ - if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1")) { + if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1")) { String[] prefixes = new String[] { "ingot", "plate", @@ -83,8 +83,8 @@ public class CommandMath implements ICommand "Silver", "Lead", "Aluminium" - }; - AutoMap itemEntities = new AutoMap(); + }; + AutoMap itemEntities = new AutoMap(); for (String g : prefixes) { for (String s : loots) { itemEntities.put(new EntityItem(W, P.posX, P.posY, P.posZ, ItemUtils.getItemStackOfAmountFromOreDictNoBroken(g+s, 64))); @@ -92,7 +92,7 @@ public class CommandMath implements ICommand for (EntityItem e : itemEntities.values()) { e.lifespan = 30000; } - + } } @@ -195,7 +195,7 @@ public class CommandMath implements ICommand public boolean canCommandSenderUseCommand(final ICommandSender var1){ final EntityPlayer P = CommandUtils.getPlayer(var1); if (P == null){ - return false; + return false; } if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1")) { return true; @@ -220,5 +220,4 @@ public class CommandMath implements ICommand return true; } -} - +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 2c09ba1f03..d34e1a1856 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -58,6 +58,7 @@ public class COMPAT_HANDLER { new RECIPES_LaserEngraver(); new RECIPES_Extruder(); + GregtechGeneratorsULV.run(); GregtechEnergyBuffer.run(); GregtechLFTR.run(); GregtechSteamCondenser.run(); diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index fe8b638d5b..1b2ef19b53 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -76,7 +76,7 @@ public class Material { public Material(String materialName, MaterialState defaultState, short[] rgba, int radiationLevel, MaterialStack[] materialStacks) { this(materialName, defaultState, null, 0, rgba, -1, -1, -1, -1, false, "", radiationLevel, false, materialStacks); - } + } public Material(String materialName, MaterialState defaultState, short[] rgba, int j, int k, int l, int m, int radiationLevel, MaterialStack[] materialStacks){ this(materialName, defaultState, null, 0, rgba, j, k, l, m, false, "", radiationLevel, false, materialStacks); @@ -104,7 +104,7 @@ public class Material { 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 String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){ this(materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, inputs); - } + } 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 String chemicalSymbol, final int radiationLevel, boolean addCells,final MaterialStack... inputs) { this (materialName, defaultState, null, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, addCells, true, inputs); @@ -113,7 +113,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, final MaterialStack... inputs){ this (materialName, defaultState, null, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs); } - + public Material(final String materialName, final MaterialState defaultState, final TextureSet set, 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){ this (materialName, defaultState, null, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs); } @@ -289,32 +289,32 @@ public class Material { this.vChemicalFormula = "??"; } - if (generateFluid){ - final Materials isValid = Materials.get(this.getLocalizedName()); - if (FluidUtils.getFluidStack(localizedName, 1) != null){ - this.vMoltenFluid = FluidUtils.getFluidStack(localizedName, 1).getFluid(); - } - else if (isValid == null || isValid == Materials._NULL){ - this.vMoltenFluid = this.generateFluid(); - } - else { - if (isValid.mFluid != null){ - this.vMoltenFluid = isValid.mFluid; + if (generateFluid){ + final Materials isValid = Materials.get(this.getLocalizedName()); + if (FluidUtils.getFluidStack(localizedName, 1) != null){ + this.vMoltenFluid = FluidUtils.getFluidStack(localizedName, 1).getFluid(); } - else if (isValid.mGas != null){ - this.vMoltenFluid = isValid.mGas; + else if (isValid == null || isValid == Materials._NULL){ + this.vMoltenFluid = this.generateFluid(); } else { - this.vMoltenFluid = this.generateFluid(); + if (isValid.mFluid != null){ + this.vMoltenFluid = isValid.mFluid; + } + else if (isValid.mGas != null){ + this.vMoltenFluid = isValid.mGas; + } + else { + this.vMoltenFluid = this.generateFluid(); + } } - } - this.vPlasma = this.generatePlasma(); - } - else { - this.vMoltenFluid = null; - this.vPlasma = null; - } + this.vPlasma = this.generatePlasma(); + } + else { + this.vMoltenFluid = null; + this.vPlasma = null; + } String ratio = ""; if (this.vSmallestRatio != null) { @@ -344,17 +344,17 @@ public class Material { public final TextureSet getTextureSet() { synchronized(this) { return textureSet; - } + } } public TextureSet setTextureSet(TextureSet set) { if (set != null) { - return set; + return set; } else { // build hash table with count AutoMap sets = new AutoMap(); - if (this.vMaterialInput != null) { + if (this.vMaterialInput != null) { for (MaterialStack r : this.vMaterialInput) { if (r.getStackMaterial().getTextureSet().mSetName.toLowerCase().contains("fluid")) { sets.put(ELEMENT.getInstance().GOLD); @@ -362,16 +362,16 @@ public class Material { else { sets.put(r.getStackMaterial()); } - } - TextureSet mostUsedTypeTextureSet = (TextureSet) MaterialUtils.getMostCommonTextureSet(new ArrayList(sets.values())); + } + TextureSet mostUsedTypeTextureSet = (TextureSet) MaterialUtils.getMostCommonTextureSet(new ArrayList(sets.values())); if (mostUsedTypeTextureSet != null && mostUsedTypeTextureSet instanceof TextureSet) { Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+mostUsedTypeTextureSet.mSetName+"."); return mostUsedTypeTextureSet; - } + } } } Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+Materials.Iron.mIconSet.mSetName+". [Fallback]"); - return Materials.Iron.mIconSet; + return Materials.Iron.mIconSet; } public final String getLocalizedName(){ @@ -402,7 +402,7 @@ public class Material { final public short[] getRGBA(){ if (this.RGBA != null) { if (this.RGBA.length == 4){ - return this.RGBA; + return this.RGBA; } else { return new short[]{this.RGBA[0], this.RGBA[1], this.RGBA[2], 0}; @@ -570,17 +570,17 @@ public class Material { } public final ItemStack getCrushedCentrifuged(final int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("crushedCentrifuged"+this.unlocalizedName, stacksize); - } + } public final ItemStack getDustPurified(final int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustPure"+this.unlocalizedName, stacksize); } public final ItemStack getDustImpure(final int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustImpure"+this.unlocalizedName, stacksize); - } + } public final boolean hasSolidForm() { if (this.getDust(1) != null || this.getBlock(1) != null || this.getSmallDust(1) != null || this.getTinyDust(1) != null) { return true; - } + } return false; } @@ -605,7 +605,7 @@ public class Material { Logger.INFO("Failed setting slot "+i+", using "+this.localizedName); } } - return temp; + return temp; } return new ItemStack[]{}; } @@ -781,8 +781,8 @@ public class Material { if (a5 != null){ Logger.INFO("Using a pre-defined Fluid from GT. Plasma."); return a5.getFluid(); - } - Logger.INFO("Using null."); + } + Logger.INFO("Using null."); return null; } } @@ -791,37 +791,37 @@ public class Material { if (this.materialState == MaterialState.SOLID){ if (isValid.mFluid != null){ Logger.INFO("Using a pre-defined Fluid from GT. mFluid."); - return isValid.mFluid; - } + return isValid.mFluid; + } else if (isValid.mStandardMoltenFluid != null){ Logger.INFO("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); - return isValid.mStandardMoltenFluid; + return isValid.mStandardMoltenFluid; } } else if (this.materialState == MaterialState.GAS){ if (isValid.mGas != null){ Logger.INFO("Using a pre-defined Fluid from GT. mGas."); - return isValid.mGas; - } + return isValid.mGas; + } } else if (this.materialState == MaterialState.LIQUID || this.materialState == MaterialState.PURE_LIQUID){ if (isValid.mFluid != null){ Logger.INFO("Using a pre-defined Fluid from GT. mFluid."); - return isValid.mFluid; - } + return isValid.mFluid; + } else if (isValid.mGas != null){ Logger.INFO("Using a pre-defined Fluid from GT. mGas."); - return isValid.mGas; + return isValid.mGas; } else if (isValid.mStandardMoltenFluid != null){ Logger.INFO("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); - return isValid.mStandardMoltenFluid; + return isValid.mStandardMoltenFluid; } - } + } Logger.INFO("Generating our own fluid."); //Generate a Cell if we need to - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){ + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){ if (this.vGenerateCells){ new BaseItemCell(this); Logger.INFO("Generated a cell for "+this.getUnlocalizedName()); @@ -873,7 +873,7 @@ public class Material { if (this.materialState == MaterialState.ORE){ return null; } - final Materials isValid = Materials.get(this.getLocalizedName()); + final Materials isValid = Materials.get(this.getLocalizedName()); if (!this.vGenerateCells){ return null; @@ -885,8 +885,8 @@ public class Material { } if (isValid.mPlasma != null){ Logger.INFO("Using a pre-defined Plasma from GT."); - return isValid.mPlasma; - } + return isValid.mPlasma; + } Logger.INFO("Generating our own Plasma."); return FluidUtils.addGTPlasma(this); @@ -894,10 +894,10 @@ public class Material { - final public FluidStack getFluid(final int fluidAmount) { + final public FluidStack getFluid(final int fluidAmount) { if (this.vMoltenFluid == null){ return null; - } + } final FluidStack moltenFluid = new FluidStack(this.vMoltenFluid, fluidAmount); return moltenFluid; } @@ -987,4 +987,4 @@ public class Material { } } -} +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java index e9d68ea864..98b02078c6 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java @@ -27,11 +27,11 @@ public class MaterialUtils { @SuppressWarnings({ "rawtypes", "unused" }) private static Class[][] commonTypes = -{{Materials.class, int.class, TextureSet.class, float.class, int.class, - int.class, int.class, int.class, int.class, int.class, int.class, - String.class, int.class, int.class, int.class, int.class, boolean.class, - boolean.class, int.class, int.class, int.class, Dyes.class, int.class, - List.class , List.class}}; + {{Materials.class, int.class, TextureSet.class, float.class, int.class, + int.class, int.class, int.class, int.class, int.class, int.class, + String.class, int.class, int.class, int.class, int.class, boolean.class, + boolean.class, int.class, int.class, int.class, Dyes.class, int.class, + List.class , List.class}}; public static List oreDictValuesForEntry(final String oredictName){ List oredictItemNames; @@ -47,7 +47,7 @@ public class MaterialUtils { public static Material generateMaterialFromGtENUM(final Materials material){ return generateMaterialFromGtENUM(material, null); } - + public static Material generateMaterialFromGtENUM(final Materials material, short[] customRGB){ @SuppressWarnings("deprecation") String name = material.name(); @@ -68,12 +68,12 @@ public class MaterialUtils { if (material.isRadioactive()){ radioactivity = 1; } - + //Weird Blacklist of Bad Chemical Strings if (material.mElement == Element.Pb || material.mElement == Element.Na || material.mElement == Element.Ar){ chemicalFormula = StringUtils.subscript(Utils.sanitizeString(material.mElement.name())); } - + //Determine default state Logger.MATERIALS("[Debug] Setting State of GT generated material. "+material.mDefaultLocalName); if (material.getMolten(1) != null || material.getSolid(1) != null){ @@ -140,10 +140,10 @@ public class MaterialUtils { return temp; } - public static boolean hasValidRGBA(final short[] rgba){ + public static boolean hasValidRGBA(final short[] rgba){ if (rgba == null || rgba.length < 3 || rgba.length > 4){ return false; - } + } return true; } @@ -184,9 +184,9 @@ public class MaterialUtils { } public static Materials getMaterialByName(String materialName) { - + if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - return (Materials) EnumUtils.getValue(gregtech.api.enums.Materials.class, materialName, false); + return (Materials) EnumUtils.getValue(gregtech.api.enums.Materials.class, materialName, false); } else { for (Materials m : Materials.values()) { @@ -197,7 +197,7 @@ public class MaterialUtils { return null; } } - + @SuppressWarnings("deprecation") public static String getMaterialName(Materials mat){ String mName; @@ -212,14 +212,12 @@ public class MaterialUtils { } return mName; } - + public static TextureSet getMostCommonTextureSet(List list) { Optional r = list.stream().map(Material::getTextureSet).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey); TextureSet o = (r != null && r.isPresent() && r.get() != null) ? r.get() : null; return o; - } - - } +} \ No newline at end of file -- cgit From 1a03af3432c350a8805340f2c9118c89763dca24 Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Sat, 12 May 2018 18:14:09 +1000 Subject: + Added recipes for all Advanced Multis. + Added new casings for Advanced EBF. $ Fixed issue with AIC tooltip. --- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 132 +++++++++++++-------- 1 file changed, 81 insertions(+), 51 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 55b7793f93..cda886eb24 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -212,46 +212,42 @@ public class RECIPES_Machines { } if (LoadedMods.Gregtech){ - - - //Lava Boiler boiler_Coal = ItemList.Machine_Bronze_Boiler.get(1); //IV MACHINES - if (!CORE.GTNH){ - EV_MACHINE_Electrolyzer = ItemList.Machine_EV_Electrolyzer.get(1); - EV_MACHINE_BendingMachine= ItemList.Machine_EV_Bender.get(1); - EV_MACHINE_Wiremill= ItemList.Machine_EV_Wiremill.get(1); - HV_MACHINE_Macerator= ItemList.Machine_HV_Macerator.get(1); - EV_MACHINE_Macerator= ItemList.Machine_EV_Macerator.get(1); - EV_MACHINE_MassFabricator= ItemList.Machine_EV_Massfab.get(1); - EV_MACHINE_Centrifuge= ItemList.Machine_EV_Centrifuge.get(1); - EV_MACHINE_Cutter = ItemList.Machine_EV_Cutter.get(1); - EV_MACHINE_Extruder = ItemList.Machine_EV_Extruder.get(1); - EV_MACHINE_Sifter = ItemList.Machine_EV_Sifter.get(1); - EV_MACHINE_ThermalCentrifuge = ItemList.Machine_EV_ThermalCentrifuge.get(1); - EV_MACHINE_OreWasher = ItemList.Machine_EV_OreWasher.get(1); - EV_MACHINE_AlloySmelter = ItemList.Machine_EV_AlloySmelter.get(1); + EV_MACHINE_Electrolyzer = ItemList.Machine_EV_Electrolyzer.get(1); + EV_MACHINE_BendingMachine= ItemList.Machine_EV_Bender.get(1); + EV_MACHINE_Wiremill= ItemList.Machine_EV_Wiremill.get(1); + HV_MACHINE_Macerator= ItemList.Machine_HV_Macerator.get(1); + EV_MACHINE_Macerator= ItemList.Machine_EV_Macerator.get(1); + EV_MACHINE_MassFabricator= ItemList.Machine_EV_Massfab.get(1); + EV_MACHINE_Centrifuge= ItemList.Machine_EV_Centrifuge.get(1); + EV_MACHINE_Cutter = ItemList.Machine_EV_Cutter.get(1); + EV_MACHINE_Extruder = ItemList.Machine_EV_Extruder.get(1); + EV_MACHINE_Sifter = ItemList.Machine_EV_Sifter.get(1); + EV_MACHINE_ThermalCentrifuge = ItemList.Machine_EV_ThermalCentrifuge.get(1); + EV_MACHINE_OreWasher = ItemList.Machine_EV_OreWasher.get(1); + EV_MACHINE_AlloySmelter = ItemList.Machine_EV_AlloySmelter.get(1); } - //Balance or some shit + //Balanced opposites else { - EV_MACHINE_Electrolyzer = ItemList.Machine_IV_Electrolyzer.get(1); - EV_MACHINE_BendingMachine= ItemList.Machine_IV_Bender.get(1); - EV_MACHINE_Wiremill= ItemList.Machine_IV_Wiremill.get(1); - HV_MACHINE_Macerator= ItemList.Machine_EV_Macerator.get(1); - EV_MACHINE_Macerator= ItemList.Machine_IV_Macerator.get(1); - EV_MACHINE_MassFabricator= ItemList.Machine_LuV_Massfab.get(1); - EV_MACHINE_Centrifuge= ItemList.Machine_IV_Centrifuge.get(1); - EV_MACHINE_Cutter = ItemList.Machine_IV_Cutter.get(1); - EV_MACHINE_Extruder = ItemList.Machine_IV_Extruder.get(1); - EV_MACHINE_Sifter = ItemList.Machine_IV_Sifter.get(1); - EV_MACHINE_ThermalCentrifuge = ItemList.Machine_IV_ThermalCentrifuge.get(1); - EV_MACHINE_OreWasher = ItemList.Machine_IV_OreWasher.get(1); - EV_MACHINE_AlloySmelter = ItemList.Machine_IV_AlloySmelter.get(1); + EV_MACHINE_Electrolyzer = ItemList.Machine_IV_Electrolyzer.get(1); + EV_MACHINE_BendingMachine= ItemList.Machine_IV_Bender.get(1); + EV_MACHINE_Wiremill= ItemList.Machine_IV_Wiremill.get(1); + HV_MACHINE_Macerator= ItemList.Machine_EV_Macerator.get(1); + EV_MACHINE_Macerator= ItemList.Machine_IV_Macerator.get(1); + EV_MACHINE_MassFabricator= ItemList.Machine_LuV_Massfab.get(1); + EV_MACHINE_Centrifuge= ItemList.Machine_IV_Centrifuge.get(1); + EV_MACHINE_Cutter = ItemList.Machine_IV_Cutter.get(1); + EV_MACHINE_Extruder = ItemList.Machine_IV_Extruder.get(1); + EV_MACHINE_Sifter = ItemList.Machine_IV_Sifter.get(1); + EV_MACHINE_ThermalCentrifuge = ItemList.Machine_IV_ThermalCentrifuge.get(1); + EV_MACHINE_OreWasher = ItemList.Machine_IV_OreWasher.get(1); + EV_MACHINE_AlloySmelter = ItemList.Machine_IV_AlloySmelter.get(1); } - + } @@ -286,22 +282,6 @@ public class RECIPES_Machines { "circuitMaster",ItemList.Cover_Screen.get(1),CI.getDataOrb(), GregtechItemList.Gregtech_Computer_Cube.get(1)); - /*RecipeUtils.addShapedGregtechRecipe( - CI.electricPiston_EV, OrePrefixes.circuit.get(Materials.Ultimate), CI.electricPiston_EV, - CI.electricMotor_EV, CI.machineCasing_EV, CI.electricMotor_EV, - "gearGtTitanium", "cableGt02Aluminium", "gearGtTitanium", - ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 793, 1)); - RecipeUtils.addShapedGregtechRecipe( - CI.electricPiston_IV, OrePrefixes.circuit.get(Materials.Superconductor), CI.electricPiston_IV, - CI.electricMotor_IV, CI.machineCasing_IV, CI.electricMotor_IV, - "gearGtTungstenSteel", "cableGt02Platinum", "gearGtTungstenSteel", - ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 794, 1)); - RecipeUtils.addShapedGregtechRecipe( - CI.electricPiston_LuV, OrePrefixes.circuit.get(Materials.Infinite), CI.electricPiston_LuV, - CI.electricMotor_LuV, CI.machineCasing_LuV, CI.electricMotor_LuV, - "gearGtChrome", "cableGt02Tungsten", "gearGtChrome", - ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 795, 1));*/ - //Buffer Core RecipeUtils.addShapedGregtechRecipe( CI.component_Plate[1], cableTier1, CI.component_Plate[1], @@ -1196,9 +1176,59 @@ public class RECIPES_Machines { plate,CI.getTieredCircuit(2),plate, GregtechItemList.Industrial_FishingPond.get(1)); } - - - + + if (true) { + + //Advanced Vacuum Freezer + ItemStack plate = ALLOY.HASTELLOY_N.getPlateDouble(1); + ItemStack gear = ALLOY.HASTELLOY_N.getGear(1); + ItemStack frame = ALLOY.HASTELLOY_N.getFrameBox(1); + ItemStack cell1 = ItemList.Reactor_Coolant_He_6.get(1); + ItemStack cell2 = ItemList.Reactor_Coolant_NaK_6.get(1); + + RecipeUtils.recipeBuilder( + plate, gear, plate, + cell1, frame, cell2, + plate, gear, plate, + GregtechItemList.Casing_AdvancedVacuum.get(Casing_Amount)); + RecipeUtils.recipeBuilder( + gear,CI.getTieredCircuit(6),gear, + CI.electricPiston_IV, GregtechItemList.Casing_AdvancedVacuum.get(1), CI.electricPiston_IV, + plate, GregtechItemList.Gregtech_Computer_Cube.get(1), plate, + GregtechItemList.Industrial_Cryogenic_Freezer.get(1)); + + //Advanced Blast Furnaace + plate = ALLOY.HG1223.getPlateDouble(1); + gear = ALLOY.INCOLOY_MA956.getGear(1); + frame = ALLOY.INCOLOY_DS.getFrameBox(1); + cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1); + cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1); + ItemStack cell3 = ItemUtils.simpleMetaStack("IC2:reactorVentDiamond:1:1", 1, 1); + + RecipeUtils.recipeBuilder( + plate, cell1, plate, + cell3, frame, cell2, + plate, gear, plate, + GregtechItemList.Casing_Adv_BlastFurnace.get(Casing_Amount)); + RecipeUtils.recipeBuilder( + gear,CI.getTieredCircuit(6),gear, + CI.robotArm_IV, GregtechItemList.Casing_Adv_BlastFurnace.get(1), CI.robotArm_IV, + plate, GregtechItemList.Gregtech_Computer_Cube.get(1), plate, + GregtechItemList.Machine_Adv_BlastFurnace.get(1)); + + //Advanced Implosion Compressor + plate = ItemUtils.getItemStackOfAmountFromOreDict("plateAlloyIridium", 1); + gear = ALLOY.HG1223.getGear(1); + frame = ALLOY.HG1223.getFrameBox(1); + cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1); + cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1); + + RecipeUtils.recipeBuilder( + gear,CI.getTieredCircuit(6),gear, + CI.fieldGenerator_IV, CI.machineHull_ZPM, CI.robotArm_IV, + plate, GregtechItemList.Gregtech_Computer_Cube.get(1), plate, + GregtechItemList.Machine_Adv_ImplosionCompressor.get(1)); + } if (CORE.ConfigSwitches.enableMultiblock_IndustrialMultiMachine){ ItemStack plate = ALLOY.STABALLOY.getPlate(1); -- cgit From c250381837a416e58a0ecc632c8a314d8f25b076 Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Sat, 12 May 2018 18:45:53 +1000 Subject: + Added recipe for the Air Intake Hatch. + Added new textures for the Adv. Vac. Freezer and casings. % Gave old Adv. Vac. Freezer texture to Adv. EBF. % Swapped recipe materials for Adv. Vac. and EBF. --- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 131 +++++++++++++-------- 1 file changed, 80 insertions(+), 51 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index cda886eb24..0cb36d4859 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -13,6 +13,7 @@ import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; +import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -859,7 +860,14 @@ public class RECIPES_Machines { CI.component_Plate[2], CI.electricMotor_ULV, CI.component_Plate[2], CI.getTieredCircuit(1), CI.machineHull_LV, CI.getTieredCircuit(0), GregtechItemList.Pollution_Detector.get(1)); - + + //Air Intake Hatch + RecipeUtils.addShapedGregtechRecipe( + CI.component_Plate[6], ItemList.Casing_Grate.get(1), CI.component_Plate[6], + CI.component_Plate[6], ItemList.FluidRegulator_IV.get(1), CI.component_Plate[6], + CI.getTieredCircuit(5), ItemList.Hatch_Input_IV.get(1), CI.getTieredCircuit(5), + GregtechItemList.Hatch_Air_Intake.get(1)); + //ULV RecipeUtils.addShapedGregtechRecipe( CI.component_Plate[0], ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1), CI.component_Plate[0], @@ -1176,58 +1184,79 @@ public class RECIPES_Machines { plate,CI.getTieredCircuit(2),plate, GregtechItemList.Industrial_FishingPond.get(1)); } - + if (true) { + //Advanced Vacuum Freezer + ItemStack plate = ALLOY.HG1223.getPlateDouble(1); + ItemStack gear = ALLOY.INCOLOY_MA956.getGear(1); + ItemStack frame = ALLOY.INCOLOY_DS.getFrameBox(1); + ItemStack cell1 = ItemList.Reactor_Coolant_He_6.get(1); + ItemStack cell2 = ItemList.Reactor_Coolant_NaK_6.get(1); - //Advanced Vacuum Freezer - ItemStack plate = ALLOY.HASTELLOY_N.getPlateDouble(1); - ItemStack gear = ALLOY.HASTELLOY_N.getGear(1); - ItemStack frame = ALLOY.HASTELLOY_N.getFrameBox(1); - ItemStack cell1 = ItemList.Reactor_Coolant_He_6.get(1); - ItemStack cell2 = ItemList.Reactor_Coolant_NaK_6.get(1); - - RecipeUtils.recipeBuilder( - plate, gear, plate, - cell1, frame, cell2, - plate, gear, plate, - GregtechItemList.Casing_AdvancedVacuum.get(Casing_Amount)); - RecipeUtils.recipeBuilder( - gear,CI.getTieredCircuit(6),gear, - CI.electricPiston_IV, GregtechItemList.Casing_AdvancedVacuum.get(1), CI.electricPiston_IV, - plate, GregtechItemList.Gregtech_Computer_Cube.get(1), plate, - GregtechItemList.Industrial_Cryogenic_Freezer.get(1)); - - //Advanced Blast Furnaace - plate = ALLOY.HG1223.getPlateDouble(1); - gear = ALLOY.INCOLOY_MA956.getGear(1); - frame = ALLOY.INCOLOY_DS.getFrameBox(1); - cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1); - cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1); - ItemStack cell3 = ItemUtils.simpleMetaStack("IC2:reactorVentDiamond:1:1", 1, 1); - - RecipeUtils.recipeBuilder( - plate, cell1, plate, - cell3, frame, cell2, - plate, gear, plate, - GregtechItemList.Casing_Adv_BlastFurnace.get(Casing_Amount)); - RecipeUtils.recipeBuilder( - gear,CI.getTieredCircuit(6),gear, - CI.robotArm_IV, GregtechItemList.Casing_Adv_BlastFurnace.get(1), CI.robotArm_IV, - plate, GregtechItemList.Gregtech_Computer_Cube.get(1), plate, - GregtechItemList.Machine_Adv_BlastFurnace.get(1)); - - //Advanced Implosion Compressor - plate = ItemUtils.getItemStackOfAmountFromOreDict("plateAlloyIridium", 1); - gear = ALLOY.HG1223.getGear(1); - frame = ALLOY.HG1223.getFrameBox(1); - cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1); - cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1); - - RecipeUtils.recipeBuilder( - gear,CI.getTieredCircuit(6),gear, - CI.fieldGenerator_IV, CI.machineHull_ZPM, CI.robotArm_IV, - plate, GregtechItemList.Gregtech_Computer_Cube.get(1), plate, - GregtechItemList.Machine_Adv_ImplosionCompressor.get(1)); + RecipeUtils.recipeBuilder( + plate, gear, plate, + cell1, frame, cell2, + plate, gear, plate, + GregtechItemList.Casing_AdvancedVacuum.get(Casing_Amount)); + RecipeUtils.recipeBuilder( + gear,CI.getTieredCircuit(6),gear, + CI.electricPiston_IV, GregtechItemList.Casing_AdvancedVacuum.get(1), CI.electricPiston_IV, + plate, GregtechItemList.Gregtech_Computer_Cube.get(1), plate, + GregtechItemList.Industrial_Cryogenic_Freezer.get(1)); + + //Advanced Blast Furnace + plate = ALLOY.HASTELLOY_N.getPlateDouble(1); + gear = ALLOY.HASTELLOY_W.getGear(1); + frame = ALLOY.HASTELLOY_X.getFrameBox(1); + cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1); + cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1); + ItemStack cell3 = ItemUtils.simpleMetaStack("IC2:reactorVentDiamond:1:1", 1, 1); + + RecipeUtils.recipeBuilder( + plate, cell1, plate, + cell3, frame, cell2, + plate, gear, plate, + GregtechItemList.Casing_Adv_BlastFurnace.get(Casing_Amount)); + RecipeUtils.recipeBuilder( + gear,CI.getTieredCircuit(6),gear, + CI.robotArm_IV, GregtechItemList.Casing_Adv_BlastFurnace.get(1), CI.robotArm_IV, + plate, GregtechItemList.Gregtech_Computer_Cube.get(1), plate, + GregtechItemList.Machine_Adv_BlastFurnace.get(1)); + + //Advanced Implosion Compressor + plate = ItemUtils.getItemStackOfAmountFromOreDict("plateAlloyIridium", 1); + gear = ALLOY.LEAGRISIUM.getGear(1); + frame = ALLOY.HG1223.getFrameBox(1); + cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1); + cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1); + + RecipeUtils.recipeBuilder( + gear,CI.getTieredCircuit(6),gear, + CI.fieldGenerator_IV, CI.machineHull_ZPM, CI.robotArm_IV, + plate, GregtechItemList.Gregtech_Computer_Cube.get(1), plate, + GregtechItemList.Machine_Adv_ImplosionCompressor.get(1)); + + + + //Supply Depot + plate = ALLOY.TUNGSTEN_CARBIDE.getPlateDouble(1); + gear = ALLOY.TRINIUM_TITANIUM.getRing(1); + frame = ALLOY.TUNGSTEN_CARBIDE.getFrameBox(1); + cell1 = CI.conveyorModule_EV; + cell2 = CI.electricMotor_IV; + ItemStack casingAmazon = GregtechItemList.Casing_AmazonWarehouse.get(1); + + RecipeUtils.recipeBuilder( + plate, ItemUtils.getItemStackOfAmountFromOreDict("cableGt12VanadiumGallium", 1), plate, + cell1, frame, cell2, + plate, gear, plate, + GregtechItemList.Casing_AmazonWarehouse.get(Casing_Amount)); + RecipeUtils.recipeBuilder( + casingAmazon, CI.getTieredCircuit(7), casingAmazon, + CI.robotArm_LuV, ItemList.Machine_LuV_Unboxinator.get(1), CI.robotArm_LuV, + CI.conveyorModule_LuV, GregtechItemList.Gregtech_Computer_Cube.get(1), CI.conveyorModule_LuV, + GregtechItemList.Amazon_Warehouse_Controller.get(1)); + } if (CORE.ConfigSwitches.enableMultiblock_IndustrialMultiMachine){ -- cgit From 7a109ef51ab0de1926c344babb9b3a64aad0199b Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Sat, 12 May 2018 19:21:25 +1000 Subject: + Added a book for Power Storage Solutions. - Removed some useless Meta Tiles. (This removes advanced Mixer recipes, but not the tiles themselves.) --- src/Java/gtPlusPlus/core/handler/BookHandler.java | 98 +++++++++++++--------- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 6 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 39 +++++---- 3 files changed, 82 insertions(+), 61 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/handler/BookHandler.java b/src/Java/gtPlusPlus/core/handler/BookHandler.java index 131662214b..0d8ba2136