From ba6bc0844281558f35cce72b54267064f6d86208 Mon Sep 17 00:00:00 2001 From: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Date: Wed, 22 Jun 2022 23:03:38 +0100 Subject: Plasma forge fixes (#1086) * Basis of changes. * Fix item stack and fluid vanishing. * Add new plasma forge UI, change tooltip and fix recipe map. * Fix corrupted fluid registry. * Fix fluids in recipes. Items still need adjusting. * Working. * Liquid spacetime and rename multi to D.T.P.S. so it can fit in GUI properly. * Make animation of spacetime fluid slower. * Fix recipe map (again). * Remove screwdriver junk. Clean up code slightly. * More cleaning. * Comments * Add hatch limitations and add some additional information. Also update NEI GUI. * Add proper recipes and change SpaceTime to a fluid not a gas. * Remove depreciated coil check (since I stole the IDs). * Remove depreciated coil check (since I stole the IDs). Add more comments. * Change temp of SpaceTime. * Add catalyst recipes + support for 16:16 fusion recipes. * Add comments. * Scala fix maybe? * Change plasma forge GUI. * Uncap temperature of materials. (Short -> Int) * Add chunkloading support (when multi is active). * Fix NEI merge issues. * fix used ids in kevlar * Add fluid support for laser engraver. * fix sh***t (cherry picked from commit 01851c100c52fd8292028cf6dda2cb136c617afc) * Add new intermediate materials to facilitate crafting. Also fix fusion typo. * Fix heat/fluid quantity display to be formatted correctly. * Change recipes to be more balanced. * Change residue fluid texture. * Restore better naming for multiblock. * Fix recipe typo. * Fix text not wrapping in multi controller. * Give laser engraver internal fluid storage. * Add IMC NEI support. * Update material properties. * Remove old dev comments. * Fix NEI texture. * Update/fix plasma forge recipes. * Increase max hatch count. * Increase max hatch count and fix mixing energy hatches. Plus quick check for processing time. * Fix spacetime recipe. * Update spacetime textures and add new item textures. * Remove manual spacetime fluid addition. * Add custom fluid texture override ability. * Update infinity and spacetime to use new custom fluid override texture. * Depreciate old recipe adding methods. * Refactor GT NEI handler. * Remove unnecessary import. * Remove debug comment. * Clean up auto generated fluid code. * Fix NPE and add a few comments. * Refactor GT NEI handler. * Update NEI GUIs. * More NEI fixes. * Update LCR NEI GUI. * Update error message. Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Co-authored-by: Martin Robertz --- src/main/java/gregtech/common/GT_Proxy.java | 38 ++++++++++++++++------ .../multi/GT_MetaTileEntity_PlasmaForge.java | 11 ++++++- 2 files changed, 38 insertions(+), 11 deletions(-) (limited to 'src/main/java/gregtech/common') 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; -- cgit