diff options
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r-- | src/main/java/gregtech/common/GT_Proxy.java | 38 | ||||
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java | 11 |
2 files changed, 38 insertions, 11 deletions
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 8491ea328c..dc8ca19220 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1821,25 +1821,42 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { return 0; } + + // ------------------------ Adds all fluids corresponding to materials ------------------------ + public Fluid addAutoGeneratedCorrespondingFluid(Materials aMaterial){ - return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial, - aMaterial.mRGBa, 1, aMaterial.getLiquidTemperature(), GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L), 1000); - } + // If the fluid is registered as custom inside the Material's constructor then to add custom fluid + // textures go to blocks/fluids and place the .png. File should be called fluid.fluid.{unlocalised_name}.png. All lower case. + String fluidTexture = aMaterial.mIconSet.is_custom ? ("fluid." + aMaterial.mName.toLowerCase()) : "molten.autogenerated"; + return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), fluidTexture, aMaterial.mDefaultLocalName, aMaterial, + aMaterial.mRGBa, 1, aMaterial.getLiquidTemperature(), GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L), 1000); + } public Fluid addAutoGeneratedCorrespondingGas(Materials aMaterial) { - return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial, - aMaterial.mRGBa, 2, aMaterial.getGasTemperature(), GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L), 1000); + // If the fluid is registered as custom inside the Material's constructor then to add custom fluid + // textures go to blocks/fluids and place the .png. File should be called fluid.gas.{unlocalised_name}.png. All lower case. + String fluidTexture = aMaterial.mIconSet.is_custom ? ("gas." + aMaterial.mName.toLowerCase()) : "molten.autogenerated"; + return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), fluidTexture, aMaterial.mDefaultLocalName, aMaterial, + aMaterial.mRGBa, 2, aMaterial.getGasTemperature(), GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L), 1000); + } + + public Fluid addAutogeneratedPlasmaFluid(Materials aMaterial) { + // If the fluid is registered as custom inside the Material's constructor then to add custom fluid + // textures go to blocks/fluids and place the .png. File should be called fluid.plasma.{unlocalised_name}.png. All lower case. + String fluidTexture = aMaterial.mIconSet.is_custom ? ("plasma." + aMaterial.mName.toLowerCase()) : "plasma.autogenerated"; + return addFluid("plasma." + aMaterial.mName.toLowerCase(Locale.ENGLISH), fluidTexture, aMaterial.mDefaultLocalName + " Plasma", aMaterial, + aMaterial.mMoltenRGBa, 3, 10000, GT_OreDictUnificator.get(OrePrefixes.cellPlasma, aMaterial, 1L), ItemList.Cell_Empty.get(1L), aMaterial.getMolten(1) != null ? 144 : 1000); } public Fluid addAutogeneratedMoltenFluid(Materials aMaterial) { - return addFluid("molten." + aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", "Molten " + aMaterial.mDefaultLocalName, aMaterial, + // If the fluid is registered as custom inside the Material's constructor then to add custom fluid + // textures go to blocks/fluids and place the .png. File should be called fluid.molten.{unlocalised_name}.png. All lower case. + String fluidTexture = aMaterial.mIconSet.is_custom ? ("molten." + aMaterial.mName.toLowerCase()) : "molten.autogenerated"; + return addFluid("molten." + aMaterial.mName.toLowerCase(Locale.ENGLISH), fluidTexture, "Molten " + aMaterial.mDefaultLocalName, aMaterial, aMaterial.mMoltenRGBa, 4, aMaterial.mMeltingPoint <= 0 ? 1000 : aMaterial.mMeltingPoint, GT_OreDictUnificator.get(OrePrefixes.cellMolten, aMaterial, 1L), ItemList.Cell_Empty.get(1L), 144); } - public Fluid addAutogeneratedPlasmaFluid(Materials aMaterial) { - return addFluid("plasma." + aMaterial.mName.toLowerCase(Locale.ENGLISH), "plasma.autogenerated", aMaterial.mDefaultLocalName + " Plasma", aMaterial, - aMaterial.mMoltenRGBa, 3, 10000, GT_OreDictUnificator.get(OrePrefixes.cellPlasma, aMaterial, 1L), ItemList.Cell_Empty.get(1L), aMaterial.getMolten(1) != null ? 144 : 1000); - } + // ------------------------------------------------------------------------------------------------------------ public void addAutoGeneratedHydroCrackedFluids(Materials aMaterial){ Fluid[] crackedFluids = new Fluid[3]; @@ -1910,6 +1927,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public Fluid addFluid(String aName, String aTexture, String aLocalized, Materials aMaterial, short[] aRGBa, int aState, int aTemperatureK, ItemStack aFullContainer, ItemStack aEmptyContainer, int aFluidAmount) { aName = aName.toLowerCase(Locale.ENGLISH); + Fluid rFluid = new GT_Fluid(aName, aTexture, aRGBa != null ? aRGBa : Dyes._NULL.getRGBA()); GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), aLocalized == null ? aName : aLocalized); if (FluidRegistry.registerFluid(rFluid)) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java index 34c38537a9..97bda10e2f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java @@ -195,6 +195,7 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul // Vital recipe info. mEUt = -tRecipe.mEUt; mMaxProgresstime = tRecipe.mDuration; + mMaxProgresstime = Math.max(1, mMaxProgresstime); // Outputs. mOutputItems = tRecipe.mOutputs.clone(); @@ -223,15 +224,23 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul if (mOutputBusses.size() > 3) return false; - if (mInputHatches.size() > 3) + // Numerous input hatches required to satisfy fluid inputs for superconductor recipes. + if (mInputHatches.size() > 6) return false; if (mOutputHatches.size() > 3) return false; + // Check that there is between 1 and 2 energy hatches in the multi. if (!((mEnergyHatches.size() == 1) || (mEnergyHatches.size() == 2))) return false; + // Check whether each energy hatch is the same tier. + byte tier_of_hatch = mEnergyHatches.get(0).mTier; + for(GT_MetaTileEntity_Hatch_Energy energyHatch : mEnergyHatches) { + if (energyHatch.mTier != tier_of_hatch) { return false; } + } + if (mMaintenanceHatches.size() != 1) return false; |