From 3226d5aef49a22161fa3c2ce94d7ef3d8cbc85ed Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 20 Aug 2022 09:38:05 +0200 Subject: spotless + update buildscrip + gitatributes --- .gitattributes | 35 + build.gradle | 370 +- settings.gradle | 10 + .../java/com/github/technus/tectech/TecTech.java | 49 +- .../dreamcraft/DreamCraftRecipeLoader.java | 7334 +++++++++++++------- .../dreamcraft/NoDreamCraftMachineLoader.java | 196 +- .../tectech/compatibility/gtpp/GtppAtomLoader.java | 216 +- .../openComputers/AvrArchitecture.java | 121 +- .../openmodularturrets/TT_turret_loader.java | 4 +- .../blocks/turretbases/TurretBaseEM.java | 14 +- .../blocks/turretbases/TurretBaseItemEM.java | 9 +- .../blocks/turretheads/TurretHeadEM.java | 22 +- .../blocks/turretheads/TurretHeadItemEM.java | 34 +- .../entity/projectiles/projectileEM.java | 125 +- .../entity/projectiles/projectileRenderEM.java | 34 +- .../tileentity/turret/TileTurretHeadEM.java | 27 +- .../tileentity/turretbase/TileTurretBaseEM.java | 49 +- .../spartakcore/SpartakCoreRecipeLoader.java | 2165 ++++-- .../definitions/EMComplexAspectDefinition.java | 33 +- .../definitions/EMPrimalAspectDefinition.java | 40 +- .../transformations/AspectDefinitionCompat.java | 14 +- .../AspectDefinitionCompatEnabled.java | 67 +- .../thing/metaTileEntity/multi/EssentiaCompat.java | 10 +- .../multi/EssentiaCompatEnabled.java | 40 +- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 128 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 136 +- .../technus/tectech/font/TecTechFontRender.java | 50 +- .../technus/tectech/loader/EntityLoader.java | 2 +- .../github/technus/tectech/loader/MainLoader.java | 70 +- .../technus/tectech/loader/NetworkDispatcher.java | 10 +- .../technus/tectech/loader/TecTechConfig.java | 221 +- .../tectech/loader/gui/CreativeTabTecTech.java | 5 +- .../technus/tectech/loader/gui/ModGuiHandler.java | 6 +- .../tectech/loader/recipe/BaseRecipeLoader.java | 195 +- .../tectech/loader/recipe/BloodyRecipeLoader.java | 3576 +++++++--- .../tectech/loader/thing/ComponentLoader.java | 14 +- .../technus/tectech/loader/thing/CoverLoader.java | 31 +- .../tectech/loader/thing/MachineLoader.java | 1010 ++- .../technus/tectech/loader/thing/ThingsLoader.java | 10 +- .../tectech/mechanics/anomaly/AnomalyHandler.java | 264 +- .../tectech/mechanics/anomaly/CancerCommand.java | 28 +- .../tectech/mechanics/anomaly/ChargeCommand.java | 28 +- .../tectech/mechanics/anomaly/MassCommand.java | 27 +- .../tectech/mechanics/avr/SidedRedstone.java | 209 +- .../tectech/mechanics/commands/ConvertFloat.java | 31 +- .../tectech/mechanics/commands/ConvertInteger.java | 31 +- .../tectech/mechanics/data/ChunkDataHandler.java | 185 +- .../tectech/mechanics/data/ChunkDataMessage.java | 63 +- .../mechanics/data/IChunkMetaDataHandler.java | 39 +- .../tectech/mechanics/data/PlayerDataMessage.java | 55 +- .../tectech/mechanics/data/PlayerPersistence.java | 66 +- .../technus/tectech/mechanics/data/WorldData.java | 13 +- .../mechanics/dataTransport/DataPacket.java | 35 +- .../dataTransport/InventoryDataPacket.java | 37 +- .../mechanics/dataTransport/QuantumDataPacket.java | 10 +- .../elementalMatter/core/commands/EMGive.java | 18 +- .../elementalMatter/core/commands/EMList.java | 50 +- .../elementalMatter/core/decay/EMDecay.java | 39 +- .../elementalMatter/core/decay/EMDecayResult.java | 4 +- .../core/definitions/EMComplexTemplate.java | 19 +- .../core/definitions/EMPrimitiveTemplate.java | 55 +- .../core/definitions/IEMDefinition.java | 100 +- .../registry/EMDefinitionsRegistry.java | 44 +- .../core/definitions/registry/EMIndirectType.java | 20 +- .../core/definitions/registry/EMType.java | 15 +- .../core/maps/EMConstantStackMap.java | 17 +- .../core/maps/EMDefinitionStackMap.java | 15 +- .../core/maps/EMInstanceStackMap.java | 64 +- .../elementalMatter/core/maps/EMStackMap.java | 7 +- .../elementalMatter/core/maps/IEMMapRead.java | 114 +- .../elementalMatter/core/maps/IEMMapWrite.java | 47 +- .../core/maps/IEMMapWriteExact.java | 51 +- .../elementalMatter/core/recipes/EMRecipe.java | 14 +- .../elementalMatter/core/recipes/EMRecipeMap.java | 35 +- .../core/stacks/EMDefinitionStack.java | 22 +- .../core/stacks/EMInstanceStack.java | 183 +- .../elementalMatter/core/stacks/IEMStack.java | 5 +- .../core/transformations/EMDequantizationInfo.java | 2 +- .../transformations/EMFluidQuantizationInfo.java | 14 +- .../transformations/EMItemQuantizationInfo.java | 23 +- .../transformations/EMOredictQuantizationInfo.java | 10 +- .../transformations/EMTransformationRegistry.java | 49 +- .../definitions/complex/EMAtomDefinition.java | 2171 ++++-- .../definitions/complex/EMHadronDefinition.java | 177 +- .../definitions/complex/EMNuclideIAEA.java | 308 +- .../definitions/primitive/EMBosonDefinition.java | 7 +- .../definitions/primitive/EMFermionDefinition.java | 7 +- .../primitive/EMGaugeBosonDefinition.java | 50 +- .../definitions/primitive/EMLeptonDefinition.java | 84 +- .../primitive/EMNeutrinoDefinition.java | 58 +- .../primitive/EMPrimitiveDefinition.java | 42 +- .../definitions/primitive/EMQuarkDefinition.java | 170 +- .../primitive/EMScalarBosonDefinition.java | 43 +- .../enderStorage/EnderFluidContainer.java | 12 +- .../enderStorage/EnderLinkCoverMessage.java | 36 +- .../mechanics/enderStorage/EnderLinkTag.java | 8 +- .../mechanics/enderStorage/EnderLinkTank.java | 10 +- .../enderStorage/EnderWorldSavedData.java | 13 +- .../tectech/mechanics/pipe/IActivePipe.java | 2 + .../mechanics/pipe/PipeActivityMessage.java | 71 +- .../tectech/mechanics/spark/RendererMessage.java | 43 +- .../tectech/mechanics/spark/ThaumSpark.java | 18 +- .../tectech/mechanics/tesla/ITeslaConnectable.java | 112 +- .../mechanics/tesla/ITeslaConnectableSimple.java | 9 +- .../mechanics/tesla/TeslaCoverConnection.java | 12 +- .../github/technus/tectech/nei/NEI_TT_Config.java | 4 +- .../tectech/nei/TT_NEI_ResearchHandler.java | 160 +- .../technus/tectech/nei/TT_NEI_ScannerHandler.java | 157 +- .../github/technus/tectech/proxy/ClientProxy.java | 104 +- .../github/technus/tectech/proxy/CommonProxy.java | 47 +- .../github/technus/tectech/recipe/TT_recipe.java | 398 +- .../technus/tectech/recipe/TT_recipeAdder.java | 412 +- .../technus/tectech/thing/CustomItemList.java | 448 +- .../tectech/thing/block/QuantumGlassBlock.java | 19 +- .../tectech/thing/block/QuantumGlassItem.java | 15 +- .../tectech/thing/block/QuantumGlassRender.java | 26 +- .../tectech/thing/block/QuantumStuffBlock.java | 18 +- .../tectech/thing/block/QuantumStuffRender.java | 51 +- .../tectech/thing/block/ReactorSimBlock.java | 23 +- .../tectech/thing/block/ReactorSimItem.java | 15 +- .../tectech/thing/casing/GT_Block_CasingsBA0.java | 31 +- .../tectech/thing/casing/GT_Block_CasingsNH.java | 39 +- .../tectech/thing/casing/GT_Block_CasingsTT.java | 44 +- .../tectech/thing/casing/GT_Item_CasingsBA0.java | 64 +- .../tectech/thing/casing/GT_Item_CasingsNH.java | 3 +- .../tectech/thing/casing/GT_Item_CasingsTT.java | 174 +- .../thing/cover/GT_Cover_TM_EnderFluidLink.java | 128 +- .../thing/cover/GT_Cover_TM_PowerPassUpgrade.java | 18 +- .../tectech/thing/cover/GT_Cover_TM_TeslaCoil.java | 36 +- .../cover/GT_Cover_TM_TeslaCoil_Ultimate.java | 5 +- .../technus/tectech/thing/item/AvrProgrammer.java | 103 +- .../item/DebugElementalInstanceContainer_EM.java | 65 +- .../item/ElementalDefinitionContainer_EM.java | 42 +- .../item/ElementalDefinitionScanStorage_EM.java | 51 +- .../tectech/thing/item/EnderFluidLinkCover.java | 22 +- .../technus/tectech/thing/item/EuMeterGT.java | 93 +- .../tectech/thing/item/ParametrizerMemoryCard.java | 61 +- .../tectech/thing/item/PowerPassUpgradeCover.java | 20 +- .../tectech/thing/item/TeslaCoilCapacitor.java | 29 +- .../tectech/thing/item/TeslaCoilComponent.java | 15 +- .../technus/tectech/thing/item/TeslaCoilCover.java | 26 +- .../technus/tectech/thing/item/TeslaStaff.java | 12 +- .../tectech/thing/item/gui/ProgrammerScreen.java | 4 +- .../tectech/thing/item/gui/ScanDisplayScreen.java | 70 +- .../thing/item/renderElemental/IElementalItem.java | 8 +- .../item/renderElemental/RenderElementalName.java | 34 +- .../tectech/thing/metaTileEntity/Textures.java | 352 +- .../hatch/GT_MetaTileEntity_Hatch_Capacitor.java | 56 +- .../GT_MetaTileEntity_Hatch_CreativeData.java | 36 +- ...T_MetaTileEntity_Hatch_CreativeMaintenance.java | 31 +- .../GT_MetaTileEntity_Hatch_DataConnector.java | 63 +- .../hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java | 35 +- .../GT_MetaTileEntity_Hatch_DynamoTunnel.java | 66 +- ...GT_MetaTileEntity_Hatch_ElementalContainer.java | 143 +- .../hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java | 39 +- .../GT_MetaTileEntity_Hatch_EnergyTunnel.java | 42 +- .../hatch/GT_MetaTileEntity_Hatch_Holder.java | 30 +- .../hatch/GT_MetaTileEntity_Hatch_InputData.java | 33 +- .../GT_MetaTileEntity_Hatch_InputDataItems.java | 112 +- .../GT_MetaTileEntity_Hatch_InputElemental.java | 21 +- .../hatch/GT_MetaTileEntity_Hatch_OutputData.java | 28 +- .../GT_MetaTileEntity_Hatch_OutputDataItems.java | 34 +- .../GT_MetaTileEntity_Hatch_OutputElemental.java | 32 +- .../GT_MetaTileEntity_Hatch_OverflowElemental.java | 128 +- .../hatch/GT_MetaTileEntity_Hatch_Param.java | 85 +- .../hatch/GT_MetaTileEntity_Hatch_ParamText.java | 52 +- .../hatch/GT_MetaTileEntity_Hatch_Rack.java | 180 +- .../hatch/GT_MetaTileEntity_Hatch_Uncertainty.java | 163 +- .../hatch/TextParametersMessage.java | 82 +- .../hatch/gui/GT_Container_Capacitor.java | 8 +- .../hatch/gui/GT_Container_Param.java | 24 +- .../hatch/gui/GT_Container_ParamAdv.java | 80 +- .../hatch/gui/GT_Container_ParamText.java | 49 +- .../hatch/gui/GT_Container_Uncertainty.java | 11 +- .../hatch/gui/GT_GUIContainer_Capacitor.java | 7 +- .../hatch/gui/GT_GUIContainer_Param.java | 55 +- .../hatch/gui/GT_GUIContainer_ParamAdv.java | 64 +- .../hatch/gui/GT_GUIContainer_ParamText.java | 93 +- .../hatch/gui/GT_GUIContainer_Uncertainty.java | 85 +- .../hatch/gui/GT_GUIContainer_UncertaintyAdv.java | 19 +- .../multi/GT_MetaTileEntity_EM_annihilation.java | 267 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 2521 ++++++- .../multi/GT_MetaTileEntity_EM_computer.java | 204 +- .../multi/GT_MetaTileEntity_EM_crafting.java | 134 +- .../multi/GT_MetaTileEntity_EM_dataBank.java | 157 +- .../multi/GT_MetaTileEntity_EM_decay.java | 219 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 148 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 139 +- .../multi/GT_MetaTileEntity_EM_junction.java | 192 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 216 +- .../multi/GT_MetaTileEntity_EM_research.java | 318 +- .../multi/GT_MetaTileEntity_EM_scanner.java | 327 +- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 96 +- .../multi/GT_MetaTileEntity_EM_switch.java | 177 +- .../multi/GT_MetaTileEntity_EM_transformer.java | 131 +- .../multi/GT_MetaTileEntity_EM_wormhole.java | 234 +- .../multi/GT_MetaTileEntity_TM_microwave.java | 209 +- .../GT_MetaTileEntity_TM_proccessingStack.java | 229 +- .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 698 +- .../multi/base/GT_Container_MultiMachineEM.java | 100 +- .../multi/base/GT_GUIContainer_MultiMachineEM.java | 293 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 733 +- .../metaTileEntity/multi/base/INameFunction.java | 2 +- .../metaTileEntity/multi/base/IStatusFunction.java | 2 +- .../thing/metaTileEntity/multi/base/LedStatus.java | 103 +- .../multi/base/MultiblockControl.java | 50 +- .../metaTileEntity/multi/base/Parameters.java | 205 +- .../thing/metaTileEntity/multi/base/SoundLoop.java | 50 +- .../render/TT_RenderedExtendedFacingTexture.java | 10 +- .../em_collider/GT_MetaTileEntity_EM_collider.java | 813 ++- .../multi/em_machine/Behaviour_Centrifuge.java | 204 +- .../multi/em_machine/Behaviour_Electrolyzer.java | 12 +- .../Behaviour_ElectromagneticSeparator.java | 260 +- .../multi/em_machine/Behaviour_PrecisionLaser.java | 12 +- .../multi/em_machine/Behaviour_Recycler.java | 19 +- .../multi/em_machine/Behaviour_Scanner.java | 12 +- .../em_machine/GT_MetaTileEntity_EM_machine.java | 204 +- .../pipe/GT_MetaTileEntity_Pipe_Data.java | 126 +- .../pipe/GT_MetaTileEntity_Pipe_EM.java | 136 +- .../pipe/GT_MetaTileEntity_Pipe_Energy.java | 140 +- .../single/GT_MetaTileEntity_BuckConverter.java | 68 +- .../single/GT_MetaTileEntity_DataReader.java | 246 +- .../single/GT_MetaTileEntity_DebugPollutor.java | 64 +- .../GT_MetaTileEntity_DebugPowerGenerator.java | 118 +- .../GT_MetaTileEntity_DebugStructureWriter.java | 94 +- .../single/GT_MetaTileEntity_MicroController.java | 142 +- .../single/GT_MetaTileEntity_OwnerDetector.java | 73 +- .../single/GT_MetaTileEntity_TT_Transformer.java | 46 +- .../single/GT_MetaTileEntity_TeslaCoil.java | 733 +- .../single/GT_MetaTileEntity_WetTransformer.java | 15 +- .../single/gui/GT_Container_BuckConverter.java | 16 +- .../single/gui/GT_Container_DataReader.java | 24 +- .../single/gui/GT_Container_DebugPollutor.java | 28 +- .../gui/GT_Container_DebugPowerGenerator.java | 22 +- .../gui/GT_Container_DebugStructureWriter.java | 9 +- .../single/gui/GT_GUIContainer_BuckConverter.java | 11 +- .../single/gui/GT_GUIContainer_DataReader.java | 94 +- .../single/gui/GT_GUIContainer_DebugPollutor.java | 4 +- .../gui/GT_GUIContainer_DebugPowerGenerator.java | 11 +- .../gui/GT_GUIContainer_DebugStructureWriter.java | 6 +- .../thing/tileEntity/ReactorSimTileEntity.java | 355 +- .../github/technus/tectech/util/CommonValues.java | 83 +- .../com/github/technus/tectech/util/Converter.java | 4 +- .../github/technus/tectech/util/DoubleCount.java | 27 +- .../technus/tectech/util/LightingHelper.java | 1114 ++- .../github/technus/tectech/util/TT_Utility.java | 140 +- .../java/com/github/technus/tectech/util/XSTR.java | 70 +- 247 files changed, 27106 insertions(+), 14147 deletions(-) create mode 100644 .gitattributes create mode 100644 settings.gradle diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..9917fc4abe --- /dev/null +++ b/.gitattributes @@ -0,0 +1,35 @@ +* text eol=lf + +*.jar binary + +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.tif binary +*.tiff binary +*.ico binary +*.svg text +*.eps binary + +*.kar binary +*.m4a binary +*.mid binary +*.midi binary +*.mp3 binary +*.ogg binary +*.ra binary + +*.7z binary +*.gz binary +*.tar binary +*.tgz binary +*.zip binary + +*.patch -text + +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf + +*autogenerated binary \ No newline at end of file diff --git a/build.gradle b/build.gradle index c09bee22f3..1f363c02bc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,9 @@ -//version: 1652851397 +//version: 1660899027 /* -DO NOT CHANGE THIS FILE! - -Also, you may replace this file at any time if there is an update available. -Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle for updates. -*/ + DO NOT CHANGE THIS FILE! + Also, you may replace this file at any time if there is an update available. + Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle for updates. + */ import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation @@ -12,10 +11,17 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import org.gradle.internal.logging.text.StyledTextOutput.Style import org.gradle.internal.logging.text.StyledTextOutputFactory +import java.nio.file.Files +import java.nio.file.Paths import java.util.concurrent.TimeUnit +import java.util.zip.ZipEntry +import java.util.zip.ZipInputStream +import java.util.zip.ZipOutputStream buildscript { repositories { + mavenCentral() + maven { name 'forge' url 'https://maven.minecraftforge.net' @@ -37,7 +43,6 @@ buildscript { classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7' } } - plugins { id 'java-library' id 'idea' @@ -52,8 +57,16 @@ plugins { id 'com.palantir.git-version' version '0.13.0' apply false id 'de.undercouch.download' version '5.0.1' id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false + id 'com.diffplug.spotless' version '6.7.2' apply false +} +verifySettingsGradle() + +dependencies { + implementation 'com.diffplug:blowdryer:1.6.0' } +apply plugin: 'com.diffplug.blowdryer' + if (project.file('.git/HEAD').isFile()) { apply plugin: 'com.palantir.git-version' } @@ -78,6 +91,13 @@ idea { } } +boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false + +if (!disableSpotless) { + apply plugin: 'com.diffplug.spotless' + apply from: Blowdryer.file('spotless.gradle') +} + if(JavaVersion.current() != JavaVersion.VERSION_1_8) { throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current()) } @@ -103,9 +123,11 @@ checkPropertyExists("containsMixinsAndOrCoreModOnly") checkPropertyExists("usesShadowedDependencies") checkPropertyExists("developmentEnvironmentUserName") -boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false -boolean usesMixinDebug = project.findProperty('usesMixinDebug') ?: project.usesMixins.toBoolean() - +boolean noPublishedSources = project.hasProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false +boolean usesMixinDebug = project.hasProperty('usesMixinDebug') ?: project.usesMixins.toBoolean() +boolean forceEnableMixins = project.hasProperty('forceEnableMixins') ? project.forceEnableMixins.toBoolean() : false +String channel = project.hasProperty('channel') ? project.channel : 'stable' +String mappingsVersion = project.hasProperty('mappingsVersion') ? project.mappingsVersion : '12' String javaSourceDir = "src/main/java/" String scalaSourceDir = "src/main/scala/" String kotlinSourceDir = "src/main/kotlin/" @@ -188,10 +210,10 @@ try { } catch (Exception ignored) { out.style(Style.Failure).text( - 'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' + - 'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' + - 'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)' - ) + 'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' + + 'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' + + 'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)' + ) versionOverride = 'NO-GIT-TAG-SET' identifiedVersion = versionOverride } @@ -215,7 +237,7 @@ else { def arguments = [] def jvmArguments = [] -if (usesMixins.toBoolean()) { +if (usesMixins.toBoolean() || forceEnableMixins) { arguments += [ "--tweakClass org.spongepowered.asm.launch.MixinTweaker" ] @@ -280,7 +302,7 @@ repositories { name 'Overmind forge repo mirror' url 'https://gregtech.overminddl1.com/' } - if(usesMixins.toBoolean()) { + if(usesMixins.toBoolean() || forceEnableMixins) { maven { name 'sponge' url 'https://repo.spongepowered.org/repository/maven-public' @@ -297,6 +319,8 @@ dependencies { annotationProcessor('com.google.guava:guava:24.1.1-jre') annotationProcessor('com.google.code.gson:gson:2.8.6') annotationProcessor('org.spongepowered:mixin:0.8-SNAPSHOT') + } + if(usesMixins.toBoolean() || forceEnableMixins) { // using 0.8 to workaround a issue in 0.7 which fails mixin application compile('com.github.GTNewHorizons:SpongePoweredMixin:0.7.12-GTNH') { // Mixin includes a lot of dependencies that are too up-to-date @@ -354,7 +378,10 @@ shadowJar { } minimize() // This will only allow shading for actually used classes - configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile] + configurations = [ + project.configurations.shadowImplementation, + project.configurations.shadowCompile + ] dependsOn(relocateShadowJar) } @@ -376,7 +403,7 @@ jar { } reobf { - if(usesMixins.toBoolean()) { + if(usesMixins.toBoolean() && file(mixinSrg).exists()) { addExtraSrgFile mixinSrg } } @@ -385,12 +412,12 @@ afterEvaluate { if(usesMixins.toBoolean()) { tasks.compileJava { options.compilerArgs += [ - "-AreobfSrgFile=${tasks.reobf.srg}", - "-AoutSrgFile=${mixinSrg}", - "-AoutRefMapFile=${refMap}", - // Elan: from what I understand they are just some linter configs so you get some warning on how to properly code - "-XDenableSunApiLintControl", - "-XDignore.symbol.file" + "-AreobfSrgFile=${tasks.reobf.srg}", + "-AoutSrgFile=${mixinSrg}", + "-AoutRefMapFile=${refMap}", + // Elan: from what I understand they are just some linter configs so you get some warning on how to properly code + "-XDenableSunApiLintControl", + "-XDignore.symbol.file" ] } } @@ -399,8 +426,8 @@ afterEvaluate { runClient { if(developmentEnvironmentUserName) { arguments += [ - "--username", - developmentEnvironmentUserName + "--username", + developmentEnvironmentUserName ] } @@ -418,13 +445,14 @@ tasks.withType(JavaExec).configureEach { javaToolchains.launcherFor { languageVersion = projectJavaVersion } - ) + ) } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version + exclude("spotless.gradle") // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { @@ -432,9 +460,9 @@ processResources { // replace modVersion and minecraftVersion expand "minecraftVersion": project.minecraft.version, - "modVersion": modVersion, - "modId": modId, - "modName": modName + "modVersion": modVersion, + "modId": modId, + "modName": modName } if(usesMixins.toBoolean()) { @@ -444,6 +472,7 @@ processResources { // copy everything else that's not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' + exclude 'spotless.gradle' } } @@ -463,9 +492,9 @@ def getManifestAttributes() { if(usesMixins.toBoolean()) { manifestAttributes += [ - "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", - "MixinConfigs" : "mixins." + modId + ".json", - "ForceLoadAsMod" : !containsMixinsAndOrCoreModOnly.toBoolean() + "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", + "MixinConfigs" : "mixins." + modId + ".json", + "ForceLoadAsMod" : !containsMixinsAndOrCoreModOnly.toBoolean() ] } return manifestAttributes @@ -492,7 +521,10 @@ task shadowDevJar(type: ShadowJar) { } minimize() // This will only allow shading for actually used classes - configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile] + configurations = [ + project.configurations.shadowImplementation, + project.configurations.shadowCompile + ] } task relocateShadowDevJar(type: ConfigureShadowRelocation) { @@ -584,7 +616,10 @@ publishing { // remove extra garbage from minecraft and minecraftDeps configuration pom.withXml { def badArtifacts = [:].withDefault {[] as Set} - for (configuration in [projectConfigs.minecraft, projectConfigs.minecraftDeps]) { + for (configuration in [ + projectConfigs.minecraft, + projectConfigs.minecraftDeps + ]) { for (dependency in configuration.allDependencies) { badArtifacts[dependency.group == null ? "" : dependency.group] += dependency.name } @@ -618,11 +653,11 @@ task updateBuildScript { doLast { if (performBuildScriptUpdate(projectDir.toString())) return - print("Build script already up-to-date!") + print("Build script already up-to-date!") } } -if (isNewBuildScriptVersionAvailable(projectDir.toString())) { +if (!project.getGradle().startParameter.isOffline() && isNewBuildScriptVersionAvailable(projectDir.toString())) { if (autoUpdateBuildScript.toBoolean()) { performBuildScriptUpdate(projectDir.toString()) } else { @@ -633,12 +668,26 @@ if (isNewBuildScriptVersionAvailable(projectDir.toString())) { static URL availableBuildScriptUrl() { new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle") } +static URL exampleSettingsGradleUrl() { + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/settings.gradle.example") +} + + +def verifySettingsGradle() { + def settingsFile = getFile("settings.gradle") + if (!settingsFile.exists()) { + println("Downloading default settings.gradle") + exampleSettingsGradleUrl().withInputStream { i -> settingsFile.withOutputStream { it << i } } + throw new GradleException("Settings.gradle has been updated, please re-run task.") + } +} boolean performBuildScriptUpdate(String projectDir) { if (isNewBuildScriptVersionAvailable(projectDir)) { def buildscriptFile = getFile("build.gradle") availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } } out.style(Style.Success).print("Build script updated. Please REIMPORT the project or RESTART your IDE!") + verifySettingsGradle() return true } return false @@ -669,80 +718,225 @@ configure(updateBuildScript) { description = 'Updates the build script to the latest version' } -// Deobfuscation +// Parameter Deobfuscation -def deobf(String sourceURL) { - try { - URL url = new URL(sourceURL) - String fileName = url.getFile() - - //get rid of directories: - int lastSlash = fileName.lastIndexOf("/") - if(lastSlash > 0) { - fileName = fileName.substring(lastSlash + 1) +task deobfParams { + doLast { + + String mcpDir = "$project.gradle.gradleUserHomeDir/caches/minecraft/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion" + String mcpZIP = "$mcpDir/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip" + String paramsCSV = "$mcpDir/params.csv" + + download.run { + src "https://maven.minecraftforge.net/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion-$minecraftVersion/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip" + dest mcpZIP + overwrite false } - //get rid of extension: - if(fileName.endsWith(".jar")) { - fileName = fileName.substring(0, fileName.lastIndexOf(".")) + + if(!file(paramsCSV).exists()) { + println("Extracting MCP archive ...") + unzip(mcpZIP, mcpDir) } - String hostName = url.getHost() - if(hostName.startsWith("www.")) { - hostName = hostName.substring(4) + println("Parsing params.csv ...") + Map params = new HashMap<>() + Files.lines(Paths.get(paramsCSV)).forEach{line -> + String[] cells = line.split(",") + if(cells.length > 2 && cells[0].matches("p_i?\\d+_\\d+_")) { + params.put(cells[0], cells[1]) + } } - List parts = Arrays.asList(hostName.split("\\.")) - Collections.reverse(parts) - hostName = String.join(".", parts) - return deobf(sourceURL, hostName + "/" + fileName) - } catch(Exception e) { - return deobf(sourceURL, "deobf/" + String.valueOf(sourceURL.hashCode())) - } + out.style(Style.Success).println("Modified ${replaceParams(file("$projectDir/src/main/java"), params)} files!") + out.style(Style.Failure).println("Don't forget to verify that the code still works as before!\n It could be broken due to duplicate variables existing now\n or parameters taking priority over other variables.") +} } -// The method above is to be preferred. Use this method if the filename is not at the end of the URL. -def deobf(String sourceURL, String fileName) { - String cacheDir = System.getProperty("user.home") + "/.gradle/caches/" - String bon2Dir = cacheDir + "forge_gradle/deobf" - String bon2File = bon2Dir + "/BON2-2.5.0.jar" - String obfFile = cacheDir + "modules-2/files-2.1/" + fileName + ".jar" - String deobfFile = cacheDir + "modules-2/files-2.1/" + fileName + "-deobf.jar" +static int replaceParams(File file, Map params) { +int fileCount = 0 - if(file(deobfFile).exists()) { - return files(deobfFile) +if(file.isDirectory()) { + for(File f : file.listFiles()) { + fileCount += replaceParams(f, params) } - - download.run { - src 'https://github.com/GTNewHorizons/BON2/releases/download/2.5.0/BON2-2.5.0.CUSTOM-all.jar' - dest bon2File - quiet true - overwrite false + return fileCount +} +println("Visiting ${file.getName()} ...") +try { + String content = new String(Files.readAllBytes(file.toPath())) + int hash = content.hashCode() + params.forEach{key, value -> + content = content.replaceAll(key, value) + } + if(hash != content.hashCode()) { + Files.write(file.toPath(), content.getBytes("UTF-8")) + return 1 + } +} catch(Exception e) { + e.printStackTrace() +} +return 0 +} + +// Credit: bitsnaps (https://gist.github.com/bitsnaps/00947f2dce66f4bbdabc67d7e7b33681) +static unzip(String zipFileName, String outputDir) { +byte[] buffer = new byte[16384] +ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFileName)) +ZipEntry zipEntry = zis.getNextEntry() +while (zipEntry != null) { + File newFile = new File(outputDir + File.separator, zipEntry.name) + if (zipEntry.isDirectory()) { + if (!newFile.isDirectory() && !newFile.mkdirs()) { + throw new IOException("Failed to create directory $newFile") + } + } else { + // fix for Windows-created archives + File parent = newFile.parentFile + if (!parent.isDirectory() && !parent.mkdirs()) { + throw new IOException("Failed to create directory $parent") + } + // write file content + FileOutputStream fos = new FileOutputStream(newFile) + int len = 0 + while ((len = zis.read(buffer)) > 0) { + fos.write(buffer, 0, len) + } + fos.close() } + zipEntry = zis.getNextEntry() +} +zis.closeEntry() +zis.close() +} + +configure(deobfParams) { +group = 'forgegradle' +description = 'Rename all obfuscated parameter names inherited from Minecraft classes' +} + +// Dependency Deobfuscation + +def deobf(String sourceURL) { +try { + URL url = new URL(sourceURL) + String fileName = url.getFile() - download.run { - src sourceURL - dest obfFile - quiet true - overwrite false + //get rid of directories: + int lastSlash = fileName.lastIndexOf("/") + if(lastSlash > 0) { + fileName = fileName.substring(lastSlash + 1) + } + //get rid of extension: + if(fileName.endsWith(".jar") || fileName.endsWith(".litemod")) { + fileName = fileName.substring(0, fileName.lastIndexOf(".")) } - exec { - commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', '1.7.10', '--mappingsVer', 'stable_12', '--notch' - workingDir bon2Dir - standardOutput = new ByteArrayOutputStream() + String hostName = url.getHost() + if(hostName.startsWith("www.")) { + hostName = hostName.substring(4) } + List parts = Arrays.asList(hostName.split("\\.")) + Collections.reverse(parts) + hostName = String.join(".", parts) + return deobf(sourceURL, "$hostName/$fileName") +} catch(Exception e) { + return deobf(sourceURL, "deobf/${sourceURL.hashCode()}") +} +} + +// The method above is to be preferred. Use this method if the filename is not at the end of the URL. +def deobf(String sourceURL, String rawFileName) { +String bon2Version = "2.5.1" +String fileName = URLDecoder.decode(rawFileName, "UTF-8") +String cacheDir = "$project.gradle.gradleUserHomeDir/caches" +String bon2Dir = "$cacheDir/forge_gradle/deobf" +String bon2File = "$bon2Dir/BON2-${bon2Version}.jar" +String obfFile = "$cacheDir/modules-2/files-2.1/${fileName}.jar" +String deobfFile = "$cacheDir/modules-2/files-2.1/${fileName}-deobf.jar" + +if(file(deobfFile).exists()) { return files(deobfFile) } +String mappingsVer +String remoteMappings = project.hasProperty('remoteMappings') ? project.remoteMappings : 'https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/' +if(remoteMappings) { + String id = "${forgeVersion.split("\\.")[3]}-$minecraftVersion" + String mappingsZIP = "$cacheDir/forge_gradle/maven_downloader/de/oceanlabs/mcp/mcp_snapshot_nodoc/$id/mcp_snapshot_nodoc-${id}.zip" + + zipMappings(mappingsZIP, remoteMappings, bon2Dir) + + mappingsVer = "snapshot_$id" +} else { + mappingsVer = "${channel}_$mappingsVersion" +} + +download.run { + src "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/com/github/parker8283/BON2/$bon2Version-CUSTOM/BON2-$bon2Version-CUSTOM-all.jar" + dest bon2File + quiet true + overwrite false +} + +download.run { + src sourceURL + dest obfFile + quiet true + overwrite false +} + +exec { + commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', minecraftVersion, '--mappingsVer', mappingsVer, '--notch' + workingDir bon2Dir + standardOutput = new FileOutputStream("${deobfFile}.log") +} + +return files(deobfFile) +} + +def zipMappings(String zipPath, String url, String bon2Dir) { +File zipFile = new File(zipPath) +if(zipFile.exists()) { + return +} + +String fieldsCache = "$bon2Dir/data/fields.csv" +String methodsCache = "$bon2Dir/data/methods.csv" + +download.run { + src "${url}fields.csv" + dest fieldsCache + quiet true +} +download.run { + src "${url}methods.csv" + dest methodsCache + quiet true +} + +zipFile.getParentFile().mkdirs() +ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile)) + +zos.putNextEntry(new ZipEntry("fields.csv")) +Files.copy(Paths.get(fieldsCache), zos) +zos.closeEntry() + +zos.putNextEntry(new ZipEntry("methods.csv")) +Files.copy(Paths.get(methodsCache), zos) +zos.closeEntry() + +zos.close() +} + // Helper methods def checkPropertyExists(String propertyName) { - if (!project.hasProperty(propertyName)) { - throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties") - } +if (!project.hasProperty(propertyName)) { + throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties") +} } def getFile(String relativePath) { - return new File(projectDir, relativePath) +return new File(projectDir, relativePath) } diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000000..97d8f71c52 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,10 @@ +plugins { + id 'com.diffplug.blowdryerSetup' version '1.6.0' +} + +apply plugin: 'com.diffplug.blowdryerSetup' + +blowdryerSetup { + github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.1.4') + //devLocal '.' // Use this when testing config updates locally +} diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index fe85fc08c5..4911b4be7b 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -1,5 +1,7 @@ package com.github.technus.tectech; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; + import com.github.technus.tectech.loader.MainLoader; import com.github.technus.tectech.loader.TecTechConfig; import com.github.technus.tectech.loader.gui.CreativeTabEM; @@ -27,21 +29,21 @@ import eu.usrv.yamcore.auxiliary.IngameErrorLog; import eu.usrv.yamcore.auxiliary.LogHelper; import gregtech.GT_Mod; import gregtech.common.GT_Proxy; -import net.minecraftforge.common.MinecraftForge; - import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.Collection; import java.util.Iterator; +import net.minecraftforge.common.MinecraftForge; -import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; - -@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION, - dependencies = "required-after:Forge@[10.13.4.1614,);" + - "required-after:YAMCore@[0.5.70,);" + "required-after:structurelib;" + - "after:ComputerCraft;" + "after:OpenComputers;" + - "required-after:gregtech;" + "after:dreamcraft;" + - "after:appliedenergistics2;" + "after:CoFHCore;" + "after:Thaumcraft;") +@Mod( + modid = Reference.MODID, + name = Reference.NAME, + version = Reference.VERSION, + dependencies = "required-after:Forge@[10.13.4.1614,);" + "required-after:YAMCore@[0.5.70,);" + + "required-after:structurelib;" + "after:ComputerCraft;" + + "after:OpenComputers;" + "required-after:gregtech;" + + "after:dreamcraft;" + "after:appliedenergistics2;" + + "after:CoFHCore;" + "after:Thaumcraft;") public class TecTech { @SidedProxy(clientSide = Reference.CLIENTSIDE, serverSide = Reference.SERVERSIDE) public static CommonProxy proxy; @@ -49,20 +51,20 @@ public class TecTech { @Mod.Instance(Reference.MODID) public static TecTech instance; - public static final XSTR RANDOM = XSTR.XSTR_INSTANCE; - public static final LogHelper LOGGER = new LogHelper(Reference.MODID); - public static CreativeTabTecTech creativeTabTecTech; - public static CreativeTabEM creativeTabEM; + public static final XSTR RANDOM = XSTR.XSTR_INSTANCE; + public static final LogHelper LOGGER = new LogHelper(Reference.MODID); + public static CreativeTabTecTech creativeTabTecTech; + public static CreativeTabEM creativeTabEM; private static IngameErrorLog moduleAdminErrorLogs; - public static TecTechConfig configTecTech; + public static TecTechConfig configTecTech; - public static ChunkDataHandler chunkDataHandler; - public static AnomalyHandler anomalyHandler; + public static ChunkDataHandler chunkDataHandler; + public static AnomalyHandler anomalyHandler; public static PlayerPersistence playerPersistence; - public static final EMDefinitionsRegistry definitionsRegistry = new EMDefinitionsRegistry(); - public static final EMTransformationRegistry transformationInfo = new EMTransformationRegistry(); + public static final EMDefinitionsRegistry definitionsRegistry = new EMDefinitionsRegistry(); + public static final EMTransformationRegistry transformationInfo = new EMTransformationRegistry(); /** * For Loader.isModLoaded checks during the runtime @@ -85,8 +87,8 @@ public class TecTech { public void PreLoad(FMLPreInitializationEvent PreEvent) { LOGGER.setDebugOutput(true); - configTecTech = new TecTechConfig(PreEvent.getModConfigurationDirectory(), Reference.COLLECTIONNAME, - Reference.MODID); + configTecTech = + new TecTechConfig(PreEvent.getModConfigurationDirectory(), Reference.COLLECTIONNAME, Reference.MODID); if (!configTecTech.LoadConfig()) { LOGGER.error(Reference.MODID + " could not load its config file. Things are going to be weird!"); @@ -172,9 +174,7 @@ public class TecTech { } @Override - public void clear() { - - } + public void clear() {} @Override public boolean retainAll(Collection c) { @@ -199,7 +199,6 @@ public class TecTech { } catch (NoSuchFieldException | IllegalAccessException e) { LOGGER.error(Reference.MODID + " could not disable material loading!"); } - } MainLoader.load(definitionsRegistry); diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index 7cce649a2e..d01ad3f43b 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -1,5 +1,7 @@ package com.github.technus.tectech.compatibility.dreamcraft; +import static com.github.technus.tectech.loader.recipe.BaseRecipeLoader.getOrDefault; + import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry; import com.github.technus.tectech.recipe.TT_recipeAdder; import com.github.technus.tectech.thing.CustomItemList; @@ -9,7 +11,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.Behaviou import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.Behaviour_Recycler; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine; import cpw.mods.fml.common.Loader; -import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -19,28 +20,24 @@ import gregtech.api.interfaces.IItemContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import java.lang.reflect.Method; import net.minecraft.init.Blocks; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.core.material.ALLOY; - -import java.lang.reflect.Method; - -import static com.github.technus.tectech.loader.recipe.BaseRecipeLoader.getOrDefault; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; /** * Created by Tec on 06.08.2017. */ public class DreamCraftRecipeLoader { - //region reflect a bit + // region reflect a bit @SuppressWarnings("rawtypes") private Class CUSTOM_ITEM_LIST; + private Method ADD_ASSEMBLER_RECIPE; @SuppressWarnings("unchecked") @@ -48,739 +45,2577 @@ public class DreamCraftRecipeLoader { return (IItemContainer) Enum.valueOf(CUSTOM_ITEM_LIST, name); } - private void addAssemblerRecipeWithCleanroom(ItemStack[] items, FluidStack fluid, ItemStack output, int time, int eut) { + private void addAssemblerRecipeWithCleanroom( + ItemStack[] items, FluidStack fluid, ItemStack output, int time, int eut) { try { ADD_ASSEMBLER_RECIPE.invoke(GT_Values.RA, items, fluid, output, time, eut, true); } catch (Exception e) { throw new RuntimeException("Failed to add clean room assembler recipe! " + output.getDisplayName(), e); } } - //endregion + // endregion public void run(EMTransformationRegistry transformationInfo) { - //region reflect a bit + // region reflect a bit try { CUSTOM_ITEM_LIST = Class.forName("com.dreammaster.gthandler.CustomItemList"); - ADD_ASSEMBLER_RECIPE = GT_Values.RA.getClass().getMethod("addAssemblerRecipe", ItemStack[].class, FluidStack.class, ItemStack.class, int.class, int.class, boolean.class); + ADD_ASSEMBLER_RECIPE = GT_Values.RA + .getClass() + .getMethod( + "addAssemblerRecipe", + ItemStack[].class, + FluidStack.class, + ItemStack.class, + int.class, + int.class, + boolean.class); } catch (Exception e) { throw new Error(e); } - //endregion - - Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); - Fluid solderUEV = FluidRegistry.getFluid("molten.mutatedlivingsolder") != null ? FluidRegistry.getFluid("molten.mutatedlivingsolder") : FluidRegistry.getFluid("molten.solderingalloy"); - - //Quantum Glass - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Containment.get(1), - GT_ModHandler.getIC2Item("reinforcedGlass", 1L) - }, getOrDefault("Trinium", Materials.Osmium).getMolten(576), new ItemStack(QuantumGlassBlock.INSTANCE, 1), 200, 500000); - - //region pipes - - //Data - addAssemblerRecipeWithCleanroom(new ItemStack[]{ - ItemList.Circuit_Parts_GlassFiber.get(8), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silver, 8) - }, Materials.Polytetrafluoroethylene.getMolten(144), CustomItemList.DATApipe.get(1), 200, 30720); - - //Tunnel - addAssemblerRecipeWithCleanroom(new ItemStack[]{ - CustomItemList.DATApipe.get(1), - GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Osmiridium, 4), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 4), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 2), - ItemList.Field_Generator_MV.get(1), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1) - }, Materials.Osmium.getMolten(288), CustomItemList.EMpipe.get(1), 400, 500000); - - //Laser - addAssemblerRecipeWithCleanroom(new ItemStack[]{ + // endregion + + Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); + Fluid solderUEV = FluidRegistry.getFluid("molten.mutatedlivingsolder") != null + ? FluidRegistry.getFluid("molten.mutatedlivingsolder") + : FluidRegistry.getFluid("molten.solderingalloy"); + + // Quantum Glass + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] {CustomItemList.eM_Containment.get(1), GT_ModHandler.getIC2Item("reinforcedGlass", 1L)}, + getOrDefault("Trinium", Materials.Osmium).getMolten(576), + new ItemStack(QuantumGlassBlock.INSTANCE, 1), + 200, + 500000); + + // region pipes + + // Data + addAssemblerRecipeWithCleanroom( + new ItemStack[] { + ItemList.Circuit_Parts_GlassFiber.get(8), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silver, 8) + }, + Materials.Polytetrafluoroethylene.getMolten(144), CustomItemList.DATApipe.get(1), - GT_ModHandler.getIC2Item("reinforcedGlass", 1L), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmiridium, 2) - }, null, CustomItemList.LASERpipe.get(1), 100, 500000); - - //endregion - - //region casing - - //High Power Casing - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Iridium, 1), - GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Iridium, 6), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 1), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 16), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Copper, 16), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NiobiumTitanium, 2) - }, Materials.TungstenSteel.getMolten(576), CustomItemList.eM_Power.get(1), 100, 30720); - - //Computer Casing - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + 200, + 30720); + + // Tunnel + addAssemblerRecipeWithCleanroom( + new ItemStack[] { + CustomItemList.DATApipe.get(1), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Osmiridium, 4), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 4), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 2), + ItemList.Field_Generator_MV.get(1), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1) + }, + Materials.Osmium.getMolten(288), + CustomItemList.EMpipe.get(1), + 400, + 500000); + + // Laser + addAssemblerRecipeWithCleanroom( + new ItemStack[] { + CustomItemList.DATApipe.get(1), + GT_ModHandler.getIC2Item("reinforcedGlass", 1L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmiridium, 2) + }, + null, + CustomItemList.LASERpipe.get(1), + 100, + 500000); + + // endregion + + // region casing + + // High Power Casing + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Iridium, 1), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Iridium, 6), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 1), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 16), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Copper, 16), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NiobiumTitanium, 2) + }, + Materials.TungstenSteel.getMolten(576), CustomItemList.eM_Power.get(1), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 8), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NiobiumTitanium, 2) - }, Materials.Aluminium.getMolten(1296), CustomItemList.eM_Computer_Casing.get(1), 200, 122880); - //Computer Vent Casing - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.StainlessSteel, 1), - ItemList.Electric_Motor_IV.get(2), - GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.StainlessSteel, 2), - GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.StainlessSteel, 16), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Copper, 16), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, getOrDefault("SuperconductorIV", Materials.Superconductor), 1) - }, Materials.SolderingAlloy.getMolten(1296), - CustomItemList.eM_Computer_Vent.get(1), 100, 1920); - - //Advanced Computer Casing - addAssemblerRecipeWithCleanroom(new ItemStack[]{ + 100, + 30720); + + // Computer Casing + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + CustomItemList.eM_Power.get(1), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 8), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NiobiumTitanium, 2) + }, + Materials.Aluminium.getMolten(1296), CustomItemList.eM_Computer_Casing.get(1), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 64), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, getOrDefault("SuperconductorLuV", Materials.Superconductor), 4) - }, Materials.Iridium.getMolten(1296), CustomItemList.eM_Computer_Bus.get(1), 200, 122880); - - //Molecular Casing - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Power.get(1), - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Osmiridium, 6), - GT_OreDictUnificator.get(OrePrefixes.foil, getOrDefault("Trinium", Materials.Osmium), 12), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.TungstenSteel, 24), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.TungstenSteel, 24), - ItemList.Field_Generator_IV.get(1) - }, Materials.Osmium.getMolten(1296), CustomItemList.eM_Containment.get(1), 800, 500000); - - //Hollow Casing - GT_Values.RA.addAssemblylineRecipe(CustomItemList.eM_Containment.get(1), 7500, new ItemStack[]{ - CustomItemList.eM_Containment.get(1), - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Europium, 2), - GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, Materials.Plutonium, 4), - GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Lead, 8), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Uranium, 16), - GT_OreDictUnificator.get(OrePrefixes.screw, getOrDefault("Quantium", Materials.Europium), 16), - }, new FluidStack[]{ - getOrDefault("Trinium", Materials.Osmium).getMolten(1296), - Materials.Osmium.getMolten(1296), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), - Materials.Argon.getGas(1000), - }, CustomItemList.eM_Hollow.get(2), 200, 200000); - - //EM Coil - GT_Values.RA.addAssemblylineRecipe(CustomItemList.eM_Hollow.get(1), 7500, new ItemStack[]{ - CustomItemList.eM_Hollow.get(1), - ItemList.Casing_Fusion_Coil.get(2), - ItemList.Casing_Coil_NaquadahAlloy.get(2), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Europium, 64), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Europium, 64), - }, new FluidStack[]{ - Materials.Glass.getMolten(2304), - Materials.Silicone.getMolten(1872), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), - getOrDefault("Trinium", Materials.Osmium).getMolten(1296), - }, CustomItemList.eM_Coil.get(4), 800, 200000); + 200, + 122880); + // Computer Vent Casing + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.StainlessSteel, 1), + ItemList.Electric_Motor_IV.get(2), + GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.StainlessSteel, 2), + GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.StainlessSteel, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Copper, 16), + GT_OreDictUnificator.get( + OrePrefixes.wireGt01, getOrDefault("SuperconductorIV", Materials.Superconductor), 1) + }, + Materials.SolderingAlloy.getMolten(1296), + CustomItemList.eM_Computer_Vent.get(1), + 100, + 1920); + + // Advanced Computer Casing + addAssemblerRecipeWithCleanroom( + new ItemStack[] { + CustomItemList.eM_Computer_Casing.get(1), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 64), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 64), + GT_OreDictUnificator.get( + OrePrefixes.wireGt02, getOrDefault("SuperconductorLuV", Materials.Superconductor), 4) + }, + Materials.Iridium.getMolten(1296), + CustomItemList.eM_Computer_Bus.get(1), + 200, + 122880); + + // Molecular Casing + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + CustomItemList.eM_Power.get(1), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Osmiridium, 6), + GT_OreDictUnificator.get(OrePrefixes.foil, getOrDefault("Trinium", Materials.Osmium), 12), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.TungstenSteel, 24), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.TungstenSteel, 24), + ItemList.Field_Generator_IV.get(1) + }, + Materials.Osmium.getMolten(1296), + CustomItemList.eM_Containment.get(1), + 800, + 500000); + + // Hollow Casing + GT_Values.RA.addAssemblylineRecipe( + CustomItemList.eM_Containment.get(1), + 7500, + new ItemStack[] { + CustomItemList.eM_Containment.get(1), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Europium, 2), + GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, Materials.Plutonium, 4), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Lead, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Uranium, 16), + GT_OreDictUnificator.get(OrePrefixes.screw, getOrDefault("Quantium", Materials.Europium), 16), + }, + new FluidStack[] { + getOrDefault("Trinium", Materials.Osmium).getMolten(1296), + Materials.Osmium.getMolten(1296), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), + Materials.Argon.getGas(1000), + }, + CustomItemList.eM_Hollow.get(2), + 200, + 200000); + + // EM Coil + GT_Values.RA.addAssemblylineRecipe( + CustomItemList.eM_Hollow.get(1), + 7500, + new ItemStack[] { + CustomItemList.eM_Hollow.get(1), + ItemList.Casing_Fusion_Coil.get(2), + ItemList.Casing_Coil_NaquadahAlloy.get(2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Europium, 64), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Europium, 64), + }, + new FluidStack[] { + Materials.Glass.getMolten(2304), + Materials.Silicone.getMolten(1872), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), + getOrDefault("Trinium", Materials.Osmium).getMolten(1296), + }, + CustomItemList.eM_Coil.get(4), + 800, + 200000); // Infinite Oil Rig - TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.OilDrill3.get(1), - 16777216, 2048, 2000000, 4, new Object[]{ - ItemList.OilDrill3.get(1), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 4), - new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 4L}, - ItemList.Electric_Motor_UHV.get(4), - ItemList.Electric_Pump_UHV.get(4), - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Neutronium, 4), - ItemList.Sensor_UHV.get(3), - ItemList.Field_Generator_UHV.get(3), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 12) - }, new FluidStack[]{ - new FluidStack(solderUEV, 1296), - Materials.Neutronium.getMolten(576) - }, ItemList.OilDrillInfinite.get(1), 6000, 2000000); + TT_recipeAdder.addResearchableAssemblylineRecipe( + ItemList.OilDrill3.get(1), + 16777216, + 2048, + 2000000, + 4, + new Object[] { + ItemList.OilDrill3.get(1), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 4), + new Object[] {OrePrefixes.circuit.get(Material