From 8b077c28bea7bcc046be1e4b8485d69b4c245a43 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Sat, 20 Jul 2024 15:35:26 +0100 Subject: Beamline (#2619) * Beamline * Remove hardcoded dreamcraft items and spotless * Remove logs and fix auto structure check * Remove logs and fix auto structure check * Fix typo and synchrotron high MF scaling * sa (cherry picked from commit b2796d95538a1b683b4a98bf6cb0f8fe21404fbd) * Add multi textures, add structuredesc info, remove test TC input, add synchrotron/input/output recipes * Spotless * Prevent mob spawning on casings * Fix LINAC glass requirement, make synchrotron structure less ugly, add last recipe * Spotless * Add placeholder particle textures * Add some mask recipes I missed * Spotless apply for branch lanth-beamline for #2619 (#2630) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Add further error messages to LINAC and Synchrotron, fix MM & LaB6 recipes * Spotless apply for branch lanth-beamline for #2619 (#2648) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Minor changes, add more multi error messages & 9x U-238 SC recipe * Spotless apply for branch lanth-beamline for #2619 (#2651) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Missed a change * Spotless apply for branch lanth-beamline for #2619 (#2652) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Update beamline desc * Remove comments, move coolant fluid check to Util class * Spotless * Spotless apply for branch lanth-beamline for #2619 (#2666) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Fix Mu-Metal recipe output amount, tool stats for MM & LaB6 * Spotless * Fix multi hatch textures * Spotless apply for branch lanth-beamline for #2619 (#2676) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Increase Synchrotron output rate eut & antenna tier scaling, in general improve output rates, buff all TC recipes' processing time * Fix misleading BL tooltip * update * remove import * Buff higher-tier wafer recipes for each IC, from a 4x to 3x increase of recipe amount per two wafer tier increases * Remove RA1 calls in beamline (#2716) * Spotless apply for branch lanth-beamline for #2619 (#2717) spotlessApply Co-authored-by: GitHub GTNH Actions <> * fix * Spotless apply for branch lanth-beamline for #2619 (#2733) spotlessApply Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: unknown Co-authored-by: Elisis Co-authored-by: Martin Robertz Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- dependencies.gradle | 2 +- .../java/com/elisis/gtnhlanth/GTNHLanthanides.java | 53 +- .../gtnhlanth/common/beamline/BeamInformation.java | 51 + .../gtnhlanth/common/beamline/BeamLinePacket.java | 51 + .../common/beamline/IConnectsToBeamline.java | 14 + .../elisis/gtnhlanth/common/beamline/Particle.java | 71 ++ .../gtnhlanth/common/beamline/TileBeamline.java | 256 +++++ .../gtnhlanth/common/block/AntennaCasing.java | 15 + .../com/elisis/gtnhlanth/common/block/Casing.java | 80 ++ .../gtnhlanth/common/block/ShieldedAccGlass.java | 68 ++ .../gtnhlanth/common/hatch/TileBusInputFocus.java | 85 ++ .../common/hatch/TileHatchBeamlineConnector.java | 136 +++ .../common/hatch/TileHatchInputBeamline.java | 131 +++ .../common/hatch/TileHatchOutputBeamline.java | 138 +++ .../elisis/gtnhlanth/common/item/ICanFocus.java | 5 + .../elisis/gtnhlanth/common/item/LanthItem.java | 15 + .../com/elisis/gtnhlanth/common/item/MaskList.java | 147 +++ .../elisis/gtnhlanth/common/item/ParticleItem.java | 124 +++ .../common/item/PhotolithographicMask.java | 38 + .../gtnhlanth/common/register/LanthItemList.java | 157 ++- .../common/register/WerkstoffMaterialPool.java | 174 +++- .../elisis/gtnhlanth/common/tileentity/LINAC.java | 729 +++++++++++++ .../gtnhlanth/common/tileentity/SourceChamber.java | 412 ++++++++ .../gtnhlanth/common/tileentity/Synchrotron.java | 1068 ++++++++++++++++++++ .../gtnhlanth/common/tileentity/TargetChamber.java | 479 +++++++++ .../recipe/beamline/BeamlineRecipeAdder2.java | 166 +++ .../recipe/beamline/BeamlineRecipeLoader.java | 191 ++++ .../tileentity/recipe/beamline/RecipeSC.java | 53 + .../tileentity/recipe/beamline/RecipeTC.java | 72 ++ .../recipe/beamline/SourceChamberFrontend.java | 24 + .../recipe/beamline/TargetChamberFrontend.java | 109 ++ .../com/elisis/gtnhlanth/loader/BotRecipes.java | 13 +- .../com/elisis/gtnhlanth/loader/RecipeLoader.java | 766 +++++++++++++- .../gtnhlanth/util/DescTextLocalization.java | 16 +- src/main/java/com/elisis/gtnhlanth/util/Util.java | 55 + .../com/elisis/gtnhlanth/xmod/nei/NEI_Config.java | 1 + .../GT_TileEntity_ElectricImplosionCompressor.java | 19 +- .../blocks/tileEntity/FuelRefineFactory.java | 5 +- .../loader/NeutronActivatorLoader.java | 7 +- src/main/java/gregtech/api/enums/ItemList.java | 3 +- src/main/java/gregtech/api/enums/Textures.java | 2 + .../api/util/GT_Multiblock_Tooltip_Builder.java | 14 + .../gregtech/common/blocks/GT_Block_Casings5.java | 2 + .../machines/multiblock/LayeredCokeBattery.java | 9 +- .../gregtech/textures/blocks/iconsets/BI_CONN.png | Bin 0 -> 1166 bytes .../gregtech/textures/blocks/iconsets/BO_CONN.png | Bin 0 -> 1166 bytes .../MACHINE_CASING_SHIELDED_ACCELERATOR.png | Bin 0 -> 696 bytes .../textures/blocks/iconsets/OVERLAY_BI_ACTIVE.png | Bin 0 -> 2206 bytes .../blocks/iconsets/OVERLAY_BI_ACTIVE.png.mcmeta | 5 + .../textures/blocks/iconsets/OVERLAY_BI_SIDES.png | Bin 0 -> 4286 bytes .../blocks/iconsets/OVERLAY_BI_SIDES.png.mcmeta | 5 + .../textures/blocks/iconsets/OVERLAY_BO_ACTIVE.png | Bin 0 -> 2206 bytes .../blocks/iconsets/OVERLAY_BO_ACTIVE.png.mcmeta | 5 + .../textures/blocks/iconsets/OVERLAY_BO_SIDES.png | Bin 0 -> 4286 bytes .../blocks/iconsets/OVERLAY_BO_SIDES.png.mcmeta | 5 + .../gregtech/textures/blocks/iconsets/pipe.png | Bin 0 -> 1166 bytes .../resources/assets/gtnhlanth/lang/en_US.lang | 111 ++ .../textures/blocks/casing.antenna_t1.png | Bin 0 -> 4354 bytes .../textures/blocks/casing.antenna_t2.png | Bin 0 -> 645 bytes .../textures/blocks/casing.coolant_delivery.png | Bin 0 -> 684 bytes .../gtnhlanth/textures/blocks/casing.electrode.png | Bin 0 -> 599 bytes .../textures/blocks/casing.focus_holder.png | Bin 0 -> 978 bytes .../textures/blocks/casing.focus_manipulator.png | Bin 0 -> 799 bytes .../blocks/casing.shielded_accelerator.png | Bin 0 -> 696 bytes .../blocks/casing.shielded_accelerator_glass.png | Bin 0 -> 607 bytes .../textures/blocks/casing.target_holder.png | Bin 0 -> 898 bytes .../textures/blocks/casing.target_receptacle.png | Bin 0 -> 719 bytes .../textures/items/capillary_exchange.png | Bin 0 -> 812 bytes .../gtnhlanth/textures/items/etched_mask1.png | Bin 0 -> 769 bytes .../gtnhlanth/textures/items/iron_quartz_plate.png | Bin 0 -> 876 bytes .../gtnhlanth/textures/items/mask_substrate.png | Bin 0 -> 614 bytes .../textures/items/masked_mask_substrate.png | Bin 0 -> 694 bytes .../assets/gtnhlanth/textures/items/mm_lattice.png | Bin 0 -> 652 bytes .../gtnhlanth/textures/items/particle/alpha.png | Bin 0 -> 1243 bytes .../gtnhlanth/textures/items/particle/electron.png | Bin 0 -> 1180 bytes .../gtnhlanth/textures/items/particle/neutron.png | Bin 0 -> 1169 bytes .../gtnhlanth/textures/items/particle/photon.png | Bin 0 -> 1089 bytes .../gtnhlanth/textures/items/particle/proton.png | Bin 0 -> 1331 bytes .../gtnhlanth/textures/items/photomask/asoc.png | Bin 0 -> 1977 bytes .../gtnhlanth/textures/items/photomask/blank1.png | Bin 0 -> 910 bytes .../gtnhlanth/textures/items/photomask/blank2.png | Bin 0 -> 910 bytes .../gtnhlanth/textures/items/photomask/blank3.png | Bin 0 -> 910 bytes .../gtnhlanth/textures/items/photomask/cpu.png | Bin 0 -> 1862 bytes .../gtnhlanth/textures/items/photomask/hpic.png | Bin 0 -> 2069 bytes .../gtnhlanth/textures/items/photomask/ilc.png | Bin 0 -> 1757 bytes .../gtnhlanth/textures/items/photomask/lpic.png | Bin 0 -> 2051 bytes .../gtnhlanth/textures/items/photomask/nand.png | Bin 0 -> 1603 bytes .../gtnhlanth/textures/items/photomask/ncpu.png | Bin 0 -> 2047 bytes .../gtnhlanth/textures/items/photomask/nor.png | Bin 0 -> 1674 bytes .../gtnhlanth/textures/items/photomask/npic.png | Bin 0 -> 2071 bytes .../gtnhlanth/textures/items/photomask/pic.png | Bin 0 -> 2012 bytes .../gtnhlanth/textures/items/photomask/ppic.png | Bin 0 -> 2054 bytes .../gtnhlanth/textures/items/photomask/qbit.png | Bin 0 -> 2019 bytes .../gtnhlanth/textures/items/photomask/qpic.png | Bin 0 -> 2062 bytes .../gtnhlanth/textures/items/photomask/ram.png | Bin 0 -> 1758 bytes .../gtnhlanth/textures/items/photomask/soc.png | Bin 0 -> 2063 bytes .../gtnhlanth/textures/items/photomask/ssoc.png | Bin 0 -> 2194 bytes .../gtnhlanth/textures/items/photomask/uhpic.png | Bin 0 -> 2069 bytes .../gtnhlanth/textures/items/photomask/ulpic.png | Bin 0 -> 2035 bytes .../textures/items/substrate_precursor.png | Bin 0 -> 621 bytes 100 files changed, 6097 insertions(+), 60 deletions(-) create mode 100644 src/main/java/com/elisis/gtnhlanth/common/beamline/BeamInformation.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/beamline/BeamLinePacket.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/beamline/IConnectsToBeamline.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/beamline/Particle.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/beamline/TileBeamline.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/block/AntennaCasing.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/block/Casing.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/block/ShieldedAccGlass.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/hatch/TileBusInputFocus.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/hatch/TileHatchBeamlineConnector.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/hatch/TileHatchInputBeamline.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/hatch/TileHatchOutputBeamline.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/item/ICanFocus.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/item/LanthItem.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/item/MaskList.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/item/ParticleItem.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/item/PhotolithographicMask.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/tileentity/LINAC.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/tileentity/SourceChamber.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/tileentity/Synchrotron.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/tileentity/TargetChamber.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeAdder2.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeSC.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeTC.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/SourceChamberFrontend.java create mode 100644 src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/TargetChamberFrontend.java create mode 100644 src/main/java/com/elisis/gtnhlanth/util/Util.java create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/BI_CONN.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/BO_CONN.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_SHIELDED_ACCELERATOR.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_ACTIVE.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_ACTIVE.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_SIDES.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_SIDES.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_ACTIVE.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_ACTIVE.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_SIDES.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_SIDES.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/pipe.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t1.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t2.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/blocks/casing.coolant_delivery.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/blocks/casing.electrode.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/blocks/casing.focus_holder.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/blocks/casing.focus_manipulator.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator_glass.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/blocks/casing.target_holder.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/blocks/casing.target_receptacle.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/capillary_exchange.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/etched_mask1.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/iron_quartz_plate.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/mask_substrate.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/masked_mask_substrate.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/mm_lattice.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/particle/alpha.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/particle/electron.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/particle/neutron.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/particle/photon.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/particle/proton.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/asoc.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/blank1.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/blank2.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/blank3.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/cpu.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/hpic.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/ilc.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/lpic.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/nand.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/ncpu.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/nor.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/npic.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/pic.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/ppic.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/qbit.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/qpic.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/ram.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/soc.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/ssoc.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/uhpic.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/photomask/ulpic.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/items/substrate_precursor.png diff --git a/dependencies.gradle b/dependencies.gradle index 246c4b940b..c3bcd38be0 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -46,13 +46,13 @@ dependencies { api('com.github.GTNewHorizons:Yamcl:0.6.0:dev') api('com.github.GTNewHorizons:ThaumicTinkerer:2.10.1:dev') api("com.github.GTNewHorizons:Mobs-Info:0.3.1-GTNH:dev") - api("com.github.GTNewHorizons:ForestryMC:4.9.7:dev") devOnlyNonPublishable("com.github.GTNewHorizons:Infernal-Mobs:1.8.1-GTNH:dev") runtimeOnly("com.github.GTNewHorizons:Draconic-Evolution:1.3.6-GTNH:dev") // needed? implementation('com.github.GTNewHorizons:GTNEIOrePlugin:1.3.2:dev') { transitive = false } implementation("com.github.GTNewHorizons:Avaritia:1.50:dev") + implementation("com.github.GTNewHorizons:ForestryMC:4.9.7:dev") { transitive = false } compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta1:api') { transitive = false } compileOnlyApi("com.github.GTNewHorizons:AppleCore:3.3.0:dev") { transitive = false } diff --git a/src/main/java/com/elisis/gtnhlanth/GTNHLanthanides.java b/src/main/java/com/elisis/gtnhlanth/GTNHLanthanides.java index 275e8ae107..8ffdc0b5a1 100644 --- a/src/main/java/com/elisis/gtnhlanth/GTNHLanthanides.java +++ b/src/main/java/com/elisis/gtnhlanth/GTNHLanthanides.java @@ -1,18 +1,15 @@ package com.elisis.gtnhlanth; -import java.util.Arrays; import java.util.logging.Logger; -import net.minecraftforge.oredict.OreDictionary; - import com.elisis.gtnhlanth.common.CommonProxy; import com.elisis.gtnhlanth.common.register.BotWerkstoffMaterialPool; import com.elisis.gtnhlanth.common.register.LanthItemList; import com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool; +import com.elisis.gtnhlanth.common.tileentity.recipe.beamline.BeamlineRecipeLoader; import com.elisis.gtnhlanth.loader.BotRecipes; import com.elisis.gtnhlanth.loader.RecipeLoader; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; @@ -21,8 +18,6 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLLoadCompleteEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_Log; @Mod( modid = Tags.MODID, @@ -46,9 +41,13 @@ public class GTNHLanthanides { @EventHandler public static void preInit(FMLPreInitializationEvent e) { + WerkstoffAdderRegistry.addWerkstoffAdder(new WerkstoffMaterialPool()); WerkstoffAdderRegistry.addWerkstoffAdder(new BotWerkstoffMaterialPool()); - LanthItemList.register(); + + LanthItemList.registerTypical(); + LanthItemList.registerGTMTE(); + // GregTech_API.sAfterGTPostload.add(new ZPMRubberChanges()); proxy.preInit(e); } @@ -61,37 +60,45 @@ public class GTNHLanthanides { @EventHandler public static void postInit(FMLPostInitializationEvent e) { + RecipeLoader.loadGeneral(); RecipeLoader.loadLanthanideRecipes(); RecipeLoader.addRandomChemCrafting(); + RecipeLoader.loadAccelerator(); + + BeamlineRecipeLoader.load(); + BotRecipes.addGTRecipe(); // RecipeLoader.loadZylonRecipes(); proxy.postInit(e); // GT_Log.out.print(FluidRegistry.getFluid("Sodium Tungstate").getName()); - GT_Log.out.print( - Arrays.toString( - Werkstoff.werkstoffNameHashMap.keySet() - .toArray())); - GT_Log.out.print( - Arrays.toString( - Werkstoff.werkstoffHashMap.keySet() - .toArray())); - - GT_Log.out.print( - "HMMM " + Arrays.toString( - OreDictionary - .getOreIDs(WerkstoffMaterialPool.DephosphatedSamariumConcentrate.get(OrePrefixes.dust, 1)))); + // GT_Log.out.print(Arrays.toString(Werkstoff.werkstoffNameHashMap.keySet().toArray())); + // GT_Log.out.print(Arrays.toString(Werkstoff.werkstoffHashMap.keySet().toArray())); + + /* + * GT_Log.out.print("HMMM " + Arrays.toString(OreDictionary.getOreIDs( + * WerkstoffMaterialPool.DephosphatedSamariumConcentrate.get(OrePrefixes.dust, 1)))); + */ } @EventHandler public static void onModLoadingComplete(FMLLoadCompleteEvent e) { - GT_Log.out.print("AAAAAAAAAAAAAA"); + // GT_Log.out.print("AAAAAAAAAAAAAA " + new + // ItemStack(LanthItemList.maskMap.get(MaskList.CPU)).getUnlocalizedName()); // - GT_Log.out.print("We are done loading"); + // GT_Log.out.print("We are done loading"); BotRecipes.removeRecipes(); RecipeLoader.removeCeriumSources(); - GT_Log.out.print("blah blah " + WerkstoffMaterialPool.PTMEGElastomer.hasGenerationFeature(OrePrefixes.ingot)); + /* + * for (GT_ItemStack stack : BeamlineRecipeAdder.instance.TargetChamberRecipes.mRecipeItemMap.keySet()) { + * GT_Log.out.print(" Recipes for: " + stack.mItem.getUnlocalizedName() + ": "); for (GT_Recipe recipe : + * BeamlineRecipeAdder.instance.TargetChamberRecipes.mRecipeItemMap.get(stack)) { + * GT_Log.out.print(Arrays.toString(recipe.mOutputs)); } } + */ + + // GT_Log.out.print("blah blah " + + // WerkstoffMaterialPool.PTMEGElastomer.hasGenerationFeature(OrePrefixes.ingot)); } } diff --git a/src/main/java/com/elisis/gtnhlanth/common/beamline/BeamInformation.java b/src/main/java/com/elisis/gtnhlanth/common/beamline/BeamInformation.java new file mode 100644 index 0000000000..9c10703c2e --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/beamline/BeamInformation.java @@ -0,0 +1,51 @@ +package com.elisis.gtnhlanth.common.beamline; + +public class BeamInformation { + + private float energy; // in keV + private int rate; + + private Particle particle; + private int particleId; + + private float focus; + + public BeamInformation(float energy, int rate, int particleId, float focus) { + this.energy = energy; + this.rate = rate; + this.particleId = particleId; + this.particle = Particle.values()[particleId]; + this.focus = focus; + } + + public float getEnergy() { + return this.energy; + } + + public int getRate() { + return this.rate; + } + + public Particle getParticle() { + return this.particle; + } + + public int getParticleId() { + return this.particleId; + } + + public float getFocus() { + return this.focus; + } + + @Override + public String toString() { + return "Energy=" + this.getEnergy() + + ",Rate=" + + this.getRate() + + ",Particle=" + + this.getParticleId() + + ",Focus=" + + this.getFocus(); + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/beamline/BeamLinePacket.java b/src/main/java/com/elisis/gtnhlanth/common/beamline/BeamLinePacket.java new file mode 100644 index 0000000000..bbd712a9b0 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/beamline/BeamLinePacket.java @@ -0,0 +1,51 @@ +package com.elisis.gtnhlanth.common.beamline; + +import net.minecraft.nbt.NBTTagCompound; + +import com.github.technus.tectech.mechanics.dataTransport.DataPacket; + +public class BeamLinePacket extends DataPacket { + + public BeamLinePacket(BeamInformation content) { + super(content); + } + + public BeamLinePacket(NBTTagCompound compound) { + super(compound); + } + + @Override + protected BeamInformation contentFromNBT(NBTTagCompound nbt) { + /* + * NBTTagCompound compound = nbt.getCompoundTag("beamline"); + */ + return new BeamInformation( + nbt.getFloat("energy"), + nbt.getInteger("rate"), + nbt.getInteger("particleId"), + nbt.getInteger("focus")); + } + + @Override + protected NBTTagCompound contentToNBT() { + + NBTTagCompound compound = new NBTTagCompound(); + + compound.setFloat("energy", content.getEnergy()); + compound.setInteger("rate", content.getRate()); + compound.setInteger("particleId", content.getParticleId()); + compound.setFloat("focus", content.getFocus()); + + return compound; + } + + @Override + public boolean extraCheck() { + return true; + } + + @Override + protected BeamInformation unifyContentWith(BeamInformation arg0) { + throw new NoSuchMethodError("Unavailable to unify beam info data packet"); + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/beamline/IConnectsToBeamline.java b/src/main/java/com/elisis/gtnhlanth/common/beamline/IConnectsToBeamline.java new file mode 100644 index 0000000000..763365647c --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/beamline/IConnectsToBeamline.java @@ -0,0 +1,14 @@ +package com.elisis.gtnhlanth.common.beamline; + +import net.minecraftforge.common.util.ForgeDirection; + +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; + +public interface IConnectsToBeamline extends IMetaTileEntity { + + boolean canConnect(ForgeDirection side); + + IConnectsToBeamline getNext(IConnectsToBeamline source); + + boolean isDataInputFacing(ForgeDirection side); +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/beamline/Particle.java b/src/main/java/com/elisis/gtnhlanth/common/beamline/Particle.java new file mode 100644 index 0000000000..f6bc2517f4 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/beamline/Particle.java @@ -0,0 +1,71 @@ +package com.elisis.gtnhlanth.common.beamline; + +import net.minecraft.util.StatCollector; + +public enum Particle { + + ELECTRON(true, 0, 0.511f, 5000, "electron", "e\u207B", -1, null), + PHOTON(false, 1, 0, 0, "photon", "\u03B3", 0, null), + NEUTRON(false, 2, 939.57f, 15000, "neutron", "n\u2070", 0, null), + PROTON(true, 3, 938.27f, 15000, "proton", "p\u207A", 1, null), + ALPHA(true, 4, 3727.38f, 8000, "alpha", "\u03B1", 2, null); + + private boolean canAcc; + + private float restMass; // in MeV + + private float maxSourceEnergy; // in keV + + private String name; + private String shortName; + + private float charge; // in multiples of elemental charge + + private String chargeSpecial; + + private Particle(boolean canAcc, int id, float restMass, float maxSourceEnergy, String name, String shortName, + float charge, String chargeSpecial) { // ID + // is + // symbolic + // only + this.canAcc = canAcc; + this.restMass = restMass; + this.maxSourceEnergy = maxSourceEnergy; + this.name = name; + this.shortName = shortName; + this.charge = charge; + this.chargeSpecial = chargeSpecial; + } + + public float getMass() { + return this.restMass; + } + + public float getCharge() { + return this.charge; + } + + public String getChargeSpecial() { + return this.chargeSpecial; + } + + public boolean canAccelerate() { + return this.canAcc; + } + + public float maxSourceEnergy() { + return this.maxSourceEnergy; + } + + public String getName() { + return this.name; + } + + public String getLocalisedName() { + return StatCollector.translateToLocal("particle." + this.name) + " (" + this.shortName + ")"; + } + + public static Particle getParticleFromId(int id) { + return Particle.values()[id]; + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/beamline/TileBeamline.java b/src/main/java/com/elisis/gtnhlanth/common/beamline/TileBeamline.java new file mode 100644 index 0000000000..058234d2bb --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/beamline/TileBeamline.java @@ -0,0 +1,256 @@ +package com.elisis.gtnhlanth.common.beamline; + +import static gregtech.api.enums.Dyes.MACHINE_METAL; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.GT_Mod; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.MetaPipeEntity; +import gregtech.common.GT_Client; +import gregtech.common.render.GT_TextureBuilder; + +public class TileBeamline extends MetaPipeEntity implements IConnectsToBeamline { + + private static Textures.BlockIcons.CustomIcon pipe; + + private byte connectionCount = 0; + + private boolean active; + + public TileBeamline(int id, String name, String nameRegional) { + super(id, name, nameRegional, 0); + } + + public TileBeamline(String name) { + super(name, 0); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if ((aTick & 31) == 31) { + mConnections = 0; + connectionCount = 0; + + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + ForgeDirection d1 = dir.getOpposite(); + TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(dir); + if (tTileEntity instanceof IConnectsToBeamline) { + if (((IConnectsToBeamline) tTileEntity).canConnect(d1)) { + mConnections |= 1 << dir.ordinal(); + connectionCount++; + } + } else if (tTileEntity instanceof IGregTechTileEntity) { + IMetaTileEntity meta = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + if (meta instanceof IConnectsToBeamline) { + if (((IConnectsToBeamline) meta).canConnect(d1)) { + mConnections |= 1 << dir.ordinal(); + connectionCount++; + } + } + } + } + } + } else if (aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected == 4) { + aBaseMetaTileEntity.issueTextureUpdate(); + } + } + + @Override + public byte getTileEntityBaseType() { + return 7; + } + + @Override + public void loadNBTData(NBTTagCompound arg0) {} + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity arg0) { + return new TileBeamline(mName); + } + + @Override + public void saveNBTData(NBTTagCompound arg0) {} + + @Override + public float getThickNess() { + if (GT_Mod.instance.isClientSide() && GT_Client.hideValue == 1) { + return 0.0625F; + } + return 0.5f; + } + + @Override + public boolean renderInside(ForgeDirection arg0) { + return false; + } + + @Override + public boolean canConnect(ForgeDirection side) { + return true; + } + + // Largely taken from Tec's DataPipe + + @Override + public IConnectsToBeamline getNext(IConnectsToBeamline source) { + + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + + if ((mConnections & 1 << dir.ordinal()) == 0) { + continue; + } + + TileEntity next = this.getBaseMetaTileEntity() + .getTileEntityAtSide(dir); + if (next instanceof IConnectsToBeamline && next != source) { + + if (((IConnectsToBeamline) next).isDataInputFacing(dir.getOpposite())) { + return (IConnectsToBeamline) next; + } + + } else if (next instanceof IGregTechTileEntity) { + + IMetaTileEntity meta = ((IGregTechTileEntity) next).getMetaTileEntity(); + if (meta instanceof IConnectsToBeamline && meta != source) { + + if (meta instanceof TileBeamline && (((TileBeamline) meta).connectionCount == 2)) { + + ((TileBeamline) meta).markUsed(); + return (IConnectsToBeamline) meta; + } + + if (((IConnectsToBeamline) meta).isDataInputFacing(dir.getOpposite())) { + + return (IConnectsToBeamline) meta; + } + } + } + } + + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + pipe = new Textures.BlockIcons.CustomIcon("iconsets/pipe"); + super.registerIcons(aBlockIconRegister); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection aSide, int aConnections, + int aColorIndex, boolean aConnected, boolean aRedstone) { + return new ITexture[] { new GT_TextureBuilder().addIcon(pipe) + .build(), + new GT_TextureBuilder().addIcon(pipe) + .setRGBA(Dyes.getModulation((byte) aColorIndex, MACHINE_METAL.getRGBA())) + .build() }; + } + + public void markUsed() { + this.active = true; + } + + @Override + public boolean isDataInputFacing(ForgeDirection side) { + return true; + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + float tSpace = (1f - 0.375f) / 2; + float tSide0 = tSpace; + float tSide1 = 1f - tSpace; + float tSide2 = tSpace; + float tSide3 = 1f - tSpace; + float tSide4 = tSpace; + float tSide5 = 1f - tSpace; + + if (getBaseMetaTileEntity().getCoverIDAtSide(ForgeDirection.DOWN) != 0) { + tSide0 = tSide2 = tSide4 = 0; + tSide3 = tSide5 = 1; + } + if (getBaseMetaTileEntity().getCoverIDAtSide(ForgeDirection.UP) != 0) { + tSide2 = tSide4 = 0; + tSide1 = tSide3 = tSide5 = 1; + } + if (getBaseMetaTileEntity().getCoverIDAtSide(ForgeDirection.NORTH) != 0) { + tSide0 = tSide2 = tSide4 = 0; + tSide1 = tSide5 = 1; + } + if (getBaseMetaTileEntity().getCoverIDAtSide(ForgeDirection.SOUTH) != 0) { + tSide0 = tSide4 = 0; + tSide1 = tSide3 = tSide5 = 1; + } + if (getBaseMetaTileEntity().getCoverIDAtSide(ForgeDirection.WEST) != 0) { + tSide0 = tSide2 = tSide4 = 0; + tSide1 = tSide3 = 1; + } + if (getBaseMetaTileEntity().getCoverIDAtSide(ForgeDirection.EAST) != 0) { + tSide0 = tSide2 = 0; + tSide1 = tSide3 = tSide5 = 1; + } + + byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; + if ((tConn & 1 << ForgeDirection.DOWN.ordinal()) != 0) { + tSide0 = 0f; + } + if ((tConn & 1 << ForgeDirection.UP.ordinal()) != 0) { + tSide1 = 1f; + } + if ((tConn & 1 << ForgeDirection.NORTH.ordinal()) != 0) { + tSide2 = 0f; + } + if ((tConn & 1 << ForgeDirection.SOUTH.ordinal()) != 0) { + tSide3 = 1f; + } + if ((tConn & 1 << ForgeDirection.WEST.ordinal()) != 0) { + tSide4 = 0f; + } + if ((tConn & 1 << ForgeDirection.EAST.ordinal()) != 0) { + tSide5 = 1f; + } + + return AxisAlignedBB + .getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); + } + + @Override + public String[] getDescription() { + return new String[] { StatCollector.translateToLocal("beamline.pipe.desc.0"), // Beamline pipe + EnumChatFormatting.AQUA + StatCollector.translateToLocal("beamline.pipe.desc.1"), // Does not cross, split + // or turn + "Added by " + EnumChatFormatting.GREEN + "GTNH: Lanthanides" + + }; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { + return false; + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/block/AntennaCasing.java b/src/main/java/com/elisis/gtnhlanth/common/block/AntennaCasing.java new file mode 100644 index 0000000000..ea7d8423df --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/block/AntennaCasing.java @@ -0,0 +1,15 @@ +package com.elisis.gtnhlanth.common.block; + +public class AntennaCasing extends Casing { + + private int antennaTier; + + public AntennaCasing(int tier) { + super("antenna_t" + tier); + this.antennaTier = tier; + } + + public int getTier() { + return this.antennaTier; + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/block/Casing.java b/src/main/java/com/elisis/gtnhlanth/common/block/Casing.java new file mode 100644 index 0000000000..71f581efbe --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/block/Casing.java @@ -0,0 +1,80 @@ +package com.elisis.gtnhlanth.common.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import com.elisis.gtnhlanth.Tags; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; + +public class Casing extends Block { + + @SideOnly(Side.CLIENT) + protected IIcon[] texture; + + private String name; + + public Casing(String name) { + super(Material.iron); + this.name = name; + this.setBlockTextureName(Tags.MODID + ":casing." + name); + GregTech_API.registerMachineBlock(this, -1); + } + + public Casing(String name, Material material) { + super(material); + this.name = name; + this.setBlockTextureName(Tags.MODID + ":casing." + name); + GregTech_API.registerMachineBlock(this, -1); + } + + @Override + public int damageDropped(int meta) { + return meta; + } + + @Override + public String getHarvestTool(int aMeta) { + return "wrench"; + } + + @Override + public int getHarvestLevel(int aMeta) { + return 2; + } + + @Override + public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { + return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ); + } + + @Override + public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + super.breakBlock(aWorld, aX, aY, aZ, aBlock, aMetaData); + } + + @Override + public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { + super.onBlockAdded(aWorld, aX, aY, aZ); + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + + @Override + public String getUnlocalizedName() { + return "casing." + this.name; + } + + @Override + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { + return false; + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/block/ShieldedAccGlass.java b/src/main/java/com/elisis/gtnhlanth/common/block/ShieldedAccGlass.java new file mode 100644 index 0000000000..41bebcf170 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/block/ShieldedAccGlass.java @@ -0,0 +1,68 @@ +package com.elisis.gtnhlanth.common.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import com.elisis.gtnhlanth.Tags; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; + +public class ShieldedAccGlass extends Block { + + private static final String name = "shielded_accelerator_glass"; + + public ShieldedAccGlass() { + super(Material.glass); + this.setBlockName("casing." + name); + this.setBlockTextureName(Tags.MODID + ":casing." + name); + GregTech_API.registerMachineBlock(this, -1); + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return 1; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + @Override + public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + @Override + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) { + if (worldClient.getBlock(xCoord, yCoord, zCoord) instanceof ShieldedAccGlass) return false; + return super.shouldSideBeRendered(worldClient, xCoord, yCoord, zCoord, aSide); + } + + @Override + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { + return false; + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/hatch/TileBusInputFocus.java b/src/main/java/com/elisis/gtnhlanth/common/hatch/TileBusInputFocus.java new file mode 100644 index 0000000000..43a6df9366 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/hatch/TileBusInputFocus.java @@ -0,0 +1,85 @@ +package com.elisis.gtnhlanth.common.hatch; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + +import com.elisis.gtnhlanth.common.item.ICanFocus; +import com.elisis.gtnhlanth.util.Util; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers.GT_MetaTileEntity_Hatch_NbtConsumable; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; + +public class TileBusInputFocus extends GT_MetaTileEntity_Hatch_NbtConsumable { + + private static final int INPUT_SLOTS = 4; + + public TileBusInputFocus(int id, String name, String nameRegional) { + super(id, name, nameRegional, 0, INPUT_SLOTS, "Input Bus for Foci", false); + } + + public TileBusInputFocus(String name, String[] descriptionArray, ITexture[][][] textures) { + super(name, 0, INPUT_SLOTS, descriptionArray, false, textures); + } + + @Override + public int getInputSlotCount() { + return INPUT_SLOTS; + } + + @Override + public boolean isFacingValid(ForgeDirection facing) { + return true; + } + + @Override + public AutoMap getItemsValidForUsageSlots() { + return new AutoMap<>(); + } + + @Override + public boolean isItemValidForUsageSlot(ItemStack aStack) { + + if (this.getContentUsageSlots() + .size() == 0) { + return aStack.getItem() instanceof ICanFocus; + } else { + return false; + } + + } + + @Override + public String getNameGUI() { + return "Focus Input Bus"; + } + + public void depleteFocusDurability(int damage) { + + ItemStack stack = this.getContentUsageSlots() + .toArray()[0]; + + Util.depleteDurabilityOfStack(stack, damage); + + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Catalyst) }; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Catalyst) }; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new TileBusInputFocus(mName, mDescriptionArray, mTextures); + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/hatch/TileHatchBeamlineConnector.java b/src/main/java/com/elisis/gtnhlanth/common/hatch/TileHatchBeamlineConnector.java new file mode 100644 index 0000000000..c0fa41774b --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/hatch/TileHatchBeamlineConnector.java @@ -0,0 +1,136 @@ +package com.elisis.gtnhlanth.common.hatch; + +import static com.github.technus.tectech.util.CommonValues.MOVE_AT; +import static net.minecraft.util.StatCollector.translateToLocalFormatted; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fluids.FluidStack; + +import org.apache.commons.lang3.reflect.FieldUtils; + +import com.elisis.gtnhlanth.common.beamline.IConnectsToBeamline; +import com.github.technus.tectech.mechanics.dataTransport.DataPacket; +import com.github.technus.tectech.util.TT_Utility; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; + +public abstract class TileHatchBeamlineConnector extends GT_MetaTileEntity_Hatch + implements IConnectsToBeamline { + + private String clientLocale = "en_US"; + + public T q; + + public short id = -1; + + protected TileHatchBeamlineConnector(int aID, String aName, String aNameRegional, int aTier, String descr) { + super(aID, aName, aNameRegional, aTier, 0, descr); + TT_Utility.setTier(aTier, this); + } + + protected TileHatchBeamlineConnector(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setShort("eID", id); + if (q != null) { + aNBT.setTag("eDATA", q.toNbt()); + } + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + id = aNBT.getShort("eID"); + if (aNBT.hasKey("eDATA")) { + q = loadPacketFromNBT(aNBT.getCompoundTag("eDATA")); + } + } + + protected abstract T loadPacketFromNBT(NBTTagCompound nbt); + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if (MOVE_AT == aTick % 20) { + if (q == null) { + getBaseMetaTileEntity().setActive(false); + } else { + getBaseMetaTileEntity().setActive(true); + moveAround(aBaseMetaTileEntity); + } + } + } + } + + public abstract void moveAround(IGregTechTileEntity aBaseMetaTileEntity); + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + try { + EntityPlayerMP player = (EntityPlayerMP) aPlayer; + clientLocale = (String) FieldUtils.readField(player, "translator", true); + } catch (Exception e) { + clientLocale = "en_US"; + } + return true; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public boolean isFluidInputAllowed(FluidStack aFluid) { + return false; + } + + @Override + public boolean isValidSlot(int aIndex) { + return false; + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public String[] getInfoData() { + if (id > 0) { + return new String[] { + translateToLocalFormatted("tt.keyword.ID", clientLocale) + ": " + EnumChatFormatting.AQUA + id, + translateToLocalFormatted("tt.keyword.Content", clientLocale) + ": " + + EnumChatFormatting.AQUA + + (q != null ? q.getContentString() : 0), + translateToLocalFormatted("tt.keyword.PacketHistory", clientLocale) + ": " + + EnumChatFormatting.RED + + (q != null ? q.getTraceSize() : 0), }; + } + return new String[] { + translateToLocalFormatted("tt.keyword.Content", clientLocale) + ": " + + EnumChatFormatting.AQUA + + (q != null ? q.getContentString() : 0), + translateToLocalFormatted("tt.keyword.PacketHistory", clientLocale) + ": " + + EnumChatFormatting.RED + + (q != null ? q.getTraceSize() : 0), }; + } + + @Override + public String[] getDescription() { + return new String[] { "Text description shouldn't be seen, report to Tec", "High speed fibre optics connector.", + EnumChatFormatting.AQUA + "Must be painted to work" }; + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/hatch/TileHatchInputBeamline.java b/src/main/java/com/elisis/gtnhlanth/common/hatch/TileHatchInputBeamline.java new file mode 100644 index 0000000000..e5a5c9df2f --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/hatch/TileHatchInputBeamline.java @@ -0,0 +1,131 @@ +package com.elisis.gtnhlanth.common.hatch; + +import static gregtech.api.enums.Dyes.MACHINE_METAL; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + +import com.elisis.gtnhlanth.common.beamline.BeamLinePacket; +import com.elisis.gtnhlanth.common.beamline.IConnectsToBeamline; +import com.github.technus.tectech.util.TT_Utility; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; + +public class TileHatchInputBeamline extends TileHatchBeamlineConnector { + + private boolean delay = true; + + private static final String activeIconPath = "iconsets/OVERLAY_BI_ACTIVE"; + private static final String sideIconPath = "iconsets/OVERLAY_BI_SIDES"; + private static final String connIconPath = "iconsets/BI_CONN"; + + private static final Textures.BlockIcons.CustomIcon activeIcon = new Textures.BlockIcons.CustomIcon(activeIconPath); + private static final Textures.BlockIcons.CustomIcon sideIcon = new Textures.BlockIcons.CustomIcon(sideIconPath); + private static final Textures.BlockIcons.CustomIcon connIcon = new Textures.BlockIcons.CustomIcon(connIconPath); + + public TileHatchInputBeamline(int id, String name, String nameRegional, int tier) { + + super(id, name, nameRegional, tier, ""); + TT_Utility.setTier(tier, this); + } + + public TileHatchInputBeamline(String name, int tier, String desc, ITexture[][][] textures) { + super(name, tier, desc, textures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, + new GT_RenderedTexture( + activeIcon, + Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), + new GT_RenderedTexture(connIcon) }; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, + new GT_RenderedTexture( + sideIcon, + Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), + new GT_RenderedTexture(connIcon) }; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity tile) { + return new TileHatchInputBeamline(mName, mTier, mDescription, mTextures); + } + + @Override + protected BeamLinePacket loadPacketFromNBT(NBTTagCompound tag) { + return new BeamLinePacket(tag); + } + + @Override + public boolean isInputFacing(ForgeDirection side) { + return side == getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean isDataInputFacing(ForgeDirection side) { + return isInputFacing(side); + } + + @Override + public boolean isOutputFacing(ForgeDirection aSide) { + return false; + } + + @Override + public boolean isFacingValid(ForgeDirection facing) { + return true; + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean canConnect(ForgeDirection side) { + return isInputFacing(side); + } + + @Override + public IConnectsToBeamline getNext(IConnectsToBeamline source) { + return null; + } + + @Override + public String[] getDescription() { + return null; + } + + public void setContents(BeamLinePacket in) { + if (in == null) { + this.q = null; + } else { + if (in.getContent() + .getRate() > 0) { + this.q = in; + delay = true; + } else { + this.q = null; + } + } + } + + @Override + public void moveAround(IGregTechTileEntity tile) { + if (delay) { + delay = false; + } else { + this.setContents(null); + } + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/hatch/TileHatchOutputBeamline.java b/src/main/java/com/elisis/gtnhlanth/common/hatch/TileHatchOutputBeamline.java new file mode 100644 index 0000000000..5483ee1d0f --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/hatch/TileHatchOutputBeamline.java @@ -0,0 +1,138 @@ +package com.elisis.gtnhlanth.common.hatch; + +import static gregtech.api.enums.Dyes.MACHINE_METAL; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + +import com.elisis.gtnhlanth.common.beamline.BeamLinePacket; +import com.elisis.gtnhlanth.common.beamline.IConnectsToBeamline; +import com.elisis.gtnhlanth.common.beamline.TileBeamline; +import com.github.technus.tectech.util.TT_Utility; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; + +public class TileHatchOutputBeamline extends TileHatchBeamlineConnector implements IConnectsToBeamline { + + private static final String activeIconPath = "iconsets/OVERLAY_BO_ACTIVE"; + private static final String sideIconPath = "iconsets/OVERLAY_BO_SIDES"; + private static final String connIconPath = "iconsets/BO_CONN"; + + private static final Textures.BlockIcons.CustomIcon activeIcon = new Textures.BlockIcons.CustomIcon(activeIconPath); + private static final Textures.BlockIcons.CustomIcon sideIcon = new Textures.BlockIcons.CustomIcon(sideIconPath); + private static final Textures.BlockIcons.CustomIcon connIcon = new Textures.BlockIcons.CustomIcon(connIconPath); + + public TileHatchOutputBeamline(int id, String name, String nameRegional, int tier) { + super(id, name, nameRegional, tier, ""); + TT_Utility.setTier(tier, this); + } + + public TileHatchOutputBeamline(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, + new GT_RenderedTexture( + activeIcon, + Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), + new GT_RenderedTexture(connIcon) }; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, + new GT_RenderedTexture( + sideIcon, + Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), + new GT_RenderedTexture(connIcon) }; + } + + @Override + public IConnectsToBeamline getNext(IConnectsToBeamline source) { + + IGregTechTileEntity base = this.getBaseMetaTileEntity(); + IGregTechTileEntity next = base.getIGregTechTileEntityAtSide(base.getFrontFacing()); + + if (next == null) { + return null; + } + + IMetaTileEntity meta = next.getMetaTileEntity(); + if (meta instanceof TileBeamline) { + + ((TileBeamline) meta).markUsed(); + return (IConnectsToBeamline) meta; + + } else if (meta instanceof TileHatchInputBeamline && ((TileHatchInputBeamline) meta).canConnect( + base.getFrontFacing() + .getOpposite())) { + + return (IConnectsToBeamline) meta; + } + + return null; + } + + @Override + public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { + IConnectsToBeamline current = this, source = this, next; + int range = 0; + while ((next = current.getNext(source)) != null && range++ < 100) { + if (next instanceof TileHatchInputBeamline) { + ((TileHatchInputBeamline) next).setContents(q); + break; + } + source = current; + current = next; + } + q = null; + } + + @Override + protected BeamLinePacket loadPacketFromNBT(NBTTagCompound nbt) { + return new BeamLinePacket(nbt); + } + + @Override + public boolean canConnect(ForgeDirection side) { + return this.isOutputFacing(side); + } + + @Override + public boolean isDataInputFacing(ForgeDirection side) { + return this.isInputFacing(side); + } + + @Override + public boolean isFacingValid(ForgeDirection facing) { + return true; + } + + @Override + public boolean isInputFacing(ForgeDirection aSide) { + return false; + } + + @Override + public boolean isOutputFacing(ForgeDirection side) { + return side == this.getBaseMetaTileEntity() + .getFrontFacing(); + } + + @Override + public String[] getDescription() { + return null; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity arg0) { + return new TileHatchOutputBeamline(mName, mTier, mDescription, mTextures); + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/item/ICanFocus.java b/src/main/java/com/elisis/gtnhlanth/common/item/ICanFocus.java new file mode 100644 index 0000000000..21cdb636c5 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/item/ICanFocus.java @@ -0,0 +1,5 @@ +package com.elisis.gtnhlanth.common.item; + +public interface ICanFocus { + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/item/LanthItem.java b/src/main/java/com/elisis/gtnhlanth/common/item/LanthItem.java new file mode 100644 index 0000000000..062b9b1a91 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/item/LanthItem.java @@ -0,0 +1,15 @@ +package com.elisis.gtnhlanth.common.item; + +import net.minecraft.item.Item; + +import com.elisis.gtnhlanth.Tags; + +public class LanthItem extends Item { + + public LanthItem(String name) { + super(); + this.setUnlocalizedName(name); + this.setTextureName(Tags.MODID + ":" + name); + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/item/MaskList.java b/src/main/java/com/elisis/gtnhlanth/common/item/MaskList.java new file mode 100644 index 0000000000..bbc2d1c18a --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/item/MaskList.java @@ -0,0 +1,147 @@ +package com.elisis.gtnhlanth.common.item; + +import net.minecraft.item.ItemStack; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.ItemList; + +public enum MaskList { + + // There are absolutely better ways of doing this than a GT Materials-esque Enum, some method of automatically + // scraping the wafer types would be preferable in particular + // Use Dyes._NULL to indicate a wafer's lack of a dedicated lens instead of null, if the wafer's mask is to be + // generated + // Ignore last argument if using all wafers + ERROR("error", "ERROR", 0, "", null, null, 0, 0, 0, 0, null), + BLANK1("blank1", "T1 Blank", 0, "VISIBLE", null, null, 0, 0, 0, 0, null), + BLANK2("blank2", "T2 Blank", 0, "UV", null, null, 0, 0, 0, 0, null), + BLANK3("blank3", "T3 Blank", 0, "X-RAY", null, null, 0, 0, 0, 0, null), + ILC("ilc", "Integrated Logic Circuit", 100, "", BLANK1, Dyes.dyeRed, 0.5e-3f, 4e-3f, 50, 1, + ItemList.Circuit_Wafer_ILC.get(1)), + RAM("ram", "Random Access Memory", 200, "", BLANK1, Dyes.dyeCyan, 2e-3f, 4e-3f, 60, 2, + ItemList.Circuit_Wafer_Ram.get(1), ItemList.Circuit_Silicon_Wafer), + NAND("nand", "NAND", 200, "", BLANK2, Dyes._NULL, 7e-3f, 12e-3f, 50, 1, ItemList.Circuit_Wafer_NAND.get(1), + ItemList.Circuit_Silicon_Wafer), // NAND uses only Ender Pearl lens, don't ask me why + NOR("nor", "NOR", 100, "", BLANK2, Dyes._NULL, 8e-3f, 10e-3f, 50, 1, ItemList.Circuit_Wafer_NOR.get(1), + ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), // Same as above, but with ender eye + CPU("cpu", "Central Processing Unit", 10, "", BLANK2, Dyes.dyeWhite, 6e-3f, 12e-3f, 50, 2, + ItemList.Circuit_Wafer_CPU.get(1)), + SOC("soc", "SoC", 150, "", BLANK2, Dyes.dyeYellow, 3e-3f, 10e-3f, 50, 2, ItemList.Circuit_Wafer_SoC.get(1), + ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), + ASOC("asoc", "Advanced SoC", 120, "", BLANK2, Dyes.dyeGreen, 100e-3f, 200e-3f, 50, 2, + ItemList.Circuit_Wafer_SoC2.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), + PIC("pic", "Power IC", 100, "", BLANK2, Dyes.dyeBlue, 5e-3f, 10e-3f, 50, 4, ItemList.Circuit_Wafer_PIC.get(1), + ItemList.Circuit_Silicon_Wafer), + HPIC("hpic", "High Power IC", 80, "", BLANK3, null, 100e-3f, 200e-3f, 50, 6, ItemList.Circuit_Wafer_HPIC.get(1), + ItemList.Circuit_Silicon_Wafer), // Different, made in chemical reactor. Figure out something for + // this later? + NCPU("ncpu", "NanoCPU", 60, "", BLANK2, null, 5e-3f, 10e-3f, 50, 4, ItemList.Circuit_Wafer_NanoCPU.get(1), + ItemList.Circuit_Silicon_Wafer), // Same as above + QBIT("qbit", "QBit", 50, "", BLANK2, null, 3e-3f, 10e-3f, 50, 4, ItemList.Circuit_Wafer_QuantumCPU.get(1), + ItemList.Circuit_Silicon_Wafer), // ^ + UHPIC("uhpic", "Ultra High Power IC", 60, "", BLANK3, null, 200e-3f, 400e-3f, 50, 8, + ItemList.Circuit_Wafer_UHPIC.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), // You + // get + // the + // gist + SSOC("ssoc", "Simple SoC", 150, "", BLANK1, Dyes.dyeOrange, 2e-3f, 4e-3f, 50, 1, + ItemList.Circuit_Wafer_Simple_SoC.get(1)), + ULPIC("ulpic", "Ultra Low Power IC", 200, "", BLANK1, Dyes.dyeGreen, 2e-3f, 4e-3f, 50, 1, + ItemList.Circuit_Wafer_ULPIC.get(1)), // Can use green for this as well as asoc, given + // the latter uses a different base mask + LPIC("lpic", "Low Power IC", 150, "", BLANK1, Dyes.dyeYellow, 2e-3f, 4e-3f, 50, 2, + ItemList.Circuit_Wafer_LPIC.get(1)), // Same as above, except for yellow + NPIC("npic", "Nano Power IC", 70, "", BLANK3, Dyes.dyeRed, 1, 100000, 50, 4, ItemList.Circuit_Wafer_NPIC.get(1), + ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, ItemList.Circuit_Silicon_Wafer3), // Same + PPIC("ppic", "PPIC", 50, "", BLANK3, null, 10, 15, 50, 6, ItemList.Circuit_Wafer_PPIC.get(1), + ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, ItemList.Circuit_Silicon_Wafer3), // CR + // recipe + QPIC("qpic", "QPIC", 50, "", BLANK3, Dyes.dyeBlue, 5, 9, 50, 6, ItemList.Circuit_Wafer_QPIC.get(1), + ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, ItemList.Circuit_Silicon_Wafer3, + ItemList.Circuit_Silicon_Wafer4); // Different base mask to PIC + + String name; + String englishName; + String spectrum; + + int maxDamage; + + MaskList precursor; + Dyes lensColour; + + float minEnergy; + float maxEnergy; + + float minFocus; + int baselineAmount; + + ItemStack producedItem; + + ItemList[] forbiddenWafers; + + MaskList(String name, String englishName, int maxDamage, String spectrum, MaskList precursor, Dyes lensColour, + float minEnergy, float maxEnergy, float minFocus, int baselineAmount, ItemStack producedItem, + ItemList... forbiddenWafers) { + this.name = name; + this.englishName = englishName; + this.spectrum = spectrum; + this.maxDamage = maxDamage; + this.precursor = precursor; + this.lensColour = lensColour; + this.minFocus = minFocus; + this.minEnergy = minEnergy; + this.maxEnergy = maxEnergy; + this.baselineAmount = baselineAmount; + this.producedItem = producedItem; + this.forbiddenWafers = forbiddenWafers; + } + + public String getName() { + return this.name; + } + + public String getEnglishName() { + return this.englishName; + } + + public String getSpectrum() { + return this.spectrum; + } + + public int getDamage() { + return this.maxDamage; + } + + public MaskList getPrecursor() { + return this.precursor; + } + + public Dyes getLensColour() { + return this.lensColour; + } + + public float getMinEnergy() { + return this.minEnergy; + } + + public float getMaxEnergy() { + return this.maxEnergy; + } + + public float getMinFocus() { + return this.minFocus; + } + + public int getBaselineAmount() { + return this.baselineAmount; + } + + public ItemStack getProducedItem() { + return this.producedItem; + } + + public ItemList[] getForbiddenWafers() { + return this.forbiddenWafers; + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/item/ParticleItem.java b/src/main/java/com/elisis/gtnhlanth/common/item/ParticleItem.java new file mode 100644 index 0000000000..b6484b93a5 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/item/ParticleItem.java @@ -0,0 +1,124 @@ +package com.elisis.gtnhlanth.common.item; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; + +import com.elisis.gtnhlanth.Tags; +import com.elisis.gtnhlanth.common.beamline.Particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ParticleItem extends Item { + + public static final int NUMBER_OF_SUBTYPES = Particle.values().length; + + private static String[] names = new String[NUMBER_OF_SUBTYPES]; + + static { + populateNamesArray(); + } + + @SideOnly(Side.CLIENT) + private IIcon[] iconArray; + + public ParticleItem() { + + this.setHasSubtypes(true); + this.setMaxDamage(0); + + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIconFromDamage(int damage) { + int j = MathHelper.clamp_int(damage, 0, NUMBER_OF_SUBTYPES - 1); + return this.iconArray[j]; + } + + public String getUnlocalizedName(ItemStack stack) { + int i = MathHelper.clamp_int(stack.getItemDamage(), 0, NUMBER_OF_SUBTYPES - 1); + return super.getUnlocalizedName() + "." + names[i]; + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @SideOnly(Side.CLIENT) + @Override + public void getSubItems(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < NUMBER_OF_SUBTYPES; ++i) { + list.add(new ItemStack(item, 1, i)); + } + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister register) { + this.iconArray = new IIcon[NUMBER_OF_SUBTYPES]; + + for (int i = 0; i < NUMBER_OF_SUBTYPES; ++i) { + this.iconArray[i] = register.registerIcon(Tags.MODID + ":" + "particle/" + names[i]); + } + } + + @SideOnly(Side.CLIENT) + @Override + public String getItemStackDisplayName(ItemStack stack) { + + int i = MathHelper.clamp_int(stack.getItemDamage(), 0, NUMBER_OF_SUBTYPES - 1); + + Particle particle = Particle.values()[i]; + + return particle.getLocalisedName(); + + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { + + int i = MathHelper.clamp_int(stack.getItemDamage(), 0, NUMBER_OF_SUBTYPES - 1); + + Particle particle = Particle.values()[i]; + + float restMass = particle.getMass(); + + float charge = particle.getCharge(); + + String chargeSpecial = particle.getChargeSpecial(); + + String chargeStringToAppend; + if (chargeSpecial != null) { + + chargeStringToAppend = chargeSpecial; + + } else { + + if (charge > 0) chargeStringToAppend = "+" + charge; + else chargeStringToAppend = "" + charge; + } + + list.add("Rest Mass: " + restMass + " MeV"); + list.add("Charge: " + chargeStringToAppend + "e"); + + } + + private static void populateNamesArray() { + + for (int i = 0; i < NUMBER_OF_SUBTYPES; i++) { + + Particle particle = Particle.values()[i]; + + names[i] = particle.getName(); + + } + + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/item/PhotolithographicMask.java b/src/main/java/com/elisis/gtnhlanth/common/item/PhotolithographicMask.java new file mode 100644 index 0000000000..a6b34660f0 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/item/PhotolithographicMask.java @@ -0,0 +1,38 @@ +package com.elisis.gtnhlanth.common.item; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import com.elisis.gtnhlanth.Tags; + +public class PhotolithographicMask extends Item implements ICanFocus { + + private String name; + private String descSpectrum; + + public PhotolithographicMask(String name, int maxDamage, String descSpectrum) { + super(); + this.name = name; + this.descSpectrum = descSpectrum; + this.setUnlocalizedName("photomask." + name); + this.setMaxStackSize(1); + this.setMaxDamage(maxDamage); + this.setTextureName(Tags.MODID + ":photomask/" + name); + } + + /* + * @Override public String getUnlocalizedName() { return "item.photomask." + this.name; } + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { + + if (!this.descSpectrum.isEmpty()) + list.add("Suitable for the " + this.descSpectrum + " segment of the electromagnetic spectrum and lower"); + + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/register/LanthItemList.java b/src/main/java/com/elisis/gtnhlanth/common/register/LanthItemList.java index 69aa026e47..1b799ac84a 100644 --- a/src/main/java/com/elisis/gtnhlanth/common/register/LanthItemList.java +++ b/src/main/java/com/elisis/gtnhlanth/common/register/LanthItemList.java @@ -1,19 +1,168 @@ package com.elisis.gtnhlanth.common.register; +import java.util.HashMap; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import com.elisis.gtnhlanth.common.beamline.TileBeamline; +import com.elisis.gtnhlanth.common.block.AntennaCasing; +import com.elisis.gtnhlanth.common.block.Casing; +import com.elisis.gtnhlanth.common.block.ShieldedAccGlass; +import com.elisis.gtnhlanth.common.hatch.TileBusInputFocus; +import com.elisis.gtnhlanth.common.hatch.TileHatchInputBeamline; +import com.elisis.gtnhlanth.common.hatch.TileHatchOutputBeamline; +import com.elisis.gtnhlanth.common.item.LanthItem; +import com.elisis.gtnhlanth.common.item.MaskList; +import com.elisis.gtnhlanth.common.item.ParticleItem; +import com.elisis.gtnhlanth.common.item.PhotolithographicMask; import com.elisis.gtnhlanth.common.tileentity.Digester; import com.elisis.gtnhlanth.common.tileentity.DissolutionTank; +import com.elisis.gtnhlanth.common.tileentity.LINAC; +import com.elisis.gtnhlanth.common.tileentity.SourceChamber; +import com.elisis.gtnhlanth.common.tileentity.Synchrotron; +import com.elisis.gtnhlanth.common.tileentity.TargetChamber; + +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.util.GT_LanguageManager; public final class LanthItemList { public static ItemStack DIGESTER; public static ItemStack DISSOLUTION_TANK; - public static void register() { + public static ItemStack LINAC; + public static ItemStack SOURCE_CHAMBER; + + public static ItemStack SYNCHROTRON; + + public static ItemStack TARGET_CHAMBER; + + public static ItemStack BEAMLINE_PIPE; + + public static ItemStack LUV_BEAMLINE_INPUT_HATCH; + public static ItemStack LUV_BEAMLINE_OUTPUT_HATCH; + + public static ItemStack BEAMLINE_FOCUS_INPUT_BUS; + + public static Item CAPILLARY_EXCHANGE = new LanthItem("capillary_exchange"); + + public static Item MM_LATTICE = new LanthItem("mm_lattice"); + + public static Item IRON_COATED_QUARTZ = new LanthItem("iron_quartz_plate"); + + public static Item SUBSTRATE_PRECURSOR = new LanthItem("substrate_precursor"); + + public static Item MASK_SUBSTRATE = new LanthItem("mask_substrate"); + + public static Item MASKED_MASK = new LanthItem("masked_mask_substrate"); + + public static Item ETCHED_MASK_1 = new LanthItem("etched_mask1"); + + public static Item SILICON_NITRIDE_MEMBRANE = new LanthItem("nitride_gold_membrane"); + + public static Item PARTICLE_ITEM = new ParticleItem().setUnlocalizedName("particle"); + + public static final Block SHIELDED_ACCELERATOR_CASING = new Casing("shielded_accelerator"); + public static final Block SHIELDED_ACCELERATOR_GLASS = new ShieldedAccGlass(); + + public static final Block ELECTRODE_CASING = new Casing("electrode"); + + public static final Block COOLANT_DELIVERY_CASING = new Casing("coolant_delivery"); + + // public static final Block ANTENNA_CASING_T1 = new Casing("antenna_t1"); + public static final Block ANTENNA_CASING_T1 = new AntennaCasing(1); + public static final Block ANTENNA_CASING_T2 = new AntennaCasing(2); + + public static final Block FOCUS_MANIPULATION_CASING = new Casing("focus_manipulator"); + public static final Block FOCUS_HOLDER = new Casing("focus_holder"); + + public static final Block TARGET_RECEPTACLE_CASING = new Casing("target_receptacle"); + public static final Block TARGET_HOLDER = new Casing("target_holder"); + + public static HashMap maskMap = new HashMap<>(); + + public static void registerGTMTE() { + + DIGESTER = new Digester(10500, "Digester", "Digester").getStackForm(1L); + DISSOLUTION_TANK = new DissolutionTank(10501, "Dissolution Tank", "Dissolution Tank").getStackForm(1L); + + BEAMLINE_PIPE = new TileBeamline(10502, "Beamline Pipe", "Beamline Pipe").getStackForm(1L); + LUV_BEAMLINE_INPUT_HATCH = new TileHatchInputBeamline( + 10503, + "LuV Beamline Input Hatch", + "LuV Beamline Input Hatch", + 6).getStackForm(1L); + LUV_BEAMLINE_OUTPUT_HATCH = new TileHatchOutputBeamline( + 10504, + "LuV Beamline Output Hatch", + "LuV Beamline Output Hatch", + 6).getStackForm(1L); + + BEAMLINE_FOCUS_INPUT_BUS = new TileBusInputFocus(10509, "Focus Input Bus", "Focus Input Bus").getStackForm(1L); + + LINAC = new LINAC(10505, "Linear Accelerator", "Linear Accelerator").getStackForm(1L); + + SOURCE_CHAMBER = new SourceChamber(10506, "Source Chamber", "Source Chamber").getStackForm(1L); + + SYNCHROTRON = new Synchrotron(10507, "Synchrotron", "Synchrotron").getStackForm(1L); + + TARGET_CHAMBER = new TargetChamber(10508, "Target Chamber", "Target Chamber").getStackForm(1L); + } + + public static void registerTypical() { + + GameRegistry.registerItem(CAPILLARY_EXCHANGE, CAPILLARY_EXCHANGE.getUnlocalizedName()); + + GameRegistry.registerItem(MM_LATTICE, MM_LATTICE.getUnlocalizedName()); + + GameRegistry.registerItem(IRON_COATED_QUARTZ, IRON_COATED_QUARTZ.getUnlocalizedName()); + + GameRegistry.registerItem(MASK_SUBSTRATE, MASK_SUBSTRATE.getUnlocalizedName()); + + GameRegistry.registerItem(ETCHED_MASK_1, ETCHED_MASK_1.getUnlocalizedName()); + + GameRegistry.registerItem(SUBSTRATE_PRECURSOR, SUBSTRATE_PRECURSOR.getUnlocalizedName()); + + GameRegistry.registerItem(MASKED_MASK, MASKED_MASK.getUnlocalizedName()); + + GameRegistry.registerItem(PARTICLE_ITEM, "particle"); + + GameRegistry.registerBlock(SHIELDED_ACCELERATOR_CASING, SHIELDED_ACCELERATOR_CASING.getUnlocalizedName()); + + GameRegistry.registerBlock(ELECTRODE_CASING, ELECTRODE_CASING.getUnlocalizedName()); + + GameRegistry.registerBlock(COOLANT_DELIVERY_CASING, COOLANT_DELIVERY_CASING.getUnlocalizedName()); + + GameRegistry.registerBlock(SHIELDED_ACCELERATOR_GLASS, SHIELDED_ACCELERATOR_GLASS.getUnlocalizedName()); + + GameRegistry.registerBlock(ANTENNA_CASING_T1, ANTENNA_CASING_T1.getUnlocalizedName()); + + GameRegistry.registerBlock(ANTENNA_CASING_T2, ANTENNA_CASING_T2.getUnlocalizedName()); + + GameRegistry.registerBlock(FOCUS_MANIPULATION_CASING, FOCUS_MANIPULATION_CASING.getUnlocalizedName()); + + GameRegistry.registerBlock(FOCUS_HOLDER, FOCUS_HOLDER.getUnlocalizedName()); + + GameRegistry.registerBlock(TARGET_RECEPTACLE_CASING, TARGET_RECEPTACLE_CASING.getUnlocalizedName()); + + GameRegistry.registerBlock(TARGET_HOLDER, TARGET_HOLDER.getUnlocalizedName()); + + for (MaskList mask : MaskList.values()) { + + String english = mask.getEnglishName(); + + String descSpectrum = mask.getSpectrum(); + + PhotolithographicMask maskItem = new PhotolithographicMask(mask.getName(), mask.getDamage(), descSpectrum); + GameRegistry.registerItem(maskItem, maskItem.getUnlocalizedName()); + + GT_LanguageManager.addStringLocalization(maskItem.getUnlocalizedName() + ".name", "Mask (" + english + ")"); + + maskMap.put(mask, maskItem); + + } - LanthItemList.DIGESTER = new Digester(10500, "Digester", "Digester").getStackForm(1L); - LanthItemList.DISSOLUTION_TANK = new DissolutionTank(10501, "Dissolution Tank", "Dissolution Tank") - .getStackForm(1L); } } diff --git a/src/main/java/com/elisis/gtnhlanth/common/register/WerkstoffMaterialPool.java b/src/main/java/com/elisis/gtnhlanth/common/register/WerkstoffMaterialPool.java index 1e45c94a0e..af7f909bdf 100644 --- a/src/main/java/com/elisis/gtnhlanth/common/register/WerkstoffMaterialPool.java +++ b/src/main/java/com/elisis/gtnhlanth/common/register/WerkstoffMaterialPool.java @@ -1,6 +1,7 @@ package com.elisis.gtnhlanth.common.register; import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers; import java.util.Arrays; @@ -13,9 +14,12 @@ import gregtech.api.enums.TextureSet; @SuppressWarnings({ "unchecked" }) public class WerkstoffMaterialPool implements Runnable { + // Current highest ID = 11_499 + private static final int offsetID = 11_000; private static final int offsetID2 = 11_100; private static final int offsetID3 = 11_300; + private static final int offsetID3b = 11_350; private static final int offsetID4 = 11_400; private static final int offsetID5 = 11_460; @@ -41,7 +45,7 @@ public class WerkstoffMaterialPool implements Runnable { // hafnium // synthesis offsetID, - TextureSet.SET_DULL); + TextureSet.SET_METALLIC); public static final Werkstoff LowPurityHafnium = new Werkstoff( new short[] { 240, 223, 208 }, @@ -50,8 +54,7 @@ public class WerkstoffMaterialPool implements Runnable { new Werkstoff.Stats(), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable() - .onlyDust(), // Perhaps use hafnia liquid in elemental hafnium - // synthesis + .onlyDust(), offsetID + 1, TextureSet.SET_DULL); @@ -62,8 +65,7 @@ public class WerkstoffMaterialPool implements Runnable { new Werkstoff.Stats(), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable() - .onlyDust(), // Perhaps use hafnia liquid in elemental hafnium - // synthesis + .onlyDust(), offsetID + 2, TextureSet.SET_DULL); @@ -116,13 +118,13 @@ public class WerkstoffMaterialPool implements Runnable { "Zirconium", subscriptNumbers("Zr"), new Werkstoff.Stats().setBlastFurnace(true), - Werkstoff.Types.COMPOUND, + Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().disable() .onlyDust() - .addMetalItems() - .enforceUnification(), + .addMetalItems(), + // .enforceUnification(), offsetID + 7, - TextureSet.SET_DULL); + TextureSet.SET_METALLIC); public static final Werkstoff Zirconia = new Werkstoff( new short[] { 177, 152, 101 }, @@ -133,7 +135,7 @@ public class WerkstoffMaterialPool implements Runnable { new Werkstoff.GenerationFeatures().disable() .onlyDust(), offsetID + 8, - TextureSet.SET_DULL); + TextureSet.SET_SHINY); public static final Werkstoff ZirconiumTetrachloride = new Werkstoff( new short[] { 179, 164, 151 }, @@ -1047,6 +1049,17 @@ public class WerkstoffMaterialPool implements Runnable { offsetID3 + 16, TextureSet.SET_FLUID); + public static final Werkstoff MolybdenumTrioxide = new Werkstoff( + new short[] { 236, 255, 248 }, + "Molybdenum Trioxide", + subscriptNumbers("MoO3"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + offsetID3 + 17, + TextureSet.SET_DULL); + // TODO Samarium Processing Line Material regist public static final Werkstoff MuddySamariumRareEarthSolution = new Werkstoff( @@ -1893,8 +1906,147 @@ public class WerkstoffMaterialPool implements Runnable { // new Pair<>(Oxygen, 3), // new Pair<>(Hydrogen, 35)); - public static void runInit() { + public static final Werkstoff Permalloy = new Werkstoff( + new short[] { 195, 230, 225 }, + "Permalloy", + subscriptNumbers("Ni4FeMo"), + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMetalItems() + .addMixerRecipes((short) 3) + .enforceUnification(), + offsetID3b, + TextureSet.SET_DULL, + new Pair<>(Materials.Nickel, 4), + new Pair<>(Materials.Iron, 1), + new Pair<>(Materials.Molybdenum, 1)); + + public static final Werkstoff MuMetal = new Werkstoff( + new short[] { 210, 230, 225 }, + "Mu-metal", + subscriptNumbers("?NiFeCuCrMo?"), + new Werkstoff.Stats().setBlastFurnace(true) + .setCentrifuge(true) + .setMass(180) + .setSpeedOverride(3), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMetalItems() + .addMultipleIngotMetalWorkingItems() + .addCraftingMetalWorkingItems() + .enforceUnification(), + offsetID3b + 1, + TextureSet.SET_METALLIC, + new Pair<>(WerkstoffMaterialPool.Permalloy, 9), + new Pair<>(Materials.Copper, 1), + new Pair<>(Materials.Chrome, 1)); + public static final Werkstoff Thorium234 = new Werkstoff( + new short[] { 0, 40, 0 }, + "Thorium 234", + superscriptNumbers("Th234"), + new Werkstoff.Stats().setBlastFurnace(true) + .setRadioactive(true), + Werkstoff.Types.ISOTOPE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + offsetID3b + 2, + TextureSet.SET_DULL); + + public static final Werkstoff SiliconNitride = new Werkstoff( + new short[] { 132, 140, 120 }, + "Silicon Nitride", + subscriptNumbers("Si3N4"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMetalItems() + .enforceUnification(), + offsetID3b + 3, + TextureSet.SET_DULL); + + public static final Werkstoff Fluoroform = new Werkstoff( + new short[] { 0, 0, 0 }, + "Fluoroform", + subscriptNumbers("CHF3"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + offsetID3b + 4, + TextureSet.SET_FLUID, + new Pair<>(Materials.Carbon, 1), + new Pair<>(Materials.Hydrogen, 1), + new Pair<>(Materials.Fluorine, 3)); + + public static final Werkstoff FluoroformOxygenMix = new Werkstoff( + new short[] { 0, 0, 0 }, + "Reactive-Ion Etching Mixture", + subscriptNumbers("CHF3/O2"), + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + offsetID3b + 5, + TextureSet.SET_FLUID); + + public static final Werkstoff BoronTrioxide = new Werkstoff( + new short[] { 238, 222, 209 }, + "Boron Trioxide", + subscriptNumbers("B2O3"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + offsetID3b + 6, + TextureSet.SET_DULL, + new Pair<>(Materials.Boron, 2), + new Pair<>(Materials.Oxygen, 3)); + + public static final Werkstoff BoronTrichloride = new Werkstoff( + new short[] { 154, 96, 208 }, + "Boron Trichloride", + subscriptNumbers("BCl3"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + offsetID3b + 7, + TextureSet.SET_FLUID, + new Pair<>(Materials.Boron, 1), + new Pair<>(Materials.Chlorine, 3)); + + public static final Werkstoff LanthanumHexaboride = new Werkstoff( + new short[] { 140, 110, 120 }, + "Lanthanum Hexaboride", + subscriptNumbers("LaB6"), + new Werkstoff.Stats().setMass(200), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addGems() + .addSimpleMetalWorkingItems(), + offsetID3b + 8, + TextureSet.SET_GEM_HORIZONTAL, + new Pair<>(Materials.Lanthanum, 1), + new Pair<>(Materials.Boron, 6)); + + public static final Werkstoff LanthanumOxide = new Werkstoff( + new short[] { 105, 209, 180 }, + "Lanthanum Oxide", + subscriptNumbers("La2O3"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + offsetID3b + 9, + TextureSet.SET_DULL); + + public static void runInit() { addSubTags(); } diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/LINAC.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/LINAC.java new file mode 100644 index 0000000000..c9d9b125b4 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/LINAC.java @@ -0,0 +1,729 @@ +package com.elisis.gtnhlanth.common.tileentity; + +import static com.elisis.gtnhlanth.util.DescTextLocalization.addDotText; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static gregtech.api.enums.GT_HatchElement.Energy; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.OutputHatch; +import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + +import java.util.ArrayList; +import java.util.Objects; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import com.elisis.gtnhlanth.common.beamline.BeamInformation; +import com.elisis.gtnhlanth.common.beamline.BeamLinePacket; +import com.elisis.gtnhlanth.common.beamline.Particle; +import com.elisis.gtnhlanth.common.hatch.TileHatchInputBeamline; +import com.elisis.gtnhlanth.common.hatch.TileHatchOutputBeamline; +import com.elisis.gtnhlanth.common.register.LanthItemList; +import com.elisis.gtnhlanth.common.tileentity.recipe.beamline.BeamlineRecipeLoader; +import com.elisis.gtnhlanth.util.DescTextLocalization; +import com.elisis.gtnhlanth.util.Util; +import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; +import com.gtnewhorizon.structurelib.StructureLib; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.TickTime; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.shutdown.ShutDownReason; +import gregtech.api.util.shutdown.SimpleShutDownReason; + +public class LINAC extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { + + private static final IStructureDefinition STRUCTURE_DEFINITION; + + protected static final String STRUCTURE_PIECE_BASE = "base"; + protected static final String STRUCTURE_PIECE_LAYER = "layer"; + protected static final String STRUCTURE_PIECE_END = "end"; + + private byte glassTier; + + private boolean onEndInnerLayer = false; + + private int machineTemp = 0; // Coolant temperature + + private ArrayList mInputBeamline = new ArrayList<>(); + private ArrayList mOutputBeamline = new ArrayList<>(); + + private static final int CASING_INDEX = GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings5, 14); + + private static final byte MIN_GLASS_TIER = 6; + + /* + * g: Grate Machine Casing b: Borosilicate glass c: Shielded accelerator casing v: Vacuum k: Shielded glass d: + * Coolant Delivery casing y: Superconducting coil + */ + + static { + STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape( + STRUCTURE_PIECE_BASE, + new String[][] { { "ggggggg", "gbbbbbg", "gbbbbbg", "gbbibbg", "gbbbbbg", "gbbbbbg", "ggg~ggg" }, + { "ggggggg", "gcccccg", "gcccccg", "gcc-ccg", "gcccccg", "gcccccg", "ggggggg" }, + { "ccccccc", "cvvvvvc", "kvvvvvk", "kvv-vvk", "kvvvvvk", "cvvvvvc", "jcccccj" }, + { "cckkkcc", "cdddddc", "kdyyydk", "kdy-ydk", "kdyyydk", "cdddddc", "jcccccj" }, + { "cckkkcc", "cdvvvdc", "kvvvvvk", "kdv-vdk", "kvvvvvk", "cdvvvdc", "jcccccj" }, + { "cckkkcc", "cdddddc", "kdyyydk", "kdy-ydk", "kdyyydk", "cdddddc", "jcccccj" }, + { "cckkkcc", "cdvvvdc", "kvvvvvk", "kdv-vdk", "kvvvvvk", "cdvvvdc", "jcccccj" }, + { "cckhkcc", "cdddddc", "kdyyydk", "kdy-ydk", "kdyyydk", "cdddddc", "jcccccj" }, }) + .addShape( + STRUCTURE_PIECE_LAYER, + new String[][] { { "cckkkcc", "cdvvvdc", "kvvvvvk", "kdv-vdk", "kvvvvvk", "cdvvvdc", "ccccccc" }, + { "cckkkcc", "cdddddc", "kdyyydk", "kdy-ydk", "kdyyydk", "cdddddc", "ccccccc" } }) + .addShape( + STRUCTURE_PIECE_END, + new String[][] { { "cckkkcc", "cdvvvdc", "kvvvvvk", "kdv-vdk", "kvvvvvk", "cdvvvdc", "ccccccc" }, + { "cckhkcc", "cdddddc", "kdyyydk", "kdy-ydk", "kdyyydk", "cdddddc", "ccccccc" }, + { "cckkkcc", "cdvvvdc", "kvvvvvk", "kdv-vdk", "kvvvvvk", "cdvvvdc", "ccccccc" }, + { "cckkkcc", "cdddddc", "kdyyydk", "kdy-ydk", "kdyyydk", "cdddddc", "ccccccc" }, + { "cckkkcc", "cdvvvdc", "kvvvvvk", "kdv-vdk", "kvvvvvk", "cdvvvdc", "ccccccc" }, + { "cckkkcc", "cdddddc", "kdyyydk", "kdy-ydk", "kdyyydk", "cdddddc", "ccccccc" }, + { "ccccccc", "cvvvvvc", "kvvvvvk", "kvv-vvk", "kvvvvvk", "cvvvvvc", "ccccccc" }, + { "ccccccc", "ccccccc", "ccccccc", "ccc-ccc", "ccccccc", "ccccccc", "ccccccc" }, + { "ccccccc", "cbbbbbc", "cbbbbbc", "cbbobbc", "cbbbbbc", "cbbbbbc", "ccccccc" } }) + .addElement('c', ofBlock(LanthItemList.SHIELDED_ACCELERATOR_CASING, 0)) + .addElement('g', ofBlock(GregTech_API.sBlockCasings3, 10)) // Grate Machine Casing + .addElement( + 'b', + BorosilicateGlass.ofBoroGlass( + (byte) 0, + MIN_GLASS_TIER, + Byte.MAX_VALUE, + (te, t) -> te.glassTier = t, + te -> te.glassTier)) + .addElement( + 'i', + buildHatchAdder(LINAC.class).hatchClass(TileHatchInputBeamline.class) + .casingIndex(CASING_INDEX) + .dot(3) + .adder(LINAC::addBeamLineInputHatch) + .build()) + .addElement( + 'o', + buildHatchAdder(LINAC.class).hatchClass(TileHatchOutputBeamline.class) + .casingIndex(CASING_INDEX) + .dot(4) + .adder(LINAC::addBeamLineOutputHatch) + .build()) + .addElement('v', ofBlock(LanthItemList.ELECTRODE_CASING, 0)) + .addElement('k', ofBlock(LanthItemList.SHIELDED_ACCELERATOR_GLASS, 0)) + .addElement('d', ofBlock(LanthItemList.COOLANT_DELIVERY_CASING, 0)) + .addElement('y', ofBlock(GregTech_API.sBlockCasings1, 15)) // Superconducting coil + .addElement( + 'h', + buildHatchAdder(LINAC.class).atLeast(InputHatch, OutputHatch) + .casingIndex(CASING_INDEX) + .dot(2) + .build()) + + .addElement( + 'j', + buildHatchAdder(LINAC.class).atLeast(Maintenance, Energy) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(ofBlock(LanthItemList.SHIELDED_ACCELERATOR_CASING, 0))) + + .build(); + } + + private float outputEnergy; + private int outputRate; + private int outputParticle; + private float outputFocus; + + private int length; + + public LINAC(int id, String name, String nameRegional) { + super(id, name, nameRegional); + } + + public LINAC(String name) { + super(name); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity te) { + return new LINAC(this.mName); + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Particle Accelerator") + .addInfo("Controller block for the LINAC") + // .addInfo("Extendable, with a minimum length of 18 blocks") + .addInfo(DescTextLocalization.BLUEPRINT_INFO) + .addInfo(DescTextLocalization.BEAMLINE_SCANNER_INFO) + .addInfo("Valid Coolants:"); + + // Valid coolant list + for (Fluid fluid : BeamlineRecipeLoader.coolantMap.keySet()) { + + tt.addInfo("- " + fluid.getLocalizedName(new FluidStack(fluid, 1))); + + } + + tt.addInfo("Requires (length + 1)kL/s of coolant") + .addSeparator() + .beginVariableStructureBlock(7, 7, 7, 7, 19, 83, false) + .addController("Front bottom") + .addCasingInfoRange(LanthItemList.SHIELDED_ACCELERATOR_CASING.getLocalizedName(), 325, 1285, false) + .addCasingInfoRange(LanthItemList.COOLANT_DELIVERY_CASING.getLocalizedName(), 148, 852, false) + .addCasingInfoRange(LanthItemList.SHIELDED_ACCELERATOR_GLASS.getLocalizedName(), 127, 703, false) + .addCasingInfoRange("Superconducting Coil Block", 56, 312, false) + .addCasingInfoRange(LanthItemList.ELECTRODE_CASING.getLocalizedName(), 156, 732, false) + .addCasingInfoExactly("Grate Machine Casing", 47, false) + .addCasingInfoExactly("Borosilicate Glass (LuV+)", 48, false) + .addEnergyHatch(addDotText(1)) + .addMaintenanceHatch(addDotText(1)) + .addInputHatch(addDotText(2)) + .addOutputHatch(addDotText(2)) + .addOtherStructurePart("Beamline Input Hatch", addDotText(3)) + .addOtherStructurePart("Beamline Output Hatch", addDotText(4)) + + .toolTipFinisher("GTNH: Lanthanides");; + return tt; + } + + private boolean addBeamLineInputHatch(IGregTechTileEntity te, int casingIndex) { + + if (te == null) return false; + + IMetaTileEntity mte = te.getMetaTileEntity(); + + if (mte == null) return false; + + if (mte instanceof TileHatchInputBeamline) { + return this.mInputBeamline.add((TileHatchInputBeamline) mte); + } + + return false; + } + + private boolean addBeamLineOutputHatch(IGregTechTileEntity te, int casingIndex) { + + if (te == null) return false; + + IMetaTileEntity mte = te.getMetaTileEntity(); + + if (mte == null) return false; + + if (mte instanceof TileHatchOutputBeamline) { + return this.mOutputBeamline.add((TileHatchOutputBeamline) mte); + } + + return false; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + + float tempFactor = 0; + // Focus as determined by multi properties + float machineFocus = 0; + // Input particle focus + float inputFocus = 0; + + // Output focus to be set + outputFocus = 0; + + float voltageFactor = 0; + float inputEnergy = 0; + + machineTemp = 0; + + // Energy quantity determined by multi + float machineEnergy = 0; + outputEnergy = 0; + + int particleId = 0; + outputParticle = 0; + + int inputRate = 0; + outputRate = 0; + + ArrayList tFluidInputs = this.getStoredFluids(); + if (tFluidInputs.size() == 0) { + this.doRandomMaintenanceDamage(); // Penalise letting coolant run dry + this.stopMachine(SimpleShutDownReason.ofCritical("gtnhlanth.nocoolant")); + return false; + } + + // Coolant input + FluidStack primFluid = tFluidInputs.get(0); + + // 1b (1000L)/m/operation + final int fluidConsumed = 1000 * length; + + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + if (this.getInputInformation() == null) { + return false; + } + + if (this.getInputInformation() + .getEnergy() == 0) { + return false; + } + + particleId = this.getInputInformation() + .getParticleId(); + Particle inputParticle = Particle.getParticleFromId(particleId); + + if (!inputParticle.canAccelerate()) { + stopMachine(SimpleShutDownReason.ofCritical("gtnhlanth.noaccel")); + return false; + } + + mMaxProgresstime = 1 * TickTime.SECOND; + // Consume the input tier's corresponding practical voltage instead of the maximum suggested by the logic + mEUt = (int) -GT_Values.VP[(int) this.getInputVoltageTier()]; + + // Particle stays the same with this multiblock + outputParticle = particleId; + + if (primFluid.isFluidEqual(new FluidStack(FluidRegistry.getFluid("ic2coolant"), 1))) { + tempFactor = calculateTemperatureFactor(60); // Default temp of 300 is unreasonable + machineTemp = 60; // Solely for tricorder use + } else { + tempFactor = calculateTemperatureFactor( + primFluid.getFluid() + .getTemperature()); + machineTemp = primFluid.getFluid() + .getTemperature(); // Solely for tricorder use + } + + machineFocus = Math.max(((-0.9f) * this.length * tempFactor) + 110, 5); // Min of 5 + if (machineFocus > 90) { // Max of 90 + machineFocus = 90; + } + + inputFocus = this.getInputInformation() + .getFocus(); + + outputFocus = (inputFocus > machineFocus) ? ((inputFocus + machineFocus) / 2) + : inputFocus * (machineFocus / 100); // If input focus > machine focus, take the average of both, else + // weigh the former by the latter + + long voltage = this.getMaxInputVoltage(); + voltageFactor = calculateVoltageFactor(voltage); + + machineEnergy = Math.max(-((60) / this.length) * voltageFactor + 60_000, 2000); // Minimum of 2000keV + + inputEnergy = this.getInputInformation() + .getEnergy(); + outputEnergy = Math.min( + (1 + inputEnergy / Particle.getParticleFromId(outputParticle) + .maxSourceEnergy()) * machineEnergy, + 100_000); // TODO more complex calculation than just + // addition + + inputRate = this.getInputInformation() + .getRate(); + outputRate = inputRate; // Cannot increase rate with this multiblock + + if (Util.coolantFluidCheck(primFluid, fluidConsumed)) { + + this.stopMachine(SimpleShutDownReason.ofCritical("gtnhlanth.inscoolant")); + return false; + + } + + primFluid.amount -= fluidConsumed; + + FluidStack fluidOutput = new FluidStack( + BeamlineRecipeLoader.coolantMap.get(primFluid.getFluid()), + fluidConsumed); + + if (Objects.isNull(fluidOutput)) return false; + + this.addFluidOutputs(new FluidStack[] { fluidOutput }); + + outputAfterRecipe(); + + return true; + } + + private void outputAfterRecipe() { + + if (!mOutputBeamline.isEmpty()) { + + BeamLinePacket packet = new BeamLinePacket( + new BeamInformation(outputEnergy, outputRate, outputParticle, outputFocus)); + + for (TileHatchOutputBeamline o : mOutputBeamline) { + + o.q = packet; + } + } + } + + @Override + public void stopMachine() { + + // GT_Log.out.print("Machine stopped"); + outputFocus = 0; + outputEnergy = 0; + outputParticle = 0; + outputRate = 0; + machineTemp = 0; + super.stopMachine(); + } + + @Override + public void stopMachine(ShutDownReason reason) { + + outputFocus = 0; + outputEnergy = 0; + outputParticle = 0; + outputRate = 0; + machineTemp = 0; + super.stopMachine(reason); + + } + + @Override + public String[] getInfoData() { + + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (tHatch.isValid()) { + storedEnergy += tHatch.getBaseMetaTileEntity() + .getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity() + .getEUCapacity(); + } + } + + BeamInformation information = this.getInputInformation(); + + return new String[] { + /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(getActualEnergyUsage()) + + EnumChatFormatting.RESET + + " EU/t", + /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxInputVoltage()) + + EnumChatFormatting.RESET + + " EU/t(*2A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + VN[GT_Utility.getTier(getMaxInputVoltage())] + + EnumChatFormatting.RESET, + /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + Float.toString(mEfficiency / 100.0F) + + EnumChatFormatting.RESET + + " %", + + /* 7 */ EnumChatFormatting.BOLD + StatCollector.translateToLocal("beamline.info") + + ": " + + EnumChatFormatting.RESET, + + StatCollector.translateToLocal("beamline.temperature") + ": " // Temperature: + + EnumChatFormatting.DARK_RED + + machineTemp + + EnumChatFormatting.RESET + + " K", // e.g. "137 K" + + StatCollector.translateToLocal("beamline.coolusage") + ": " // Coolant usage: + + EnumChatFormatting.AQUA + + length + + EnumChatFormatting.RESET + + " kL/s", // e.g. "24 kL/s + + /* 8 */ EnumChatFormatting.BOLD + StatCollector.translateToLocal("beamline.in_pre") + + ": " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.particle") + ": " // "Multiblock Beamline Input:" + + EnumChatFormatting.GOLD + + Particle.getParticleFromId(information.getParticleId()) + .getLocalisedName() // e.g. "Electron + // (e-)" + + " " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.energy") + ": " // "Energy:" + + EnumChatFormatting.DARK_RED + + information.getEnergy() + + EnumChatFormatting.RESET + + " keV", // e.g. "10240 keV" + StatCollector.translateToLocal("beamline.focus") + ": " // "Focus:" + + EnumChatFormatting.BLUE + + information.getFocus() + + " " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.amount") + ": " // "Amount:" + + EnumChatFormatting.LIGHT_PURPLE + + information.getRate(), + EnumChatFormatting.BOLD + StatCollector.translateToLocal("beamline.out_pre") // "Multiblock Beamline + // Output:" + + ": " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.particle") + ": " + + EnumChatFormatting.GOLD + + Particle.getParticleFromId(this.outputParticle) + .getLocalisedName() + + " " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.energy") + ": " + + EnumChatFormatting.DARK_RED + + this.outputEnergy + + EnumChatFormatting.RESET + + " keV", + StatCollector.translateToLocal( + "beamline.focus") + ": " + EnumChatFormatting.BLUE + this.outputFocus + " " + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.amount") + ": " + + EnumChatFormatting.LIGHT_PURPLE + + this.outputRate, }; + } + + private BeamInformation getInputInformation() { + + for (TileHatchInputBeamline in : this.mInputBeamline) { // Easy way to find the desired input. Efficient? No. + // Will it matter? No :boubs_glasses: + + if (in.q == null) return new BeamInformation(0, 0, 0, 0); + // if (in.q == null) return new BeamInformation(10000, 10, 0, 90); // temporary for testing purposes + + return in.q.getContent(); + } + return null; + } + + private static float calculateTemperatureFactor(int fluidTemp) { + + float factor = (float) Math.pow(1.1, 0.2 * fluidTemp); + return factor; + } + + private static float calculateVoltageFactor(long voltage) { + + float factor = (float) Math.pow(1.00009, -(voltage - 125000)); + return factor; + } + + @Override + public String[] getStructureDescription(ItemStack arg0) { + return DescTextLocalization.addText("LINAC.hint", 11); + } + + @Override + public boolean checkMachine(IGregTechTileEntity mte, ItemStack stack) { + + mInputBeamline.clear(); + mOutputBeamline.clear(); + + this.outputEnergy = 0; + this.outputRate = 0; + this.outputParticle = 0; + this.outputFocus = 0; + + this.glassTier = 0; + + this.onEndInnerLayer = false; + + length = 8; // Base piece length + + if (!checkPiece(STRUCTURE_PIECE_BASE, 3, 6, 0)) return false; + + while (length < 128) { + + if (!checkPiece(STRUCTURE_PIECE_LAYER, 3, 6, -length)) { + if (!checkPiece(STRUCTURE_PIECE_END, 3, 6, -length)) { + return false; + } + break; + } ; + + length += 2; + } + + // if (!checkPiece(STRUCTURE_PIECE_END, 3, 6, -length)) return false; + + // Likely off by one or two, not visible to player however so doesn't particularly matter + length += 8; + + return this.mInputBeamline.size() == 1 && this.mOutputBeamline.size() == 1 + && this.mMaintenanceHatches.size() == 1 + && this.mEnergyHatches.size() <= 2 + && this.glassTier >= MIN_GLASS_TIER; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + + buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 3, 6, 0); + + int lLength = Math.max(stackSize.stackSize + 7, 8); // !! + + if (!(lLength % 2 == 0)) { + lLength++; // Otherwise you get gaps at the end + } + + for (int i = -8; i > -lLength - 1; i -= 2) { + + // GT_Log.out.print("Building inner piece! i = " + i); + + buildPiece(STRUCTURE_PIECE_LAYER, stackSize, hintsOnly, 3, 6, i); + } + + buildPiece(STRUCTURE_PIECE_END, stackSize, hintsOnly, 3, 6, -(lLength + 2)); + + StructureLib.addClientSideChatMessages("Length: " + (11 + lLength) + " blocks."); + } + + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { + + elementBudget = 200; // Maybe make a config + + if (mMachine) return -1; + + int build = 0; + + build = survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 3, 6, 0, elementBudget, env, false, true); + + if (build >= 0) return build; // Incomplete + + int lLength = Math.max(stackSize.stackSize + 7, 8); // !! + + if (!(lLength % 2 == 0)) { + lLength++; // Otherwise you get gaps at the end + } + + for (int i = -8; i > -lLength - 1; i -= 2) { + + build = survivialBuildPiece(STRUCTURE_PIECE_LAYER, stackSize, 3, 6, i, elementBudget, env, false, true); + + if (build >= 0) return build; + + } + + int finalOutput = survivialBuildPiece( + STRUCTURE_PIECE_END, + stackSize, + 3, + 6, + -(lLength + 2), + elementBudget, + env, + false, + true); + + return finalOutput; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean active, boolean aRedstone) { + + // Placeholder + if (side == facing) { + if (active) return new ITexture[] { casingTexturePages[0][47], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { casingTexturePages[0][47], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW) + .extFacing() + .glow() + .build() }; + } + return new ITexture[] { casingTexturePages[0][47] }; + } + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + public boolean addInputHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + this.onEndInnerLayer = true; + return super.addInputHatchToMachineList(aTileEntity, aBaseCasingIndex); + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/SourceChamber.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/SourceChamber.java new file mode 100644 index 0000000000..6649d0a232 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/SourceChamber.java @@ -0,0 +1,412 @@ +package com.elisis.gtnhlanth.common.tileentity; + +import static com.elisis.gtnhlanth.util.DescTextLocalization.BLUEPRINT_INFO; +import static com.elisis.gtnhlanth.util.DescTextLocalization.addDotText; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static gregtech.api.enums.GT_HatchElement.Energy; +import static gregtech.api.enums.GT_HatchElement.InputBus; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.OutputBus; +import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +import com.elisis.gtnhlanth.common.beamline.BeamInformation; +import com.elisis.gtnhlanth.common.beamline.BeamLinePacket; +import com.elisis.gtnhlanth.common.beamline.Particle; +import com.elisis.gtnhlanth.common.hatch.TileHatchOutputBeamline; +import com.elisis.gtnhlanth.common.register.LanthItemList; +import com.elisis.gtnhlanth.common.tileentity.recipe.beamline.BeamlineRecipeAdder2; +import com.elisis.gtnhlanth.common.tileentity.recipe.beamline.RecipeSC; +import com.elisis.gtnhlanth.util.DescTextLocalization; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.shutdown.SimpleShutDownReason; + +public class SourceChamber extends GT_MetaTileEntity_EnhancedMultiBlockBase + implements ISurvivalConstructable { + + private static final IStructureDefinition STRUCTURE_DEFINITION; + + private ArrayList mOutputBeamline = new ArrayList<>(); + + private static final int CASING_INDEX = GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings5, 14); + + private float outputEnergy; + private int outputRate; + private int outputParticle; + private float outputFocus; + + static { + STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape( + "sc", + new String[][] { { "ccccc", "ckkkc", "ckikc", "ckkkc", "dd~dd" }, + { "ckkkc", "keeek", "ke-ek", "keeek", "ccocc" }, { "ckkkc", "k---k", "k---k", "k---k", "ccccc" }, + { "ckkkc", "k---k", "k---k", "k---k", "ccccc" }, { "ckkkc", "keeek", "ke-ek", "keeek", "ccccc" }, + { "ccccc", "ckkkc", "ckbkc", "ckkkc", "ccccc" } }) + .addElement('c', ofBlock(LanthItemList.SHIELDED_ACCELERATOR_CASING, 0)) + .addElement('k', ofBlock(LanthItemList.SHIELDED_ACCELERATOR_GLASS, 0)) + .addElement('e', ofBlock(LanthItemList.ELECTRODE_CASING, 0)) + .addElement( + 'b', + buildHatchAdder(SourceChamber.class).hatchClass(TileHatchOutputBeamline.class) + .casingIndex(CASING_INDEX) + .dot(4) + .adder(SourceChamber::addBeamLineOutputHatch) + .build()) + .addElement( + 'i', + buildHatchAdder(SourceChamber.class).atLeast(InputBus) + .casingIndex(CASING_INDEX) + .dot(1) + .build()) + .addElement( + 'o', + buildHatchAdder(SourceChamber.class).atLeast(OutputBus) + .casingIndex(CASING_INDEX) + .dot(2) + .build()) + .addElement( + 'd', + buildHatchAdder(SourceChamber.class).atLeast(Maintenance, Energy) + .casingIndex(CASING_INDEX) + .dot(3) + .buildAndChain(ofBlock(LanthItemList.SHIELDED_ACCELERATOR_CASING, 0))) + + .build(); + } + + public SourceChamber(int id, String name, String nameRegional) { + super(id, name, nameRegional); + } + + public SourceChamber(String name) { + super(name); + } + + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { + if (mMachine) return -1; + return survivialBuildPiece("sc", stackSize, 2, 4, 0, elementBudget, env, false, true); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity te) { + return new SourceChamber(this.mName); + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Particle Source") + .addInfo("Controller block for the Source Chamber") + .addInfo(BLUEPRINT_INFO) + .addInfo(DescTextLocalization.BEAMLINE_SCANNER_INFO) + .addSeparator() + .beginStructureBlock(5, 5, 6, true) + .addController("Front bottom") + .addCasingInfoExactly(LanthItemList.SHIELDED_ACCELERATOR_CASING.getLocalizedName(), 56, false) + .addCasingInfoExactly(LanthItemList.SHIELDED_ACCELERATOR_GLASS.getLocalizedName(), 52, false) + .addCasingInfoExactly(LanthItemList.ELECTRODE_CASING.getLocalizedName(), 16, false) + .addOtherStructurePart("Beamline Output Hatch", addDotText(4)) + .addEnergyHatch(addDotText(3)) + .addMaintenanceHatch(addDotText(3)) + .addInputBus(addDotText(1)) + .addOutputBus(addDotText(2)) + .toolTipFinisher("GTNH: Lanthanides"); + return tt; + } + + private boolean addBeamLineOutputHatch(IGregTechTileEntity te, int casingIndex) { + + if (te == null) return false; + + IMetaTileEntity mte = te.getMetaTileEntity(); + + if (mte == null) return false; + + if (mte instanceof TileHatchOutputBeamline) { + return this.mOutputBeamline.add((TileHatchOutputBeamline) mte); + } + + return false; + } + /* + * protected OverclockDescriber createOverclockDescriber() { return new EUNoTotalOverclockDescriber((byte) 4, 1); } + */ + + @Override + public boolean checkRecipe(ItemStack itemStack) { + + // GT_Log.out.print("In checkRecipe"); + + // No input particle, so no input quantities + + outputFocus = 0; + outputEnergy = 0; + outputParticle = 0; + outputRate = 0; + + ItemStack[] tItems = this.getStoredInputs() + .toArray(new ItemStack[0]); + // GT_Log.out.print(Arrays.toString(tItems)); + long tVoltageMaxTier = this.getMaxInputVoltage(); // Used to keep old math the same + long tVoltageActual = GT_Values.VP[(int) this.getInputVoltageTier()]; + + RecipeSC tRecipe = (RecipeSC) BeamlineRecipeAdder2.instance.SourceChamberRecipes + .findRecipe(this.getBaseMetaTileEntity(), false, tVoltageActual, new FluidStack[] {}, tItems); + + if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, new FluidStack[] {}, tItems)) return false; // Consumes + // input + // item + + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + this.mMaxProgresstime = tRecipe.mDuration; + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; + + mEUt = (int) -tVoltageActual; + if (this.mEUt > 0) this.mEUt = (-this.mEUt); + + outputParticle = tRecipe.particleId; + float maxParticleEnergy = Particle.getParticleFromId(outputParticle) + .maxSourceEnergy(); // The maximum energy a + // particle can possess + // when produced by this + // multiblock + float maxMaterialEnergy = tRecipe.maxEnergy; // The maximum energy for the recipe processed + // outputEnergy = (float) ((-maxEnergy) * Math.pow(1.001, -(tRecipe.energyRatio)*(tVoltage-tRecipe.mEUt))) + + // maxEnergy; + outputEnergy = (float) Math.min( + (-maxMaterialEnergy) * Math.pow(1.001, -(tRecipe.energyRatio) * (tVoltageMaxTier - tRecipe.mEUt)) + + maxMaterialEnergy, + maxParticleEnergy); + + if (outputEnergy <= 0) { + stopMachine(SimpleShutDownReason.ofCritical("gtnhlanth.scerror")); + return false; + } + + outputFocus = tRecipe.focus; + outputRate = tRecipe.rate; + + this.mOutputItems = tRecipe.mOutputs; + this.updateSlots(); + + outputAfterRecipe(); + + return true; + } + + @Override + public String[] getStructureDescription(ItemStack arg0) { + return DescTextLocalization.addText("SourceChamber.hint", 7); // Generate 7 localised hint strings in structure + // description + } + + private void outputAfterRecipe() { + + if (!mOutputBeamline.isEmpty()) { + + BeamLinePacket packet = new BeamLinePacket( + new BeamInformation(outputEnergy, outputRate, outputParticle, outputFocus)); + + for (TileHatchOutputBeamline o : mOutputBeamline) { + + o.q = packet; + } + } + } + + @Override + public void stopMachine() { + outputFocus = 0; + outputEnergy = 0; + outputParticle = 0; + outputRate = 0; + super.stopMachine(); + } + + @Override + public RecipeMap getRecipeMap() { + return BeamlineRecipeAdder2.instance.SourceChamberRecipes; + } + + @Override + public String[] getInfoData() { + + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (tHatch.isValid()) { + storedEnergy += tHatch.getBaseMetaTileEntity() + .getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity() + .getEUCapacity(); + } + } + + return new String[] { + /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(getActualEnergyUsage()) + + EnumChatFormatting.RESET + + " EU/t", + /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxInputVoltage()) + + EnumChatFormatting.RESET + + " EU/t(*2A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + VN[GT_Utility.getTier(getMaxInputVoltage())] + + EnumChatFormatting.RESET, + /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + Float.toString(mEfficiency / 100.0F) + + EnumChatFormatting.RESET + + " %", + EnumChatFormatting.BOLD + StatCollector.translateToLocal("beamline.out_pre") + + ": " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.particle") + ": " + + EnumChatFormatting.GOLD + + Particle.getParticleFromId(this.outputParticle) + .getLocalisedName() + + " " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.energy") + ": " + + EnumChatFormatting.DARK_RED + + this.outputEnergy + + EnumChatFormatting.RESET + + " keV", + StatCollector.translateToLocal( + "beamline.focus") + ": " + EnumChatFormatting.BLUE + this.outputFocus + " " + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.amount") + ": " + + EnumChatFormatting.LIGHT_PURPLE + + this.outputRate, }; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece("sc", stackSize, hintsOnly, 2, 4, 0); + } + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + + this.mOutputBeamline.clear(); // Necessary due to the nature of the beamline hatch adder + + return checkPiece("sc", 2, 4, 0) && this.mMaintenanceHatches.size() == 1 + && this.mInputBusses.size() == 1 + && this.mOutputBusses.size() == 1 + && this.mOutputBeamline.size() == 1 + && this.mEnergyHatches.size() == 1; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity baseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int colorIndex, boolean active, boolean redstoneLevel) { + + // Placeholder + if (side == facing) { + if (active) return new ITexture[] { casingTexturePages[1][14], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { casingTexturePages[1][14], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW) + .extFacing() + .glow() + .build() }; + } + return new ITexture[] { casingTexturePages[1][14] }; + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/Synchrotron.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/Synchrotron.java new file mode 100644 index 0000000000..3eaa682381 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/Synchrotron.java @@ -0,0 +1,1068 @@ +package com.elisis.gtnhlanth.common.tileentity; + +import static com.elisis.gtnhlanth.util.DescTextLocalization.addDotText; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAdder; +import static gregtech.api.enums.GT_HatchElement.Energy; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.OutputHatch; +import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + +import java.util.ArrayList; +import java.util.Objects; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import com.elisis.gtnhlanth.common.beamline.BeamInformation; +import com.elisis.gtnhlanth.common.beamline.BeamLinePacket; +import com.elisis.gtnhlanth.common.beamline.Particle; +import com.elisis.gtnhlanth.common.block.AntennaCasing; +import com.elisis.gtnhlanth.common.hatch.TileHatchInputBeamline; +import com.elisis.gtnhlanth.common.hatch.TileHatchOutputBeamline; +import com.elisis.gtnhlanth.common.register.LanthItemList; +import com.elisis.gtnhlanth.common.tileentity.recipe.beamline.BeamlineRecipeLoader; +import com.elisis.gtnhlanth.util.DescTextLocalization; +import com.elisis.gtnhlanth.util.Util; +import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; +import com.google.common.collect.ImmutableMap; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.TickTime; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.shutdown.ShutDownReason; +import gregtech.api.util.shutdown.SimpleShutDownReason; + +public class Synchrotron extends GT_MetaTileEntity_EnhancedMultiBlockBase + implements ISurvivalConstructable { + + private static final IStructureDefinition STRUCTURE_DEFINITION; + + protected static final String STRUCTURE_PIECE_ENTRANCE = "entrance"; + protected static final String STRUCTURE_PIECE_BASE = "base"; + + public static final int CONSUMED_FLUID = 32_000; // Fluid consumed per processed recipe, maybe increase with EU + public static final int MIN_INPUT_FOCUS = 25; // Inclusive + + private ArrayList mInputBeamline = new ArrayList<>(); + private ArrayList mOutputBeamline = new ArrayList<>(); + + public ArrayList mAntennaCasings = new ArrayList<>(); + + private static final int CASING_INDEX = GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings5, 14); + + private static final byte MIN_GLASS_TIER = 6; + + private int energyHatchTier; + + private int antennaeTier; + + private Byte glassTier; + + /* + * c: Shielded accelerator casing v: Vacuum k: Superconducting coil d: Coolant Delivery casing + */ + + // TODO: E > 1200eV for x-ray lithography + // spotless:off + static { + + STRUCTURE_DEFINITION = StructureDefinition.builder().addShape( + STRUCTURE_PIECE_ENTRANCE, + + + + new String[][] { + { + " ", + " ccc ", + " cgggc ", + " cgvgc ", + " cgggc ", + " ccc " + } + }) + .addShape( + STRUCTURE_PIECE_BASE, + + new String[][] { + { + " ", + " ccc ", + " ccccc cjjjjjc ", + " cc-cc cjjc~cjjc ", + " ccccc cjjjjjc ", + " ccc ", + " " + }, + { + " ", + " ccc ccccccccccc ", + " c---c ccc-------ccc ", + " c---c ccc-------ccc ", + " c---c ccc-------ccc ", + " ccc ccccccccccc ", + " " + }, + { + " ccccccccccc ", + " ccc cc-----------cc ", + " c---c cc-------------cc ", + " c---c cc-------------cc ", + " c---c cc-------------cc ", + " ccc ccc---------ccc ", + " ccccccccccc " + }, + { + " ccccccccccccccc ", + " ccc cc---------------cc ", + " c---ccc-----------------c ", + " c---ccc-----------------cc ", + " c---ccc-----------------c ", + " ccc cc---------------cc ", + " ccccccccccccccc ", + + }, + { + " ccc ccccccccccccccccc ", + " ckkkccc-----------------cc ", + "ck---kc-------------------cc ", + "ck---kc--------------------c ", + "ck---kc-------------------cc ", + " ckkkccc-----------------cc ", + " ccc cccccccccccccccccc " + + }, + { + " cccccccccccc ccccccc ", + " cdddcc-------ccccc-------cc ", + "cd---d----------------------c ", + "cd---d----------------------c ", + "cd---d----------------------c ", + " cdddcc-------ccccc-------cc ", + " cccccccccccc ccccccc ", + }, + { + " ccccccccc ccccc ", + " ckkkc-----cccc cccc-----cc ", + "ck---k-------ccccccc--------c ", + "ck---k-------ccccccc---------c ", + "ck---k-------ccccccc--------c ", + " ckkkc-----cccc cccc-----cc ", + " ccccccccc ccccc " + }, + { + " cccccccc ccccc ", + " c--------cc cc-----cc ", + "c----------cc cc-------c ", + "c----------cc cc-------c ", + "c----------cc cc-------c ", + " c--------cc cc-----cc ", + " cccccccc ccccc " + + }, + { + " ccccccc ccccc ", + " c-------c c-----c ", + "c---------c c-------c ", + "c---------c c-------c ", + "c---------c c-------c ", + " c-------c c-----c ", + " ccccccc ccccc " + + }, + { + " cccccc ccccc ", + " c------c c-----c ", + "c--------c c------c ", + "c--------c c------c ", + "c--------c c------c ", + " c------c c-----c ", + " cccccc ccccc " + + }, + { + " ccccc cccc ", + " c-----c c----c ", + "c-------c c------c ", + "c-------c c------c ", + "c-------c c------c ", + " c-----c c----c ", + " ccccc cccc " + + }, + { + " cccc ccc ", + " c----cc cc---cc ", + "c------c c-----c ", + "c------c c-----c ", + "c------c c-----c ", + " c----cc cc---cc ", + " cccc ccc " + + }, + { + " cccc cccc ", + " c---cc c----c ", + "c------c c-----c ", + "c------c c-----cc ", + "c------c c-----c ", + " c---cc cc---c ", + " cccc cccc " + + }, + { + " cccc cccc ", + " c---cc c----c ", + "c-----c c----cc ", + "c-----c c----cc ", + "c-----c c----cc ", + " c---cc cc---c ", + " cccc cccc " + + }, + { + " ccc ccc ", + " ckkkcc cckkkc ", + "ck---kc ck---kc ", + "ck---kc ck---kc ", + "ck---kc ck---kc ", + " ckkkcc cckkkc ", + " ccc ccc " + + }, + { + " cec cec ", + " cnanc cnanc ", + "cn---nc cn---nc ", + "cn---nc cn---nc ", + "cn---nc cn---nc ", + " cnnnc cnnnc ", + " ccc ccc " + + }, + { + " cic cic ", + " cndnc cndnc ", + "cn---nc cn---nc ", + "cn---nc cn---nc ", + "cn---nc cn---nc ", + " cndnc cndnc ", + " coc coc " + + }, + { + " cec cec ", + " cnanc cnanc ", + "cn---nc cn---nc ", + "cn---nc cn---nc ", + "cn---nc cn---nc ", + " cnnnc cnnnc ", + " ccc ccc " + + }, + { + " ccc ccc ", + " ckkkcc cckkkc ", + "ck---kc ck---kc ", + "ck---kc ck---kc ", + "ck---kc ck---kc ", + " ckkkcc cckkkc ", + " ccc ccc " + + }, + { + " cccc cccc ", + " c----c c----c ", + "cc----c c----cc ", + "cc----c c----cc ", + "cc----c c----cc ", + " c---cc cc---c ", + " cccc cccc " + + }, + { + " cccc cccc ", + " c----c c----c ", + " c-----c c-----c ", + "cc-----c c-----cc ", + " c-----c c-----c ", + " c---cc cc---c ", + " cccc cccc " + + }, + { + " ccc ccc ", + " cc---cc cc---cc ", + " c-----c c-----c ", + " c-----c c-----c ", + " c-----c c-----c ", + " cc---cc cc---cc ", + " ccc ccc " + + }, + { + " cccc cccc ", + " c----c c----c ", + " c------c c------c ", + " c------c c------c ", + " c------c c------c ", + " c----c c----c ", + " cccc cccc " + + }, + { + " ccccc ccccc ", + " c-----c c-----c ", + " c------c c------c ", + " c------c c------c ", + " c------c c------c ", + " c-----c c-----c ", + " ccccc ccccc " + + }, + { + " ccccc ccccc ", + " c-----c c-----c ", + " c-------c c-------c ", + " c-------c c-------c ", + " c-------c c-------c ", + " c-----c c-----c ", + " ccccc ccccc " + + }, + { + " ccccc ccccc ", + " c-----cc cc-----c ", + " c-------cc cc-------cc ", + " c-------cc cc-------cc ", + " c-------cc cc-------cc ", + " c-----cc cc------c ", + " ccccc cccccc " + + }, + { + " ccccc ccccccc ", + " cc-----cccc cccc-----ccc ", + " c--------ccccccc--------cccc ", + " c--------ccccccc--------cccc ", + " c--------ccccccc--------cccc ", + " cc-----cccc cccc------cc ", + " ccccc cccccc " + + }, + { + " ccccccc cccccccccc ", + " cc-------ccccc--------cccc ", + " c---------kdkdk--------ccccccccc", + " c---------kdkdk--------ccccccccc", + " c---------kdkdk--------ccccccccc", + " cc-------ccccc--------cccc ", + " ccccccc cccccccc " + + }, + { + " cccccccccccccccccccc ", + " cc-------------------ccccccccc", + " cc---------------------------cg", + " c----------------------------cg", + " cc---------------------------cg", + " c-------------------ccccccccc", + " ccccccccccccccccccc " + + }, + { + " ccccccccccccccccccc ", + " cc-----------------cccccccccc", + " c--------------------------cg", + " cc---------------------------b", + " c--------------------------cg", + " c-----------------cccccccccc", + " ccccccccccccccccc " + + }, + { + " ccccccccccccccc ", + " ccc-------------ccccccccccc", + " cc------------------------cg", + " cc------------------------cg", + " cc------------------------cg", + " ccc-------------ccccccccccc", + " ccccccccccccc " + + }, + { + " ", + " cccccccccccccccccc ", + " ccc-kdkdk------ccccccccccc", + " cc--kdkdk------ccccccccccc", + " ccc-kdkdk------ccccccccccc", + " cccccccccccccccccc " + + }, + { + " ", + " ", + " cccccccccccccccc ", + " ccccccccccccccccc ", + " cccccccccccccccc ", + " ", + " " + + } + + } + + ).addElement('c', ofBlock(LanthItemList.SHIELDED_ACCELERATOR_CASING, 0)) + .addElement('k', ofBlock(GregTech_API.sBlockCasings1, 15)) // Superconducting coils + .addElement('d', ofBlock(LanthItemList.COOLANT_DELIVERY_CASING, 0)) + .addElement('e', buildHatchAdder(Synchrotron.class).atLeast(ImmutableMap.of(Energy, 4)).dot(6).casingIndex(CASING_INDEX).build()) + .addElement('n', ofBlock(GregTech_API.sBlockMetal5, 5)) //Niobium Blocks + .addElement('a', ofBlockAdder(Synchrotron::addAntenna, LanthItemList.ANTENNA_CASING_T1, 3)) //Antenna Casings + .addElement('i', buildHatchAdder(Synchrotron.class).atLeast(ImmutableMap.of(InputHatch, 2)).dot(4).casingIndex(CASING_INDEX).build()) + .addElement('o', buildHatchAdder(Synchrotron.class).atLeast(ImmutableMap.of(OutputHatch, 2)).dot(5).casingIndex(CASING_INDEX).build()) + .addElement('v', buildHatchAdder(Synchrotron.class).hatchClass(TileHatchInputBeamline.class).casingIndex(CASING_INDEX) + .dot(1).adder(Synchrotron::addBeamlineInputHatch).build()) + .addElement('b', buildHatchAdder(Synchrotron.class).hatchClass(TileHatchOutputBeamline.class).casingIndex(CASING_INDEX) + .dot(2).adder(Synchrotron::addBeamlineOutputHatch).build()) + .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, MIN_GLASS_TIER, Byte.MAX_VALUE, (te, t) -> te.glassTier = t, te -> te.glassTier)) + .addElement('j', + buildHatchAdder(Synchrotron.class).atLeast(Maintenance).dot(3).casingIndex(CASING_INDEX) + .buildAndChain(LanthItemList.SHIELDED_ACCELERATOR_CASING, 0)) + + .build(); + + + + } + + // spotless:on + + /* + * v = pi * lorentz^2 * sfreq sfreq = sw / 2pi sw = e * B / mass(e) * c v = (e * B * l^2) / (2 * mass(e) * c) = + * 292.718624222 * l^2 * B + */ + + private float outputEnergy; + private int outputRate; + private int outputParticle; + private float outputFocus; + private float machineFocus; + + private int machineTemp; + + public Synchrotron(String aName) { + super(aName); + } + + public Synchrotron(int id, String name, String nameRegional) { + super(id, name, nameRegional); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new Synchrotron(this.mName); + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Particle Accelerator") + .addInfo("Controller block for the Synchrotron") + .addInfo("Torus-shaped, accelerates electrons to produce high-energy electromagnetic radiation") + .addInfo(DescTextLocalization.BLUEPRINT_INFO) + .addInfo(DescTextLocalization.BEAMLINE_SCANNER_INFO) + .addInfo("Valid Coolants:"); + + // Valid coolant list + for (Fluid fluid : BeamlineRecipeLoader.coolantMap.keySet()) { + + tt.addInfo("- " + fluid.getLocalizedName(new FluidStack(fluid, 1))); + + } + + tt.addInfo("Requires 32 kL/s of coolant") + .addSeparator() + .beginStructureBlock(36, 7, 34, true) + .addController("Front middle") + .addCasingInfoExactly(LanthItemList.SHIELDED_ACCELERATOR_CASING.getLocalizedName(), 676, false) + .addCasingInfoExactly("Superconducting Coil Block", 90, false) + .addCasingInfoExactly("Niobium Block", 64, false) + .addCasingInfoExactly(LanthItemList.COOLANT_DELIVERY_CASING.getLocalizedName(), 28, false) + .addCasingInfoExactly("Borosilicate Glass Block (LuV+)", 16, false) + .addCasingInfoExactly("Antenna Casing (must match)", 4, true) + .addOtherStructurePart("Beamline Input Hatch", addDotText(1)) + .addOtherStructurePart("Beamline Output Hatch", addDotText(2)) + .addMaintenanceHatch(addDotText(3)) + .addInputHatch(addDotText(4)) + .addOutputHatch(addDotText(5)) + .addEnergyHatch(addDotText(6)) + + .toolTipFinisher("GTNH: Lanthanides"); + return tt; + } + + private boolean addBeamlineInputHatch(IGregTechTileEntity te, int casingIndex) { + + if (te == null) return false; + + IMetaTileEntity mte = te.getMetaTileEntity(); + + if (mte == null) return false; + + if (mte instanceof TileHatchInputBeamline) { + return this.mInputBeamline.add((TileHatchInputBeamline) mte); + } + + return false; + + } + + private boolean addBeamlineOutputHatch(IGregTechTileEntity te, int casingIndex) { + + if (te == null) return false; + + IMetaTileEntity mte = te.getMetaTileEntity(); + + if (mte == null) return false; + + if (mte instanceof TileHatchOutputBeamline) { + return this.mOutputBeamline.add((TileHatchOutputBeamline) mte); + } + + return false; + + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean active, boolean aRedstone) { + // Placeholder + if (side == facing) { + if (active) return new ITexture[] { casingTexturePages[1][14], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { casingTexturePages[1][14], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW) + .extFacing() + .glow() + .build() }; + } + return new ITexture[] { casingTexturePages[1][14] }; + } + + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { + elementBudget = 200; + + if (mMachine) return -1; + + int build = survivialBuildPiece(STRUCTURE_PIECE_ENTRANCE, stackSize, 16, 3, 1, elementBudget, env, false, true); + + if (build >= 0) return build; + + return survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 16, 3, 0, elementBudget, env, false, true); + + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(STRUCTURE_PIECE_ENTRANCE, stackSize, hintsOnly, 16, 3, 1); + buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 16, 3, 0); + + } + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { + + GT_MetaTileEntity_Hatch_Energy hatch = (GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity; + + // First energy hatch added + if (this.mEnergyHatches.size() == 0) this.energyHatchTier = hatch.mTier; + + // Disallow any hatches that don't match the tier of the first hatch added + if (hatch.mTier != this.energyHatchTier) return false; + + hatch.updateTexture(aBaseCasingIndex); + hatch.updateCraftingIcon(this.getMachineCraftingIcon()); + return mEnergyHatches.add(hatch); + } + return false; + } + + private boolean addAntenna(Block block, int meta) { + + if (block == null) return false; + + if (!(block instanceof AntennaCasing)) return false; + + AntennaCasing antennaBlock = (AntennaCasing) block; + + int antennaTier = antennaBlock.getTier(); + + // First antenna casing added + if (this.mAntennaCasings.size() == 0) this.antennaeTier = antennaTier; + + if (antennaTier != this.antennaeTier) return false; + + return mAntennaCasings.add(antennaBlock); + + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public boolean checkRecipe(ItemStack aStack) { + + float inputEnergy = 0; + float inputFocus = 0; + float inputRate = 0; + int inputParticleId = 0; + + machineFocus = 0; + machineTemp = 0; + + outputEnergy = 0; + outputFocus = 0; + outputRate = 0; + outputParticle = 0; + + float tempFactor = 0; + + float voltageFactor = 0; + + ArrayList fluidList = this.getStoredFluids(); + + if (fluidList.size() == 0) { + + this.stopMachine(SimpleShutDownReason.ofCritical("gtnhlanth.nocoolant")); + + return false; + } + + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + if (this.getInputInformation() == null) { + return false; + } + + if (this.getInputInformation() + .getEnergy() == 0) { // Only really applies if there's no input + return false; + } + + if (this.getInputInformation() + .getFocus() < MIN_INPUT_FOCUS) { + return false; + } + + inputParticleId = this.getInputInformation() + .getParticleId(); + + Particle inputParticle = Particle.getParticleFromId(inputParticleId); + + if (!inputParticle.canAccelerate()) { + stopMachine(SimpleShutDownReason.ofCritical("gtnhlanth.noaccel")); + return false; + } + + mMaxProgresstime = TickTime.SECOND; + + long voltage = this.getMaxInputVoltage(); + mEUt = (int) (-voltage / GT_Values.V[(int) this.getInputVoltageTier()] + * GT_Values.VP[(int) this.getInputVoltageTier()]); // Multiply VP by amps + + outputParticle = 1; // Photon + + FluidStack primaryFluid = fluidList.get(0); + + int fluidTemperature; + + if (primaryFluid.isFluidEqual(new FluidStack(FluidRegistry.getFluid("ic2coolant"), 1))) { + fluidTemperature = 60; // Default temp of 300 is unreasonable + } else { + fluidTemperature = primaryFluid.getFluid() + .getTemperature(); + } + + machineTemp = fluidTemperature; // Solely for tricorder info + + machineFocus = getMachineFocus(fluidTemperature); + + inputFocus = this.getInputInformation() + .getFocus(); + + outputFocus = (inputFocus > machineFocus) ? ((inputFocus + machineFocus) / 2.5f) + : inputFocus * (machineFocus / 100); // If input focus > machine focus, divide their sum by 2.5, else + // weigh the former by the latter. This punishes having too low a + // machine focus for low values of input focus + // E.g. An input focus of 50 requires a machine focus of 100 to get an + // output focus of 50, + // whereas an input focus of 60 only requires around 80 + // In general, as input focus increases, output scales better with + // machine focus + + voltageFactor = getVoltageFactor(voltage, this.antennaeTier); + + inputEnergy = this.getInputInformation() + .getEnergy(); + float mass = inputParticle.getMass(); + + // Perhaps divide by mass somehow here too + outputEnergy = (float) calculateOutputParticleEnergy(voltage, inputEnergy, this.antennaeTier); // maybe + // adjust + // behaviour here + + inputRate = this.getInputInformation() + .getRate(); + outputRate = (int) (inputRate * getOutputRatetio(voltageFactor, this.antennaeTier)); + + if (outputRate == 0) { + stopMachine(SimpleShutDownReason.ofCritical("gtnhlanth.low_input_rate")); + return false; + } + + if (Util.coolantFluidCheck(primaryFluid, CONSUMED_FLUID)) { + + stopMachine(SimpleShutDownReason.ofCritical("gtnhlanth.inscoolant")); + return false; + + } + + primaryFluid.amount -= CONSUMED_FLUID; + + FluidStack fluidOutput = new FluidStack( + BeamlineRecipeLoader.coolantMap.get(primaryFluid.getFluid()), + CONSUMED_FLUID); + if (Objects.isNull(fluidOutput)) return false; + + this.addFluidOutputs(new FluidStack[] { fluidOutput }); + + outputAfterRecipe(); + + return true; + } + + private void outputAfterRecipe() { + + if (!mOutputBeamline.isEmpty()) { + + BeamLinePacket packet = new BeamLinePacket( + new BeamInformation(outputEnergy, outputRate, outputParticle, outputFocus)); + + for (TileHatchOutputBeamline o : mOutputBeamline) { + + o.q = packet; + } + } + } + + @Override + public void stopMachine() { + + outputFocus = 0; + outputEnergy = 0; + outputParticle = 0; + outputRate = 0; + machineFocus = 0; + machineTemp = 0; + super.stopMachine(); + + } + + @Override + public void stopMachine(ShutDownReason reason) { + + outputFocus = 0; + outputEnergy = 0; + outputParticle = 0; + outputRate = 0; + machineFocus = 0; + machineTemp = 0; + super.stopMachine(reason); + + } + + private BeamInformation getInputInformation() { + + for (TileHatchInputBeamline in : this.mInputBeamline) { + + if (in.q == null) return new BeamInformation(0, 0, 0, 0); + // if (in.q == null) return new BeamInformation(10000, 10, 0, 90); // TODO temporary for testing purposes + + return in.q.getContent(); + } + return null; + } + + private static float getVoltageFactor(long mEU, int antennaTier) { + + // float factor = (float) Math.pow(1.00004, -mEU * Math.pow(antennaTier, 1.0/3.0) + 80000); + float factor = (float) -Math.pow(1.1, -mEU / 2000 * Math.pow(antennaTier, 2.0 / 3.0)) + 1; // Strictly improves + // with higher tier + // antenna + return factor; + + } + + /* + * private static float getTemperatureFactor(int temperature) { float factor = (float) Math.pow(1.11, 0.18 * + * temperature); return factor; } + */ + private static double calculateOutputParticleEnergy(long voltage, double inputParticleEnergy, int antennaTier) { + + /* + * Energy in general increases as input energy increases, with the relationship between the machine EUt and + * energy being an negative exponential, with a maximum depending on both input particle energy and antenna + * tier. The extent to which the output depends on the former is determined by the cbrt of the latter, meaning + * that increases in antenna tier result in diminishing returns. In the same way, the curve of the output energy + * vs. machine voltage exponential depends on antenna tier, with an increase in antenna tier resulting in a more + * shallow curve up. The effect of this also increases with the tier. LaTeX: + * -\frac{l^{1.11t^{\frac{1}{3}}}}{40000000}\cdot\left(0.15^{\frac{2}{t^{\frac{3}{2}}}}\right)^{\frac{x}{60768}} + * \ +\ \frac{l^{1.11t^{\frac{1}{3}}}}{40000000} + */ + + double energy = (Math.pow(inputParticleEnergy, 1.13 * Math.pow(antennaTier, 1.0 / 3.0)) / 40_000_000) + * (-Math.pow(Math.pow(0.15, 2.0 / (Math.pow(antennaTier, 3.0 / 2.0))), voltage / 60768.0) + 1); // In + // keV + + return energy; + + } + + private static float getMachineFocus(int temperature) { + + return (float) Math.max(Math.min(Math.pow(1.5, -1.0 / 40.0 * (temperature - 480)), 90), 10); + } + + // Punny, right? + private static float getOutputRatetio(float voltageFactor, int antennaTier) { + return (float) (voltageFactor / 10 / Math.pow(2.5, antennaTier)); // Scale ratio with antenna tier, such a high + // exponential should be fine so long as there + // are only few antenna tiers + } + + @Override + public String[] getStructureDescription(ItemStack arg0) { + return DescTextLocalization.addText("Synchrotron.hint", 12); + } + + @Override + public String[] getInfoData() { + + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (tHatch.isValid()) { + storedEnergy += tHatch.getBaseMetaTileEntity() + .getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity() + .getEUCapacity(); + } + } + + BeamInformation information = this.getInputInformation(); + + return new String[] { + /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(getActualEnergyUsage()) + + EnumChatFormatting.RESET + + " EU/t", + /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxInputVoltage()) + + EnumChatFormatting.RESET + + " EU/t(*2A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + VN[GT_Utility.getTier(getMaxInputVoltage())] + + EnumChatFormatting.RESET, + /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + Float.toString(mEfficiency / 100.0F) + + EnumChatFormatting.RESET + + " %", + + /* 7 */ EnumChatFormatting.BOLD + StatCollector.translateToLocal("beamline.info") + + ": " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.focus") + ": " // Machine Focus: + + EnumChatFormatting.BLUE + + machineFocus + + " " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.temperature") + ": " // Temperature: + + EnumChatFormatting.DARK_RED + + machineTemp + + EnumChatFormatting.RESET + + " K", // e.g. "137 K" + StatCollector.translateToLocal("beamline.coolusage") + ": " // Coolant Usage: + + EnumChatFormatting.AQUA + + 32_000 + + EnumChatFormatting.RESET + + " kL/s", // 32 kL/s + + /* 8 */ EnumChatFormatting.BOLD + StatCollector.translateToLocal("beamline.in_pre") + + ": " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.particle") + ": " // "Multiblock Beamline Input:" + + EnumChatFormatting.GOLD + + Particle.getParticleFromId(information.getParticleId()) + .getLocalisedName() // e.g. "Electron + // (e-)" + + " " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.energy") + ": " // "Energy:" + + EnumChatFormatting.DARK_RED + + information.getEnergy() + + EnumChatFormatting.RESET + + " keV", // e.g. "10240 keV" + StatCollector.translateToLocal("beamline.focus") + ": " // "Focus:" + + EnumChatFormatting.BLUE + + information.getFocus() + + " " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.amount") + ": " // "Amount:" + + EnumChatFormatting.LIGHT_PURPLE + + information.getRate(), + EnumChatFormatting.BOLD + StatCollector.translateToLocal("beamline.out_pre") // "Multiblock Beamline + // Output:" + + ": " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.particle") + ": " + + EnumChatFormatting.GOLD + + Particle.getParticleFromId(this.outputParticle) + .getLocalisedName() + + " " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.energy") + ": " + + EnumChatFormatting.DARK_RED + + this.outputEnergy * 1000 + + EnumChatFormatting.RESET + + " eV", + StatCollector.translateToLocal( + "beamline.focus") + ": " + EnumChatFormatting.BLUE + this.outputFocus + " " + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.amount") + ": " + + EnumChatFormatting.LIGHT_PURPLE + + this.outputRate, }; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + + this.mInputBeamline.clear(); + this.mOutputBeamline.clear(); + + this.mAntennaCasings.clear(); + + this.mEnergyHatches.clear(); + this.energyHatchTier = 0; + this.antennaeTier = 0; + + this.glassTier = 0; + + this.outputEnergy = 0; + this.outputRate = 0; + this.outputFocus = 0; + this.outputParticle = 0; + + if (!checkPiece(STRUCTURE_PIECE_ENTRANCE, 16, 3, 1)) return false; + if (!checkPiece(STRUCTURE_PIECE_BASE, 16, 3, 0)) return false; + + return this.mInputBeamline.size() == 1 && this.mOutputBeamline.size() == 1 + && this.mMaintenanceHatches.size() == 1 + && this.mEnergyHatches.size() == 4 + && this.glassTier >= MIN_GLASS_TIER; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/TargetChamber.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/TargetChamber.java new file mode 100644 index 0000000000..1fde839173 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/TargetChamber.java @@ -0,0 +1,479 @@ +package com.elisis.gtnhlanth.common.tileentity; + +import static com.elisis.gtnhlanth.util.DescTextLocalization.BLUEPRINT_INFO; +import static com.elisis.gtnhlanth.util.DescTextLocalization.addDotText; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAdder; +import static gregtech.api.enums.GT_HatchElement.Energy; +import static gregtech.api.enums.GT_HatchElement.InputBus; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.OutputBus; +import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +import com.elisis.gtnhlanth.common.beamline.BeamInformation; +import com.elisis.gtnhlanth.common.beamline.Particle; +import com.elisis.gtnhlanth.common.hatch.TileBusInputFocus; +import com.elisis.gtnhlanth.common.hatch.TileHatchInputBeamline; +import com.elisis.gtnhlanth.common.register.LanthItemList; +import com.elisis.gtnhlanth.common.tileentity.recipe.beamline.BeamlineRecipeAdder2; +import com.elisis.gtnhlanth.common.tileentity.recipe.beamline.RecipeTC; +import com.elisis.gtnhlanth.util.DescTextLocalization; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.TickTime; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; + +public class TargetChamber extends GT_MetaTileEntity_EnhancedMultiBlockBase + implements ISurvivalConstructable { + + private static final IStructureDefinition STRUCTURE_DEFINITION; + + private ArrayList mInputBeamline = new ArrayList<>(); + + private ArrayList mInputFocus = new ArrayList<>(); + + private static final int CASING_INDEX_FRONT = GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings3, 10); // Grate + private static final int CASING_INDEX_CENTRE = GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings5, 14); // Shielded + // Acc. + + private float inputEnergy; + private float inputRate; + private int inputParticle; + private float inputFocus; + + // spotless:off + static { + STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape( + "base", + new String[][] { + {"ggggg", "gjjjg", "gjbjg", "gjjjg", "ff~ff"}, + {"cslsc", "s-r-s", "srhrs", "s-r-s", "ccccc"}, + {"csssc", "s---s", "s---s", "s---s", "ccccc"}, + {"csssc", "s---s", "s---s", "s---s", "ccccc"}, + {"cstsc", "s-u-s", "suius", "s-u-s", "ccccc"}, + {"ggggg", "gjjjg", "gjojg", "gjjjg", "ggggg"}}) + + .addElement('g', ofBlock(GregTech_API.sBlockCasings3, 10)) //Grate casing + .addElement( + 'f', + buildHatchAdder(TargetChamber.class).atLeast(Maintenance, Energy) + .casingIndex(CASING_INDEX_FRONT).dot(2).buildAndChain(ofBlock(GregTech_API.sBlockCasings3, 10))) + + .addElement('j', ofBlockAdder(TargetChamber::addGlass, ItemRegistry.bw_glasses[0], 1)) + .addElement('b', buildHatchAdder(TargetChamber.class).hatchClass(TileHatchInputBeamline.class).casingIndex(CASING_INDEX_CENTRE).dot(5).adder(TargetChamber::addBeamLineInputHatch).build()) + .addElement('c', ofBlock(LanthItemList.SHIELDED_ACCELERATOR_CASING, 0)) + + .addElement('l', buildHatchAdder(TargetChamber.class).hatchClass(TileBusInputFocus.class).casingIndex(CASING_INDEX_CENTRE).dot(1).adder(TargetChamber::addFocusInputHatch).build()) + + .addElement('t', buildHatchAdder(TargetChamber.class).atLeast(InputBus).casingIndex(CASING_INDEX_CENTRE).dot(3).build()) + .addElement('s', ofBlock(LanthItemList.SHIELDED_ACCELERATOR_GLASS, 0)) + .addElement('r', ofBlock(LanthItemList.FOCUS_MANIPULATION_CASING, 0)) + .addElement('h', ofBlock(LanthItemList.FOCUS_HOLDER, 0)) + .addElement('u', ofBlock(LanthItemList.TARGET_RECEPTACLE_CASING, 0)) + .addElement('i', ofBlock(LanthItemList.TARGET_HOLDER, 0)) + .addElement('o', buildHatchAdder(TargetChamber.class).atLeast(OutputBus).casingIndex(CASING_INDEX_CENTRE).dot(4).build()) + + .build(); + } + //spotless:on + + private boolean addGlass(Block block, int meta) { + return block == ItemRegistry.bw_glasses[0]; + } + + private boolean addBeamLineInputHatch(IGregTechTileEntity te, int casingIndex) { + + if (te == null) return false; + + IMetaTileEntity mte = te.getMetaTileEntity(); + + if (mte == null) return false; + + if (mte instanceof TileHatchInputBeamline) { + return this.mInputBeamline.add((TileHatchInputBeamline) mte); + } + + return false; + } + + private boolean addFocusInputHatch(IGregTechTileEntity te, int casingIndex) { + + if (te == null) return false; + + IMetaTileEntity mte = te.getMetaTileEntity(); + + if (mte == null) return false; + + if (mte instanceof TileBusInputFocus) { + return this.mInputFocus.add((TileBusInputFocus) mte); + } + + return false; + } + + public TargetChamber(int id, String name, String nameRegional) { + super(id, name, nameRegional); + } + + public TargetChamber(String name) { + super(name); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity te) { + return new TargetChamber(this.mName); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity baseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int colorIndex, boolean active, boolean redstoneLevel) { + // Placeholder + if (side == facing) { + if (active) return new ITexture[] { casingTexturePages[0][47], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { casingTexturePages[0][47], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW) + .extFacing() + .glow() + .build() }; + } + return new ITexture[] { casingTexturePages[0][47] }; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Collision Chamber") + .addInfo("Controller block for the Target Chamber") + .addInfo("Hitting things with other things") + + .addInfo(BLUEPRINT_INFO) + .addInfo(DescTextLocalization.BEAMLINE_SCANNER_INFO) + .addSeparator() + .beginStructureBlock(5, 5, 6, true) + .addController("Front bottom") + .addCasingInfoExactly("Grate Machine Casing", 29, false) + .addCasingInfoExactly("Shielded Accelerator Casing", 28, false) + .addCasingInfoExactly("Borosilicate Glass", 16, true) + .addCasingInfoExactly(LanthItemList.SHIELDED_ACCELERATOR_GLASS.getLocalizedName(), 34, false) + .addCasingInfoExactly(LanthItemList.TARGET_RECEPTACLE_CASING.getLocalizedName(), 4, false) + .addCasingInfoExactly(LanthItemList.FOCUS_MANIPULATION_CASING.getLocalizedName(), 4, false) + .addCasingInfoExactly(LanthItemList.FOCUS_HOLDER.getLocalizedName(), 1, false) + .addCasingInfoExactly(LanthItemList.TARGET_HOLDER.getLocalizedName(), 1, false) + .addOtherStructurePart("Focus Input Bus", addDotText(1)) + .addMaintenanceHatch(addDotText(2)) + .addEnergyHatch(addDotText(2)) + .addInputBus(addDotText(3)) + .addOutputBus(addDotText(4)) + .addOtherStructurePart("Beamline Input Hatch", addDotText(5)) + .toolTipFinisher("GTNH: Lanthanides"); + return tt; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece("base", stackSize, hintsOnly, 2, 4, 0); + + } + + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { + if (mMachine) return -1; + return survivialBuildPiece("base", stackSize, 2, 4, 0, elementBudget, env, false, true); + } + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + public RecipeMap getRecipeMap() { + return BeamlineRecipeAdder2.instance.TargetChamberRecipes; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + + inputEnergy = 0; + inputRate = 0; + inputParticle = 0; + inputFocus = 0; + + ArrayList tItems = this.getStoredInputs(); + ItemStack tFocusItem = this.getFocusItemStack(); + + ItemStack tFocusItemZeroDamage = null; + + if (tFocusItem != null) { + + tFocusItemZeroDamage = tFocusItem.copy(); + tFocusItemZeroDamage.setItemDamage(0); + } + + ArrayList tItemsWithFocusItem = new ArrayList<>(); + tItemsWithFocusItem.add(tFocusItemZeroDamage); + tItemsWithFocusItem.addAll(tItems); + + long tVoltage = this.getMaxInputVoltage(); + + ItemStack[] tItemsArray = tItems.toArray(new ItemStack[0]); + + ItemStack[] tItemsWithFocusItemArray = tItemsWithFocusItem.toArray(new ItemStack[0]); + + RecipeTC tRecipe = (RecipeTC) BeamlineRecipeAdder2.instance.TargetChamberRecipes.findRecipeQuery() + .items(tItemsWithFocusItemArray) + .voltage(tVoltage) + .filter((GT_Recipe recipe) -> { + + RecipeTC recipeTc = (RecipeTC) recipe; + + BeamInformation inputInfo = this.getInputInformation(); + + int particle = recipeTc.particleId; + + return (particle == inputInfo.getParticleId() + && !(inputInfo.getEnergy() < recipeTc.minEnergy || inputInfo.getEnergy() > recipeTc.maxEnergy)); + + }) + .find(); + + if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, new FluidStack[] {}, tItemsWithFocusItemArray)) + return false; + + if (tRecipe.focusItem != null) { + if (tRecipe.focusItem.getItem() != tFocusItem.getItem()) return false; + } + + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + BeamInformation inputInfo = this.getInputInformation(); + + if (inputInfo == null) return false; + + inputEnergy = inputInfo.getEnergy(); + inputRate = inputInfo.getRate(); + inputParticle = inputInfo.getParticleId(); + inputFocus = inputInfo.getFocus(); + + if (inputEnergy < tRecipe.minEnergy || inputEnergy > tRecipe.maxEnergy) return false; + + if (inputFocus < tRecipe.minFocus) return false; + + if (inputParticle != tRecipe.particleId) return false; + + this.mMaxProgresstime = Math.round((tRecipe.amount / inputRate * 10 * TickTime.SECOND)); // 10 seconds per + // integer multiple + // over the rate. E.g., 100a, 10r + // would equal 100 seconds + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; + + mEUt = (int) -tVoltage; + if (this.mEUt > 0) this.mEUt = (-this.mEUt); + + this.mOutputItems = tRecipe.mOutputs; + + if (tRecipe.focusItem != null) // Recipe actually uses the mask, can also assume machine mask item is nonnull + // due to above conditions + mInputFocus.get(0) + .depleteFocusDurability(1); + + this.updateSlots(); + + return true; + } + + private BeamInformation getInputInformation() { + + for (TileHatchInputBeamline in : this.mInputBeamline) { + + if (in.q == null) return new BeamInformation(0, 0, 0, 0); + // if (in.q == null) return new BeamInformation(10, 10, Particle.PHOTON.ordinal(), 90); // temporary + // for + // testing purposes + + return in.q.getContent(); + } + return null; + } + + private ItemStack getFocusItemStack() { + + for (TileBusInputFocus hatch : this.mInputFocus) { + return hatch.getContentUsageSlots() + .get(0); + } + + return null; + + } + + @Override + public boolean checkMachine(IGregTechTileEntity arg0, ItemStack arg1) { + + mInputBeamline.clear(); + mInputFocus.clear(); + + if (!checkPiece("base", 2, 4, 0)) return false; + + return this.mInputBeamline.size() == 1 && this.mMaintenanceHatches.size() == 1 + && this.mInputBusses.size() == 1 + && this.mOutputBusses.size() == 1 + && this.mInputFocus.size() == 1; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack arg0) { + return false; + } + + @Override + public int getDamageToComponent(ItemStack arg0) { + return 0; + } + + @Override + public int getMaxEfficiency(ItemStack arg0) { + return 10000; + } + + @Override + public boolean isCorrectMachinePart(ItemStack arg0) { + return true; + } + + @Override + public String[] getStructureDescription(ItemStack arg0) { + return DescTextLocalization.addText("TargetChamber.hint", 13); + } + + @Override + public String[] getInfoData() { + + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (tHatch.isValid()) { + storedEnergy += tHatch.getBaseMetaTileEntity() + .getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity() + .getEUCapacity(); + } + } + + BeamInformation information = this.getInputInformation(); + + return new String[] { + /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(getActualEnergyUsage()) + + EnumChatFormatting.RESET + + " EU/t", + /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxInputVoltage()) + + EnumChatFormatting.RESET + + " EU/t(*2A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + VN[GT_Utility.getTier(getMaxInputVoltage())] + + EnumChatFormatting.RESET, + /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + Float.toString(mEfficiency / 100.0F) + + EnumChatFormatting.RESET + + " %", + + /* 6 */ EnumChatFormatting.BOLD + StatCollector.translateToLocal("beamline.in_pre") + + ": " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.particle") + ": " // "Multiblock Beamline Input:" + + EnumChatFormatting.GOLD + + Particle.getParticleFromId(information.getParticleId()) + .getLocalisedName() // e.g. "Electron + // (e-)" + + " " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.energy") + ": " // "Energy:" + + EnumChatFormatting.DARK_RED + + information.getEnergy() * 1000 // In line with the synchrotron's output + + EnumChatFormatting.RESET + + " eV", // e.g. "10240 eV" + StatCollector.translateToLocal("beamline.focus") + ": " // "Focus:" + + EnumChatFormatting.BLUE + + information.getFocus() + + " " + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("beamline.amount") + ": " // "Amount:" + + EnumChatFormatting.LIGHT_PURPLE + + information.getRate(), }; + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeAdder2.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeAdder2.java new file mode 100644 index 0000000000..59c14940d6 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeAdder2.java @@ -0,0 +1,166 @@ +package com.elisis.gtnhlanth.common.tileentity.recipe.beamline; + +import java.util.Arrays; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; + +import com.elisis.gtnhlanth.common.beamline.Particle; + +import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMapBackend; +import gregtech.api.recipe.RecipeMapBuilder; +import gregtech.api.util.GT_Utility; + +public class BeamlineRecipeAdder2 { + + public static final BeamlineRecipeAdder2 instance = new BeamlineRecipeAdder2(); + + public final RecipeMap SourceChamberRecipes = RecipeMapBuilder.of("gtnhlanth.recipe.sc") + .minInputs(0, 0) + .maxIO(1, 2, 0, 0) + .amperage(1) + .frontend(SourceChamberFrontend::new) + .progressBar(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1) + .neiSpecialInfoFormatter((recipeInfo) -> { + + RecipeSC recipe = (RecipeSC) recipeInfo.recipe; + + float focus = recipe.focus; + float maxEnergy = recipe.maxEnergy; + + int amount = recipe.rate; + + Particle particle = Particle.getParticleFromId(recipe.particleId); + + return Arrays.asList( + + // StatCollector.translateToLocal("beamline.particle") + ": " + particle.getLocalisedName(), + + StatCollector.translateToLocal("beamline.energy") + ": <=" + + GT_Utility.formatNumbers(Math.min(maxEnergy, particle.maxSourceEnergy())) + + " keV", + + StatCollector.translateToLocal("beamline.focus") + ": " + GT_Utility.formatNumbers(focus), + + StatCollector.translateToLocal("beamline.rate") + ": " + GT_Utility.formatNumbers(amount) + + ); + }) + // .slotOverlays(null) + + .build(); + + public final RecipeMap TargetChamberRecipes = RecipeMapBuilder.of("gtnhlanth.recipe.tc") + .minInputs(0, 0) + .maxIO(3, 4, 0, 0) + .frontend(TargetChamberFrontend::new) + .neiSpecialInfoFormatter(((recipeInfo) -> { + + RecipeTC recipe = (RecipeTC) recipeInfo.recipe; + + float minEnergy = recipe.minEnergy; + float maxEnergy = recipe.maxEnergy; + + float minFocus = recipe.minFocus; + + float amount = recipe.amount; + + Particle particle = Particle.getParticleFromId(recipe.particleId); + + return Arrays.asList( + + // StatCollector.translateToLocal("beamline.particle") + ": " + particle.getLocalisedName(), + + StatCollector.translateToLocal("beamline.energy") + ": " + + GT_Utility.formatNumbers(minEnergy * 1000) + + "-" + + GT_Utility.formatNumbers(maxEnergy * 1000) + + " eV", // Note the eV unit + + StatCollector.translateToLocal("beamline.focus") + ": >=" + GT_Utility.formatNumbers(minFocus), + + StatCollector.translateToLocal("beamline.amount") + ": " + GT_Utility.formatNumbers(amount) + + ); + })) + // .slotOverlays(null) + .progressBar(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1) + .progressBarPos(108, 22) + .neiTransferRect(100, 22, 28, 18) + .build(); + + /*** + * + * @param itemInputs - duh + * @param itemOutputs - duh + * @param particleId - The ID of the {@link com.elisis.gtnhlanth.common.beamline.Particle} generated by the recipe. + * It is recommended to use Particle#ordinal() + * @param rate - The rate/amount of particles generated + * @param maxEnergy - The maximum energy particles generated by this recipe can possess (keV). Set this value >= + * max particle energy to limit it to the latter + * @param focus - Focus of the particle generated + * @param energyRatio - Set high for little-to-no EUt energy scaling, low for the opposite + * @param minEUt - Minimum EUt required for the recipe. ! May not output if input energy is equal to minimum ! + */ + public boolean addSourceChamberRecipe(ItemStack[] itemInputs, ItemStack[] itemOutputs, int particleId, int rate, + float maxEnergy, float focus, float energyRatio, int minEUt) { + + return (SourceChamberRecipes.addRecipe( + new RecipeSC( + false, + itemInputs, + itemOutputs, + null, + new int[] {}, + null, + null, + 20, + minEUt, + particleId, + rate, + maxEnergy, + focus, + energyRatio)) + != null); + } + + /*** + * + * @param itemInput - The item to be used as a target. Should have durability + * @param itemOutput - duh + * @param particleId - The ID of the {@link com.elisis.gtnhlanth.common.beamline.Particle} used by the recipe. It + * is recommended to use Particle#ordinal() + * @param amount - The total amount of particles required for the recipe to come to completion. The duration of + * the recipe will be determined by this and the input particle rate. + * @param minEnergy - The minimum energy amount required by this recipe in keV (inclusive) + * @param maxEnergy - The maximum energy amount allowed by this recipe in keV (inclusive) + * @param minFocus - Minimum focus allowed by the recipe + * @param energyRatio - Set high for little-to-no EUt energy scaling, low for the opposite + * @param minEUt - Minimum EUt required for the recipe to start + */ + + public boolean addTargetChamberRecipe(ItemStack itemInput, ItemStack itemOutput, ItemStack itemFocus, + int particleId, int amount, float minEnergy, float maxEnergy, float minFocus, float energyRatio, int minEUt) { + + return (TargetChamberRecipes.addRecipe( + new RecipeTC( + false, + itemInput, + itemOutput, + itemFocus, + particleId, + amount, + minEnergy, + maxEnergy, + minFocus, + energyRatio, + minEUt), + false, + false, + false) != null); + + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java new file mode 100644 index 0000000000..5b2ca7b650 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java @@ -0,0 +1,191 @@ +package com.elisis.gtnhlanth.common.tileentity.recipe.beamline; + +import java.util.Arrays; +import java.util.HashMap; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; + +import com.elisis.gtnhlanth.common.beamline.Particle; +import com.elisis.gtnhlanth.common.item.MaskList; +import com.elisis.gtnhlanth.common.register.LanthItemList; +import com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool; + +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.material.ELEMENT; + +public class BeamlineRecipeLoader { + + public static final HashMap coolantMap = new HashMap<>(); + + private static final ItemList[] VIABLE_WAFERS = new ItemList[] { ItemList.Circuit_Silicon_Wafer, + ItemList.Circuit_Silicon_Wafer2, ItemList.Circuit_Silicon_Wafer3, ItemList.Circuit_Silicon_Wafer4, + ItemList.Circuit_Silicon_Wafer5, ItemList.Circuit_Silicon_Wafer6, ItemList.Circuit_Silicon_Wafer7 }; + + public static void load() { + + /* + * Coolant list + */ + + coolantMap.put( + Materials.LiquidNitrogen.getGas(1L) + .getFluid(), + Materials.Nitrogen.getGas(1L) + .getFluid()); + coolantMap.put( + Materials.LiquidOxygen.getGas(1L) + .getFluid(), + Materials.Oxygen.getGas(1L) + .getFluid()); + coolantMap.put(FluidRegistry.getFluid("ic2coolant"), FluidRegistry.getFluid("ic2hotcoolant")); + coolantMap.put( + Materials.SuperCoolant.getFluid(1L) + .getFluid(), + Materials.Water.getFluid(1L) + .getFluid()); + + /* + * ELECTRON + */ + BeamlineRecipeAdder2.instance.addSourceChamberRecipe( + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Tungsten, 1) }, + null, + Particle.ELECTRON.ordinal(), + 20, + 1000, + 98, + 0.1f, + 7680); + + BeamlineRecipeAdder2.instance.addSourceChamberRecipe( + new ItemStack[] { WerkstoffMaterialPool.LanthanumHexaboride.get(OrePrefixes.stickLong, 1) }, + null, + Particle.ELECTRON.ordinal(), + 60, + 5000, + 99, + 0.3f, + 7680); + + /* + * NEUTRON + */ + BeamlineRecipeAdder2.instance.addSourceChamberRecipe( + new ItemStack[] { ELEMENT.getInstance().CALIFORNIUM.getDust(1) }, + null, + Particle.NEUTRON.ordinal(), + 10, + 9000, + 95, + 999, + 1920); + + /* + * ALPHA + */ + BeamlineRecipeAdder2.instance.addSourceChamberRecipe( + new ItemStack[] { Materials.Uranium.getDust(1) }, + new ItemStack[] { WerkstoffMaterialPool.Thorium234.get(OrePrefixes.dust, 1) }, + Particle.ALPHA.ordinal(), + 1, + 4270, + 90, + 999, + 480); + + /* + * TARGET CHAMBER + */ + + for (MaskList mask : MaskList.values()) { + + if (mask.getProducedItem() == null) // Blank or error + continue; + + int index = 0; + for (ItemList wafer : VIABLE_WAFERS) { + + index++; + + if (!Arrays.asList(mask.getForbiddenWafers()) + .contains(wafer)) { + + BeamlineRecipeAdder2.instance.addTargetChamberRecipe( + wafer.get(1), + GT_Utility.copyAmountUnsafe((int) Math.pow(2, index + 2), mask.getProducedItem()), + new ItemStack(LanthItemList.maskMap.get(mask), 0), + 1, + mask.getBaselineAmount() * (int) Math.pow(Math.sqrt(3), index - 1), // 3x recipe amount increase + // per 2 increases in wafer + // tier. This greatly + // incentivises the use of + // higher tier boule wafer + // recipes + mask.getMinEnergy(), + mask.getMaxEnergy(), + mask.getMinFocus(), + 1, + 1920); + + } + + } + + /* + * if (!Arrays.asList(MaskList.CPU.getForbiddenWafers()).contains(wafer)) { + * BeamlineRecipeAdder.instance.addTargetChamberRecipe( wafer.get(1), GT_Utility.copyAmountUnsafe((int) + * Math.pow(2, index + 2), ItemList.Circuit_Wafer_CPU.get(1)), //Varies new + * ItemStack(LanthItemList.maskMap.get(MaskList.CPU), 0), // Varies 0, 10 * (int) Math.pow(2, index - 1), // + * Varies 1, //Varies 10000000, //Varies 50, //Varies 1, 1920 ); } /* PPIC + */ + + /* + * if (!Arrays.asList(MaskList.PPIC.getForbiddenWafers()).contains(wafer)) { + * GT_Log.out.print("Adding recipe for PPIC with " + wafer.get(1).getUnlocalizedName() + " amount: " + 40 * + * (int) Math.pow(2, index - 1)); BeamlineRecipeAdder.instance.addTargetChamberRecipe( wafer.get(1), + * ItemList.Circuit_Wafer_PPIC.get((int) Math.pow(2, index + 2)), //Varies new + * ItemStack(LanthItemList.maskMap.get(MaskList.PPIC), 0), // Varies 0, 40 * (int) Math.pow(2, index - 1), + * // Varies 1, //Varies 10000000, //Varies 50, //Varies 1, 1920 ); } + */ + + } + /* + * BeamlineRecipeAdder2.instance.addTargetChamberRecipe( new ItemStack(Items.coal, 1), new + * ItemStack(Items.diamond, 1), null, 1, 20, 100, 1000, 60, 1, 1920); + * BeamlineRecipeAdder2.instance.addTargetChamberRecipe( new ItemStack(Items.coal, 1), new + * ItemStack(Items.cooked_chicken, 1), null, 1, 20, 1, 10, 60, 1, 1920); + */ + + BeamlineRecipeAdder2.instance.addTargetChamberRecipe( + new ItemStack(Items.chicken, 1), + new ItemStack(Items.cooked_chicken), + null, + Particle.PHOTON.ordinal(), + 400, + 5, + 20, + 80, + 1, + 7864320); + + BeamlineRecipeAdder2.instance.addTargetChamberRecipe( + new ItemStack(Items.chicken, 1), + new ItemStack(Items.egg), + null, + Particle.PHOTON.ordinal(), + 400, + 21, + 600, + 80, + 1, + 7864320); + + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeSC.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeSC.java new file mode 100644 index 0000000000..0d65421e67 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeSC.java @@ -0,0 +1,53 @@ +package com.elisis.gtnhlanth.common.tileentity.recipe.beamline; + +import java.util.ArrayList; +import java.util.Arrays; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import com.elisis.gtnhlanth.common.register.LanthItemList; + +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; + +public class RecipeSC extends GT_Recipe { + + public int particleId; + public int rate; + public float maxEnergy; + public float focus; + public float energyRatio; + + public RecipeSC(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int particleId, int rate, + float maxEnergy, float focus, float energyRatio) { + + super(aOptimize, aInputs, aOutputs, null, aChances, null, null, aDuration, aEUt, 0); + + this.particleId = particleId; + this.rate = rate; + this.maxEnergy = maxEnergy; + this.focus = focus; + this.energyRatio = energyRatio; + } + + @Override + public ItemStack getRepresentativeOutput(int aIndex) { + + ArrayList mOutputsWithParticle = new ArrayList<>(); + + ItemStack particleStack = new ItemStack(LanthItemList.PARTICLE_ITEM); + + Items.ender_pearl.setDamage(particleStack, this.particleId); + + mOutputsWithParticle.addAll(Arrays.asList(mOutputs)); + mOutputsWithParticle.add(particleStack); + + ItemStack[] mOutputsWithParticleArray = mOutputsWithParticle.toArray(new ItemStack[0]); + + if (aIndex < 0 || aIndex >= mOutputsWithParticleArray.length) return null; + return GT_Utility.copyOrNull(mOutputsWithParticleArray[aIndex]); + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeTC.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeTC.java new file mode 100644 index 0000000000..49a5b64e1d --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeTC.java @@ -0,0 +1,72 @@ +package com.elisis.gtnhlanth.common.tileentity.recipe.beamline; + +import java.util.ArrayList; +import java.util.Arrays; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +import com.elisis.gtnhlanth.common.register.LanthItemList; + +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; + +public class RecipeTC extends GT_Recipe { + + public int particleId; + public int amount; + + public float minEnergy; + public float maxEnergy; + + public float minFocus; + public float energyRatio; + + public ItemStack focusItem; + + public RecipeTC(boolean aOptimize, ItemStack aInput, ItemStack aOutput, ItemStack aFocusItem, int particleId, + int amount, float minEnergy, float maxEnergy, float minFocus, float energyRatio, int aEUt) { + + super( + aOptimize, + new ItemStack[] { aFocusItem, aInput }, + new ItemStack[] { aOutput }, + null, + null, + null, + null, + 1, + aEUt, + 0); + + this.particleId = particleId; + this.amount = amount; + + this.minEnergy = minEnergy; + this.maxEnergy = maxEnergy; + + this.minFocus = minFocus; + + this.energyRatio = energyRatio; + + this.focusItem = aFocusItem; + } + + @Override + public ItemStack getRepresentativeInput(int aIndex) { + + ArrayList mInputsWithParticle = new ArrayList<>(); + + ItemStack particleStack = new ItemStack(LanthItemList.PARTICLE_ITEM); + Items.ender_pearl.setDamage(particleStack, this.particleId); + + mInputsWithParticle.add(particleStack); + mInputsWithParticle.addAll(Arrays.asList(mInputs)); + + ItemStack[] mInputsWithParticleArray = mInputsWithParticle.toArray(new ItemStack[0]); + + if (aIndex < 0 || aIndex >= mInputsWithParticleArray.length) return null; + return GT_Utility.copyOrNull(mInputsWithParticleArray[aIndex]); + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/SourceChamberFrontend.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/SourceChamberFrontend.java new file mode 100644 index 0000000000..24282e54c6 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/SourceChamberFrontend.java @@ -0,0 +1,24 @@ +package com.elisis.gtnhlanth.common.tileentity.recipe.beamline; + +import gregtech.api.recipe.BasicUIPropertiesBuilder; +import gregtech.api.recipe.NEIRecipePropertiesBuilder; +import gregtech.api.recipe.RecipeMapFrontend; +import gregtech.nei.RecipeDisplayInfo; + +public class SourceChamberFrontend extends RecipeMapFrontend { + + public SourceChamberFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, + NEIRecipePropertiesBuilder neiPropertiesBuilder) { + super(uiPropertiesBuilder, neiPropertiesBuilder); + } + + @Override + public void drawDescription(RecipeDisplayInfo recipeInfo) { + drawEnergyInfo(recipeInfo); + // drawDurationInfo(recipeInfo); Unnecessary and misleading + drawSpecialInfo(recipeInfo); + drawMetadataInfo(recipeInfo); + drawRecipeOwnerInfo(recipeInfo); + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/TargetChamberFrontend.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/TargetChamberFrontend.java new file mode 100644 index 0000000000..58b73fb58d --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/TargetChamberFrontend.java @@ -0,0 +1,109 @@ +package com.elisis.gtnhlanth.common.tileentity.recipe.beamline; + +import static gregtech.api.util.GT_Utility.trans; + +import java.util.List; + +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + +import com.elisis.gtnhlanth.util.Util; +import com.gtnewhorizons.modularui.api.math.Pos2d; + +import gregtech.api.recipe.BasicUIPropertiesBuilder; +import gregtech.api.recipe.NEIRecipePropertiesBuilder; +import gregtech.api.recipe.RecipeMapFrontend; +import gregtech.api.util.GT_OverclockCalculator; +import gregtech.api.util.GT_Utility; +import gregtech.common.gui.modularui.UIHelper; +import gregtech.nei.GT_NEI_DefaultHandler; +import gregtech.nei.RecipeDisplayInfo; + +public class TargetChamberFrontend extends RecipeMapFrontend { + + public TargetChamberFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, + NEIRecipePropertiesBuilder neiPropertiesBuilder) { + super(uiPropertiesBuilder, neiPropertiesBuilder); + } + + public void drawDescription(RecipeDisplayInfo recipeInfo) { + drawEnergyInfo(recipeInfo); + // drawDurationInfo(recipeInfo); + drawSpecialInfo(recipeInfo); + drawMetadataInfo(recipeInfo); + drawRecipeOwnerInfo(recipeInfo); + } + + @Override + protected void drawNEIOverlayForInput(GT_NEI_DefaultHandler.FixedPositionedStack stack) { + if (stack.isNotConsumed()) { // The stack actually takes damage, but is technically still not considered to be + // consumed by the code + drawNEIOverlayText("PC", stack); + } + } + + @Override + protected List handleNEIItemInputTooltip(List currentTip, + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + if (pStack.isNotConsumed()) { // See above + currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("gtnhlanth.tt.pc")); // Partially + // consumed: + // Takes damage + // in the + // process + } + return currentTip; + } + + @Override + public void drawEnergyInfo(RecipeDisplayInfo recipeInfo) { + if (recipeInfo.calculator.getConsumption() <= 0) return; + + // recipeInfo.drawText(trans("152", "Total: ") + getTotalPowerString(recipeInfo.calculator)); + + recipeInfo.drawText(trans("153", "Usage: ") + getEUtDisplay(recipeInfo.calculator)); + recipeInfo.drawText(trans("154", "Voltage: ") + getVoltageString(recipeInfo.calculator)); + recipeInfo.drawText(trans("155", "Amperage: ") + getAmperageString(recipeInfo.calculator)); + + } + + @Override + public List getItemOutputPositions(int itemOutputCount) { + return UIHelper.getGridPositions(itemOutputCount, 128, 24, 1, 3); // Make output items display vertically, not + // in a square + } + + @Override + public List getItemInputPositions(int itemInputCount) { + + /* + * Pos2d posParticle = new Pos2d(8, 28); // Particle item ArrayList posList = new ArrayList<>(); + * posList.add(posParticle); posList.addAll(UIHelper.getGridPositions(itemInputCount - 1, 36, 28, 3)); + */ + + List posList = Util.getGridPositions(itemInputCount, 8, 20, 3, 1, 20); + return posList; + } + + private String getEUtDisplay(GT_OverclockCalculator calculator) { + return getEUtWithoutTier(calculator); + } + + private String getEUtWithoutTier(GT_OverclockCalculator calculator) { + return GT_Utility.formatNumbers(calculator.getConsumption()) + " EU/t"; + } + + private String getVoltageString(GT_OverclockCalculator calculator) { + long voltage = computeVoltageForEURate(calculator.getConsumption()); + return GT_Utility.formatNumbers(voltage) + " EU/t" + GT_Utility.getTierNameWithParentheses(voltage); + } + + private long computeVoltageForEURate(long euPerTick) { + return euPerTick; + } + + private String getAmperageString(GT_OverclockCalculator calculator) { + return GT_Utility.formatNumbers(1); + } + +} diff --git a/src/main/java/com/elisis/gtnhlanth/loader/BotRecipes.java b/src/main/java/com/elisis/gtnhlanth/loader/BotRecipes.java index a0480b62dd..0851914f1e 100644 --- a/src/main/java/com/elisis/gtnhlanth/loader/BotRecipes.java +++ b/src/main/java/com/elisis/gtnhlanth/loader/BotRecipes.java @@ -1,7 +1,16 @@ package com.elisis.gtnhlanth.loader; -import static com.elisis.gtnhlanth.common.register.BotWerkstoffMaterialPool.*; -import static gregtech.api.enums.OrePrefixes.*; +import static com.elisis.gtnhlanth.common.register.BotWerkstoffMaterialPool.AmmoniumNitrate; +import static com.elisis.gtnhlanth.common.register.BotWerkstoffMaterialPool.Nitromethane; +import static com.elisis.gtnhlanth.common.register.BotWerkstoffMaterialPool.OXylene; +import static com.elisis.gtnhlanth.common.register.BotWerkstoffMaterialPool.Phosgene; +import static com.elisis.gtnhlanth.common.register.BotWerkstoffMaterialPool.SodiumTungstate; +import static com.elisis.gtnhlanth.common.register.BotWerkstoffMaterialPool.TungstenTrioxide; +import static com.elisis.gtnhlanth.common.register.BotWerkstoffMaterialPool.TungsticAcid; +import static gregtech.api.enums.OrePrefixes.cell; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.ingotHot; +import static gregtech.api.enums.OrePrefixes.item; import static gregtech.api.recipe.RecipeMaps.chemicalReactorRecipes; import static gregtech.api.recipe.RecipeMaps.electrolyzerRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; diff --git a/src/main/java/com/elisis/gtnhlanth/loader/RecipeLoader.java b/src/main/java/com/elisis/gtnhlanth/loader/RecipeLoader.java index ee9f9b7cd3..1aaa945f93 100644 --- a/src/main/java/com/elisis/gtnhlanth/loader/RecipeLoader.java +++ b/src/main/java/com/elisis/gtnhlanth/loader/RecipeLoader.java @@ -2,8 +2,88 @@ package com.elisis.gtnhlanth.loader; import static com.elisis.gtnhlanth.api.recipe.LanthanidesRecipeMaps.digesterRecipes; import static com.elisis.gtnhlanth.api.recipe.LanthanidesRecipeMaps.dissolutionTankRecipes; -import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.*; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.CeriumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.CeriumDioxide; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.CeriumDopedLutetiumAluminiumGarnet; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.CeriumDopedLutetiumAluminiumOxygenBlend; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.CeriumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.CeriumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.ChlorinatedRareEarthConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.ChlorinatedRareEarthDilutedSolution; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.ChlorinatedRareEarthEnrichedSolution; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.DephosphatedSamariumConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.DilutedSamariumRareEarthSolution; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.DysprosiumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.DysprosiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.DysprosiumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.ErbiumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.ErbiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.ErbiumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.EuropiumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.EuropiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.EuropiumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledCeriumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledDysprosiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledErbiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledEuropiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledGadoliniumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledHolmiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledLanthanumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledLutetiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledNeodymiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledPraseodymiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledPromethiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledSamariumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledTerbiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledThuliumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.FilledYtterbiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.GadoliniumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.GadoliniumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.GadoliniumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.HolmiumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.HolmiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.HolmiumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.ImpureLanthanumChloride; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.LanthaniumChloride; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.LanthanumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.LanthanumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.LanthanumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.LutetiumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.LutetiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.LutetiumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.MuddySamariumRareEarthSolution; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.NeodymicRareEarthConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.NeodymiumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.NeodymiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.NeodymiumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.PraseodymiumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.PraseodymiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.PraseodymiumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.PromethiumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.PromethiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.PromethiumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.RarestEarthResidue; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.SamariumChloride; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.SamariumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.SamariumChlorideSodiumChlorideBlend; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.SamariumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.SamariumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.SamariumOxalate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.SamariumRareEarthMud; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.TerbiumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.TerbiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.TerbiumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.ThoriumPhosphateConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.ThuliumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.ThuliumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.ThuliumOreConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.YtterbiumChlorideConcentrate; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.YtterbiumExtractingNanoResin; +import static com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool.YtterbiumOreConcentrate; +import static gregtech.api.enums.OrePrefixes.blockCasingAdvanced; +import static gregtech.api.recipe.RecipeMaps.assemblerRecipes; import static gregtech.api.recipe.RecipeMaps.autoclaveRecipes; +import static gregtech.api.recipe.RecipeMaps.blastFurnaceRecipes; import static gregtech.api.recipe.RecipeMaps.centrifugeNonCellRecipes; import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; import static gregtech.api.recipe.RecipeMaps.chemicalBathRecipes; @@ -11,6 +91,7 @@ import static gregtech.api.recipe.RecipeMaps.distillationTowerRecipes; import static gregtech.api.recipe.RecipeMaps.electrolyzerNonCellRecipes; import static gregtech.api.recipe.RecipeMaps.electrolyzerRecipes; import static gregtech.api.recipe.RecipeMaps.fluidExtractionRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidSolidifierRecipes; import static gregtech.api.recipe.RecipeMaps.hammerRecipes; import static gregtech.api.recipe.RecipeMaps.laserEngraverRecipes; import static gregtech.api.recipe.RecipeMaps.maceratorRecipes; @@ -22,6 +103,8 @@ import static gregtech.api.recipe.RecipeMaps.sifterRecipes; import static gregtech.api.recipe.RecipeMaps.thermalCentrifugeRecipes; import static gregtech.api.recipe.RecipeMaps.vacuumFreezerRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeConstants.AssemblyLine; +import static gregtech.api.util.GT_RecipeConstants.UniversalChemical; import static gregtech.common.items.GT_MetaGenerated_Item_01.registerCauldronCleaningFor; import static gtPlusPlus.api.recipe.GTPPRecipeMaps.chemicalDehydratorRecipes; import static gtPlusPlus.api.recipe.GTPPRecipeMaps.simpleWasherRecipes; @@ -34,11 +117,13 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.HashSet; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.ShapedRecipes; import net.minecraft.item.crafting.ShapelessRecipes; +import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -47,13 +132,17 @@ import net.minecraftforge.oredict.ShapelessOreRecipe; import org.apache.commons.lang3.reflect.FieldUtils; import com.elisis.gtnhlanth.Tags; +import com.elisis.gtnhlanth.common.item.MaskList; import com.elisis.gtnhlanth.common.register.BotWerkstoffMaterialPool; import com.elisis.gtnhlanth.common.register.LanthItemList; import com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool; +import com.github.bartimaeusnek.bartworks.system.material.BW_GT_MaterialReference; import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.PlatinumSludgeOverHaul; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import cpw.mods.fml.common.registry.GameRegistry; import goodgenerator.items.MyMaterial; +import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -63,11 +152,641 @@ import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_RecipeBuilder; +import gregtech.api.util.GT_RecipeConstants; import gregtech.api.util.GT_Utility; +import ic2.core.Ic2Items; public class RecipeLoader { - private static final Materials[] BLACKLIST = null; + // private static final Materials[] BLACKLIST = null; + + @SuppressWarnings("deprecation") + public static void loadAccelerator() { + + /* Actual Beamline Multiblocks */ + + // SC + GT_Values.RA.stdBuilder() + .fluidInputs(Materials.SolderingAlloy.getMolten(288)) + .itemInputs( + ItemList.Hull_LuV.get(1), + WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plateDense, 8), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 4), + ItemList.Conveyor_Module_LuV.get(4), + GT_Utility.copyAmount(2, LanthItemList.BEAMLINE_PIPE), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.VanadiumGallium, 2), + GT_Utility.getIntegratedCircuit(16) + + ) + .itemOutputs(LanthItemList.SOURCE_CHAMBER) + .duration(30 * GT_RecipeBuilder.SECONDS) + .eut(7680) + .addTo(assemblerRecipes); + + // LINAC + GT_Values.RA.stdBuilder() + .fluidInputs(Materials.SolderingAlloy.getMolten(288)) + .itemInputs( + ItemList.Hull_LuV.get(1), + WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plateDense, 8), + ItemList.Casing_Coil_Superconductor.get(2), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 8), + ItemList.Electric_Pump_LuV.get(2), + GT_Utility.copyAmount(2, LanthItemList.BEAMLINE_PIPE), + GT_OreDictUnificator.get(OrePrefixes.cableGt08, Materials.VanadiumGallium, 2), + GT_Utility.getIntegratedCircuit(16) + + ) + .itemOutputs(LanthItemList.LINAC) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(7680) + .addTo(assemblerRecipes); + + // TC + GT_Values.RA.stdBuilder() + .fluidInputs(Materials.SolderingAlloy.getMolten(288)) + .itemInputs( + ItemList.Hull_LuV.get(1), + WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plateDense, 8), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 4), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 4), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.SuperconductorUHV, 2), + GT_Utility.copyAmount(2, LanthItemList.BEAMLINE_PIPE), + GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.VanadiumGallium, 1), + GT_Utility.getIntegratedCircuit(16) + + ) + .itemOutputs(LanthItemList.TARGET_CHAMBER) + .duration(30 * GT_RecipeBuilder.SECONDS) + .eut(7680) + .addTo(assemblerRecipes); + + // Synchrotron + GT_Values.RA.stdBuilder() + .fluidInputs(Materials.SolderingAlloy.getMolten(6000)) + .itemInputs( + ItemList.Hull_LuV.get(1), + WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plateDense, 8), + ItemList.Casing_Coil_Superconductor.get(12), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 8), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.SuperconductorUHV, 8), + GT_Utility.copyAmount(8, LanthItemList.BEAMLINE_PIPE), + GT_OreDictUnificator.get(OrePrefixes.cableGt08, Materials.NiobiumTitanium, 8), + GT_Utility.getIntegratedCircuit(16)) + .itemOutputs(LanthItemList.SYNCHROTRON) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(7680) + .addTo(assemblerRecipes); + + /* + * //Permalloy GT_Values.RA.addMixerRecipe( GT_Utility.getIntegratedCircuit(4), Materials.Nickel.getDust(4), + * Materials.Iron.getDust(1), Materials.Molybdenum.getDust(1), null, null, + * WerkstoffMaterialPool.Permalloy.get(OrePrefixes.dust, 6), 1920, 200 ); + */ + // Mu-metal + GT_Values.RA.stdBuilder() + .itemInputs( + GT_Utility.getIntegratedCircuit(2), + WerkstoffMaterialPool.Permalloy.get(OrePrefixes.dust, 9), + Materials.Copper.getDust(1), + Materials.Chrome.getDust(1)) + .itemOutputs(WerkstoffMaterialPool.MuMetal.get(OrePrefixes.ingot, 11)) + .duration(20 * SECONDS) + .eut(1920) + .specialValue(4500) + .addTo(blastFurnaceRecipes); + + // Shielded Accelerator Casing -- Maybe assline recipe + GT_Values.RA.stdBuilder() + .itemInputs( + ItemList.Casing_RadiationProof.get(1L), + WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plateDense, 6), + GT_Utility.getIntegratedCircuit(6)) + .fluidInputs(Materials.SolderingAlloy.getMolten(144)) + .itemOutputs(new ItemStack(LanthItemList.SHIELDED_ACCELERATOR_CASING, 1)) + .duration(40 * SECONDS) + .eut(7980) + .addTo(assemblerRecipes); + + // Accelerator Electrode Casing + GT_Values.RA.stdBuilder() + .itemInputs( + BW_GT_MaterialReference.Silver.get(blockCasingAdvanced, 1), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Silver, 12), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Gold, 6), + GT_Utility.getIntegratedCircuit(6)) + .fluidInputs(Materials.SolderingAlloy.getMolten(288)) + .itemOutputs(new ItemStack(LanthItemList.ELECTRODE_CASING, 1)) + .duration(40 * SECONDS) + .eut(7680) + .addTo(assemblerRecipes); + + ItemStack insulator = GT_ModHandler.getModItem("dreamcraft", "item.MicaInsulatorSheet", 1); + + // Coolant Delivery Casing + + GT_Values.RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Aluminium, 1), + Materials.Copper.getPlates(6), + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Naquadah, 2), + ItemList.Electric_Pump_LuV.get(3L), + new ItemStack(LanthItemList.CAPILLARY_EXCHANGE, 1), + new ItemStack(LanthItemList.CAPILLARY_EXCHANGE, 1), + new ItemStack(LanthItemList.CAPILLARY_EXCHANGE, 1), + GT_Utility.copyAmount(2, insulator), + GT_Utility.copyAmount(2, insulator), + GT_Utility.copyAmount(2, insulator), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Tungsten, 1)) + .fluidInputs(Materials.SolderingAlloy.getMolten(288), Materials.Lubricant.getFluid(1152)) + .itemOutputs(new ItemStack(LanthItemList.COOLANT_DELIVERY_CASING)) + .metadata(GT_RecipeConstants.RESEARCH_ITEM, ItemList.Casing_Pipe_TungstenSteel.get(1L)) + .metadata(GT_RecipeConstants.RESEARCH_TIME, 72000) + .duration(50 * SECONDS) + .eut(7680) + .addTo(AssemblyLine); + + // T1 Antenna Casing + GT_Values.RA.stdBuilder() + .fluidInputs( + Materials.SolderingAlloy.getMolten(6000), + Materials.Gold.getMolten(4000), + WerkstoffLoader.Xenon.getFluidOrGas(2000)) + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tungsten, 1), + Materials.Copper.getPlates(4), + WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plate, 5), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorLuV, 4), + new Object[] { OrePrefixes.circuit.get(Materials.Ultimate), 4 }, + ItemList.Emitter_LuV.get(6), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Gold, 32), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Electrum, 6)) + .itemOutputs(new ItemStack(LanthItemList.ANTENNA_CASING_T1)) + + .metadata(GT_RecipeConstants.RESEARCH_ITEM, Materials.Niobium.getBlocks(1)) + .metadata(GT_RecipeConstants.RESEARCH_TIME, 30 * GT_RecipeBuilder.MINUTES) + + .duration(30 * GT_RecipeBuilder.SECONDS) + .eut(1920) + .addTo(AssemblyLine); + + // T2 Antenna Casing + GT_Values.RA.stdBuilder() + .fluidInputs( + Materials.SolderingAlloy.getMolten(12000), + Materials.Gold.getMolten(6000), + WerkstoffLoader.Xenon.getFluidOrGas(2000)) + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenCarbide, 1), + Materials.Copper.getPlates(4), + WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plate, 5), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorZPM, 4), + new Object[] { OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4 }, + ItemList.Emitter_ZPM.get(6), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Gold, 64), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Electrum, 6)) + .itemOutputs(new ItemStack(LanthItemList.ANTENNA_CASING_T2)) + .metadata(GT_RecipeConstants.RESEARCH_ITEM, new ItemStack(LanthItemList.ANTENNA_CASING_T1)) + .metadata(GT_RecipeConstants.RESEARCH_TIME, 40 * GT_RecipeBuilder.MINUTES) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(7680) + .addTo(AssemblyLine); + + // Focus Manipulator + GT_Values.RA.stdBuilder() + .fluidInputs( + Materials.SolderingAlloy.getMolten(8000), + Materials.Gold.getMolten(2000), + Materials.Argon.getGas(1000)) + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Aluminium, 1), + + new Object[] { OrePrefixes.circuit.get(Materials.Elite), 4 }, + ItemList.Robot_Arm_LuV.get(2), + ItemList.Robot_Arm_LuV.get(2), + ItemList.Conveyor_Module_LuV.get(2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Gold, 16), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Gold, 16), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Tungsten, 2)) + .itemOutputs(new ItemStack(LanthItemList.FOCUS_MANIPULATION_CASING)) + .metadata(GT_RecipeConstants.RESEARCH_ITEM, new ItemStack(LanthItemList.maskMap.get(MaskList.BLANK1))) + .metadata(GT_RecipeConstants.RESEARCH_TIME, 20 * GT_RecipeBuilder.MINUTES) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(1920) + .addTo(AssemblyLine); + + // Target Holder + GameRegistry.addShapedRecipe( + new ItemStack(LanthItemList.TARGET_HOLDER), + new Object[] { "MCM", "MHM", "MCM", 'M', WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plateDense, 1), 'H', + ItemList.Hull_LuV.get(1), 'C', ItemList.Conveyor_Module_LuV.get(1) }); + + GameRegistry.addShapedRecipe( + + new ItemStack(LanthItemList.FOCUS_HOLDER), + new Object[] { "MCM", "R R", "MHM", 'M', WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plateDense, 1), 'C', + ItemList.Conveyor_Module_LuV.get(1), 'R', ItemList.Robot_Arm_LuV.get(1), 'H', + ItemList.Hull_LuV.get(1) }); + + // Focus Input Bus + GameRegistry.addShapedRecipe( + LanthItemList.BEAMLINE_FOCUS_INPUT_BUS, + "MCM", + "McM", + "RCR", + 'M', + WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plateDense, 1), + 'C', + ItemList.Conveyor_Module_HV.get(1), + 'R', + ItemList.Robot_Arm_HV.get(1), + 'c', + new ItemStack(Blocks.chest, 1, 32767)); + + // Target Receptacle, same thing as Focus Manipulator basically + GT_Values.RA.stdBuilder() + .fluidInputs( + Materials.SolderingAlloy.getMolten(8000), + Materials.Gold.getMolten(2000), + Materials.Argon.getGas(1000)) + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Aluminium, 1), + new Object[] { OrePrefixes.circuit.get(Materials.Elite), 4 }, + ItemList.Robot_Arm_LuV.get(2), + ItemList.Robot_Arm_LuV.get(2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Gold, 16), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Tungsten, 2)) + .itemOutputs(new ItemStack(LanthItemList.TARGET_RECEPTACLE_CASING)) + .metadata(GT_RecipeConstants.RESEARCH_ITEM, ItemList.Circuit_Silicon_Wafer.get(1)) + .metadata(GT_RecipeConstants.RESEARCH_TIME, 20 * GT_RecipeBuilder.MINUTES) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(1920) + .addTo(AssemblyLine); + + // Capillary Exchange + GT_Values.RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.TungstenSteel, 8), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Copper, 2), + Materials.Titanium.getPlates(6), + GT_Utility.copyAmount(4, insulator), + ItemList.Electric_Pump_LuV.get(1), + Materials.Silver.getDust(2)) + .fluidInputs(Materials.Silicone.getMolten(288L)) + .itemOutputs(new ItemStack(LanthItemList.CAPILLARY_EXCHANGE, 1)) + .duration(20 * SECONDS) + .eut(7680) + .addTo(assemblerRecipes); + + // Mu-metal lattice + GT_Values.RA.stdBuilder() + .itemInputs( + WerkstoffMaterialPool.MuMetal.get(OrePrefixes.wireFine, 12), + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 4)) + .fluidInputs(Materials.SolderingAlloy.getMolten(144)) + .itemOutputs(new ItemStack(LanthItemList.MM_LATTICE, 1)) + .duration(15 * SECONDS) + .eut(1920) + .addTo(assemblerRecipes); + + // Shielded Accelerator Glass + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(LanthItemList.MM_LATTICE, 4)) + .fluidInputs(Materials.BorosilicateGlass.getMolten(144)) + .itemOutputs(new ItemStack(LanthItemList.SHIELDED_ACCELERATOR_GLASS, 1)) + .duration(25 * SECONDS) + .eut(1920) + .addTo(fluidSolidifierRecipes); + + // Beamline Pipe + GT_Values.RA.stdBuilder() + .itemInputs( + WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plate, 4), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.TungstenCarbide, 4), + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenCarbide, 8), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmiridium, 4), + GT_Utility.getIntegratedCircuit(7)) + .fluidInputs(Materials.SolderingAlloy.getMolten(144)) + .itemOutputs(LanthItemList.BEAMLINE_PIPE) + .duration(20 * SECONDS) + .eut(1920) + .addTo(assemblerRecipes); + + // Beamline Input Hatch + GT_Values.RA.stdBuilder() + .fluidInputs( + Materials.SolderingAlloy.getMolten(6000), + Materials.Argon.getGas(1000), + Materials.Helium.getGas(2000) + + ) + .itemInputs( + ItemList.Hull_LuV.get(1), + new Object[] { OrePrefixes.circuit.get(Materials.Master), 2 }, + new ItemStack(LanthItemList.CAPILLARY_EXCHANGE, 2), + ItemList.Electric_Pump_LuV.get(1), + LanthItemList.BEAMLINE_PIPE, + WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plate, 4) + + ) + .itemOutputs(LanthItemList.LUV_BEAMLINE_INPUT_HATCH) + .metadata(GT_RecipeConstants.RESEARCH_ITEM, ItemList.Hatch_Input_LuV.get(1)) + .metadata(GT_RecipeConstants.RESEARCH_TIME, 30 * GT_RecipeBuilder.MINUTES) + .duration(2 * GT_RecipeBuilder.MINUTES) + .eut(30720) + .addTo(AssemblyLine); + + // Beamline Output Hatch + GT_Values.RA.stdBuilder() + .fluidInputs( + Materials.SolderingAlloy.getMolten(8000), + Materials.Argon.getGas(1000), + Materials.Helium.getGas(6000) + + ) + .itemInputs( + ItemList.Hull_LuV.get(1), + new Object[] { OrePrefixes.circuit.get(Materials.Master), 6 }, + new ItemStack(LanthItemList.CAPILLARY_EXCHANGE, 4), + ItemList.Electric_Pump_LuV.get(2), + ItemList.Electric_Motor_LuV.get(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorLuV, 8), + LanthItemList.BEAMLINE_PIPE, + WerkstoffMaterialPool.MuMetal.get(OrePrefixes.plate, 8) + + ) + .itemOutputs(LanthItemList.LUV_BEAMLINE_OUTPUT_HATCH) + .metadata(GT_RecipeConstants.RESEARCH_ITEM, ItemList.Hatch_Output_LuV.get(1)) + .metadata(GT_RecipeConstants.RESEARCH_TIME, 40 * GT_RecipeBuilder.MINUTES) + .duration(4 * GT_RecipeBuilder.MINUTES) + .eut(30720) + .addTo(AssemblyLine); + + GT_Values.RA.stdBuilder() + .fluidInputs(Materials.Chloroform.getFluid(1000), Materials.HydrofluoricAcid.getFluid(3000)) + .fluidOutputs( + WerkstoffMaterialPool.Fluoroform.getFluidOrGas(1000), + Materials.HydrochloricAcid.getFluid(3000)) + .duration(15 * GT_RecipeBuilder.SECONDS) + .eut(1920) + .addTo(multiblockChemicalReactorRecipes); + + // NB: http://www.smfl.rit.edu/pdf/process/process_nitride_etch_paper.pdf + // Reactive Ion Etchant + GT_Values.RA.stdBuilder() + .fluidInputs(WerkstoffMaterialPool.Fluoroform.getFluidOrGas(3000)) + .itemInputs(Materials.Oxygen.getCells(4)) + .fluidOutputs(WerkstoffMaterialPool.FluoroformOxygenMix.getFluidOrGas(5000)) + .itemOutputs(Materials.Empty.getCells(4)) + .duration(15 * GT_RecipeBuilder.SECONDS) + .eut(1920) + .addTo(mixerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Iron.getDust(2), Materials.NetherQuartz.getPlates(1)) + .itemOutputs(new ItemStack(LanthItemList.IRON_COATED_QUARTZ)) + .duration(10 * GT_RecipeBuilder.SECONDS) + .eut(480) + .addTo(assemblerRecipes); + + // Masks + // Quartz + Fe2O3 T1 + // " + Cr T2 + // + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(LanthItemList.IRON_COATED_QUARTZ)) + .fluidInputs(Materials.Oxygen.getGas(1000)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.BLANK1))) + .outputChances(10000) + .requiresCleanRoom() + .duration(12 * SECONDS) + .eut(1920) + .addTo(autoclaveRecipes); + + /* + * Unsure what was intended with this recipe? + * GT_Values.RA.stdBuilder() + * .itemInputs(new ItemStack(LanthItemList.IRON_COATED_QUARTZ), Materials.Chrome.getDust(1)) + * .fluidInputs(Materials.Oxygen.getGas(1000)) + * .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.BLANK2))) + * .outputChances(10000).requiresCleanRoom().duration(12 * SECONDS).eut(7980).addTo(autoclaveRecipes); + */ + + // Grow the first silicon + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Glass.getPlates(1)) + .fluidInputs(Materials.Silane.getGas(4000)) + .itemOutputs(new ItemStack(LanthItemList.SUBSTRATE_PRECURSOR)) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(480) + .requiresCleanRoom() + .addTo(autoclaveRecipes); + + // Now to deposit nitride + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(LanthItemList.SUBSTRATE_PRECURSOR), Materials.Silane.getCells(2)) + .fluidInputs(Materials.Nitrogen.getPlasma(4000)) + .fluidOutputs(Materials.Nitrogen.getGas(3000)) + .itemOutputs(new ItemStack(LanthItemList.MASK_SUBSTRATE), Materials.Empty.getCells(2)) + .duration(30 * GT_RecipeBuilder.SECONDS) + .eut(TierEU.EV) + .specialValue(3200) + .requiresCleanRoom() + .addTo(blastFurnaceRecipes); + + /* + * GT_Values.RA.stdBuilder().itemInputs(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicon, 1)) + * .fluidInputs(Materials.SiliconTetrachloride.getFluid(3000), Materials.Ammonia.getFluid(4000)) + * .fluidOutputs(Materials.HydrochloricAcid.getFluid(12000)) + * .itemOutputs(WerkstoffMaterialPool.SiliconNitride.get(OrePrefixes.plate)) .duration(GT_RecipeBuilder.SECONDS + * * 30) .eut(TierEU.EV) .addTo(GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes); + */ + + for (ItemStack lens : OreDictionary.getOres("craftingLensYellow")) { + + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(0, lens), new ItemStack(LanthItemList.MASK_SUBSTRATE)) + .itemOutputs(new ItemStack(LanthItemList.MASKED_MASK)) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(1920) + .requiresCleanRoom() + .addTo(laserEngraverRecipes); + + } + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(LanthItemList.MASKED_MASK)) + .fluidInputs(WerkstoffMaterialPool.FluoroformOxygenMix.getFluidOrGas(4000)) + .itemOutputs(new ItemStack(LanthItemList.ETCHED_MASK_1)) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(1920) + .requiresCleanRoom() + .addTo(autoclaveRecipes); + + // Etch pt. 2 with KOH + GT_Values.RA.stdBuilder() + .fluidInputs(Materials.Argon.getGas(1000)) + .itemInputs( + new ItemStack(LanthItemList.MASKED_MASK), + MyMaterial.lithiumChloride.get(OrePrefixes.dust, 2), + GT_ModHandler.getModItem("dreamcraft", "item.PotassiumHydroxideDust", 4)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.BLANK2))) + .duration(25 * GT_RecipeBuilder.SECONDS) + .eut(1920) + .specialValue(2400) + .addTo(blastFurnaceRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(LanthItemList.ETCHED_MASK_1), + Materials.Sodium.getDust(1), + Materials.Chrome.getPlates(1), + Materials.Gold.getPlates(2)) + .fluidInputs(Materials.Hydrogen.getGas(1000)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.BLANK3))) + .duration(10 * GT_RecipeBuilder.SECONDS) + .eut(1920) + .specialValue(3600) + .addTo(blastFurnaceRecipes); + + for (MaskList mask : MaskList.values()) { + + MaskList maskIngredient = mask.getPrecursor(); + Dyes lensColour = mask.getLensColour(); + + if (maskIngredient == null) continue; + + if (mask.getLensColour() == null) { // CR Recipe + + if (mask == MaskList.PPIC) { + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(LanthItemList.maskMap.get(MaskList.NPIC)), + Materials.IndiumGalliumPhosphide.getDust(64)) + .fluidInputs(Materials.Sunnarium.getMolten(1440L)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.PPIC))) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(TierEU.RECIPE_ZPM) + .requiresCleanRoom() + .addTo(UniversalChemical); + + } else if (mask == MaskList.HPIC) { + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(LanthItemList.maskMap.get(MaskList.PIC)), + Materials.IndiumGalliumPhosphide.getDust(2)) + .fluidInputs(Materials.VanadiumGallium.getMolten(288L)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.HPIC))) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(7860) + .requiresCleanRoom() + .addTo(UniversalChemical); + + } else if (mask == MaskList.UHPIC) { + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(LanthItemList.maskMap.get(MaskList.HPIC)), + Materials.IndiumGalliumPhosphide.getDust(8)) + .fluidInputs(Materials.Naquadah.getMolten(576L)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.UHPIC))) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(TierEU.RECIPE_LuV) + .requiresCleanRoom() + .addTo(UniversalChemical); + + } else if (mask == MaskList.NCPU) { + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(LanthItemList.maskMap.get(MaskList.CPU)), + GT_Utility.copyAmount(16, Ic2Items.carbonFiber)) + .fluidInputs(Materials.Glowstone.getMolten(576L)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.NCPU))) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(TierEU.RECIPE_EV) + .requiresCleanRoom() + .addTo(UniversalChemical); + + } else if (mask == MaskList.QBIT) { + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(LanthItemList.maskMap.get(MaskList.NCPU)), + Materials.IndiumGalliumPhosphide.getDust(1)) + .fluidInputs(Materials.Radon.getGas(50L)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.QBIT))) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(TierEU.RECIPE_EV) + .requiresCleanRoom() + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(LanthItemList.maskMap.get(MaskList.NCPU)), ItemList.QuantumEye.get(2)) + .fluidInputs(Materials.GalliumArsenide.getMolten(288L)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.QBIT))) + .duration(45 * GT_RecipeBuilder.SECONDS) + .eut(TierEU.RECIPE_EV) + .requiresCleanRoom() + .addTo(UniversalChemical); + + } + + continue; + + } + + if (mask == MaskList.NAND) { + + // Very copy-paste heavy, could possibly offload most of this into one case and just assign an + // otherIngredient variable or something, wouldn't save much space though. Plus: lazy + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(LanthItemList.maskMap.get(maskIngredient)), + GT_Utility.copyAmount(0, GT_OreDictUnificator.get(OrePrefixes.lens, Materials.EnderPearl, 1))) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(mask))) + .requiresCleanRoom() + .duration(120 * SECONDS) + .eut(1920) + .addTo(laserEngraverRecipes); + + } else if (mask == MaskList.NOR) { + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(LanthItemList.maskMap.get(maskIngredient)), + GT_Utility.copyAmount(0, GT_OreDictUnificator.get(OrePrefixes.lens, Materials.EnderEye, 1))) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(mask))) + .requiresCleanRoom() + .duration(120 * SECONDS) + .eut(1920) + .addTo(laserEngraverRecipes); + + } + + else { + + for (ItemStack lens : OreDictionary.getOres("craftingLens" + lensColour.mName.replace(" ", ""))) { + + if (lens == null) continue; + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(LanthItemList.maskMap.get(maskIngredient)), + GT_Utility.copyAmount(0, lens)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(mask))) + .requiresCleanRoom() + .duration(120 * SECONDS) + .eut(1920) + .addTo(laserEngraverRecipes); + + } + } + } + + } public static void loadGeneral() { @@ -92,7 +811,7 @@ public class RecipeLoader { 200); // Zr - // ZrCl4·H2O + 2Mg = Zr + 2MgCl2 + // ZrCl4�H2O + 2Mg = Zr + 2MgCl2 GT_Values.RA.addBlastRecipe( GT_Utility.getIntegratedCircuit(2), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2), @@ -316,6 +1035,45 @@ public class RecipeLoader { Materials.HydrochloricAcid.getCells(2), 600, 450); + + // Lanthanum Oxide + GT_Values.RA.stdBuilder() + .fluidInputs(Materials.Water.getFluid(3000)) + .fluidOutputs(Materials.HydrochloricAcid.getFluid(6000)) + .itemInputs(WerkstoffMaterialPool.LanthaniumChloride.get(OrePrefixes.dust, 4)) + .itemOutputs(WerkstoffMaterialPool.LanthanumOxide.get(OrePrefixes.dust, 1)) + .duration(10 * GT_RecipeBuilder.SECONDS) + .eut(480) + .addTo(UniversalChemical); + + // Boron Trioxide + GT_Values.RA.stdBuilder() + .fluidInputs(FluidRegistry.getFluidStack("boricacid", 2000)) + .fluidOutputs(new FluidStack(FluidRegistry.WATER, 3000)) + .itemOutputs(WerkstoffMaterialPool.BoronTrioxide.get(OrePrefixes.dust, 1)) + .duration(15 * GT_RecipeBuilder.SECONDS) + .eut(1920) + .addTo(UniversalChemical); + + // Boron Trichloride + GT_Values.RA.stdBuilder() + .fluidInputs(BotWerkstoffMaterialPool.Phosgene.getFluidOrGas(3000)) + .fluidOutputs(WerkstoffMaterialPool.BoronTrichloride.getFluidOrGas(2000)) + .itemInputs(WerkstoffMaterialPool.BoronTrioxide.get(OrePrefixes.dust, 1), Materials.Empty.getCells(3)) + .itemOutputs(Materials.CarbonMonoxide.getCells(3)) + .duration(10 * GT_RecipeBuilder.SECONDS) + .eut(480) + .addTo(UniversalChemical); + + // Lanthanum Hexaboride + GT_Values.RA.stdBuilder() + .fluidInputs(WerkstoffMaterialPool.BoronTrichloride.getFluidOrGas(8000)) + .fluidOutputs(FluidRegistry.getFluidStack("boricacid", 1000)) + .itemInputs(WerkstoffMaterialPool.LanthanumOxide.get(OrePrefixes.dust, 1)) + .itemOutputs(WerkstoffMaterialPool.LanthanumHexaboride.get(OrePrefixes.gemChipped)) + .duration(60 * GT_RecipeBuilder.SECONDS) + .eut(7980) + .addTo(autoclaveRecipes); } public static void loadLanthanideRecipes() { @@ -437,7 +1195,6 @@ public class RecipeLoader { .specialValue(10) .noOptimize() .addTo(dissolutionTankRecipes); - sifterRecipes.addRecipe( false, null, @@ -3720,4 +4477,5 @@ public class RecipeLoader { } } } + } diff --git a/src/main/java/com/elisis/gtnhlanth/util/DescTextLocalization.java b/src/main/java/com/elisis/gtnhlanth/util/DescTextLocalization.java index 28e63b2744..f0c5509d59 100644 --- a/src/main/java/com/elisis/gtnhlanth/util/DescTextLocalization.java +++ b/src/main/java/com/elisis/gtnhlanth/util/DescTextLocalization.java @@ -1,16 +1,12 @@ package com.elisis.gtnhlanth.util; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; public class DescTextLocalization { - public static final String BLUEPRINT_INFO = "Follow the" + EnumChatFormatting.BLUE - + " Structure" - + EnumChatFormatting.DARK_BLUE - + "Lib" - + EnumChatFormatting.GRAY - + " hologram projector to build the main structure."; + public static final String BLUEPRINT_INFO = StatCollector.translateToLocal("gtnhlanth.tt.blueprint"); + + public static final String BEAMLINE_SCANNER_INFO = StatCollector.translateToLocal("gtnhlanth.tt.beaminfo"); public static String[] addText(String preFix, int length) { String[] text = new String[length]; @@ -19,4 +15,10 @@ public class DescTextLocalization { } return text; } + + public static String addDotText(int dotNum) { + + return StatCollector.translateToLocalFormatted("gtnhlanth.tt.hintdot", dotNum + ""); + + } } diff --git a/src/main/java/com/elisis/gtnhlanth/util/Util.java b/src/main/java/com/elisis/gtnhlanth/util/Util.java new file mode 100644 index 0000000000..1a42396de0 --- /dev/null +++ b/src/main/java/com/elisis/gtnhlanth/util/Util.java @@ -0,0 +1,55 @@ +package com.elisis.gtnhlanth.util; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import com.gtnewhorizons.modularui.api.math.Pos2d; + +public class Util { + + public static void depleteDurabilityOfStack(ItemStack stack, int damage) { + + if (stack == null) return; + + if (stack.stackSize == 0) // Might happen, who knows + return; + + if (damage + stack.getItemDamage() > stack.getMaxDamage()) { + stack.stackSize--; + } else { + + stack.setItemDamage(stack.getItemDamage() + damage); + + } + + } + + public static List getGridPositions(int totalCount, int xOrigin, int yOrigin, int xDirMaxCount, + int yDirMaxCount, int distanceBetweenSlots) { + // 18 pixels to get to a new grid for placing an item tile since they are 16x16 and have 1 pixel buffers + // around them. + + int distance = 18 + distanceBetweenSlots; + + List results = new ArrayList<>(); + int count = 0; + loop: for (int j = 0; j < yDirMaxCount; j++) { + for (int i = 0; i < xDirMaxCount; i++) { + if (count >= totalCount) break loop; + results.add(new Pos2d(xOrigin + i * distance, yOrigin + j * distance)); + count++; + } + } + return results; + } + + public static boolean coolantFluidCheck(FluidStack inStack, int fluidToConsume) { + return (inStack.amount < fluidToConsume + || (!inStack.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant", 1)) && inStack.getFluid() + .getTemperature() > 200)); + } +} diff --git a/src/main/java/com/elisis/gtnhlanth/xmod/nei/NEI_Config.java b/src/main/java/com/elisis/gtnhlanth/xmod/nei/NEI_Config.java index cf784d638e..0ed71e712f 100644 --- a/src/main/java/com/elisis/gtnhlanth/xmod/nei/NEI_Config.java +++ b/src/main/java/com/elisis/gtnhlanth/xmod/nei/NEI_Config.java @@ -21,6 +21,7 @@ public class NEI_Config implements IConfigureNEI { @Override public void loadConfig() { isAdded = false; + isAdded = true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index cb2140d62b..fd88673208 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -16,9 +16,22 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.Textures.BlockIcons.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.isAir; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.Energy; +import static gregtech.api.enums.GT_HatchElement.ExoticEnergy; +import static gregtech.api.enums.GT_HatchElement.InputBus; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.OutputBus; +import static gregtech.api.enums.GT_HatchElement.OutputHatch; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import java.util.ArrayList; diff --git a/src/main/java/goodgenerator/blocks/tileEntity/FuelRefineFactory.java b/src/main/java/goodgenerator/blocks/tileEntity/FuelRefineFactory.java index 8fbe8787ed..d8ae889037 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/FuelRefineFactory.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/FuelRefineFactory.java @@ -1,6 +1,9 @@ package goodgenerator.blocks.tileEntity; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static goodgenerator.util.DescTextLocalization.BLUE_PRINT_INFO; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; diff --git a/src/main/java/goodgenerator/loader/NeutronActivatorLoader.java b/src/main/java/goodgenerator/loader/NeutronActivatorLoader.java index 353277dc1f..09c2f9ae47 100644 --- a/src/main/java/goodgenerator/loader/NeutronActivatorLoader.java +++ b/src/main/java/goodgenerator/loader/NeutronActivatorLoader.java @@ -1,6 +1,11 @@ package goodgenerator.loader; -import static goodgenerator.items.MyMaterial.*; +import static goodgenerator.items.MyMaterial.plutoniumBasedLiquidFuel; +import static goodgenerator.items.MyMaterial.plutoniumBasedLiquidFuelExcited; +import static goodgenerator.items.MyMaterial.thoriumBasedLiquidFuelDepleted; +import static goodgenerator.items.MyMaterial.thoriumBasedLiquidFuelExcited; +import static goodgenerator.items.MyMaterial.uraniumBasedLiquidFuel; +import static goodgenerator.items.MyMaterial.uraniumBasedLiquidFuelExcited; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index 2d2b066825..ca1cf5e2a9 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -2016,7 +2016,8 @@ public enum ItemList implements IItemContainer { TierdDrone0, TierdDrone1, TierdDrone2, - Hatch_DroneDownLink; + Hatch_DroneDownLink, + Casing_Shielded_Accelerator; public static final ItemList[] DYE_ONLY_ITEMS = { Color_00, Color_01, Color_02, Color_03, Color_04, Color_05, Color_06, Color_07, Color_08, Color_09, Color_10, Color_11, Color_12, Color_13, Color_14, Color_15 }, diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index f4ce94c4f2..5d3f65cfaf 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -1354,6 +1354,8 @@ public class Textures { MACHINE_CASING_PCB_TIER_3, INFINITY_COOLED_CASING, + MACHINE_CASING_SHIELDED_ACCELERATOR, + LARGETURBINE_NEW1, LARGETURBINE_NEW2, LARGETURBINE_NEW3, diff --git a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java index 43eeccdc9f..d9d493bc09 100644 --- a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java +++ b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java @@ -110,6 +110,20 @@ public class GT_Multiblock_Tooltip_Builder { return this; } + /** + * Add a number of basic lines of information about this structure + * + * @param infoStrings The lines to be added. + * @return Instance this method was called on. + */ + + public GT_Multiblock_Tooltip_Builder addInfoAll(String... infoStrings) { + for (String str : infoStrings) { + iLines.add(str); + } + return this; + } + /** * Add a separator line like this:
* ----------------------------------------- diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java index 3a9efdbe71..0cb1934dec 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java @@ -66,6 +66,7 @@ public class GT_Block_Casings5 extends GT_Block_Casings_Abstract implements IHea ItemList.Casing_Coil_Infinity.set(new ItemStack(this, 1, 11)); ItemList.Casing_Coil_Hypogen.set(new ItemStack(this, 1, 12)); ItemList.Casing_Coil_Eternal.set(new ItemStack(this, 1, 13)); + ItemList.Casing_Shielded_Accelerator.set(new ItemStack(this, 1, 14)); } @Override @@ -91,6 +92,7 @@ public class GT_Block_Casings5 extends GT_Block_Casings_Abstract implements IHea case 11 -> Textures.BlockIcons.MACHINE_COIL_INFINITY.getIcon(); case 12 -> Textures.BlockIcons.MACHINE_COIL_HYPOGEN.getIcon(); case 13 -> Textures.BlockIcons.MACHINE_COIL_ETERNAL.getIcon(); + case 14 -> Textures.BlockIcons.MACHINE_CASING_SHIELDED_ACCELERATOR.getIcon(); default -> Textures.BlockIcons.MACHINE_COIL_CUPRONICKEL.getIcon(); }; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multiblock/LayeredCokeBattery.java b/src/main/java/gregtech/common/tileentities/machines/multiblock/LayeredCokeBattery.java index 3b00708e40..e2f8dc9b6e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multiblock/LayeredCokeBattery.java +++ b/src/main/java/gregtech/common/tileentities/machines/multiblock/LayeredCokeBattery.java @@ -1,7 +1,12 @@ package gregtech.common.tileentities.machines.multiblock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.Mods.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockUnlocalizedName; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.Mods.BartWorks; +import static gregtech.api.enums.Mods.IndustrialCraft2; +import static gregtech.api.enums.Mods.Thaumcraft; import static gregtech.api.multitileentity.multiblock.base.MultiBlockPart.ENERGY_IN; import static gregtech.api.multitileentity.multiblock.base.MultiBlockPart.FLUID_IN; import static gregtech.api.multitileentity.multiblock.base.MultiBlockPart.FLUID_OUT; diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/BI_CONN.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/BI_CONN.png new file mode 100644 index 0000000000..222b9329ea Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/BI_CONN.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/BO_CONN.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/BO_CONN.png new file mode 100644 index 0000000000..222b9329ea Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/BO_CONN.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_SHIELDED_ACCELERATOR.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_SHIELDED_ACCELERATOR.png new file mode 100644 index 0000000000..c7aa4234b9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_SHIELDED_ACCELERATOR.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_ACTIVE.png new file mode 100644 index 0000000000..a931c65801 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_ACTIVE.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_ACTIVE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_ACTIVE.png.mcmeta new file mode 100644 index 0000000000..60af678259 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_ACTIVE.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":4 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_SIDES.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_SIDES.png new file mode 100644 index 0000000000..c0851e234c Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_SIDES.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_SIDES.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_SIDES.png.mcmeta new file mode 100644 index 0000000000..97596ba817 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BI_SIDES.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":2 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_ACTIVE.png new file mode 100644 index 0000000000..a931c65801 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_ACTIVE.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_ACTIVE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_ACTIVE.png.mcmeta new file mode 100644 index 0000000000..60af678259 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_ACTIVE.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":4 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_SIDES.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_SIDES.png new file mode 100644 index 0000000000..c0851e234c Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_SIDES.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_SIDES.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_SIDES.png.mcmeta new file mode 100644 index 0000000000..97596ba817 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BO_SIDES.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":2 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/pipe.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/pipe.png new file mode 100644 index 0000000000..c3b889dc79 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/pipe.png differ diff --git a/src/main/resources/assets/gtnhlanth/lang/en_US.lang b/src/main/resources/assets/gtnhlanth/lang/en_US.lang index 5aeb987b00..7b3568b390 100644 --- a/src/main/resources/assets/gtnhlanth/lang/en_US.lang +++ b/src/main/resources/assets/gtnhlanth/lang/en_US.lang @@ -1,6 +1,20 @@ # RecipeMaps gtnhlanth.recipe.digester=Digester gtnhlanth.recipe.disstank=Dissolution Tank +gtnhlanth.recipe.tc=Target Chamber +gtnhlanth.recipe.sc=Source Chamber + +gtnhlanth.tt.beaminfo=Use a §bportable scanner §7for info about the input/output of this multiblock. +gtnhlanth.tt.blueprint=Follow the §9Structure§2Lib §7hologram projector to build the main structure. +gtnhlanth.tt.pc=§6Partially consumed: §7Takes damage in the process + +gtnhlanth.tt.hintdot=Hint block with dot %s + +GT5U.gui.text.gtnhlanth.nocoolant=No coolant present in machine! +GT5U.gui.text.gtnhlanth.inscoolant=Insufficient coolant in machine! +GT5U.gui.text.gtnhlanth.noaccel=Particle type can't be accelerated! +GT5U.gui.text.gtnhlanth.low_input_rate=Input amount too low! +GT5U.gui.text.gtnhlanth.scerror=Math error, broken recipe? # NEI value.disstank=Ratio: %s:1 @@ -18,6 +32,54 @@ Digester.hint.3=16x Coil Block Digester.hint.4=Input Bus, Output Bus, Input Hatch, Output Hatch Digester.hint.5=Energy Hatch, Maintenance Hatch +SourceChamber.hint.0=56x Shielded Accelerator Casing +SourceChamber.hint.1=52x Shielded Accelerator Glass +SourceChamber.hint.2=16x Electrode Casing +SourceChamber.hint.3=Dot 1: Input Bus +SourceChamber.hint.4=Dot 2: Output Bus +SourceChamber.hint.5=Dot 3: Maintenance Hatch, Energy Hatch +SourceChamber.hint.6=Dot 4: Beamline Output Hatch + +LINAC.hint.0=325-1285x Shielded Accelerator Casing +LINAC.hint.1=148-852x Coolant Delivery Casing +LINAC.hint.2=127-703x Shielded Accelerator Glass +LINAC.hint.3=56-312x Superconducting Coil Block +LINAC.hint.4=156-732x Electrode Casing +LINAC.hint.5=47x Grate Machine Casing +LINAC.hint.6=48x Borosilicate Glass (LuV+) +LINAC.hint.7=Dot 1: Energy Hatch, Maintenance Hatch +LINAC.hint.8=Dot 2: Input Hatch, Output Hatch +LINAC.hint.9=Dot 3: Beamline Input Hatch +LINAC.hint.10=Dot 4: Beamline Output Hatch + +Synchrotron.hint.0=676x Shielded Accelerator Casing +Synchrotron.hint.1=90x Superconducting Coil Block +Synchrotron.hint.2=64x Niobium Block +Synchrotron.hint.3=28x Coolant Delivery Casing +Synchrotron.hint.4=16x Borosilicate Glass (LuV+) +Synchrotron.hint.5=4x Antenna Casing +Synchrotron.hint.6=Dot 1: Beamline Input Hatch +Synchrotron.hint.7=Dot 2: Beamline Output Hatch +Synchrotron.hint.8=Dot 3: Maintenance Hatch +Synchrotron.hint.9=Dot 4: Input Hatch +Synchrotron.hint.10=Dot 5: Output Hatch +Synchrotron.hint.11=Dot 6: Energy Hatch + +TargetChamber.hint.0=28x Shielded Accelerator Casing +TargetChamber.hint.1=34x Shielded Accelerator Glass +TargetChamber.hint.2=16x Borosilicate Glass (any) +TargetChamber.hint.3=29x Grate Machine Casing +TargetChamber.hint.4=4x Focus Manipulation Casing +TargetChamber.hint.5=4x Target Receptacle Casing +TargetChamber.hint.6=1x Focus Holder +TargetChamber.hint.7=1x Target Holder +TargetChamber.hint.8=Dot 1: Focus Input Bus +TargetChamber.hint.9=Dot 2: Energy Hatch, Maintenance Hatch +TargetChamber.hint.10=Dot 3: Input Bus +TargetChamber.hint.11=Dot 4: Output Bus +TargetChamber.hint.12=Dot 5: Beamline Input Hatch + + fluid.Antimony Pentafluoride Solution=Antimony Pentafluoride Solution fluid.Hafnium Tetrachloride Solution=Hafnium Tetrachloride Solution fluid.Zirconium Tetrachloride Solution=Zirconium Tetrachloride Solution @@ -52,4 +114,53 @@ fluid.Diaminotoluene=Diaminotoluene fluid.Toluene Tetramethyl Diisocyanate=Toluene Tetramethyl Diisocyanate fluid.Diluted Acetone=Diluted Acetone +tile.casing.shielded_accelerator_glass.name=Shielded Accelerator Glass +casing.electrode.name=Electrode Casing +casing.coolant_delivery.name=Coolant Delivery Casing +casing.antenna_t1.name=Antenna Casing (T1) +casing.antenna_t2.name=Antenna Casing (T2) +casing.focus_manipulator.name=Focus Manipulator +casing.focus_holder.name=Focus Holder +casing.target_receptacle.name=Target Receptacle +casing.target_holder.name=Target Holder +casing.shielded_accelerator.name=Shielded Accelerator Casing + +item.capillary_exchange.name=Capillary Exchange +item.mm_lattice.name=Mu-Metal Lattice +item.iron_quartz_plate.name=Iron Quartz Plate +item.mask_substrate.name=Mask Substrate +item.etched_mask1.name=Etched Mask +item.substrate_precursor.name=Substrate Precursor +item.masked_mask_substrate.name=Processed Mask Substrate + + + + +beamline.info=Machine Information + +beamline.in_pre=Multiblock Beamline Input +beamline.particle=Particle +beamline.energy=Energy +beamline.focus=Focus +beamline.amount=Amount +beamline.rate=Rate + +beamline.temperature=Temperature +beamline.coolusage=Coolant Usage + +beamline.out_pre=Multiblock Beamline Output + +beamline.particleinput=Input Particle Info: + +beamline.pipe.desc.0=Transport for particles +beamline.pipe.desc.1=Signal does not cross or bend + +tile.recipe.tc=Target Chamber +tile.recipe.sc=Source Chamber + +particle.electron=Electron +particle.photon=Photon +particle.alpha=Alpha +particle.neutron=Neutron +particle.proton=Proton GT5U.gui.text.dissolution_ratio=§7Wrong fluid input ratio diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t1.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t1.png new file mode 100644 index 0000000000..8d03f0fe17 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t1.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t2.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t2.png new file mode 100644 index 0000000000..23e79ebb16 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t2.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.coolant_delivery.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.coolant_delivery.png new file mode 100644 index 0000000000..80e1b9af97 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.coolant_delivery.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.electrode.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.electrode.png new file mode 100644 index 0000000000..2532325e8e Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.electrode.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.focus_holder.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.focus_holder.png new file mode 100644 index 0000000000..5eccc6dcb8 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.focus_holder.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.focus_manipulator.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.focus_manipulator.png new file mode 100644 index 0000000000..0cd77fe120 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.focus_manipulator.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator.png new file mode 100644 index 0000000000..c7aa4234b9 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator_glass.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator_glass.png new file mode 100644 index 0000000000..f5cb01e83c Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator_glass.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.target_holder.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.target_holder.png new file mode 100644 index 0000000000..b5f70f5597 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.target_holder.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.target_receptacle.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.target_receptacle.png new file mode 100644 index 0000000000..31a73624bf Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.target_receptacle.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/capillary_exchange.png b/src/main/resources/assets/gtnhlanth/textures/items/capillary_exchange.png new file mode 100644 index 0000000000..e72e5578b2 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/capillary_exchange.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/etched_mask1.png b/src/main/resources/assets/gtnhlanth/textures/items/etched_mask1.png new file mode 100644 index 0000000000..e64484950e Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/etched_mask1.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/iron_quartz_plate.png b/src/main/resources/assets/gtnhlanth/textures/items/iron_quartz_plate.png new file mode 100644 index 0000000000..eebe09bdfa Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/iron_quartz_plate.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/mask_substrate.png b/src/main/resources/assets/gtnhlanth/textures/items/mask_substrate.png new file mode 100644 index 0000000000..bbdbfb9f53 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/mask_substrate.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/masked_mask_substrate.png b/src/main/resources/assets/gtnhlanth/textures/items/masked_mask_substrate.png new file mode 100644 index 0000000000..075d429162 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/masked_mask_substrate.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/mm_lattice.png b/src/main/resources/assets/gtnhlanth/textures/items/mm_lattice.png new file mode 100644 index 0000000000..2056958382 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/mm_lattice.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/particle/alpha.png b/src/main/resources/assets/gtnhlanth/textures/items/particle/alpha.png new file mode 100644 index 0000000000..24fcb6cfb7 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/particle/alpha.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/particle/electron.png b/src/main/resources/assets/gtnhlanth/textures/items/particle/electron.png new file mode 100644 index 0000000000..8c7dac8bfe Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/particle/electron.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/particle/neutron.png b/src/main/resources/assets/gtnhlanth/textures/items/particle/neutron.png new file mode 100644 index 0000000000..8a865844d1 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/particle/neutron.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/particle/photon.png b/src/main/resources/assets/gtnhlanth/textures/items/particle/photon.png new file mode 100644 index 0000000000..de92250071 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/particle/photon.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/particle/proton.png b/src/main/resources/assets/gtnhlanth/textures/items/particle/proton.png new file mode 100644 index 0000000000..b081e83dfa Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/particle/proton.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/asoc.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/asoc.png new file mode 100644 index 0000000000..cbb39abb60 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/asoc.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank1.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank1.png new file mode 100644 index 0000000000..561e64860a Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank1.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank2.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank2.png new file mode 100644 index 0000000000..561e64860a Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank2.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank3.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank3.png new file mode 100644 index 0000000000..561e64860a Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank3.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/cpu.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/cpu.png new file mode 100644 index 0000000000..fbce1c288c Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/cpu.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/hpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/hpic.png new file mode 100644 index 0000000000..b2ee8eec84 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/hpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ilc.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ilc.png new file mode 100644 index 0000000000..109432abf3 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ilc.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/lpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/lpic.png new file mode 100644 index 0000000000..d297990869 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/lpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/nand.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/nand.png new file mode 100644 index 0000000000..388d8494d6 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/nand.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ncpu.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ncpu.png new file mode 100644 index 0000000000..c76e03744d Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ncpu.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/nor.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/nor.png new file mode 100644 index 0000000000..c5526b530d Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/nor.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/npic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/npic.png new file mode 100644 index 0000000000..1a3d2866f2 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/npic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/pic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/pic.png new file mode 100644 index 0000000000..ce29d88643 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/pic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ppic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ppic.png new file mode 100644 index 0000000000..4431df6b03 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ppic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/qbit.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/qbit.png new file mode 100644 index 0000000000..b4668e9887 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/qbit.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/qpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/qpic.png new file mode 100644 index 0000000000..c421ebe38b Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/qpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ram.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ram.png new file mode 100644 index 0000000000..569fc38d75 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ram.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/soc.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/soc.png new file mode 100644 index 0000000000..931c2a4f47 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/soc.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ssoc.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ssoc.png new file mode 100644 index 0000000000..10209d8c63 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ssoc.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/uhpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/uhpic.png new file mode 100644 index 0000000000..54b0d412bb Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/uhpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ulpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ulpic.png new file mode 100644 index 0000000000..a3274605e5 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ulpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/substrate_precursor.png b/src/main/resources/assets/gtnhlanth/textures/items/substrate_precursor.png new file mode 100644 index 0000000000..14e9cd5b48 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/substrate_precursor.png differ -- cgit