diff --git a/.github/actions/build_setup/action.yml b/.github/actions/build_setup/action.yml new file mode 100644 index 00000000..cb3c17ba --- /dev/null +++ b/.github/actions/build_setup/action.yml @@ -0,0 +1,30 @@ +name: Build Setup +description: Setup for standard Java builds + +inputs: + update-cache: + description: If cache should be updated + required: false + default: false + +runs: + using: 'composite' + + steps: + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 17 + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + cache-write-only: ${{ inputs.update-cache }} + generate-job-summary: false + gradle-home-cache-includes: | + caches + caches/retro_futura_gradle + notifications + jdks + wrapper \ No newline at end of file diff --git a/.github/workflows/beta_test_release.yml b/.github/workflows/beta_test_release.yml new file mode 100644 index 00000000..4877f2ba --- /dev/null +++ b/.github/workflows/beta_test_release.yml @@ -0,0 +1,49 @@ +name: Beta Test Release + +on: + push: + branches: + - 0.1.0 +jobs: + build: + runs-on: ubuntu-latest + + permissions: + contents: write # needed to create GitHub releases + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Declare some variables + id: vars + shell: bash + run: | + echo "::set-output name=sha_short::$(git rev-parse --short $GITHUB_SHA)" + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '17' + + - name: Build Project + uses: gradle/gradle-build-action@v2 + with: + arguments: 'build --build-cache --daemon' # use the daemon here so the rest of the process is faster + generate-job-summary: false + gradle-home-cache-includes: | + caches + jdks + notifications + wrapper + + - name: Publish to GitHub + uses: softprops/action-gh-release@v1 + with: + files: "build/libs/*.jar" + fail_on_unmatched_files: true + prerelease: true + tag_name: "0.1.0-beta-testing" + name: "Beta Release Testing ${{ steps.vars.outputs.sha_short }}" + body: "Testing Pre-release for the GCYL Beta Release" \ No newline at end of file diff --git a/.gitignore b/.gitignore index ff99070a..2c770e09 100644 --- a/.gitignore +++ b/.gitignore @@ -20,5 +20,3 @@ build # other eclipse run -libs -libs \ No newline at end of file diff --git a/README.md b/README.md index b7285cc4..7f81b11b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ # GCYL: CEu -## Currently in alpha. LV-UV should be playable. Breaking changes may come without support for your world. Find breaks in progression, overlapping recipes, missing recipes, useless recipes, etc. and submit problems and suggestions with GitHub issues. +## Currently in beta. LV-UV should be playable. Breaking changes may come without support for your world. Find breaks in progression, overlapping recipes, missing recipes, useless recipes, etc. and submit problems and suggestions with GitHub issues. ### Accelerated playtesting is reasonable now. Gregicality Legacy Port to CEu (specifically with reference to the Technological Journey fork) -Requires [this](https://github.com/GregTechCEu/GregTech/releases/tag/nuclear-testing) version of Gregtech: CEu, [this](https://github.com/MrKono/MaterialReplication/releases/tag/1.3.0pre) version of Material Replication, and the latest versions of Gregicality Multiblocks, GroovyScript, ModularUI and their dependencies to run. +Requires special versions of GT, GCYM, Material Replication, Supercritical, these can be found with [this](https://github.com/Synthitic/GCYL-CEu/tags) release. + +Requires latest version of GroovyScript and [ModularUI RC-3](https://github.com/CleanroomMC/ModularUI/releases/tag/v2.5.0-rc3). ## Discord: https://discord.gg/59Faberfsq + +Textures are from GT:NH, GT:CEu, and Gregicality diff --git a/build.gradle b/build.gradle index 8ea7b057..a99d4771 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1707682661 +//version: 1720840170 /* * DO NOT CHANGE THIS FILE! * Also, you may replace this file at any time if there is an update available. @@ -7,14 +7,24 @@ */ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import com.gtnewhorizons.retrofuturagradle.MinecraftExtension +import com.gtnewhorizons.retrofuturagradle.mcp.MCPTasks +import com.gtnewhorizons.retrofuturagradle.minecraft.MinecraftTasks import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar +import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask +import com.gtnewhorizons.retrofuturagradle.util.Distribution import com.modrinth.minotaur.dependencies.ModDependency import com.modrinth.minotaur.dependencies.VersionDependency +import de.undercouch.gradle.tasks.download.DownloadExtension +import org.apache.commons.io.FileUtils +import org.gradle.api.internal.artifacts.configurations.DefaultUnlockedConfiguration import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent import org.gradle.internal.logging.text.StyledTextOutputFactory import org.jetbrains.gradle.ext.Gradle +import javax.inject.Inject + import static org.gradle.internal.logging.text.StyledTextOutput.Style plugins { @@ -23,9 +33,9 @@ plugins { id 'base' id 'eclipse' id 'maven-publish' - id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7' - id 'com.gtnewhorizons.retrofuturagradle' version '1.3.33' - id 'net.darkhax.curseforgegradle' version '1.1.18' apply false + id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.8' + id 'com.gtnewhorizons.retrofuturagradle' version '1.4.0' + id 'net.darkhax.curseforgegradle' version '1.1.24' apply false id 'com.modrinth.minotaur' version '2.8.7' apply false id 'com.diffplug.spotless' version '6.13.0' apply false id 'com.palantir.git-version' version '3.0.0' apply false @@ -33,6 +43,7 @@ plugins { id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false + id 'de.undercouch.download' version '5.6.0' apply false } def out = services.get(StyledTextOutputFactory).create('an-output') @@ -58,6 +69,8 @@ propertyDefaultIfUnset("includeMCVersionJar", false) propertyDefaultIfUnset("autoUpdateBuildScript", false) propertyDefaultIfUnset("modArchivesBaseName", project.modId) propertyDefaultIfUnsetWithEnvVar("developmentEnvironmentUserName", "Developer", "DEV_USERNAME") +propertyDefaultIfUnset("additionalJavaArguments", "") +propertyDefaultIfUnset("enableJava17RunTasks", false) propertyDefaultIfUnset("generateGradleTokenClass", "") propertyDefaultIfUnset("gradleTokenModId", "") propertyDefaultIfUnset("gradleTokenModName", "") @@ -65,8 +78,10 @@ propertyDefaultIfUnset("gradleTokenVersion", "") propertyDefaultIfUnset("useSrcApiPath", false) propertyDefaultIfUnset("includeWellKnownRepositories", true) propertyDefaultIfUnset("includeCommonDevEnvMods", true) +propertyDefaultIfUnset("stripForgeRequirements", false) propertyDefaultIfUnset("noPublishedSources", false) propertyDefaultIfUnset("forceEnableMixins", false) +propertyDefaultIfUnset("mixinConfigRefmap", "mixins.${project.modId}.refmap.json") propertyDefaultIfUnsetWithEnvVar("enableCoreModDebug", false, "CORE_MOD_DEBUG") propertyDefaultIfUnset("generateMixinConfig", true) propertyDefaultIfUnset("usesShadowedDependencies", false) @@ -107,7 +122,7 @@ if (!getFile(targetPackageJava).exists() && !getFile(targetPackageScala).exists( if (apiPackage) { final String endApiPath = modGroupPath + '/' + apiPackagePath - if (useSrcApiPath) { + if (useSrcApiPath.toBoolean()) { targetPackageJava = 'src/api/java/' + endApiPath targetPackageScala = 'src/api/scala/' + endApiPath targetPackageKotlin = 'src/api/kotlin/' + endApiPath @@ -369,6 +384,14 @@ minecraft { '-Dlegacy.debugClassLoadingSave=true' ]) } + + if (additionalJavaArguments.size() != 0) { + extraRunJvmArguments.addAll(additionalJavaArguments.split(';')) + } + + if (enableJava17RunTasks.toBoolean()) { + lwjgl3Version = "3.3.2" + } } if (coreModClass) { @@ -504,7 +527,7 @@ dependencies { // should use 2.8.6 but 2.8.9+ has a vulnerability fix annotationProcessor 'com.google.code.gson:gson:2.8.9' - mixinProviderSpec = modUtils.enableMixins(mixinProviderSpec, "mixins.${modId}.refmap.json") + mixinProviderSpec = modUtils.enableMixins(mixinProviderSpec, mixinConfigRefmap) api (mixinProviderSpec) { transitive = false } @@ -546,6 +569,10 @@ dependencies { transitive = false } + if ((usesMixins.toBoolean() || forceEnableMixins.toBoolean()) && stripForgeRequirements.toBoolean()) { + runtimeOnlyNonPublishable 'com.cleanroommc:strip-latest-forge-requirements:1.0' + } + if (includeCommonDevEnvMods.toBoolean()) { if (!(modId.equals('jei'))) { implementation 'mezz.jei:jei_1.12.2:4.16.1.302' @@ -679,7 +706,6 @@ tasks.register('generateAssets') { if (usesMixins.toBoolean() && generateMixinConfig.toBoolean()) { def mixinConfigFile = getFile("src/main/resources/mixins.${modId}.json") if (!mixinConfigFile.exists()) { - def mixinConfigRefmap = "mixins.${modId}.refmap.json" mixinConfigFile.text = """{ "package": "${modGroup}.${mixinsPackage}", @@ -820,6 +846,218 @@ def getManifestAttributes() { } +// LWJGL3ify setup +if (enableJava17RunTasks.toBoolean()) { + + apply plugin: 'de.undercouch.download' + + ext.java17Toolchain = (JavaToolchainSpec spec) -> { + spec.languageVersion.set(JavaLanguageVersion.of(17)) + spec.vendor.set(JvmVendorSpec.matching("jetbrains")) + } + ext.java21Toolchain = (JavaToolchainSpec spec) -> { + spec.languageVersion.set(JavaLanguageVersion.of(21)) + spec.vendor.set(JvmVendorSpec.matching("jetbrains")) + } + + ext.java17DependenciesCfg = (DefaultUnlockedConfiguration) configurations.create("java17Dependencies") { + extendsFrom(configurations.getByName("runtimeClasspath")) // Ensure consistent transitive dependency resolution + canBeConsumed = false + } + ext.java17PatchDependenciesCfg = (DefaultUnlockedConfiguration) configurations.create("java17PatchDependencies") { + canBeConsumed = false + } + + dependencies { + if (modId != 'lwjgl3ify') { + java17Dependencies("io.github.twilightflower:lwjgl3ify:1.0.0") + } + java17PatchDependencies("io.github.twilightflower:lwjgl3ify:1.0.0:forgePatches") { + transitive = false + } + } + + ext.java17JvmArgs = [ + "-Dfile.encoding=UTF-8", + "-Djava.system.class.loader=com.gtnewhorizons.retrofuturabootstrap.RfbSystemClassLoader", + "-Djava.security.manager=allow", + "--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED", + "--add-opens", "java.base/java.net=ALL-UNNAMED", + "--add-opens", "java.base/java.nio=ALL-UNNAMED", + "--add-opens", "java.base/java.io=ALL-UNNAMED", + "--add-opens", "java.base/java.lang=ALL-UNNAMED", + "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", + "--add-opens", "java.base/java.text=ALL-UNNAMED", + "--add-opens", "java.base/java.util=ALL-UNNAMED", + "--add-opens", "java.base/jdk.internal.reflect=ALL-UNNAMED", + "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", + "--add-opens", "jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED,java.naming", + "--add-opens", "java.desktop/sun.awt=ALL-UNNAMED", + "--add-opens", "java.desktop/sun.awt.image=ALL-UNNAMED", + "--add-opens", "java.desktop/com.sun.imageio.plugins.png=ALL-UNNAMED", + "--add-opens", "jdk.dynalink/jdk.dynalink.beans=ALL-UNNAMED", + "--add-opens", "java.sql.rowset/javax.sql.rowset.serial=ALL-UNNAMED" + ] + + ext.hotswapJvmArgs = [ + // DCEVM advanced hot reload + "-XX:+AllowEnhancedClassRedefinition", + "-XX:HotswapAgent=fatjar" + ] + + ext.setupHotswapAgent17 = tasks.register("setupHotswapAgent17", SetupHotswapAgentTask, t -> { + t.setTargetForToolchain(java17Toolchain) + }) + + ext.setupHotswapAgent21 = tasks.register("setupHotswapAgent21", SetupHotswapAgentTask, t -> { + t.setTargetForToolchain(java21Toolchain) + }) + + def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient") + runClient17Task.configure { + dependsOn(setupHotswapAgent17) + setup(project) + javaLauncher = project.javaToolchains.launcherFor(project.java17Toolchain) + } + + def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Distribution.DEDICATED_SERVER, "runServer") + runServer17Task.configure { + dependsOn(setupHotswapAgent17) + setup(project) + javaLauncher = project.javaToolchains.launcherFor(project.java17Toolchain) + } + + def runClient21Task = tasks.register("runClient21", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient") + runClient21Task.configure { + dependsOn(setupHotswapAgent21) + setup(project) + javaLauncher = project.javaToolchains.launcherFor(project.java21Toolchain) + } + + def runServer21Task = tasks.register("runServer21", RunHotswappableMinecraftTask, Distribution.DEDICATED_SERVER, "runServer") + runServer21Task.configure { + dependsOn(setupHotswapAgent21) + setup(project) + javaLauncher = project.javaToolchains.launcherFor(project.java21Toolchain) + } +} + +abstract class RunHotswappableMinecraftTask extends RunMinecraftTask { + + // IntelliJ doesn't seem to allow pre-set commandline arguments, so we also support an env variable + private boolean enableHotswap = Boolean.valueOf(System.getenv("HOTSWAP")) + + public final Distribution side + public final String superTask + + @Input + boolean getEnableHotswap() { + return enableHotswap + } + + @Option(option = "hotswap", description = "Enables HotSwapAgent for enhanced class reloading under a debugger") + boolean setEnableHotswap(boolean enable) { + enableHotswap = enable + } + + @Inject + RunHotswappableMinecraftTask(Distribution side, String superTask, org.gradle.api.invocation.Gradle gradle) { + super(side, gradle) + + this.side = side + this.superTask = superTask + setGroup("Modded Minecraft") + setDescription("Runs the modded " + side.name().toLowerCase(Locale.ROOT) + " using modern Java and lwjgl3ify") + this.getLwjglVersion().set(3) + } + + void setup(Project project) { + final MinecraftExtension minecraft = project.getExtensions().getByType(MinecraftExtension.class) + final MCPTasks mcpTasks = project.getExtensions().getByType(MCPTasks.class) + final MinecraftTasks mcTasks = project.getExtensions().getByType(MinecraftTasks.class) + + this.getExtraJvmArgs().addAll((List) project.property("java17JvmArgs")) + if (getEnableHotswap()) { + this.getExtraJvmArgs().addAll((List) project.property("hotswapJvmArgs")) + } + + this.classpath(project.property("java17PatchDependenciesCfg")) + this.classpath(mcpTasks.getTaskPackageMcLauncher()) + this.classpath(mcpTasks.getTaskPackagePatchedMc()) + this.classpath(mcpTasks.getPatchedConfiguration()) + this.classpath(project.getTasks().named("jar")) + this.classpath(project.property("java17DependenciesCfg")) + + super.setup(project) + + dependsOn( + mcpTasks.getLauncherSources().getClassesTaskName(), + mcTasks.getTaskDownloadVanillaAssets(), + mcpTasks.getTaskPackagePatchedMc(), + "jar" + ) + + getMainClass().set((side == Distribution.CLIENT) ? "GradleStart" : "GradleStartServer") + getUsername().set(minecraft.getUsername()) + getUserUUID().set(minecraft.getUserUUID()) + if (side == Distribution.DEDICATED_SERVER) { + getExtraArgs().add("nogui") + } + + systemProperty("gradlestart.bouncerClient", "com.gtnewhorizons.retrofuturabootstrap.Main") + systemProperty("gradlestart.bouncerServer", "com.gtnewhorizons.retrofuturabootstrap.Main") + + if (project.usesMixins.toBoolean()) { + this.extraJvmArgs.addAll(project.provider(() -> { + def mixinCfg = project.configurations.detachedConfiguration(project.dependencies.create(project.mixinProviderSpec)) + mixinCfg.canBeConsumed = false + mixinCfg.canBeResolved = true + mixinCfg.transitive = false + enableHotswap ? ["-javaagent:" + mixinCfg.singleFile.absolutePath] : [] + })) + } + } +} + +abstract class SetupHotswapAgentTask extends DefaultTask { + + @OutputFile + abstract RegularFileProperty getTargetFile() + + void setTargetForToolchain(Action spec) { + getTargetFile().set(project.javaToolchains.launcherFor(spec).map { + it.metadata.installationPath.file("lib/hotswap/hotswap-agent.jar") + }) + } + + @Inject + SetupHotswapAgentTask() { + setGroup("GT Buildscript") + setDescription("Installs a recent version of HotSwapAgent into the Java runtime directory") + onlyIf("Run only if not already installed", t -> !((SetupHotswapAgentTask) t).getTargetFile().getAsFile().get().exists()) + } + + @TaskAction + void installHSA() { + final String url = 'https://github.com/HotswapProjects/HotswapAgent/releases/download/1.4.2-SNAPSHOT/hotswap-agent-1.4.2-SNAPSHOT.jar' + final File target = getTargetFile().getAsFile().get() + final File parent = target.getParentFile() + FileUtils.forceMkdir(parent) + final DownloadExtension download = getProject().getExtensions().findByType(DownloadExtension.class) + download.run(ds -> { + try { + ds.src(url) + } catch (MalformedURLException e) { + throw new RuntimeException(e) + } + ds.dest(target) + ds.overwrite(false) + ds.tempAndMove(true) + }) + } +} + + // IDE Configuration eclipse { @@ -844,9 +1082,25 @@ idea { '2. Run Client'(Gradle) { taskNames = ['runClient'] } + if (enableJava17RunTasks.toBoolean()) { + '2a. Run Client (Java 17)'(Gradle) { + taskNames = ['runClient17'] + } + '2b. Run Client (Java 21)'(Gradle) { + taskNames = ['runClient21'] + } + } '3. Run Server'(Gradle) { taskNames = ['runServer'] } + if (enableJava17RunTasks.toBoolean()) { + '3a. Run Server (Java 17)'(Gradle) { + taskNames = ['runServer17'] + } + '3b. Run Server (Java 21)'(Gradle) { + taskNames = ['runServer21'] + } + } '4. Run Obfuscated Client'(Gradle) { taskNames = ['runObfClient'] } @@ -983,6 +1237,30 @@ if (cfApiKey.isPresent() || deploymentDebug.toBoolean()) { additionalFile.changelog = changelogRaw } } + doLast { + // No File IDs in Debug Mode + if (!deploymentDebug.toBoolean()) { + def list = [] + for (def artifact : tasks.curseforge.getUploadArtifacts()) { + list.add(artifact) + for (def additionalArtifact : artifact.getAdditionalArtifacts()) { + list.add(additionalArtifact) + } + } + def summary = "## CurseForge Build Summary (Mod ${modName} | Project ID ${curseForgeProjectId})" + for (def artifact : list) { + def fileId = artifact.getCurseFileId() + def fileName = artifact.getArtifact().getSingleFile().name + println("Uploaded File ${fileName}, With File ID: ${fileId}") + summary = summary + "\n - File: ${fileName} | File ID: ${fileId}" + } + println(summary) + def stepSummary = providers.environmentVariable("GITHUB_STEP_SUMMARY") + if (stepSummary.isPresent()) { + file(stepSummary.get()).write(summary) + } + } + } } tasks.curseforge.dependsOn(build) tasks.curseforge.dependsOn('generateChangelog') diff --git a/dependencies.gradle b/dependencies.gradle index 02ead702..8146f11f 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -22,17 +22,25 @@ * For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph */ dependencies { + // Hard Dependencies - devOnlyNonPublishable(rfg.deobf(project.files("libs/gregtech-1.12.2-2.9.0-beta-dev.jar"))) // GTCEu 2.8.8 + devOnlyNonPublishable(rfg.deobf(project.files("libs/gregtech-1.12.2-2.9.0-beta-dev.jar"))) // GTCEu 2.9.0 + devOnlyNonPublishable(rfg.deobf(project.files("libs/Supercritical-0.0.2-dev.jar"))) implementation rfg.deobf("curse.maven:codechicken-lib-1-8-242818:2779848") // CCL 3.2.3.358 - implementation rfg.deobf("curse.maven:gregicality-multiblocks-564858:5121714") //GCYM 1.2.8 - implementation rfg.deobf("curse.maven:groovyscript-687577:5219945") //Groovyscript 1.0.1 - devOnlyNonPublishable(rfg.deobf(project.files("libs/MaterialReplication-1.3.0-pre1-dev.jar"))) //Material replication 1.2.2 + devOnlyNonPublishable(rfg.deobf(project.files("libs/GregicalityMultiblocks-1.3.0-dev.jar"))) //GCYM 1.3 + implementation("com.cleanroommc:groovyscript:1.2.0-hotfix1") { transitive = false } + devOnlyNonPublishable(rfg.deobf(project.files("libs/MaterialReplication-1.2.7-dev.jar"))) //Material replication 1.3.0 // Soft Dependencies implementation "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.684" compileOnlyApi rfg.deobf("curse.maven:ctm-267602:2915363") // CTM 1.0.2.31 compileOnlyApi rfg.deobf("curse.maven:ae2-extended-life-570458:5147702") // AE2UEL 0.56.4 - compileOnlyApi rfg.deobf("curse.maven:modularui-624243:5153413") - api("com.cleanroommc:modularui:2.4.3") + compileOnlyApi rfg.deobf("curse.maven:ae2-fluid-crafting-rework-623955:5751930") + compileOnlyApi rfg.deobf("curse.maven:galacticraft-legacy-564236:4671122") + api("com.cleanroommc:modularui:3.0.4") { transitive = false } + + compileOnly("curse.maven:journeymap-32274:5172461") // Journeymap 5.7.1p3 + compileOnly("curse.maven:voxelmap-225179:3029445") // VoxelMap 1.9.28 + compileOnly("curse.maven:xaeros-263420:5394758") // Xaero's Minimap 24.2.0 + } diff --git a/gradle.properties b/gradle.properties index 2b5521b2..4ed382c5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ modGroup = com.fulltrix.gcyl # Version of your mod. # This field can be left empty if you want your mod's version to be determined by the latest git tag instead. -modVersion = 0.0.6 +modVersion = 0.1.0 # Whether to use the old jar naming structure (modid-mcversion-version) instead of the new version (modid-version) includeMCVersionJar = false @@ -16,7 +16,7 @@ includeMCVersionJar = false modArchivesBaseName=gcyl-ceu # Will update your build.gradle automatically whenever an update is available -autoUpdateBuildScript = true +autoUpdateBuildScript = false minecraftVersion = 1.12.2 @@ -46,14 +46,14 @@ apiPackage = # Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/ # There can be multiple files in a comma-separated list. # Example value: mymodid_at.cfg,jei_at.cfg -accessTransformersFile = +accessTransformersFile = gcyl_at.cfg # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! -usesMixins = false +usesMixins = true # Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! mixinsPackage = mixin # Automatically generates a mixin config json if enabled, with the name mixins.modid.json -generateMixinConfig = false +generateMixinConfig = true # Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! # Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin coreModClass = @@ -80,12 +80,12 @@ includeCommonDevEnvMods = true # If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your # responsibility check the licence and request permission for distribution, if required. -usesShadowedDependencies = false +usesShadowedDependencies = true # If disabled, won't remove unused classes from shaded dependencies. Some libraries use reflection to access # their own classes, making the minimization unreliable. minimizeShadowedDependencies = true # If disabled, won't rename the shadowed classes. -relocateShadowedDependencies = true +relocateShadowedDependencies = false # Separate run directories into "run/client" for runClient task, and "run/server" for runServer task. # Useful for debugging a server and client simultaneously. If not enabled, it will be in the standard location "run/" @@ -125,7 +125,7 @@ curseForgeRelations = # This project's release type on CurseForge and/or Modrinth # Alternatively this can be set with the 'RELEASE_TYPE' environment variable. # Allowed types: release, beta, alpha -releaseType=alpha +releaseType=beta # Generate a default changelog for releases. Requires git to be installed, as it uses it to generate a changelog of # commits since the last tagged release. @@ -166,4 +166,4 @@ deploymentDebug = false org.gradle.logging.stacktrace = all # Sets default memory used for gradle commands. Can be overridden by user or command line properties. # This is required to provide enough memory for the Minecraft decompilation process. -org.gradle.jvmargs = -Xmx3G \ No newline at end of file +org.gradle.jvmargs = -Xmx8G \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a79..7f93135c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c30b486a..1af9e093 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 8197bafb..0adc8e1a 100755 --- a/gradlew +++ b/gradlew @@ -83,10 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -197,6 +198,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in @@ -241,4 +246,4 @@ eval "set -- $( tr '\n' ' ' )" '"$@"' -exec "$JAVACMD" "$@" \ No newline at end of file +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index c138ebb7..6689b85b 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -89,4 +89,4 @@ exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal -:omega \ No newline at end of file +:omega diff --git a/libs/GregicalityMultiblocks-1.3.0-dev.jar b/libs/GregicalityMultiblocks-1.3.0-dev.jar new file mode 100644 index 00000000..19f9fbde Binary files /dev/null and b/libs/GregicalityMultiblocks-1.3.0-dev.jar differ diff --git a/libs/MaterialReplication-1.2.7-dev.jar b/libs/MaterialReplication-1.2.7-dev.jar new file mode 100644 index 00000000..1e1aecaa Binary files /dev/null and b/libs/MaterialReplication-1.2.7-dev.jar differ diff --git a/libs/Supercritical-0.0.2-dev.jar b/libs/Supercritical-0.0.2-dev.jar new file mode 100644 index 00000000..c4f67c55 Binary files /dev/null and b/libs/Supercritical-0.0.2-dev.jar differ diff --git a/libs/gregtech-1.12.2-2.9.0-beta-dev.jar b/libs/gregtech-1.12.2-2.9.0-beta-dev.jar new file mode 100644 index 00000000..454dae6b Binary files /dev/null and b/libs/gregtech-1.12.2-2.9.0-beta-dev.jar differ diff --git a/src/main/java/com/fulltrix/gcyl/ClientProxy.java b/src/main/java/com/fulltrix/gcyl/ClientProxy.java index 853f7e50..6a40fb15 100644 --- a/src/main/java/com/fulltrix/gcyl/ClientProxy.java +++ b/src/main/java/com/fulltrix/gcyl/ClientProxy.java @@ -1,7 +1,7 @@ package com.fulltrix.gcyl; import com.fulltrix.gcyl.client.ClientHandler; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; diff --git a/src/main/java/com/fulltrix/gcyl/CommonProxy.java b/src/main/java/com/fulltrix/gcyl/CommonProxy.java index dbbe2916..e356c334 100644 --- a/src/main/java/com/fulltrix/gcyl/CommonProxy.java +++ b/src/main/java/com/fulltrix/gcyl/CommonProxy.java @@ -1,26 +1,36 @@ package com.fulltrix.gcyl; +import com.fulltrix.gcyl.api.recipes.CachedRecipes; +import com.fulltrix.gcyl.api.recipes.GCYLMaterialRecipeHandler; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.api.recipes.MixerPropertyAddition; +import com.fulltrix.gcyl.api.recipes.properties.AdvFusionCoilProperty; +import com.fulltrix.gcyl.api.recipes.properties.ComponentALProperty; import com.fulltrix.gcyl.api.util.VirtualContainerRegistry; +import com.fulltrix.gcyl.api.util.VirtualEnergyRegistry; +import com.fulltrix.gcyl.api.util.VirtualResearchRegistry; +import com.fulltrix.gcyl.api.worldgen.VirtualOreVeinSaveData; +import com.fulltrix.gcyl.api.worldgen.WorldGenRegister; import com.fulltrix.gcyl.item.GCYLCoreItems; import com.fulltrix.gcyl.materials.GCYLMaterialOverride; import com.fulltrix.gcyl.materials.GCYLMaterials; -import com.fulltrix.gcyl.materials.GCYLNuclearMaterials; import com.fulltrix.gcyl.recipes.RecipeHandler; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.recipes.categories.RecipeOverrideLate; import com.fulltrix.gcyl.recipes.categories.handlers.ElectricImplosionHandler; import com.fulltrix.gcyl.recipes.categories.handlers.FuelHandler; import com.fulltrix.gcyl.recipes.categories.handlers.VoidMinerHandler; import com.fulltrix.gcyl.recipes.helper.GCYLComponents; -import com.fulltrix.gcyl.recipes.recipeproperties.AdvFusionCoilProperty; -import com.fulltrix.gcyl.worldgen.WorldGenRegister; import gregicality.multiblocks.common.GCYMConfigHolder; +import gregtech.api.GTValues; import gregtech.api.GregTechAPI; import gregtech.api.block.VariantItemBlock; import gregtech.api.event.HighTierEvent; +import gregtech.api.metatileentity.registry.MTEManager; import gregtech.api.recipes.GTRecipeInputCache; -import gregtech.api.recipes.recipeproperties.FusionEUToStartProperty; +import gregtech.api.recipes.properties.impl.FusionEUToStartProperty; import gregtech.api.unification.material.event.MaterialEvent; import gregtech.api.unification.material.event.MaterialRegistryEvent; +import gregtech.api.unification.material.event.PostMaterialEvent; import gregtech.common.ConfigHolder; import net.minecraft.block.Block; import net.minecraft.item.Item; @@ -41,7 +51,7 @@ import java.io.IOException; import java.util.function.Function; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.*; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.*; @Mod.EventBusSubscriber(modid = GCYLCore.MODID) public class CommonProxy { @@ -49,6 +59,10 @@ public void preInit() { GCYLCoreItems.init(); } + public void postInit() { + CachedRecipes.cacheRecipesForOPF(); + } + private static void registerRecipesAfterCT() { ElectricImplosionHandler.buildElectricImplosionRecipes(); } @@ -63,7 +77,16 @@ public static void forceHighTierConfig(HighTierEvent event) { //Force enable high tier content, regardless of config option event.enableHighTier(); + if (GCYLConfig.recipes.hardMode) { + GCYLConfig.recipes.gcylCasingsPerCraftOverride = 1; + GCYLConfig.recipes.circuitsPerCraft = 1; + GCYLConfig.recipes.circuitCoresPerCraft = 1; + } + + ConfigHolder.recipes.casingsPerCraft = GCYLConfig.recipes.gcylCasingsPerCraftOverride; + ConfigHolder.machines.enableHighTierSolars = true; + ConfigHolder.recipes.harderCircuitRecipes = false; //Force enable tiered casings from GCYM GCYMConfigHolder.globalMultiblocks.enableTieredCasings = true; @@ -73,15 +96,22 @@ public static void forceHighTierConfig(HighTierEvent event) { @SubscribeEvent(priority = EventPriority.NORMAL) public static void registerMaterials(MaterialEvent event) { - //TJFMaterials.registerNuclearMaterials(); - GCYLNuclearMaterials.registerNuclear(); - GCYLMaterials.register(); - GCYLMaterials.register2(); - GCYLMaterials.registerSuperconductors(); - GCYLMaterials.initDEMaterials(); - GCYLMaterialOverride.materialChanges(); - GCYLMaterialOverride.tempMaterialModifications(); + GCYLMaterials.init(); + + + + GCYLMaterialOverride.init(); + } + + @SubscribeEvent + public static void registerMTERegistry(MTEManager.MTERegistryEvent event) { + GregTechAPI.mteManager.createRegistry(Tags.MODID); + } + + @SubscribeEvent(priority = EventPriority.HIGH) + public static void registerMaterialsPost(PostMaterialEvent event) { + MixerPropertyAddition.init(); } @SubscribeEvent @@ -97,6 +127,7 @@ public static void registerBlocks(RegistryEvent.Register event) { registry.register(HEATING_COIL); registry.register(MULTIBLOCK_CASING2); //registry.register(TRANSPARENT_CASING); + registry.register(FUSION_COILS); registry.register(FUSION_CASING); registry.register(VACUUM_CASING); registry.register(DIVERTOR_CASING); @@ -106,6 +137,10 @@ public static void registerBlocks(RegistryEvent.Register event) { registry.register(METAL_CASING_1); registry.register(METAL_CASING_2); registry.register(REACTOR_CASING); + registry.register(GCYL_CLEANROOM_CASING); + registry.register(GCYL_COMPONENT_AL_CASING); + registry.register(ELEVATOR_CASING); + registry.register(ELEVATOR_CASING_TIERED); } @SubscribeEvent @@ -114,6 +149,7 @@ public static void registerItems(RegistryEvent.Register event) { registry.register(createItemBlock(HEATING_COIL, VariantItemBlock::new)); registry.register(createItemBlock(MULTIBLOCK_CASING2, VariantItemBlock::new)); //registry.register(createItemBlock(TRANSPARENT_CASING, VariantItemBlock::new)); + registry.register(createItemBlock(FUSION_COILS, VariantItemBlock::new)); registry.register(createItemBlock(FUSION_CASING, VariantItemBlock::new)); registry.register(createItemBlock(VACUUM_CASING, VariantItemBlock::new)); registry.register(createItemBlock(DIVERTOR_CASING, VariantItemBlock::new)); @@ -123,6 +159,10 @@ public static void registerItems(RegistryEvent.Register event) { registry.register(createItemBlock(METAL_CASING_1, VariantItemBlock::new)); registry.register(createItemBlock(METAL_CASING_2, VariantItemBlock::new)); registry.register(createItemBlock(REACTOR_CASING, VariantItemBlock::new)); + registry.register(createItemBlock(GCYL_CLEANROOM_CASING, VariantItemBlock::new)); + registry.register(createItemBlock(GCYL_COMPONENT_AL_CASING, VariantItemBlock::new)); + registry.register(createItemBlock(ELEVATOR_CASING, VariantItemBlock::new)); + registry.register(createItemBlock(ELEVATOR_CASING_TIERED, VariantItemBlock::new)); } @SubscribeEvent(priority = EventPriority.HIGHEST) @@ -138,7 +178,7 @@ public static void createMaterialRegistry(MaterialRegistryEvent event) { } - @SubscribeEvent(priority = EventPriority.LOW) + @SubscribeEvent(priority = EventPriority.NORMAL) public static void registerRecipes(RegistryEvent.Register event) { AdvFusionCoilProperty.registerAdvFusionTier(1, "1"); @@ -152,8 +192,14 @@ public static void registerRecipes(RegistryEvent.Register event) { FusionEUToStartProperty.registerFusionTier(12, "(Adv MK4)"); FusionEUToStartProperty.registerFusionTier(13, "(Adv MK5)"); + for(int i = 1; i < GTValues.VN.length; i++) { + ComponentALProperty.registerCasingTier(i, GTValues.VN[i]); + } + GCYLRecipeMaps.modifyMaps(); + GCYLMaterialRecipeHandler.register(); + RecipeHandler.initRecipes(); RecipeHandler.initChains(); @@ -162,17 +208,30 @@ public static void registerRecipes(RegistryEvent.Register event) { //RecipeHandler.registerLargeMachineRecipes(); } + @SubscribeEvent(priority = EventPriority.LOW) + public static void lateRecipeOverride(RegistryEvent.Register event) { + RecipeOverrideLate.init(); + } + @SubscribeEvent public static void onWorldLoadEvent(WorldEvent.Load event) { VirtualContainerRegistry.initializeStorage(event.getWorld()); - } + VirtualEnergyRegistry.initializeStorage(event.getWorld()); + VirtualResearchRegistry.initializeStorage(event.getWorld()); + VirtualOreVeinSaveData.setDirty(); + } + @SubscribeEvent + public static void onWorldSaveEvent(WorldEvent.Save event) { + VirtualOreVeinSaveData.setDirty(); + } @SubscribeEvent public static void registerOrePrefix(RegistryEvent.Register event) { //NuclearHandler.register(); VoidMinerHandler.register(); + CachedRecipes.register(); //TODO: remove ore prefixes from hidden & removed circuits diff --git a/src/main/java/com/fulltrix/gcyl/GCYLConfig.java b/src/main/java/com/fulltrix/gcyl/GCYLConfig.java index df27a0d9..58273c43 100644 --- a/src/main/java/com/fulltrix/gcyl/GCYLConfig.java +++ b/src/main/java/com/fulltrix/gcyl/GCYLConfig.java @@ -11,6 +11,13 @@ public class GCYLConfig { public static class Multis { public VoidMiner voidMiner = new VoidMiner(); public HyperReactors hyperReactors = new HyperReactors(); + public LargeFisher largeFisher = new LargeFisher(); + } + + public static class LargeFisher { + @Config.Comment("The whitelisted biomes for the large fisher to work in.") + @Config.RequiresMcRestart + public String[] whitelistedBiomes = {"Ocean", "Deep Ocean", "River"}; } public static class HyperReactors { @@ -32,10 +39,15 @@ public static class HyperReactors { @Config.RangeInt(min = 1) public int[] boostedEuAmount = {2, 2, 2}; - @Config.Comment("The liquid that boosts the Reactor.") + @Config.Comment("The material fluid that boosts the Reactor.") @Config.RequiresMcRestart @Config.Name("Hyper Reactor boosters") - public String[] boosterFluid = {"plasma.helium", "plasma.radon", "degenerate_rhenium_plasma"}; + public String[] boosterFluid = {"helium", "radon", "gcyl:degenerate_rhenium_plasma"}; + + @Config.Comment("The fluid state of the boosters for the Reactor.") + @Config.RequiresMcRestart + @Config.Name("Hyper Reactor boosters fluid states") + public String[] boosterFluidStates = {"plasma", "plasma", "plasma"}; @Config.Comment("The amount of liquid that boosts the Reactor.") @Config.RequiresMcRestart @@ -67,20 +79,30 @@ public static class VoidMiner { @Config.Name("Void miner ore variants") public boolean oreVariants = true; + @Config.Comment("The name of the ores to blacklist for all Void Miners because there are existing recipes in the Deep Miner") + @Config.RequiresMcRestart + @Config.Name("Void Miner because Deep Miner Blacklist") + public String[] oreBlackListDeepMinerConflict = new String[]{"diamond", "coal", "pyrochlore", "columbite", "bauxite", "aluminium", "rutile", "gallite", "platinum_metallic_powder", "palladium_metallic_powder", "bastnasite", "monazite", "neodymium", "nether_star", "salt", "fluorite", "lepidolite", "spodumene", "naquadric_compound", "enriched_naquadric_compound", "naquadriatic_compound", "uranium_238", "plutonium_generic", "rarest_metal_mixture", "rhodium_salt", "sodium_ruthenate", "tantalum", "tantalite"}; + + @Config.Comment("The name of the ores to blacklist for all Void Miners") + @Config.RequiresMcRestart + @Config.Name("Universal Void Miner Blacklist") + public String[] oreBlackListUniversal = new String[]{"naquadah", "cooperite", "platinum", "palladium", "iridium", "osmium", "barium", "arsenic", "titanium", "tungsten"}; + @Config.Comment("The name of the ores to blacklist for the MK1 Void Miner") @Config.RequiresMcRestart @Config.Name("MK1 Void Miner Blacklist") - public String[] oreBlacklist = new String[]{"trinium, triniite, duranium, tritanium, rutherfordium, californium, curium, seaborgium, berkelium, fermium, einsteinium, dubnium, bohrium"}; + public String[] oreBlacklist = new String[]{"trinium", "triniite", "duranium", "tritanium", "rutherfordium", "californium", "curium", "seaborgium", "berkelium", "fermium", "einsteinium", "dubnium", "bohrium"}; @Config.Comment("The name of the ores to blacklist for the MK2 Void Miner") @Config.RequiresMcRestart @Config.Name("MK2 Void Miner Blacklist") - public String[] oreBlacklistUHV = new String[]{"trinium, fermium, bohrium, seaborgium, einsteinium"}; + public String[] oreBlacklistUHV = new String[]{"trinium", "fermium", "bohrium", "seaborgium", "einsteinium"}; @Config.Comment("The name of the ores to blacklist for the MK3 Void Miner") @Config.RequiresMcRestart @Config.Name("MK3 Void Miner Blacklist") - public String[] oreBlacklistUEV = new String[]{"bohrium, fermium"}; + public String[] oreBlacklistUEV = new String[]{"bohrium", "fermium"}; @Config.Comment("The name of items you wish to add to the MK1 Void Miner. Example: \"minecraft:wool:2\"") @Config.RequiresMcRestart @@ -111,6 +133,11 @@ public static class Misc { @Config.RequiresMcRestart public boolean enableMagnetoCircuits = true; + @Config.Comment({"Whether to enable wireless dynamo hatches or not. When false, they will be hidden in JEI. They do not have recipes.", "default=false"}) + @Config.Name("Enable Wireless Dynamos") + @Config.RequiresMcRestart + public boolean enableWirelessDynamos = false; + @Config.Comment("Whether or not to add diminishing returns for Gregicality Naquadah Reactors. Does not affect the Large Nauqadah Reactor") @Config.Name("Naquadah Reactor efficiency loss") @Config.RequiresMcRestart @@ -128,4 +155,65 @@ public static class Misc { public int LuVRocketEfficiency= 25; } + + + @Config.Comment("Config options for recipes") + public static Recipes recipes = new Recipes(); + + public static class Recipes { + + @Config.Comment({"1 click hard mode, makes everything have maximum cost. Other configs that change cost do nothing. (May do other things in the future.)", "default = false"}) + @Config.RequiresMcRestart + public boolean hardMode = false; + + @Config.Comment({"Base amount of circuits outputted per craft of the first circuit of a tier.", "default = 1"}) + @Config.RequiresMcRestart + public int circuitsPerCraft = 4; + + + @Config.Comment({"Base amount of high tier circuit cores outputted per craft.", "default = 1"}) + @Config.RequiresMcRestart + public int circuitCoresPerCraft = 8; + + @Config.Comment({"How many Multiblock Casings to make per craft. Overrides the default GT Option", "Default: 1"}) + @Config.RequiresMcRestart + public int gcylCasingsPerCraftOverride = 2; + + @Config.Comment({"Whether to use the new Platinum Group Line instead of Legacy.", "Default: true"}) + @Config.Name("New Platinum Chain") + @Config.RequiresMcRestart + public boolean useNewPlatinumChain = true; + + @Config.Comment({"Whether to use the new Rare Earth Processing instead of Legacy.", "Default: true"}) + @Config.Name("New REE Chain") + @Config.RequiresMcRestart + public boolean useNewREEChain = true; + } + + @Config.Comment("Config options for space") + public static Space space = new Space(); + + public static class Space{ + + @Config.Comment({"List of Planet Names. These are mapped to an ID. Starting Index is 1."}) + @Config.RequiresMcRestart + public String[] planetNames = {"Jupiter", "Saturn", "Uranus", "Neptune"}; + + } + + //TODO remove (THREADED TESTING MARK123) + public static Experimental experimental = new Experimental(); + + public static class Experimental { + + @Config.Comment({"Whether threading MTE updates is enabled.", "Default: false"}) + @Config.RequiresMcRestart + public boolean threadedMTEUpdates = false; + + @Config.Comment({ + "Override to number of threads available to the Global Thread Pool Executor. -1 for no override, can't be higher than CPUs - 2.", + "Default: -1" }) + @Config.RangeInt(min = 2) + public int globalThreadPoolExecutorThreadCount = -1; + } } diff --git a/src/main/java/com/fulltrix/gcyl/GCYLCore.java b/src/main/java/com/fulltrix/gcyl/GCYLCore.java index 3e9df6fd..cb1151e6 100644 --- a/src/main/java/com/fulltrix/gcyl/GCYLCore.java +++ b/src/main/java/com/fulltrix/gcyl/GCYLCore.java @@ -1,32 +1,47 @@ package com.fulltrix.gcyl; +import com.fulltrix.gcyl.api.recipes.CachedRecipes; +import com.fulltrix.gcyl.api.util.VirtualContainerRegistry; +import com.fulltrix.gcyl.api.util.VirtualEnergyRegistry; +import com.fulltrix.gcyl.api.util.VirtualResearchRegistry; +import com.fulltrix.gcyl.api.worldgen.PacketVirtualOreVeinList; +import com.fulltrix.gcyl.api.worldgen.VirtualOreVeinHandler; +import com.fulltrix.gcyl.api.worldgen.VirtualOreVeinSaveData; +import com.fulltrix.gcyl.blocks.component_al.GCYLComponentALCasing; +import com.fulltrix.gcyl.blocks.elevator.ElevatorCasingTiered; +import com.fulltrix.gcyl.blocks.metal.GCYLCleanroomCasing; import com.fulltrix.gcyl.covers.GCYLCoverBehaviors; -import com.fulltrix.gcyl.item.GCYLHeatingCoil; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.GCYLHeatingCoil; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; import com.fulltrix.gcyl.machines.GCYLTileEntities; import gregtech.GTInternalTags; import gregtech.api.GregTechAPI; import gregtech.api.cover.CoverDefinition; +import gregtech.api.worldgen.bedrockFluids.BedrockFluidVeinHandler; +import gregtech.api.worldgen.bedrockFluids.BedrockFluidVeinSaveData; import gregtech.common.blocks.BlockWireCoil; import gregtech.common.blocks.MetaBlocks; +import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.common.event.FMLServerStartingEvent; +import net.minecraftforge.fml.common.event.*; +import net.minecraftforge.fml.relauncher.Side; import java.io.IOException; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.HEATING_COIL; +import static com.fulltrix.gcyl.api.GCYLAPI.*; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.*; import static gregtech.api.GregTechAPI.COVER_REGISTRY; import static gregtech.api.GregTechAPI.HEATING_COILS; @Mod(modid = GCYLCore.MODID, name = GCYLCore.NAME, version = GCYLCore.VERSION, - dependencies = GTInternalTags.DEP_VERSION_STRING) + dependencies = "required:forge@[14.23.5.2847,);" + "required-after:codechickenlib@[3.2.3,);" + + "required-after:modularui@[2.3,);" + GTInternalTags.DEP_VERSION_STRING + "required-after:gcym@[1.3.,);" + + "required-after:materialreplication@[1.2.7,);" + "required-after:groovyscript@[1.2,);" + "required-after:jei@[4.15.0,);") public class GCYLCore { public static final String MODID = Tags.MODID; public static final String NAME = Tags.MODNAME; @@ -45,10 +60,23 @@ public void preInit(FMLPreInitializationEvent event) { HEATING_COILS.put(HEATING_COIL.getState(type), type); } + for (GCYLComponentALCasing.CasingType type : GCYLComponentALCasing.CasingType.values()) { + COMPONENT_AL_CASINGS.put(GCYL_COMPONENT_AL_CASING.getState(type), type); + } + + for (GCYLCleanroomCasing.CasingType type : GCYLCleanroomCasing.CasingType.values()) { + GCYL_FILTER_CASINGS.put(GCYL_CLEANROOM_CASING.getState(type), type); + } + + for(ElevatorCasingTiered.CasingType type : ElevatorCasingTiered.CasingType.values()) { + ELEVATOR_MOTORS.put(ELEVATOR_CASING_TIERED.getState(type), type); + } + + HEATING_COILS.remove(MetaBlocks.WIRE_COIL.getState(BlockWireCoil.CoilType.TRINIUM),BlockWireCoil.CoilType.TRINIUM); HEATING_COILS.remove(MetaBlocks.WIRE_COIL.getState(BlockWireCoil.CoilType.TRITANIUM),BlockWireCoil.CoilType.TRITANIUM); - + GregTechAPI.networkHandler.registerPacket(PacketVirtualOreVeinList.class); } @EventHandler @@ -64,7 +92,10 @@ public void init(FMLInitializationEvent event) throws IOException { @EventHandler public void postInit(FMLPostInitializationEvent event) { - //CommonProxy.postInit(); + proxy.postInit(); + + VirtualOreVeinHandler.recalculateChances(true); + } @EventHandler @@ -72,7 +103,32 @@ public void postInit(FMLPostInitializationEvent event) { public void serverStarting(FMLServerStartingEvent event) { } + @EventHandler + public void serverStarted(FMLServerStartedEvent event) { + if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) { + World world = FMLCommonHandler.instance().getMinecraftServerInstance().getEntityWorld(); + if (!world.isRemote) { + VirtualOreVeinSaveData saveData = (VirtualOreVeinSaveData) world + .loadData(VirtualOreVeinSaveData.class, VirtualOreVeinSaveData.dataName); + if (saveData == null) { + saveData = new VirtualOreVeinSaveData(VirtualOreVeinSaveData.dataName); + world.setData(VirtualOreVeinSaveData.dataName, saveData); + // the save data does not yet exist, use the latest version number + VirtualOreVeinHandler.saveDataVersion = VirtualOreVeinHandler.MAX_VIRTUAL_ORE_SAVE_DATA_VERSION; + } + VirtualOreVeinSaveData.setInstance(saveData); + } + } + } + static { FluidRegistry.enableUniversalBucket(); } + + @EventHandler + public void serverStopped(FMLServerStoppedEvent event) { + VirtualEnergyRegistry.clearMaps(); + VirtualContainerRegistry.clearMaps(); + VirtualResearchRegistry.clearMaps(); + } } diff --git a/src/main/java/com/fulltrix/gcyl/GCYLElements.java b/src/main/java/com/fulltrix/gcyl/GCYLElements.java index b87f1cc6..dd3ce789 100644 --- a/src/main/java/com/fulltrix/gcyl/GCYLElements.java +++ b/src/main/java/com/fulltrix/gcyl/GCYLElements.java @@ -7,7 +7,25 @@ public class GCYLElements { private GCYLElements() { + } + public static final Element He4 = add(2, 2, -1, null, "Helium-4", "He-4", true); + public static final Element Ti50 = add(22,28, -1, null, "Titanium-50", "Ti-50", true); + public static final Element Bi210 = add(83,127,-1,null, "Bismuth-210", "Bi-210", true); + public static final Element Am241 = add(95,146, -1, null, "Americium-241", "Am-241", true); + public static final Element Am243 = add(95,148, -1, null, "Americium-243", "Am-243", true); + public static final Element Cm244 = add(96,148, -1, null, "Curium-244", "Cm-244", true); + public static final Element Cm245 = add(96,149, -1, null, "Curium-245", "Cm-245", true); + public static final Element Cm247 = add(96,151, -1, null, "Curium-247", "Cm-247", true); + public static final Element Cm248 = add(96,152, -1, null, "Curium-248", "Cm-248", true); + public static final Element Cm250 = add(96,154, -1, null, "Curium-250", "Cm-250", true); + public static final Element Bk249 = add(97, 152, -1, null, "Berkelium-249", "Bk-249", true); + public static final Element Cf252 = add(98, 154, -1, null, "Californium-252", "Cf-252", true); + public static final Element Cf253 = add(98, 155, -1, null, "Californium-253", "Cf-253", true); + public static final Element Es253 = add(99,154,-1,null,"Einsteinium-253","Es-253",true); + public static final Element Fm258 = add(100,158, -1, null, "Fermium-258", "Fm-258", true); + public static final Element Fm259 = add(100,159, -1, null, "Fermium-259", "Fm-259", true); + public static final Element Md261 = add(101, 160, -1, null, "Mendelevium-261", "Md-261", true); public static final Element Ad = add(351, 509, -1, null, "Adamantium", "Ad", false); public static final Element Vb = add(457, 663, -1, null, "Vibranium", "Vb", false); diff --git a/src/main/java/com/fulltrix/gcyl/GCYLUtility.java b/src/main/java/com/fulltrix/gcyl/GCYLUtility.java deleted file mode 100644 index 9a7a0361..00000000 --- a/src/main/java/com/fulltrix/gcyl/GCYLUtility.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.fulltrix.gcyl; - -import net.minecraft.util.ResourceLocation; -import org.jetbrains.annotations.NotNull; - -public class GCYLUtility { - - public static @NotNull ResourceLocation gcylId(@NotNull String path) { - return new ResourceLocation("gcyl", path); - } - - public static int setBetweenInclusive(int value, int start, int end) { - if (value < start) - return start; - return Math.min(value, end); - } -} diff --git a/src/main/java/com/fulltrix/gcyl/api/GCYLAPI.java b/src/main/java/com/fulltrix/gcyl/api/GCYLAPI.java index d547f33d..08817eef 100644 --- a/src/main/java/com/fulltrix/gcyl/api/GCYLAPI.java +++ b/src/main/java/com/fulltrix/gcyl/api/GCYLAPI.java @@ -1,10 +1,26 @@ package com.fulltrix.gcyl.api; +import com.fulltrix.gcyl.api.block.IComponentALTier; +import com.fulltrix.gcyl.api.block.IElevatorMotorTier; import com.fulltrix.gcyl.api.block.IFusionCoilBlockStats; +import gregtech.api.block.ICleanroomFilter; +import gregtech.api.recipes.Recipe; +import gregtech.api.unification.ore.OrePrefix; import it.unimi.dsi.fastutil.objects.Object2ObjectMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; +import java.util.List; public class GCYLAPI { public static final Object2ObjectMap FUSION_COILS = new Object2ObjectOpenHashMap<>(); + + public static final Object2ObjectMap COMPONENT_AL_CASINGS = new Object2ObjectOpenHashMap<>(); + + public static final Object2ObjectMap ELEVATOR_MOTORS = new Object2ObjectOpenHashMap<>(); + + public static final Object2ObjectMap GCYL_FILTER_CASINGS = new Object2ObjectOpenHashMap<>(); + } diff --git a/src/main/java/com/fulltrix/gcyl/api/GCYLUtility.java b/src/main/java/com/fulltrix/gcyl/api/GCYLUtility.java new file mode 100644 index 00000000..1ada9b31 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/GCYLUtility.java @@ -0,0 +1,731 @@ +package com.fulltrix.gcyl.api; + +import com.fulltrix.gcyl.GCYLConfig; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; +import com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils; +import gregtech.api.GTValues; +import gregtech.api.fluids.store.FluidStorageKey; +import gregtech.api.fluids.store.FluidStorageKeys; +import gregtech.api.items.metaitem.MetaItem; +import gregtech.api.metatileentity.multiblock.CleanroomType; +import gregtech.api.recipes.RecipeBuilder; +import gregtech.api.recipes.RecipeMap; +import gregtech.api.recipes.builders.AssemblyLineRecipeBuilder; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.MarkerMaterials; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.ore.OrePrefix; +import gregtech.common.ConfigHolder; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.concurrent.BasicThreadFactory; +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadPoolExecutor; + +import static com.fulltrix.gcyl.item.GCYLCoreItems.*; +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; +import static com.fulltrix.gcyl.materials.chains.MiscMaterials.Irirutan; +import static gregicality.multiblocks.api.unification.GCYMMaterials.Zeron100; +import static gregtech.api.recipes.GTRecipeHandler.removeRecipesByInputs; +import static gregtech.api.recipes.RecipeMaps.ASSEMBLY_LINE_RECIPES; +import static gregtech.api.recipes.RecipeMaps.EXTRACTOR_RECIPES; +import static gregtech.api.unification.material.Materials.*; +import static gregtech.common.items.MetaItems.*; + +public class GCYLUtility { + + //TODO remove (THREADED TESTING MARK123) + + private static ThreadPoolExecutor GLOBAL_THREAD_POOL_EXECUTOR; + + static { + if(GCYLConfig.experimental.threadedMTEUpdates) { + int cpus = Runtime.getRuntime().availableProcessors(); + + if (GCYLConfig.experimental.globalThreadPoolExecutorThreadCount == -1) { + cpus = cpus < 4 ? 2 : cpus / 2; + } else { + cpus = Math.max(2, Math.min(cpus - 2, GCYLConfig.experimental.globalThreadPoolExecutorThreadCount)); + } + + GLOBAL_THREAD_POOL_EXECUTOR = (ThreadPoolExecutor) Executors.newFixedThreadPool( + cpus, new BasicThreadFactory.Builder() + .namingPattern("gt_global_threads-%d").priority(Thread.NORM_PRIORITY).build()); + } + } + + public static ThreadPoolExecutor getGlobalThreadPoolExecutor() { + return GLOBAL_THREAD_POOL_EXECUTOR; + } + + public static @NotNull ResourceLocation gcylId(@NotNull String path) { + return new ResourceLocation("gcyl", path); + } + + public static MetaItem.MetaValueItem getDiodeByTier(int tier) { + return switch (tier) { + case (2) -> SMD_DIODE_REFINED; + case (3) -> SMD_DIODE; + case (4) -> SMD_DIODE_NANO; + case (5) -> SMD_DIODE_QUANTUM; + case (6) -> SMD_DIODE_CRYSTAL; + case (7) -> SMD_DIODE_WETWARE; + case (8) -> SMD_DIODE_BIOWARE; + case (9) -> SMD_DIODE_OPTICAL; + case (10) -> SMD_DIODE_EXOTIC; + case (11) -> SMD_DIODE_COSMIC; + default -> SMD_DIODE_SUPRACAUSAL; + }; + } + + public static int setBetweenInclusive(int value, int start, int end) { + if (value < start) + return start; + return Math.min(value, end); + } + + public static FluidStorageKey getFluidStorageKeyByName(String name) { + return switch (name) { + case ("liquid") -> FluidStorageKeys.LIQUID; + case ("gas") -> FluidStorageKeys.GAS; + case ("plasma") -> FluidStorageKeys.PLASMA; + default -> null; + }; + } + + public static void removeExtractorRecipe(Material material, OrePrefix prefix) { + removeRecipesByInputs(EXTRACTOR_RECIPES, OreDictUnifier.get(prefix, material)); + } + + public static ItemStack getPowerICStack(int tier) { + if (tier < 3) + return ULTRA_LOW_POWER_INTEGRATED_CIRCUIT.getStackForm(64); + if (tier < 4) + return LOW_POWER_INTEGRATED_CIRCUIT.getStackForm(64); + if (tier < 5) + return POWER_INTEGRATED_CIRCUIT.getStackForm(64); + if (tier < 7) + return HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(64); + if (tier < 9) + return ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(64); + if (tier < 11) + + return NPIC.getStackForm(64); + if (tier < 13) + return PPIC.getStackForm(64); + else + return QPIC.getStackForm(64); + } + + public static MetaItem.MetaValueItem getPowerIC(int tier) { + if (tier < 3) + return ULTRA_LOW_POWER_INTEGRATED_CIRCUIT; + if (tier < 4) + return LOW_POWER_INTEGRATED_CIRCUIT; + if (tier < 5) + return POWER_INTEGRATED_CIRCUIT; + if (tier < 7) + return HIGH_POWER_INTEGRATED_CIRCUIT; + if (tier < 9) + return ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT; + if (tier < 11) + return NPIC; + if (tier < 13) + return PPIC; + else + return QPIC; + } + + public static Material getEmitterDustByTier(int tier) { + return switch (tier) { + case(6) -> ZincSelenide; + case(7) -> Fluorescein; + case(8) -> Stilbene; + case(9) -> FranciumCaesiumCadmiumBromide; + case(10) -> RhodamineB; + case(11) -> null; + case(12) -> null; + case(13) -> ChargedCaesiumCeriumCobaltIndium; + case(14) -> RheniumHassiumThalliumIsophtaloylbisdiethylthioureaHexafluorophosphate; + default -> null; + }; + } + + public static Material getSensorDustByTier(int tier) { + return switch (tier) { + case(6) -> Germanium; + case(7) -> LeadSenenide; + case(8) -> BariumStrontiumTitanate; + case(9) -> BariumStrontiumTitanate; + case(10) -> MagnetorestrictiveAlloy; + case(11) -> null; + case(12) -> null; + case(13) -> null; + case(14) -> null; + default -> null; + }; + } + + public static Material getSensorEmitterFoil(int tier) { + return switch (tier) { + case (6) -> Palladium; + case (7) -> Platinum; + case (8) -> Osmiridium; + case (9) -> Osmium; //TODO UHV sensor emitter foil materials + case (10) -> Trinium; //TODO UEV sensor emitter foil materials + case(11) -> TriniumTitanium; + case(12) -> ProtoAdamantium; + default -> getMainComponentMaterialByTier(tier); + }; + } + + public static Material getGemByTier(int tier) { + return switch (tier) { + case (6) -> Ruby; + case (7) -> Emerald; + case (8) -> Diamond; + case (9) -> Diamond; + case (10) -> Diamond; + case (11) -> Diamond; + case (12) -> Diamond; + case (13) -> Jasper; + default -> Diamond; + }; + } + + public static int getCWUt(int tier) { + return (int) Math.max(4, Math.pow(2, tier - 2)); + } + + public static ItemStack getDataStack(int CWUt) { + if(CWUt < 128) + return TOOL_DATA_ORB.getStackForm(); + else if(CWUt < 256) + return TOOL_DATA_MODULE.getStackForm(); + else if(CWUt < 1024) + return TOOL_DATA_MODULE_CLUSTER.getStackForm(); + else if(CWUt < 4096) + return TOOL_DATA_ULTIMATE.getStackForm(); + else + return TOOL_DATA_SUPRACAUSAL.getStackForm(); + + } + + public static Material getSolderingAlloyByTier(int tier) { + if(tier > 8) + return Indalloy140; + else + return SolderingAlloy; + } + + public static Material getFineWireByTier(int tier) { + return switch (tier) { + case(1) -> Copper; + case(2) -> Cupronickel; + case(3) -> Electrum; + case(4) -> Kanthal; + case(5) -> BrightSteel; + case(6) -> Irirutan; + case(7) -> DuctileA356; + case(8) -> Duranium; + case(9) -> TungstenTitaniumCarbide; + case(10) -> Pikyonium; + case(11) -> CarbonNanotubes; + case(12) -> LanthanumFullereneNanotubes; + case(13) -> MetastableOganesson; + case(14) -> HeavyQuarkDegenerateMatter; //TODO CHANGE THIS + default -> Lead; + }; + } + + public static Material getMaterialByTier(int tier) { + return switch (tier) { + case(1) -> Steel; + case(2) -> Aluminium; + case(3) -> StainlessSteel; + case(4) -> Titanium; + case(5) -> TungstenSteel; + case(6) -> RhodiumPlatedPalladium; + case(7) -> Duranium; + case(8) -> Tritanium; + case(9) -> Seaborgium; + case(10) -> Bohrium; + case(11) -> Quantum; + case(12) -> BlackTitanium; + case(13) -> HeavyQuarkDegenerateMatter; + case(14) -> Neutronium; + default -> Lead; + }; + } + + public static MetaItem.MetaValueItem getEmitterCrystalByTier(int tier) { + return switch (tier) { + case(11) -> LEPTON_TRAP_CRYSTAL; + case(12) -> CHARGED_LEPTON_TRAP_CRYSTAL; + case(13) -> SCINTILLATOR_CRYSTAL; + default -> null; + }; + } + + public static MetaItem.MetaValueItem getVoltageCoilByTier(int tier) { + return switch (tier) { + case(1) -> VOLTAGE_COIL_LV; + case(2) -> VOLTAGE_COIL_MV; + case(3) -> VOLTAGE_COIL_HV; + case(4) -> VOLTAGE_COIL_EV; + case(5) -> VOLTAGE_COIL_IV; + case(6) -> VOLTAGE_COIL_LuV; + case(7) -> VOLTAGE_COIL_ZPM; + case(8) -> VOLTAGE_COIL_UV; + case(9) -> VOLTAGE_COIL_UHV; + case(10) -> VOLTAGE_COIL_UEV; + case(11) -> VOLTAGE_COIL_UIV; + case(12) -> VOLTAGE_COIL_UXV; + case(13) -> VOLTAGE_COIL_OpV; + case(14) -> VOLTAGE_COIL_MAX; + default -> VOLTAGE_COIL_ULV; + + }; + } + + public static Material getMagneticMaterialFluidByTier(int tier) { + if(tier == 1) + return IronMagnetic; + if(tier < 4) + return SteelMagnetic; + if(tier < 10) { + return NeodymiumMagnetic; + } + if(tier < 13) + return SamariumMagnetic; + else + return NaquadriaticTaranium; + } + + public static Material getCableByTier(int tier) { + return switch (tier) { + case(1) -> Tin; + case(2) -> Copper; + case(3) -> Silver; + case(4) -> Aluminium; + case(5) -> Tungsten; + case(6) -> YttriumBariumCuprate; + case(7) -> Naquadah; + case(8) -> Duranium; + case(9) -> TungstenTitaniumCarbide; + case(10) -> Pikyonium; + case(11) -> Cinobite; + case(12) -> NaquadriaticTaranium; + case(13) -> Neutronium; + case(14) -> CosmicNeutronium; + default -> Lead; + }; + } + + public static Material getSuperconductorByTier(int tier) { + if(tier < 1) + return LVSuperconductor; + + return switch (tier) { + case(1) -> LVSuperconductor; + case(2) -> MVSuperconductor; + case(3) -> HVSuperconductor; + case(4) -> EVSuperconductor; + case(5) -> IVSuperconductor; + case(6) -> LuVSuperconductor; + case(7) -> ZPMSuperconductor; + case(8) -> UVSuperconductor; + case(9) -> UHVSuperconductor; + case(10) -> UEVSuperconductor; + case(11) -> UIVSuperconductor; + case(12) -> UXVSuperconductor; + case(13) -> OpVSuperconductor; + default -> MAXSuperconductor; + }; + } + + public static MetaItem.MetaValueItem getFieldGeneratorByTier(int tier) { + if(tier < 1) + return FIELD_GENERATOR_LV; + + return switch (tier) { + case(1) -> FIELD_GENERATOR_LV; + case(2) -> FIELD_GENERATOR_MV; + case(3) -> FIELD_GENERATOR_HV; + case(4) -> FIELD_GENERATOR_EV; + case(5) -> FIELD_GENERATOR_IV; + case(6) -> FIELD_GENERATOR_LuV; + case(7) -> FIELD_GENERATOR_ZPM; + case(8) -> FIELD_GENERATOR_UV; + case(9) -> FIELD_GENERATOR_UHV; + case(10) -> FIELD_GENERATOR_UEV; + case(11) -> FIELD_GENERATOR_UIV; + case(12) -> FIELD_GENERATOR_UXV; + case(13) -> FIELD_GENERATOR_OpV; + default -> FIELD_GENERATOR_MAX; + }; + } + + public static MetaItem.MetaValueItem getSensorByTier(int tier) { + if(tier < 1) + return SENSOR_LV; + + return switch (tier) { + case(1) -> SENSOR_LV; + case(2) -> SENSOR_MV; + case(3) -> SENSOR_HV; + case(4) -> SENSOR_EV; + case(5) -> SENSOR_IV; + case(6) -> SENSOR_LuV; + case(7) -> SENSOR_ZPM; + case(8) -> SENSOR_UV; + case(9) -> SENSOR_UHV; + case(10) -> SENSOR_UEV; + case(11) -> SENSOR_UIV; + case(12) -> SENSOR_UXV; + case(13) -> SENSOR_OpV; + default -> SENSOR_MAX; + }; + } + + public static Material getMarkerMaterialByTier(int tier) { + if(tier < 0) + return MarkerMaterials.Tier.ULV; + + return switch (tier) { + case(0) -> MarkerMaterials.Tier.ULV; + case(1) -> MarkerMaterials.Tier.LV; + case(2) -> MarkerMaterials.Tier.MV; + case(3) -> MarkerMaterials.Tier.HV; + case(4) -> MarkerMaterials.Tier.EV; + case(5) -> MarkerMaterials.Tier.IV; + case(6) -> MarkerMaterials.Tier.LuV; + case(7) -> MarkerMaterials.Tier.ZPM; + case(8) -> MarkerMaterials.Tier.UV; + case(9) -> MarkerMaterials.Tier.UHV; + case(10) -> MarkerMaterials.Tier.UEV; + case(11) -> MarkerMaterials.Tier.UIV; + case(12) -> MarkerMaterials.Tier.UXV; + case(13) -> MarkerMaterials.Tier.OpV; + default -> MarkerMaterials.Tier.MAX; + }; + } + + public static CleanroomType getCleanroomTypeByTierNotV(int tier) { + return switch (tier) { + case(2)-> CleanroomType.STERILE_CLEANROOM; + case(3)-> GCYLCleanroomType.ISO3; + case(4)-> GCYLCleanroomType.ISO2; + case(5)-> GCYLCleanroomType.ISO1; + case(6)-> GCYLCleanroomType.ISO0; + default -> CleanroomType.CLEANROOM; + }; + } + + public static Material getMainComponentMaterialByTier(int tier) { + return switch (tier) { + case(6)->HSSS; + case(7)->HSSE; + case(8)->Tritanium; + case(9)->HDCS; + case(10)->EnrichedNaquadahAlloy; + case(11)->HastelloyX78; + case(12)->HastelloyK243; + case(13)->Neutronium; + case(14)->QCDMatter; + case(15)->CosmicNeutronium; + default -> Tin; + }; + } + + public static Material getFluidMaterialByTier(int tier) { + return switch (tier) { + case (9) -> Seaborgium; + case (10) -> Bohrium; + case (11) -> MetastableHassium; + case (12) -> HeavyQuarkDegenerateMatter; + case (13) -> SuperheavyMix; + case (14) -> Neutronium; + default -> Naquadria; + }; + } + + public static Material getFluidPipeMaterialByTier(int tier) { + return switch (tier) { + case(1) -> Bronze; + case(2) -> Steel; + case(3) -> StainlessSteel; + case(4) -> Titanium; + case(5) -> TungstenSteel; + case (9) -> Zeron100; + case (10) -> Lafium; + case (11) -> TantalumHafniumSeaborgiumCarbide; + case (12) -> EnrichedNaquadahAlloy; + case (13) -> Neutronium; + case (14) -> CosmicNeutronium; + default -> Tin; + }; + } + + public static Material getPolymerByTier(int tier) { + return switch (tier) { + case(8) -> Polybenzimidazole; + case(9) -> Polyetheretherketone; + case(10) -> Polyetheretherketone; + case(11) -> Zylon; + case(12) -> Zylon; + case(13) -> FullerenePolymerMatrix; + case(14) -> FullerenePolymerMatrix; + default -> Polyethylene; + }; + } + + public static MetaItem.MetaValueItem getMotorByTier(int tier) { + return switch (tier) { + case(2) -> ELECTRIC_MOTOR_MV; + case(3) -> ELECTRIC_MOTOR_HV; + case(4) -> ELECTRIC_MOTOR_EV; + case(5) -> ELECTRIC_MOTOR_IV; + case(6) -> ELECTRIC_MOTOR_LuV; + case(7) -> ELECTRIC_MOTOR_ZPM; + case(8) -> ELECTRIC_MOTOR_UV; + case(9) -> ELECTRIC_MOTOR_UHV; + case(10) -> ELECTRIC_MOTOR_UEV; + case(11) -> ELECTRIC_MOTOR_UIV; + case(12) -> ELECTRIC_MOTOR_UXV; + case(13) -> ELECTRIC_MOTOR_OpV; + case(14) -> ELECTRIC_MOTOR_MAX; + default -> ELECTRIC_MOTOR_LV; + }; + } + + public static MetaItem.MetaValueItem getConveyorByTier(int tier) { + return switch (tier) { + case(2) -> CONVEYOR_MODULE_MV; + case(3) -> CONVEYOR_MODULE_HV; + case(4) -> CONVEYOR_MODULE_EV; + case(5) -> CONVEYOR_MODULE_IV; + case(6) -> CONVEYOR_MODULE_LuV; + case(7) -> CONVEYOR_MODULE_ZPM; + case(8) -> CONVEYOR_MODULE_UV; + case(9) -> CONVEYOR_MODULE_UHV; + case(10) -> CONVEYOR_MODULE_UEV; + case(11) -> CONVEYOR_MODULE_UIV; + case(12) -> CONVEYOR_MODULE_UXV; + case(13) -> CONVEYOR_MODULE_OpV; + case(14) -> CONVEYOR_MODULE_MAX; + default -> CONVEYOR_MODULE_LV; + }; + } + + public static MetaItem.MetaValueItem getPistonByTier(int tier) { + return switch (tier) { + case(2) -> ELECTRIC_PISTON_MV; + case(3) -> ELECTRIC_PISTON_HV; + case(4) -> ELECTRIC_PISTON_EV; + case(5) -> ELECTRIC_PISTON_IV; + case(6) -> ELECTRIC_PISTON_LUV; + case(7) -> ELECTRIC_PISTON_ZPM; + case(8) -> ELECTRIC_PISTON_UV; + case(9) -> ELECTRIC_PISTON_UHV; + case(10) -> ELECTRIC_PISTON_UEV; + case(11) -> ELECTRIC_PISTON_UIV; + case(12) -> ELECTRIC_PISTON_UXV; + case(13) -> ELECTRIC_PISTON_OpV; + case(14) -> ELECTRIC_PISTON_MAX; + default -> ELECTRIC_PISTON_LV; + }; + } + + public static MetaItem.MetaValueItem getRobotArmByTier(int tier) { + return switch (tier) { + case(2) -> ROBOT_ARM_MV; + case(3) -> ROBOT_ARM_HV; + case(4) -> ROBOT_ARM_EV; + case(5) -> ROBOT_ARM_IV; + case(6) -> ROBOT_ARM_LuV; + case(7) -> ROBOT_ARM_ZPM; + case(8) -> ROBOT_ARM_UV; + case(9) -> ROBOT_ARM_UHV; + case(10) -> ROBOT_ARM_UEV; + case(11) -> ROBOT_ARM_UIV; + case(12) -> ROBOT_ARM_UXV; + case(13) -> ROBOT_ARM_OpV; + case(14) -> ROBOT_ARM_MAX; + default -> ROBOT_ARM_LV; + }; + } + + public static MetaItem.MetaValueItem getEmitterByTier(int tier) { + return switch (tier) { + case(2) -> EMITTER_MV; + case(3) -> EMITTER_HV; + case(4) -> EMITTER_EV; + case(5) -> EMITTER_IV; + case(6) -> EMITTER_LuV; + case(7) -> EMITTER_ZPM; + case(8) -> EMITTER_UV; + case(9) -> EMITTER_UHV; + case(10) -> EMITTER_UEV; + case(11) -> EMITTER_UIV; + case(12) -> EMITTER_UXV; + case(13) -> EMITTER_OpV; + case(14) -> EMITTER_MAX; + default -> EMITTER_LV; + }; + } + + public static MetaItem.MetaValueItem getPumpByTier(int tier) { + return switch (tier) { + case(2) -> ELECTRIC_PUMP_MV; + case(3) -> ELECTRIC_PUMP_HV; + case(4) -> ELECTRIC_PUMP_EV; + case(5) -> ELECTRIC_PUMP_IV; + case(6) -> ELECTRIC_PUMP_LuV; + case(7) -> ELECTRIC_PUMP_ZPM; + case(8) -> ELECTRIC_PUMP_UV; + case(9) -> ELECTRIC_PUMP_UHV; + case(10) -> ELECTRIC_PUMP_UEV; + case(11) -> ELECTRIC_PUMP_UIV; + case(12) -> ELECTRIC_PUMP_UXV; + case(13) -> ELECTRIC_PUMP_OpV; + case(14) -> ELECTRIC_PUMP_MAX; + default -> ELECTRIC_PUMP_LV; + }; + } + + public static MetaItem.MetaValueItem getStarByTier(int tier) { + if(tier == 4) + return QUANTUM_EYE; + if(tier < 8) + return QUANTUM_STAR; + if(tier < 10) + return GRAVI_STAR; + if(tier < 12) + return UNSTABLE_STAR; + else + return NUCLEAR_STAR; + } + + public static Material getLowEmitterSensorStarMaterial(int tier) { + return switch (tier) { + case(1) -> Quartzite; + case(2) -> Emerald; + case(3) -> EnderEye; + default -> null; + }; + } + + public static Material getLowEmitterSensorRodMaterial(int tier) { + return switch (tier) { + case(1) -> Brass; + case(2) -> Electrum; + case(3) -> Chrome; + case(4) -> Platinum; + case(5) -> Iridium; + default -> null; + }; + } + + public static GCYLFusionCoils.CasingType getAdvFusionCoilByAdvTier(int tier) { + return switch (tier) { + case(1) -> GCYLFusionCoils.CasingType.ADV_FUSION_COIL_2; + case(2) -> GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3; + case(3) -> GCYLFusionCoils.CasingType.ADV_FUSION_COIL_4; + case(4) -> GCYLFusionCoils.CasingType.ADV_FUSION_COIL_5; + default -> GCYLFusionCoils.CasingType.ADV_FUSION_COIL_1; + }; + } + + public static Material getAdvFusionMaterialByAdvTier1(int tier) { + return switch (tier) { + case(1) -> Bohrium; + case(2) -> Vibranium; + case(3) -> HeavyQuarkDegenerateMatter; + case(4) -> QCDMatter; + default -> TantalumHafniumSeaborgiumCarbide; + }; + } + + public static Material getAdvFusionMaterialByAdvTier2(int tier) { + return switch (tier) { + case(1) -> Einsteinium; + case(2) -> Mendelevium; + case(3) -> MetastableFlerovium; + case(4) -> SuperheavyLAlloy; + default -> TantalumHafniumSeaborgiumCarbide; + }; + } + + public static List> buildHigherYieldCleanroomRecipes(RecipeMap recipeMap, MetaItem.MetaValueItem output, int baseOutputAmount, int startCleanRoomTier, int startEUt) { + List> recipeBuilderList = new ArrayList<>(); + + for (int i = startCleanRoomTier; i < 7; i++) { + recipeBuilderList.add(recipeMap.recipeBuilder() + .circuitMeta(i) + .cleanroom(getCleanroomTypeByTierNotV(i)) + .EUt(i == startCleanRoomTier ? startEUt : (int) (startEUt * Math.pow(4, i - startCleanRoomTier))) + //.outputs(output.getStackForm((int) (baseOutputAmount * Math.pow(2, i - startCleanRoomTier)))) //TODO MAY NEED NERF + .outputs(output.getStackForm(i == startCleanRoomTier ? baseOutputAmount : 2 * baseOutputAmount * (i - startCleanRoomTier)))); + } + return recipeBuilderList; + } + + public static RecipeBuilder getAssLineResearchBuilder(int tier, int duration, ItemStack researchStack, boolean upTierEUt, boolean upTierCWUt) { + return ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(GTValues.VA[upTierEUt ? tier + 1 : tier]).duration(duration) + .stationResearch(b -> b + .dataStack(getDataStack(getCWUt(upTierCWUt ? tier + 1 : tier))) + .CWUt(getCWUt(upTierCWUt ? tier + 1 : tier)) + .researchStack(researchStack) + .EUt(GTValues.VA[upTierEUt ? tier + 1 : tier])); + } + + public static RecipeBuilder getAssLineResearchBuilder(int tier, int duration, ItemStack researchStack, boolean upTierEUt, boolean upTierCWUt, double researchCWUTotalMulti) { + return ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(GTValues.VA[upTierEUt ? tier + 1 : tier]).duration(duration) + .stationResearch(b -> b + .CWUt(getCWUt(upTierCWUt ? tier + 1 : tier), (int) (4000 * (GTValues.VA[upTierEUt ? tier + 1 : tier] * researchCWUTotalMulti))) + .dataStack(getDataStack(getCWUt(upTierCWUt ? tier + 1 : tier))) + .researchStack(researchStack) + .EUt(GTValues.VA[upTierEUt ? tier + 1 : tier])); + } + + public static RecipeBuilder getAssLineResearchBuilder(int tier, int duration, ItemStack researchStack, boolean upTierEUt, boolean upTierCWUt, CleanroomType cleanroomType) { + return ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(GTValues.VA[upTierEUt ? tier + 1 : tier]).duration(duration).cleanroom(cleanroomType) + .stationResearch(b -> b + .dataStack(getDataStack(getCWUt(upTierCWUt ? tier + 1 : tier))) + .CWUt(getCWUt(upTierCWUt ? tier + 1 : tier)) + .researchStack(researchStack) + .EUt(GTValues.VA[upTierEUt ? tier + 1 : tier])); + } + + public static RecipeBuilder getAssLineResearchBuilder(int tier, int duration, ItemStack researchStack, boolean upTierEUt, boolean upTierCWUt, double researchCWUTotalMulti, CleanroomType cleanroomType) { + return ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(GTValues.VA[upTierEUt ? tier + 1 : tier]).duration(duration).cleanroom(cleanroomType) + .stationResearch(b -> b + .CWUt(getCWUt(upTierCWUt ? tier + 1 : tier), (int) (4000 * (GTValues.VA[upTierEUt ? tier + 1 : tier] * researchCWUTotalMulti))) + .dataStack(getDataStack(getCWUt(upTierCWUt ? tier + 1 : tier))) + .researchStack(researchStack) + .EUt(GTValues.VA[upTierEUt ? tier + 1 : tier])); + } + + public static RecipeBuilder getAssLineResearchBuilder(int tier, int duration, ItemStack researchStack, boolean upTierEUt, boolean upTierCWUt, CleanroomType cleanroomType, int recipeEUt) { + return ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(recipeEUt).duration(duration).cleanroom(cleanroomType) + .stationResearch(b -> b + .dataStack(getDataStack(getCWUt(upTierCWUt ? tier + 1 : tier))) + .CWUt(getCWUt(upTierCWUt ? tier + 1 : tier)) + .researchStack(researchStack) + .EUt(GTValues.VA[upTierEUt ? tier + 1 : tier])); + } + + public static RecipeBuilder getAssLineResearchBuilder(int tier, int duration, ItemStack researchStack, boolean upTierEUt, boolean upTierCWUt, int recipeEUt) { + return ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(recipeEUt).duration(duration) + .stationResearch(b -> b + .dataStack(getDataStack(getCWUt(upTierCWUt ? tier + 1 : tier))) + .CWUt(getCWUt(upTierCWUt ? tier + 1 : tier)) + .researchStack(researchStack) + .EUt(GTValues.VA[upTierEUt ? tier + 1 : tier])); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/block/IComponentALTier.java b/src/main/java/com/fulltrix/gcyl/api/block/IComponentALTier.java new file mode 100644 index 00000000..b7bce22d --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/block/IComponentALTier.java @@ -0,0 +1,5 @@ +package com.fulltrix.gcyl.api.block; + +public interface IComponentALTier { + int getTier(); +} diff --git a/src/main/java/com/fulltrix/gcyl/api/block/IElevatorMotorTier.java b/src/main/java/com/fulltrix/gcyl/api/block/IElevatorMotorTier.java new file mode 100644 index 00000000..1fdecd44 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/block/IElevatorMotorTier.java @@ -0,0 +1,5 @@ +package com.fulltrix.gcyl.api.block; + +public interface IElevatorMotorTier { + int getTier(); +} diff --git a/src/main/java/com/fulltrix/gcyl/api/items/WirelessElectricItem.java b/src/main/java/com/fulltrix/gcyl/api/items/WirelessElectricItem.java new file mode 100644 index 00000000..2f16054a --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/items/WirelessElectricItem.java @@ -0,0 +1,213 @@ +package com.fulltrix.gcyl.api.items; + +import com.fulltrix.gcyl.api.util.VirtualEnergyRegistry; +import gregtech.api.GTValues; +import gregtech.api.capability.GregtechCapabilities; +import gregtech.api.capability.IElectricItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.world.World; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.minecraftforge.common.util.Constants; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import java.util.function.BiConsumer; + +public class WirelessElectricItem implements IElectricItem, ICapabilityProvider { + + protected final ItemStack itemStack; + + protected final long maxCharge; + protected final int tier; + + protected final boolean chargeable; + protected final boolean canProvideEnergyExternally; + + protected final List> listeners = new ArrayList<>(); + + public WirelessElectricItem(ItemStack itemStack, long maxCharge, int tier, boolean chargeable, + boolean canProvideEnergyExternally) { + this.itemStack = itemStack; + this.maxCharge = maxCharge; + this.tier = tier; + this.chargeable = chargeable; + this.canProvideEnergyExternally = canProvideEnergyExternally; + } + + @Override + public void addChargeListener(BiConsumer chargeListener) { + listeners.add(chargeListener); + } + + public void setCharge(long change) { + if (!itemStack.hasTagCompound()) { + itemStack.setTagCompound(new NBTTagCompound()); + } + // noinspection ConstantConditions + itemStack.getTagCompound().setLong("Charge", change); + listeners.forEach(l -> l.accept(itemStack, change)); + } + + public void setMaxChargeOverride(long maxCharge) { + if (!itemStack.hasTagCompound()) { + itemStack.setTagCompound(new NBTTagCompound()); + } + // noinspection ConstantConditions + itemStack.getTagCompound().setLong("MaxCharge", maxCharge); + } + + @Override + public long getTransferLimit() { + return GTValues.V[getTier()]; + } + + @Override + public long getMaxCharge() { + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (tagCompound == null) + return maxCharge; + if (tagCompound.hasKey("MaxCharge", Constants.NBT.TAG_LONG)) + return tagCompound.getLong("MaxCharge"); + return maxCharge; + } + + + public UUID getPlayerUUID() { + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (tagCompound == null) + return null; + return tagCompound.getUniqueId("playerUUID"); + } + + public boolean getInitialized() { + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (tagCompound == null) + return false; + return tagCompound.getBoolean("initialized"); + } + + public String getPlayerName() { + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (tagCompound == null) + return null; + return tagCompound.getString("playerName"); + } + + + public void setPlayerUUID(UUID uuid) { + if (!itemStack.hasTagCompound()) { + itemStack.setTagCompound(new NBTTagCompound()); + } + + itemStack.getTagCompound().setUniqueId("playerUUID", uuid); + } + + public void setInitialized(boolean initialized) { + if (!itemStack.hasTagCompound()) { + itemStack.setTagCompound(new NBTTagCompound()); + } + + itemStack.getTagCompound().setBoolean("initialized", initialized); + } + + public void setPlayerName(String name) { + if (!itemStack.hasTagCompound()) { + itemStack.setTagCompound(new NBTTagCompound()); + } + + itemStack.getTagCompound().setString("playerName", name); + } + + public long getCharge() { + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (tagCompound == null) + return 0; + if (tagCompound.getBoolean("Infinite")) + return getMaxCharge(); + return Math.min(tagCompound.getLong("Charge"), getMaxCharge()); + } + + public void setInfiniteCharge(boolean infiniteCharge) { + if (!itemStack.hasTagCompound()) { + itemStack.setTagCompound(new NBTTagCompound()); + } + // noinspection ConstantConditions + itemStack.getTagCompound().setBoolean("Infinite", infiniteCharge); + listeners.forEach(l -> l.accept(itemStack, getMaxCharge())); + } + + @Override + public boolean canProvideChargeExternally() { + return this.canProvideEnergyExternally; + } + + @Override + public boolean chargeable() { + return chargeable; + } + + @Override + public long charge(long amount, int chargerTier, boolean ignoreTransferLimit, boolean simulate) { + if (itemStack.getCount() != 1) { + return 0L; + } + if ((chargeable || amount == Long.MAX_VALUE) && (chargerTier >= tier) && amount > 0L) { + long canReceive = getMaxCharge() - getCharge(); + if (!ignoreTransferLimit) { + amount = Math.min(amount, getTransferLimit()); + } + long charged = Math.min(amount, canReceive); + if (!simulate) { + setCharge(getCharge() + charged); + } + return charged; + } + return 0; + } + + @Override + public long discharge(long amount, int chargerTier, boolean ignoreTransferLimit, boolean externally, + boolean simulate) { + if (itemStack.getCount() != 1) { + return 0L; + } + if ((canProvideEnergyExternally || !externally || amount == Long.MAX_VALUE) && (chargerTier >= tier) && + amount > 0L) { + if (!ignoreTransferLimit) { + amount = Math.min(amount, getTransferLimit()); + } + long charge = getCharge(); + long discharged = Math.min(amount, charge); + if (!simulate) { + setCharge(charge - discharged); + } + return discharged; + } + return 0; + } + + @Override + public int getTier() { + return tier; + } + + @Override + public boolean hasCapability(@NotNull Capability capability, @Nullable EnumFacing facing) { + return capability == GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM; + } + + @Nullable + @Override + public T getCapability(@NotNull Capability capability, @Nullable EnumFacing facing) { + return capability == GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM ? (T) this : null; + } +} \ No newline at end of file diff --git a/src/main/java/com/fulltrix/gcyl/api/items/WirelessElectricStats.java b/src/main/java/com/fulltrix/gcyl/api/items/WirelessElectricStats.java new file mode 100644 index 00000000..6d7c366c --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/items/WirelessElectricStats.java @@ -0,0 +1,279 @@ +package com.fulltrix.gcyl.api.items; + +import com.fulltrix.gcyl.api.util.VirtualEnergyRegistry; +import gregtech.api.GTValues; +import gregtech.api.capability.FeCompat; +import gregtech.api.capability.GregtechCapabilities; +import gregtech.api.capability.IElectricItem; +import gregtech.api.capability.impl.ElectricItem; +import gregtech.api.items.metaitem.ElectricStats; +import gregtech.api.items.metaitem.stats.*; +import gregtech.api.util.Mods; +import gregtech.api.util.TextComponentUtil; +import gregtech.common.ConfigHolder; +import gregtech.integration.baubles.BaublesModule; + +import net.minecraft.client.resources.I18n; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.NonNullList; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.minecraftforge.energy.CapabilityEnergy; +import net.minecraftforge.energy.IEnergyStorage; + +import java.time.Duration; +import java.time.Instant; +import java.util.List; +import java.util.Objects; +import java.util.UUID; + +public class WirelessElectricStats implements IItemComponent, IItemCapabilityProvider, IItemMaxStackSizeProvider, + IItemBehaviour, ISubItemHandler { + + public static final ElectricStats EMPTY = new ElectricStats(0, 0, false, false); + + public final long maxCharge; + public final int tier; + + public final boolean chargeable; + public final boolean dischargeable; + + public WirelessElectricStats(long maxCharge, long tier, boolean chargeable, boolean dischargeable) { + this.maxCharge = maxCharge; + this.tier = (int) tier; + this.chargeable = chargeable; + this.dischargeable = dischargeable; + } + + @Override + public ActionResult onItemRightClick(World world, EntityPlayer player, EnumHand hand) { + ItemStack itemStack = player.getHeldItem(hand); + WirelessElectricItem electricItem = (WirelessElectricItem) itemStack.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null); + + if (electricItem != null && electricItem.canProvideChargeExternally() && player.isSneaking() && !electricItem.getInitialized()) { + if (!world.isRemote) { + boolean isInDischargeMode = isInDischargeMode(itemStack); + setInDischargeMode(itemStack, !isInDischargeMode); + electricItem.setPlayerUUID(player.getUniqueID()); + electricItem.setInitialized(true); + electricItem.setPlayerName(player.getName()); + player.sendStatusMessage(new TextComponentTranslation("gcyl.wireless_initialized_private"), true); + } + return ActionResult.newResult(EnumActionResult.SUCCESS, itemStack); + } + + if (electricItem != null && electricItem.canProvideChargeExternally() && !electricItem.getInitialized()) { + if (!world.isRemote) { + boolean isInDischargeMode = isInDischargeMode(itemStack); + setInDischargeMode(itemStack, !isInDischargeMode); + electricItem.setPlayerUUID(new UUID(0,0)); + electricItem.setInitialized(true); + electricItem.setPlayerName("public"); + player.sendStatusMessage(new TextComponentTranslation("gcyl.wireless_initialized_public"), true); + } + return ActionResult.newResult(EnumActionResult.SUCCESS, itemStack); + } + return ActionResult.newResult(EnumActionResult.PASS, itemStack); + + } + + @Override + public void onUpdate(ItemStack itemStack, Entity entity) { + WirelessElectricItem electricItem = (WirelessElectricItem) itemStack.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null); + + if (!entity.world.isRemote && entity instanceof EntityPlayer entityPlayer && electricItem != null && electricItem.canProvideChargeExternally() && + isInDischargeMode(itemStack) && electricItem.getCharge() != electricItem.getMaxCharge() && electricItem.getInitialized()) { + VirtualEnergyRegistry.VirtualEnergyContainer virtualEnergyContainer = VirtualEnergyRegistry.getContainerCreate(makeEnergyContainerName(), electricItem.getPlayerUUID()); + if(virtualEnergyContainer.getEnergyStored() > electricItem.getTransferLimit()) { + virtualEnergyContainer.remove(electricItem.charge(electricItem.getTransferLimit(), GTValues.MAX, true, false)); + } + } + + if (!entity.world.isRemote && entity instanceof EntityPlayer entityPlayer && electricItem != null && + electricItem.canProvideChargeExternally() && + isInDischargeMode(itemStack) && electricItem.getCharge() > 0L) { + + IInventory inventoryPlayer = entityPlayer.inventory; + long transferLimit = electricItem.getTransferLimit(); + + if (Mods.Baubles.isModLoaded()) { + inventoryPlayer = BaublesModule.getBaublesWrappedInventory(entityPlayer); + } + + for (int i = 0; i < inventoryPlayer.getSizeInventory(); i++) { + ItemStack itemInSlot = inventoryPlayer.getStackInSlot(i); + IElectricItem slotElectricItem = itemInSlot.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, + null); + IEnergyStorage feEnergyItem = itemInSlot.getCapability(CapabilityEnergy.ENERGY, null); + if (slotElectricItem != null && !slotElectricItem.canProvideChargeExternally()) { + + long chargedAmount = chargeElectricItem(transferLimit, electricItem, slotElectricItem); + if (chargedAmount > 0L) { + transferLimit -= chargedAmount; + if (transferLimit == 0L) break; + } + } else if (ConfigHolder.compat.energy.nativeEUToFE && feEnergyItem != null) { + if (feEnergyItem.getEnergyStored() < feEnergyItem.getMaxEnergyStored()) { + int energyMissing = feEnergyItem.getMaxEnergyStored() - feEnergyItem.getEnergyStored(); + long euToCharge = FeCompat.toEu(energyMissing, ConfigHolder.compat.energy.feToEuRatio); + long energyToTransfer = Math.min(euToCharge, transferLimit); + long maxDischargeAmount = Math.min(energyToTransfer, + electricItem.discharge(energyToTransfer, electricItem.getTier(), false, true, true)); + FeCompat.insertEu(feEnergyItem, maxDischargeAmount); + electricItem.discharge(maxDischargeAmount, electricItem.getTier(), false, true, false); + } + } + } + } + } + + private static long chargeElectricItem(long maxDischargeAmount, IElectricItem source, IElectricItem target) { + long maxDischarged = source.discharge(maxDischargeAmount, source.getTier(), false, false, true); + long maxReceived = target.charge(maxDischarged, source.getTier(), false, true); + if (maxReceived > 0L) { + long resultDischarged = source.discharge(maxReceived, source.getTier(), false, true, false); + target.charge(resultDischarged, source.getTier(), false, false); + return resultDischarged; + } + return 0L; + } + + private static void setInDischargeMode(ItemStack itemStack, boolean isDischargeMode) { + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (isDischargeMode) { + if (tagCompound == null) { + tagCompound = new NBTTagCompound(); + itemStack.setTagCompound(tagCompound); + } + tagCompound.setBoolean("DischargeMode", true); + } else { + if (tagCompound != null) { + tagCompound.removeTag("DischargeMode"); + if (tagCompound.isEmpty()) { + itemStack.setTagCompound(null); + } + } + } + } + + @Override + public void addInformation(ItemStack itemStack, List lines) { + WirelessElectricItem electricItem = (WirelessElectricItem) itemStack.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null); + if (electricItem != null && electricItem.canProvideChargeExternally()) { + addTotalChargeTooltip(lines, electricItem.getMaxCharge(), electricItem.getTier()); + if(!isInitialized(itemStack)) { + lines.add(TextFormatting.RED + I18n.format("metaitem.wireless_electric.not_initialized.tooltip")); + } + else { + if (isPrivate(itemStack)) { + lines.add(TextFormatting.LIGHT_PURPLE + I18n.format("metaitem.wireless_electric.private.tooltip", electricItem.getPlayerName())); + } + else { + lines.add(TextFormatting.LIGHT_PURPLE + I18n.format("metaitem.wireless_electric.public.tooltip")); + } + } + if (isInDischargeMode(itemStack)) { + lines.add(I18n.format("metaitem.electric.discharge_mode.enabled")); + } + } + } + + private static void addTotalChargeTooltip(List tooltip, long maxCharge, int tier) { + Instant start = Instant.now(); + Instant end = Instant.now().plusSeconds((long) ((maxCharge * 1.0) / GTValues.V[tier] / 20)); + Duration duration = Duration.between(start, end); + + long chargeTime; + String unit; + if (duration.getSeconds() <= 180) { + chargeTime = duration.getSeconds(); + unit = I18n.format("metaitem.battery.charge_unit.second"); + } else if (duration.toMinutes() <= 180) { + chargeTime = duration.toMinutes(); + unit = I18n.format("metaitem.battery.charge_unit.minute"); + } else { + chargeTime = duration.toHours(); + unit = I18n.format("metaitem.battery.charge_unit.hour"); + } + tooltip.add(I18n.format("metaitem.battery.charge_time", chargeTime, unit, GTValues.VNF[tier])); + } + + private static boolean isInDischargeMode(ItemStack itemStack) { + NBTTagCompound tagCompound = itemStack.getTagCompound(); + return tagCompound != null && tagCompound.getBoolean("DischargeMode"); + } + + private static boolean isPrivate(ItemStack itemStack) { + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if(tagCompound == null) { + return false; + } + + return !tagCompound.getString("playerName").equals("public"); + } + + private static boolean isInitialized(ItemStack itemStack) { + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if(tagCompound == null) { + return false; + } + + return tagCompound.getBoolean("initialized"); + } + + @Override + public int getMaxStackSize(ItemStack itemStack, int defaultValue) { + WirelessElectricItem electricItem = (WirelessElectricItem) itemStack + .getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null); + if (electricItem == null || electricItem.getCharge() == 0) { + return defaultValue; + } + return 1; + } + + @Override + public String getItemSubType(ItemStack itemStack) { + return ""; + } + + @Override + public void getSubItems(ItemStack itemStack, CreativeTabs creativeTab, NonNullList subItems) { + ItemStack copy = itemStack.copy(); + IElectricItem electricItem = copy.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null); + if (electricItem != null) { + electricItem.charge(electricItem.getMaxCharge(), electricItem.getTier(), true, false); + subItems.add(copy); + } else { + subItems.add(itemStack); + } + } + + @Override + public ICapabilityProvider createProvider(ItemStack itemStack) { + return new WirelessElectricItem(itemStack, maxCharge, tier, chargeable, dischargeable); + } + + public static WirelessElectricStats createElectricItem(long maxCharge, long tier) { + return new WirelessElectricStats(maxCharge, tier, true, false); + } + + public static WirelessElectricStats createRechargeableBattery(long maxCharge, int tier) { + return new WirelessElectricStats(maxCharge, tier, true, true); + } + + public static WirelessElectricStats createBattery(long maxCharge, int tier, boolean rechargeable) { + return new WirelessElectricStats(maxCharge, tier, rechargeable, true); + } + + private String makeEnergyContainerName() {return "EContainer#";} +} diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/GCYLCleanroomType.java b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLCleanroomType.java new file mode 100644 index 00000000..469720b2 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLCleanroomType.java @@ -0,0 +1,10 @@ +package com.fulltrix.gcyl.api.multi; + +import gregtech.api.metatileentity.multiblock.CleanroomType; + +public class GCYLCleanroomType { + public static final CleanroomType ISO3 = new CleanroomType("cleanroom_iso_3","gcyl.recipe.cleanroom_iso_3.display_name"); + public static final CleanroomType ISO2 = new CleanroomType("cleanroom_iso_2","gcyl.recipe.cleanroom_iso_2.display_name"); + public static final CleanroomType ISO1 = new CleanroomType("cleanroom_iso_1","gcyl.recipe.cleanroom_iso_1.display_name"); + public static final CleanroomType ISO0 = new CleanroomType("cleanroom_iso_0","gcyl.recipe.cleanroom_iso_0.display_name"); +} diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/GCYLComputationRecipeLogic.java b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLComputationRecipeLogic.java new file mode 100644 index 00000000..cc376d8f --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLComputationRecipeLogic.java @@ -0,0 +1,49 @@ +package com.fulltrix.gcyl.api.multi; + +import gregicality.multiblocks.api.capability.IParallelMultiblock; +import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; +import gregicality.multiblocks.api.metatileentity.GCYMMultiblockAbility; +import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; +import gregicality.multiblocks.common.GCYMConfigHolder; +import gregtech.api.GTValues; +import gregtech.api.capability.impl.ComputationRecipeLogic; +import gregtech.api.metatileentity.ITieredMetaTileEntity; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class GCYLComputationRecipeLogic extends ComputationRecipeLogic { + + + public GCYLComputationRecipeLogic(RecipeMapMultiblockController metaTileEntity, ComputationType type) { + super(metaTileEntity, type); + } + + public @NotNull RecipeMapMultiblockController getMetaTileEntity() { + return (RecipeMapMultiblockController)super.getMetaTileEntity(); + } + + @Override + public int getParallelLimit() { + return this.metaTileEntity instanceof IParallelMultiblock && ((IParallelMultiblock)this.metaTileEntity).isParallel() ? ((IParallelMultiblock)this.metaTileEntity).getMaxParallel() : 1; + } + + @Override + public long getMaxVoltage() { + if (!GCYMConfigHolder.globalMultiblocks.enableTieredCasings) { + return super.getMaxVoltage(); + } else { + RecipeMapMultiblockController var2 = this.getMetaTileEntity(); + if (var2 instanceof GCYMRecipeMapMultiblockController) { + GCYMRecipeMapMultiblockController controller = (GCYMRecipeMapMultiblockController)var2; + if (!controller.isTiered()) { + return super.getMaxVoltage(); + } + } + + List list = this.getMetaTileEntity().getAbilities(GCYMMultiblockAbility.TIERED_HATCH); + return list.isEmpty() ? super.getMaxVoltage() : Math.min(GTValues.V[((ITieredMetaTileEntity)list.get(0)).getTier()], super.getMaxVoltage()); + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/GCYLMultiblockRecipeLogic.java b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLMultiblockRecipeLogic.java new file mode 100644 index 00000000..550705bc --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLMultiblockRecipeLogic.java @@ -0,0 +1,46 @@ +package com.fulltrix.gcyl.api.multi; + +import gregicality.multiblocks.api.capability.IParallelMultiblock; +import gregicality.multiblocks.api.metatileentity.GCYMMultiblockAbility; +import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; +import gregicality.multiblocks.common.GCYMConfigHolder; +import gregtech.api.GTValues; +import gregtech.api.capability.impl.MultiblockRecipeLogic; +import gregtech.api.metatileentity.ITieredMetaTileEntity; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class GCYLMultiblockRecipeLogic extends MultiblockRecipeLogic { + public GCYLMultiblockRecipeLogic(RecipeMapMultiblockController tileEntity, boolean hasPerfectOC) { + super(tileEntity, hasPerfectOC); + } + + @Override + public int getParallelLimit() { + return this.metaTileEntity instanceof IParallelMultiblock && ((IParallelMultiblock)this.metaTileEntity).isParallel() ? ((IParallelMultiblock)this.metaTileEntity).getMaxParallel() : 1; + } + + public @NotNull RecipeMapMultiblockController getMetaTileEntity() { + return (RecipeMapMultiblockController)super.getMetaTileEntity(); + } + + @Override + public long getMaxVoltage() { + if (!GCYMConfigHolder.globalMultiblocks.enableTieredCasings) { + return super.getMaxVoltage(); + } else { + RecipeMapMultiblockController var2 = this.getMetaTileEntity(); + if (var2 instanceof GCYMRecipeMapMultiblockController) { + GCYMRecipeMapMultiblockController controller = (GCYMRecipeMapMultiblockController)var2; + if (!controller.isTiered()) { + return super.getMaxVoltage(); + } + } + + List list = this.getMetaTileEntity().getAbilities(GCYMMultiblockAbility.TIERED_HATCH); + return list.isEmpty() ? super.getMaxVoltage() : Math.min(GTValues.V[((ITieredMetaTileEntity)list.get(0)).getTier()], super.getMaxVoltage()); + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/GCYLRecipeMapMultiblockController.java b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java similarity index 84% rename from src/main/java/com/fulltrix/gcyl/machines/multi/simple/GCYLRecipeMapMultiblockController.java rename to src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java index a66591fb..a8e7d35c 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/GCYLRecipeMapMultiblockController.java +++ b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java @@ -1,4 +1,4 @@ -package com.fulltrix.gcyl.machines.multi.simple; +package com.fulltrix.gcyl.api.multi; import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; import gregicality.multiblocks.api.metatileentity.GCYMMultiblockAbility; @@ -10,20 +10,26 @@ public abstract class GCYLRecipeMapMultiblockController extends GCYMRecipeMapMultiblockController { + private boolean isParallel; public GCYLRecipeMapMultiblockController(ResourceLocation metaTileEntityId, RecipeMap recipeMap, boolean isParallel) { this(metaTileEntityId, new RecipeMap[] {recipeMap}, isParallel); + this.isParallel = isParallel; } public GCYLRecipeMapMultiblockController(ResourceLocation metaTileEntityId, RecipeMap[] recipeMaps, boolean isParallel) { super(metaTileEntityId, recipeMaps); this.recipeMapWorkable = new GCYMMultiblockRecipeLogic(this); + this.isParallel = isParallel; } @Override public boolean isTiered() { return true; } + @Override + public boolean isParallel() {return this.isParallel; } + public static @NotNull TraceabilityPredicate tieredCasing() { return new TraceabilityPredicate(abilities(GCYMMultiblockAbility.TIERED_HATCH)); } diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/IOreFactoryProvider.java b/src/main/java/com/fulltrix/gcyl/api/multi/IOreFactoryProvider.java new file mode 100644 index 00000000..eacfeb86 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/multi/IOreFactoryProvider.java @@ -0,0 +1,17 @@ +package com.fulltrix.gcyl.api.multi; + +import gregtech.api.capability.IMultipleTankHandler; +import net.minecraftforge.items.IItemHandlerModifiable; + +public interface IOreFactoryProvider { + + boolean drainEnergy(boolean simulate); + + IMultipleTankHandler getImportFluidHandler(); + + IItemHandlerModifiable getOutputInventory(); + + IItemHandlerModifiable getInputInventory(); + + int getVoltageTier(); +} diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/ISpaceElevatorProvider.java b/src/main/java/com/fulltrix/gcyl/api/multi/ISpaceElevatorProvider.java new file mode 100644 index 00000000..4af707ad --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/multi/ISpaceElevatorProvider.java @@ -0,0 +1,14 @@ +package com.fulltrix.gcyl.api.multi; + +import gregtech.api.capability.IEnergyContainer; +import gregtech.api.capability.IOpticalComputationProvider; + +public interface ISpaceElevatorProvider { + int getMotorTier(); + + IEnergyContainer getEnergyContainerForModules(); + + boolean amIInTheList(ISpaceElevatorReceiver receiver); + + IOpticalComputationProvider getComputationProvider(); +} diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/ISpaceElevatorReceiver.java b/src/main/java/com/fulltrix/gcyl/api/multi/ISpaceElevatorReceiver.java new file mode 100644 index 00000000..e8cde56f --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/multi/ISpaceElevatorReceiver.java @@ -0,0 +1,17 @@ +package com.fulltrix.gcyl.api.multi; + +import org.jetbrains.annotations.Nullable; + +public interface ISpaceElevatorReceiver { + + @Nullable + ISpaceElevatorProvider getSpaceElevator(); + + void setSpaceElevator(ISpaceElevatorProvider provider); + + void sentWorkingDisabled(); + + void sentWorkingEnabled(); + + String getNameForDisplayCount(); +} diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/IVoidMinerProvider.java b/src/main/java/com/fulltrix/gcyl/api/multi/IVoidMinerProvider.java new file mode 100644 index 00000000..f62402ff --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/multi/IVoidMinerProvider.java @@ -0,0 +1,15 @@ +package com.fulltrix.gcyl.api.multi; + +import gregtech.api.capability.IMultipleTankHandler; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.items.IItemHandlerModifiable; + +public interface IVoidMinerProvider { + boolean drainEnergy(boolean simulate); + + IMultipleTankHandler getImportFluidHandler(); + + IMultipleTankHandler getExportFluidHandler(); + + IItemHandlerModifiable getOutputInventory(); +} diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/OreFactoryLogic.java b/src/main/java/com/fulltrix/gcyl/api/multi/OreFactoryLogic.java new file mode 100644 index 00000000..d938512b --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/multi/OreFactoryLogic.java @@ -0,0 +1,529 @@ +package com.fulltrix.gcyl.api.multi; + +import com.fulltrix.gcyl.Tags; +import com.fulltrix.gcyl.api.recipes.CachedRecipes; +import com.fulltrix.gcyl.machines.multi.advance.MetaTileEntityOreFactory; +import gregtech.api.capability.GregtechDataCodes; +import gregtech.api.capability.IMultipleTankHandler; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.multiblock.IMaintenance; +import gregtech.api.recipes.Recipe; +import gregtech.api.recipes.RecipeMap; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.Materials; +import gregtech.api.unification.ore.OrePrefix; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTTransferUtils; +import gregtech.api.util.GTUtility; +import gregtech.common.ConfigHolder; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.NonNullList; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.items.IItemHandlerModifiable; +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +import static gregtech.api.recipes.RecipeMaps.*; + +public class OreFactoryLogic { + private static final int MAX_PARALLEL = 2048; + private static final String MAX_PARALLEL_STRING = "UXV"; + private final MetaTileEntity metaTileEntity; + private final boolean hasMaintenance; + private boolean isActive; + private boolean isWorkingEnabled = true; + private boolean wasActiveAndNeedsUpdate; + private boolean hasNotEnoughEnergy; + private int maxProgress = 0; + private int progressTime = 0; + private int configuration = 0; + + private List input = new ArrayList<>(); + + public OreFactoryLogic(MetaTileEntityOreFactory metaTileEntity) { + this.metaTileEntity = metaTileEntity; + this.hasMaintenance = ConfigHolder.machines.enableMaintenance && + ((IMaintenance) metaTileEntity).hasMaintenanceMechanics(); + } + + protected void simulation(List drops, int fortuneLevel, RecipeMap map, int tier, List itemStack, List finalItemStack) { + if(itemStack != null) { + for (ItemStack item : itemStack) { + OrePrefix orePrefix = OreDictUnifier.getPrefix(item); + //Recipe recipe = map.findRecipe(32, Collections.singletonList(item), Collections.emptyList()); + Recipe recipe = null; + String metadata = item.getMetadata() + item.getItem().getCreatorModId(item); + if(map == THERMAL_CENTRIFUGE_RECIPES) { + if(orePrefix == OrePrefix.crushed) { + recipe = CachedRecipes.cachedThermalCentrifugeCrushedRecipes.get(metadata); + } else { + recipe = CachedRecipes.cachedThermalCentrifugeCrushedPurifiedRecipes.get(metadata); + } + } + else if(map == MACERATOR_RECIPES) { + if(orePrefix == OrePrefix.crushed) { + recipe = CachedRecipes.cachedMaceratorCrushedRecipes.get(metadata); + } else if(orePrefix == OrePrefix.crushedPurified) { + recipe = CachedRecipes.cachedMaceratorCrushedPurifiedRecipes.get(metadata); + } else { + recipe = CachedRecipes.cachedMaceratorCrushedCentrifugedRecipes.get(metadata); + } + } + else if(map == CENTRIFUGE_RECIPES) { + if(orePrefix == OrePrefix.dustPure) { + recipe = CachedRecipes.cachedCentrifugePureRecipes.get(metadata); + } else { + recipe = CachedRecipes.cachedCentrifugeImpureRecipes.get(metadata); + } + } + if (recipe != null && !recipe.getOutputs().isEmpty()) { + //for(int x = 0; x < item.getCount(); x++) { + for (ItemStack outputStack : recipe.getResultItemOutputs(GTUtility.getTierByVoltage(recipe.getEUt()), tier, map)) { + outputStack = outputStack.copy(); + if (fortuneLevel > 1) { + outputStack.setCount(outputStack.getCount() * fortuneLevel); + } + //if (OreDictUnifier.getPrefix(outputStack) == OrePrefix.dust || OreDictUnifier.getPrefix(outputStack) == OrePrefix.gemExquisite || OreDictUnifier.getPrefix(outputStack) == OrePrefix.gemFlawless || OreDictUnifier.getPrefix(outputStack) == OrePrefix.gem) { + if (OreDictUnifier.getPrefix(outputStack) == OrePrefix.dust) { + outputStack.setCount(outputStack.getCount() * item.getCount()); + finalItemStack.add(outputStack); + } else { + outputStack.setCount(outputStack.getCount() * item.getCount()); + drops.add(outputStack); + } + } + //} + } + } + } + } + + protected void simulationFirst(List drops, int fortuneLevel, int tier, List itemStack, List finalItemStack) { + if(itemStack != null) { + for (ItemStack item : itemStack) { + OrePrefix orePrefix = OreDictUnifier.getPrefix(item); + if(orePrefix == OrePrefix.ore || orePrefix == OrePrefix.oreNetherrack || orePrefix == OrePrefix.oreEndstone + || orePrefix == OrePrefix.oreGranite + || orePrefix == OrePrefix.oreAndesite + || orePrefix == OrePrefix.oreBlackgranite + || orePrefix == OrePrefix.oreRedgranite + || orePrefix == OrePrefix.oreBasalt + || orePrefix == OrePrefix.oreDiorite + || orePrefix == OrePrefix.oreMarble + || orePrefix == OrePrefix.oreSand + || orePrefix == OrePrefix.oreRedSand) { + //Recipe recipe = MACERATOR_RECIPES.findRecipe(32, Collections.singletonList(item), Collections.emptyList()); + Recipe recipe = CachedRecipes.cachedMaceratorOreRecipes.get(item.getItem()); + if (recipe != null && !recipe.getOutputs().isEmpty()) { + //for(int x = 0; x < item.getCount(); x++) { + for (ItemStack outputStack : recipe.getResultItemOutputs(GTUtility.getTierByVoltage(recipe.getEUt()), tier, MACERATOR_RECIPES)) { + outputStack = outputStack.copy(); + if (fortuneLevel > 1) { + outputStack.setCount(outputStack.getCount() * fortuneLevel); + } + //if (OreDictUnifier.getPrefix(outputStack) == OrePrefix.dust || OreDictUnifier.getPrefix(outputStack) == OrePrefix.gemExquisite || OreDictUnifier.getPrefix(outputStack) == OrePrefix.gemFlawless || OreDictUnifier.getPrefix(outputStack) == OrePrefix.gem) { + if (OreDictUnifier.getPrefix(outputStack) == OrePrefix.dust) { + outputStack.setCount(outputStack.getCount() * item.getCount()); + finalItemStack.add(outputStack); + } else { + outputStack.setCount(outputStack.getCount() * item.getCount()); + drops.add(outputStack); + } + } + //} + } + } + else { + if (fortuneLevel > 1) { + item.setCount(item.getCount() * fortuneLevel); + } + drops.add(item); + } + } + } + } + + protected void simulationWash(List drops, int fortuneLevel, int tier, List itemStack, List finalItemStack) { + if(itemStack != null) { + for (ItemStack item : itemStack) { + //Recipe recipe = ORE_WASHER_RECIPES.findRecipe(32, Collections.singletonList(item), Collections.singletonList(Materials.DistilledWater.getFluid(100))); + String metadata = item.getMetadata() + item.getItem().getCreatorModId(item); + Recipe recipe = CachedRecipes.cachedWasherRecipes.get(metadata); + if (recipe != null && !recipe.getOutputs().isEmpty()) { + //for(int x = 0; x < item.getCount(); x++) { + for (ItemStack outputStack : recipe.getResultItemOutputs(GTUtility.getTierByVoltage(recipe.getEUt()), tier, ORE_WASHER_RECIPES)) { + outputStack = outputStack.copy(); + if (fortuneLevel > 1) { + outputStack.setCount(outputStack.getCount() * fortuneLevel); + } + if (OreDictUnifier.getPrefix(outputStack) == OrePrefix.dust) { + outputStack.setCount(outputStack.getCount() * item.getCount()); + finalItemStack.add(outputStack); + } else { + outputStack.setCount(outputStack.getCount() * item.getCount()); + drops.add(outputStack); + } + } + //} + } + } + } + } + + public void updateLogic() { + if(!this.isWorkingEnabled) { + return; + } + + if (hasMaintenance && ((IMaintenance) metaTileEntity).getNumMaintenanceProblems() > 1) return; + + if(!consumeEnergy(true)) { + if (progressTime >= 2) { + if (ConfigHolder.machines.recipeProgressLowEnergy) this.progressTime = 1; + else this.progressTime = Math.max(1, progressTime - 2); + } + return; + } + + + if(!checkInput() && progressTime == 0) { + setActive(false); + return; + } + + + if(progressTime == 0 && !checkFluidInput(getInputInventory())) { + setActive(false); + return; + } + + + setActive(true); + + consumeEnergy(false); + + if (progressTime == 0) { + input = consumeGetInput(getInputInventory()); + } + + progressTime++; + if (progressTime % getMaxProgress() != 0) return; + progressTime = 0; + + List drops = NonNullList.create(); + List drops1 = NonNullList.create(); + List drops2 = NonNullList.create(); + List drops3 = NonNullList.create(); + List finalOutput = NonNullList.create(); + NonNullList finalOutput2 = NonNullList.create(); + + if (configuration == 0) { + simulationFirst(drops, calculateFortune(), getVoltageTier(), input, finalOutput); + simulationWash(drops1, 0, getVoltageTier(), drops, finalOutput); + simulation(drops2, 0, THERMAL_CENTRIFUGE_RECIPES, getVoltageTier(), drops1, finalOutput); + simulation(drops3, 0, MACERATOR_RECIPES, getVoltageTier(), drops2, finalOutput); + } + + if (configuration == 1) { + simulationFirst(drops, calculateFortune(), getVoltageTier(), input, finalOutput); + simulationWash(drops1, 0, getVoltageTier(), drops, finalOutput); + simulation(drops2, 0, MACERATOR_RECIPES, getVoltageTier(), drops1, finalOutput); + simulation(drops3, 0, CENTRIFUGE_RECIPES, getVoltageTier(), drops2, finalOutput); + } + + /* + if (configuration == 2) { + simulation(drops, 0, RecipeMap.getByName("macerator"), getVoltageTier(), input, finalOutput); + simulationWash(drops1, 0, RecipeMap.getByName("ore_washer"), getVoltageTier(), drops, finalOutput); + simulation(drops2, 0, RecipeMap.getByName("sifter"), getVoltageTier(), drops1, finalOutput); + } + */ + + if (configuration == 3) { + simulationFirst(drops, calculateFortune(), getVoltageTier(), input, finalOutput); + simulation(drops1, 0, MACERATOR_RECIPES, getVoltageTier(), drops, finalOutput); + simulation(drops2, 0, CENTRIFUGE_RECIPES, getVoltageTier(), drops1, finalOutput); + } + + if (configuration == 4) { + simulationFirst(drops, calculateFortune(), getVoltageTier(), input, finalOutput); + simulation(drops1, 0, THERMAL_CENTRIFUGE_RECIPES, getVoltageTier(), drops, finalOutput); + simulation(drops2, 0, MACERATOR_RECIPES, getVoltageTier(), drops1, finalOutput); + } + + + finalOutput2.addAll(finalOutput); + + + insertItems(finalOutput2); + + + } + + private void insertItems(NonNullList itemDrops) { + + GTTransferUtils.addItemsToItemHandler(getOutputInventory(), false, itemDrops); + + } + + public boolean checkFluidInput(IItemHandlerModifiable handler) { + int x = 0; + //int comparator = ORES_PER_VOTAGE_TIER * getVoltageTier(); + int comparator = getComparator(); + for (int i = 0; i < handler.getSlots(); i++) { + ItemStack itemStack = handler.getStackInSlot(i); + OrePrefix orePrefix = OreDictUnifier.getPrefix(itemStack); + if (!itemStack.isEmpty() && (orePrefix == OrePrefix.ore || orePrefix == OrePrefix.crushed || orePrefix == OrePrefix.oreNetherrack || orePrefix == OrePrefix.oreEndstone + || orePrefix == OrePrefix.oreGranite + || orePrefix == OrePrefix.oreAndesite + || orePrefix == OrePrefix.oreBlackgranite + || orePrefix == OrePrefix.oreRedgranite + || orePrefix == OrePrefix.oreBasalt + || orePrefix == OrePrefix.oreDiorite + || orePrefix == OrePrefix.oreMarble + || orePrefix == OrePrefix.oreSand + || orePrefix == OrePrefix.oreRedSand)) { + if (x < comparator) { + if (x + itemStack.getCount() >= comparator) { + x = comparator; + } else { + x += itemStack.getCount(); + } + } + } + } + + FluidStack canDrainDistilledWater = getImportFluidHandler().drain(Materials.DistilledWater.getFluid(100 * x), false); + FluidStack canDrainLubricant = getImportFluidHandler().drain(Materials.Lubricant.getFluid(x * 10), false); + + if(canDrainLubricant != null && canDrainDistilledWater != null ) { + return canDrainLubricant.isFluidStackIdentical(Materials.Lubricant.getFluid(x * 10)) + && canDrainDistilledWater.isFluidStackIdentical(Materials.DistilledWater.getFluid(100 * x)); + } + return false; + } + + public boolean checkInput() { + + for(int i = 0; i < getInputInventory().getSlots(); i++) { + ItemStack itemStack = getInputInventory().getStackInSlot(i); + OrePrefix orePrefix = OreDictUnifier.getPrefix(itemStack); + if (!itemStack.isEmpty() && (orePrefix == OrePrefix.ore || orePrefix == OrePrefix.crushed || orePrefix == OrePrefix.oreNetherrack || orePrefix == OrePrefix.oreEndstone + || orePrefix == OrePrefix.oreGranite + || orePrefix == OrePrefix.oreAndesite + || orePrefix == OrePrefix.oreBlackgranite + || orePrefix == OrePrefix.oreRedgranite + || orePrefix == OrePrefix.oreBasalt + || orePrefix == OrePrefix.oreDiorite + || orePrefix == OrePrefix.oreMarble + || orePrefix == OrePrefix.oreSand + || orePrefix == OrePrefix.oreRedSand)) { + return true; + } + } + return false; + } + + public List consumeGetInput(IItemHandlerModifiable handler) { + List itemStacks = new ArrayList<>(); + int x = 0; + //int comparator = ORES_PER_VOTAGE_TIER * getVoltageTier(); + int comparator = getComparator(); + for (int i = 0; i < handler.getSlots(); i++) { + OrePrefix orePrefix = OreDictUnifier.getPrefix(handler.getStackInSlot(i)); + if(orePrefix == OrePrefix.ore || orePrefix == OrePrefix.crushed || orePrefix == OrePrefix.oreNetherrack || orePrefix == OrePrefix.oreEndstone + || orePrefix == OrePrefix.oreGranite + || orePrefix == OrePrefix.oreAndesite + || orePrefix == OrePrefix.oreBlackgranite + || orePrefix == OrePrefix.oreRedgranite + || orePrefix == OrePrefix.oreBasalt + || orePrefix == OrePrefix.oreDiorite + || orePrefix == OrePrefix.oreMarble + || orePrefix == OrePrefix.oreSand + || orePrefix == OrePrefix.oreRedSand) { + if (x < comparator) { + if (x + handler.getStackInSlot(i).getCount() >= comparator) { + itemStacks.add(handler.extractItem(i, comparator - x, false)); + x += comparator - x; + } else { + x += handler.getStackInSlot(i).getCount(); + itemStacks.add(handler.extractItem(i, handler.getStackInSlot(i).getCount(), false)); + } + } + } + } + + getImportFluidHandler().drain(Materials.DistilledWater.getFluid(100 * x), true); + getImportFluidHandler().drain(Materials.Lubricant.getFluid(x * 10), true); + + return itemStacks; + } + + public void setWorkingEnabled(boolean workingEnabled) { + this.isWorkingEnabled = workingEnabled; + this.metaTileEntity.markDirty(); + World world = this.metaTileEntity.getWorld(); + if (world != null && !world.isRemote) { + this.metaTileEntity.writeCustomData(GregtechDataCodes.WORKING_ENABLED, + buf -> buf.writeBoolean(workingEnabled)); + } + } + + protected boolean consumeEnergy(boolean simulate) { + return ((IOreFactoryProvider) metaTileEntity).drainEnergy(simulate); + } + + protected IMultipleTankHandler getImportFluidHandler() { + return ((IOreFactoryProvider) metaTileEntity).getImportFluidHandler(); + } + + protected IItemHandlerModifiable getInputInventory() { + return ((IOreFactoryProvider) metaTileEntity).getInputInventory(); + } + + protected IItemHandlerModifiable getOutputInventory() { + return ((IOreFactoryProvider) metaTileEntity).getOutputInventory(); + } + + public void setConfiguration(int config) { + this.configuration = config; + } + + public int getConfiguration() { + return this.configuration; + } + + protected int getVoltageTier() { + return ((IOreFactoryProvider) metaTileEntity).getVoltageTier(); + } + + public int getComparator() { + return (int) Math.min(Math.max(Math.pow(2, getVoltageTier() - 1) , 1), MAX_PARALLEL); + } + + public int calculateFortune() { + if(getVoltageTier() > 12 && !metaTileEntity.getWorld().isRemote) { + int r = metaTileEntity.getWorld().rand.nextInt(100); + if(r > 49) { + return (int) ((getVoltageTier() - 11) / 2.0) + 1; + } + else { + return (int) ((getVoltageTier() - 12) / 2.0) + 1; + } + } + else return 0; + } + + public void invalidate() { + this.progressTime = 0; + this.maxProgress = 0; + this.input.clear(); + setActive(false); + } + + public boolean isActive() { + return this.isActive && isWorkingEnabled(); + } + + public void setActive(boolean active) { + if (this.isActive != active) { + this.isActive = active; + this.metaTileEntity.markDirty(); + World world = this.metaTileEntity.getWorld(); + if (world != null && !world.isRemote) { + this.metaTileEntity.writeCustomData(GregtechDataCodes.WORKABLE_ACTIVE, buf -> buf.writeBoolean(active)); + } + } + } + + public boolean wasActiveAndNeedsUpdate() { + return this.wasActiveAndNeedsUpdate; + } + + public void setWasActiveAndNeedsUpdate(boolean wasActiveAndNeedsUpdate) { + this.wasActiveAndNeedsUpdate = wasActiveAndNeedsUpdate; + } + + public boolean isWorkingEnabled() { + return isWorkingEnabled; + } + + public boolean isWorking() { + return isActive && !hasNotEnoughEnergy && isWorkingEnabled; + } + + public int getProgressTime() { + return this.progressTime; + } + + public void setMaxProgress(int maxProgress) { + this.maxProgress = maxProgress; + } + + public int getMaxProgress() { + return this.maxProgress; + } + + public int getProgressPercent() { + return (int) ((1.0F * getProgressTime() / getMaxProgress()) * 100); + } + + public int getMaxParallel() { + return MAX_PARALLEL; + } + + public String maxParallelTier() { + return MAX_PARALLEL_STRING; + } + + public NBTTagCompound writeToNBT(@NotNull NBTTagCompound data) { + data.setBoolean("isActive", this.isActive); + data.setBoolean("isWorkingEnabled", this.isWorkingEnabled); + data.setBoolean("wasActiveAndNeedsUpdate", this.wasActiveAndNeedsUpdate); + data.setInteger("progressTime", progressTime); + data.setInteger("maxProgress", maxProgress); + data.setInteger("configuration", this.configuration); + return data; + } + + public void readFromNBT(@NotNull NBTTagCompound data) { + this.isActive = data.getBoolean("isActive"); + this.isWorkingEnabled = data.getBoolean("isWorkingEnabled"); + this.wasActiveAndNeedsUpdate = data.getBoolean("wasActiveAndNeedsUpdate"); + this.progressTime = data.getInteger("progressTime"); + this.maxProgress = data.getInteger("maxProgress"); + this.configuration = data.getInteger("configuration"); + } + + public void writeInitialSyncData(@NotNull PacketBuffer buf) { + buf.writeBoolean(this.isActive); + buf.writeBoolean(this.isWorkingEnabled); + buf.writeBoolean(this.wasActiveAndNeedsUpdate); + buf.writeInt(this.progressTime); + buf.writeInt(this.maxProgress); + buf.writeInt(this.configuration); + } + + public void receiveInitialSyncData(@NotNull PacketBuffer buf) { + setActive(buf.readBoolean()); + setWorkingEnabled(buf.readBoolean()); + setWasActiveAndNeedsUpdate(buf.readBoolean()); + this.progressTime = buf.readInt(); + this.maxProgress = buf.readInt(); + this.configuration = buf.readInt(); + } + + public void receiveCustomData(int dataId, PacketBuffer buf) { + if (dataId == GregtechDataCodes.IS_WORKING) { + setActive(buf.readBoolean()); + metaTileEntity.scheduleRenderUpdate(); + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/VirtualMinerLogic.java b/src/main/java/com/fulltrix/gcyl/api/multi/VirtualMinerLogic.java new file mode 100644 index 00000000..02709e03 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/multi/VirtualMinerLogic.java @@ -0,0 +1,335 @@ +package com.fulltrix.gcyl.api.multi; + +import com.fulltrix.gcyl.api.worldgen.VirtualOreVeinHandler; +import com.fulltrix.gcyl.machines.multi.miner.virtual.MetaTileEntityVirtualMiner; +import gregtech.api.GTValues; +import gregtech.api.capability.GregtechDataCodes; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.ore.OrePrefix; +import gregtech.api.util.GTTransferUtils; +import gregtech.common.ConfigHolder; +import it.unimi.dsi.fastutil.objects.Object2ObjectMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.objects.ObjectList; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +//TODO finish implementing +public class VirtualMinerLogic { + + public static final int MAX_PROGRESS = 20; + + private int progressTime = 0; + + private final MetaTileEntityVirtualMiner metaTileEntity; + + private boolean isActive; + private boolean isWorkingEnabled = true; + private boolean wasActiveAndNeedsUpdate; + private boolean isDone = false; + protected boolean isInventoryFull; + + private boolean hasNotEnoughEnergy; + + private final Object2ObjectMap vein = new Object2ObjectOpenHashMap<>(); + + public VirtualMinerLogic(MetaTileEntityVirtualMiner metaTileEntity) { + this.metaTileEntity = metaTileEntity; + } + + public void performDrilling() { + if (metaTileEntity.getWorld().isRemote) return; + + ObjectList layers = metaTileEntity.getLayers(); + + // if we have no fluid, try to get a new one + if (vein.isEmpty()) + if (!acquireNewMaterials(layers)) + return; // stop if we still have no fluid + + // drills that cannot work do nothing + if (!this.isWorkingEnabled) + return; + + // check if drilling is possible + if (!checkCanDrain()) + return; + + for(int i = 0; i < layers.size(); i++) { + int amount = getProduce(i); + if(amount > 0) { + break; + } + + if(i == layers.size() - 1) { + if (this.isActive) + setActive(false); + return; + } + } + + // if the inventory is not full, drain energy etc. from the drill + // the storages have already been checked earlier + if (!isInventoryFull) { + // actually drain the energy + if(metaTileEntity.getTier() > 0) + consumeEnergy(false); + else if(metaTileEntity.getFuelBurnTimeLeft() == 0) { + consumeFuel(false); + } + + // since energy is being consumed the rig is now active + if (!this.isActive) + setActive(true); + } else { + // the rig cannot drain, therefore it is inactive + if (this.isActive) + setActive(false); + return; + } + + + // increase progress + progressTime++; + if(metaTileEntity.getTier() == 0) { + metaTileEntity.removeBurnTime(); + } + if (progressTime % MAX_PROGRESS != 0) + return; + progressTime = 0; + + useDrill(false); + + List stacks = new ArrayList<>(); + for(int i : layers) { + int amount = getProduce(i); + if(amount > 0) { + stacks.add(OreDictUnifier.get(metaTileEntity.getTier() == 0 ? OrePrefix.crushed : OrePrefix.ore, vein.get(i))); + depleteVein(i, amount); + } + } + + if (GTTransferUtils.addItemsToItemHandler(metaTileEntity.getExportItems(), true, stacks)) { + GTTransferUtils.addItemsToItemHandler(metaTileEntity.getExportItems(), false, stacks); + } else { + isInventoryFull = true; + setActive(false); + setWasActiveAndNeedsUpdate(true); + } + } + + protected void depleteVein(int layer, int amount) { + int chance = metaTileEntity.getDepletionChance(); + + // chance to deplete based on the rig + if (chance == 1 || GTValues.RNG.nextInt(chance) == 0) + VirtualOreVeinHandler.depleteVein(metaTileEntity.getWorld(), getChunkX(), getChunkZ(), amount, layer, false); + } + + protected boolean consumeEnergy(boolean simulate) { + return metaTileEntity.drainEnergy(simulate); + } + + protected boolean consumeFuel(boolean simulate) { + return metaTileEntity.consumeFuel(simulate); + } + + protected boolean useDrill(boolean simulate) { + return metaTileEntity.useDrill(simulate); + } + + private boolean acquireNewMaterials(ObjectList layers) { + + for(int i : layers) { + if(this.vein.get(i) == null) { + List materials = VirtualOreVeinHandler.getMaterialsInChunk(metaTileEntity.getWorld(), getChunkX(), getChunkZ()); + + if(materials != null && !materials.isEmpty()) { + this.vein.put(i, materials.get(i)); + } + } + } + + return !this.vein.isEmpty(); + } + + private void clearVein() { + this.vein.clear(); + } + + public int getProduce(int layer) { + + int remainingOperations = VirtualOreVeinHandler.getOperationsRemaining(metaTileEntity.getWorld(), getChunkX(), getChunkZ()).get(layer); + + int produced = 0; + + if(remainingOperations > 0) { + produced = metaTileEntity.getRigMultiplier(); + // Overclocks produce 50% more + if (isOverclocked()) { + produced = produced * 3 / 2; + } + } + + return produced; + } + + protected boolean checkCanDrain() { + if(metaTileEntity.getTier() != 0) { + if (!consumeEnergy(true)) { + if (progressTime >= 2) { + if (ConfigHolder.machines.recipeProgressLowEnergy) + this.progressTime = 1; + else + this.progressTime = Math.max(1, progressTime - 2); + + hasNotEnoughEnergy = true; + } + return false; + } + } else { + if (!consumeFuel(true)) { + return false; + } + } + + if(!useDrill(true)) { + return false; + } + + if (this.hasNotEnoughEnergy && metaTileEntity.getTier() != 0 && + metaTileEntity.getEnergyInputPerSecond() > 19L * GTValues.VA[metaTileEntity.getEnergyTier()]) { + this.hasNotEnoughEnergy = false; + } + + if (GTTransferUtils.addItemsToItemHandler(metaTileEntity.getExportItems(), true, new ArrayList<>(Collections.singletonList(new ItemStack(Blocks.COBBLESTONE, 64))))) { + this.isInventoryFull = false; + return true; + } + this.isInventoryFull = true; + + if (isActive()) { + setActive(false); + setWasActiveAndNeedsUpdate(true); + } + return false; + } + + public int getChunkX() { + return Math.floorDiv(metaTileEntity.getPos().getX(), 16); + } + + public int getChunkZ() { + return Math.floorDiv(metaTileEntity.getPos().getZ(), 16); + } + + public boolean isActive() { + return this.isActive; + } + + + public void setActive(boolean active) { + if (this.isActive != active) { + this.isActive = active; + this.metaTileEntity.markDirty(); + if (metaTileEntity.getWorld() != null && !metaTileEntity.getWorld().isRemote) { + this.metaTileEntity.writeCustomData(GregtechDataCodes.WORKABLE_ACTIVE, buf -> buf.writeBoolean(active)); + } + } + } + public void setWorkingEnabled(boolean isWorkingEnabled) { + if (this.isWorkingEnabled != isWorkingEnabled) { + this.isWorkingEnabled = isWorkingEnabled; + metaTileEntity.markDirty(); + if (metaTileEntity.getWorld() != null && !metaTileEntity.getWorld().isRemote) { + this.metaTileEntity.writeCustomData(GregtechDataCodes.WORKING_ENABLED, + buf -> buf.writeBoolean(isWorkingEnabled)); + } + } + } + + public boolean isWorkingEnabled() { + return isWorkingEnabled; + } + + public boolean isWorking() { + return isActive && !hasNotEnoughEnergy && isWorkingEnabled; + } + + public int getProgressTime() { + return this.progressTime; + } + + public double getProgressPercent() { + return getProgressTime() * 1.0 / MAX_PROGRESS; + } + + protected boolean isOverclocked() { + return metaTileEntity.getEnergyTier() > metaTileEntity.getTier(); + } + + public boolean isInventoryFull() { + return this.isInventoryFull; + } + + public NBTTagCompound writeToNBT(@NotNull NBTTagCompound data) { + data.setBoolean("isActive", this.isActive); + data.setBoolean("isWorkingEnabled", this.isWorkingEnabled); + data.setBoolean("wasActiveAndNeedsUpdate", this.wasActiveAndNeedsUpdate); + data.setBoolean("isDone", isDone); + data.setInteger("progressTime", progressTime); + data.setBoolean("isInventoryFull", isInventoryFull); + return data; + } + + public void readFromNBT(@NotNull NBTTagCompound data) { + this.isActive = data.getBoolean("isActive"); + this.isWorkingEnabled = data.getBoolean("isWorkingEnabled"); + this.wasActiveAndNeedsUpdate = data.getBoolean("wasActiveAndNeedsUpdate"); + this.isDone = data.getBoolean("isDone"); + this.progressTime = data.getInteger("progressTime"); + this.isInventoryFull = data.getBoolean("isInventoryFull"); + } + + public void writeInitialSyncData(@NotNull PacketBuffer buf) { + buf.writeBoolean(this.isActive); + buf.writeBoolean(this.isWorkingEnabled); + buf.writeBoolean(this.wasActiveAndNeedsUpdate); + buf.writeInt(this.progressTime); + buf.writeBoolean(this.isInventoryFull); + } + + public void receiveInitialSyncData(@NotNull PacketBuffer buf) { + setActive(buf.readBoolean()); + setWorkingEnabled(buf.readBoolean()); + setWasActiveAndNeedsUpdate(buf.readBoolean()); + this.progressTime = buf.readInt(); + this.isInventoryFull = buf.readBoolean(); + } + + public void receiveCustomData(int dataId, PacketBuffer buf) { + if (dataId == GregtechDataCodes.WORKABLE_ACTIVE) { + this.isActive = buf.readBoolean(); + metaTileEntity.scheduleRenderUpdate(); + } else if (dataId == GregtechDataCodes.WORKING_ENABLED) { + this.isWorkingEnabled = buf.readBoolean(); + metaTileEntity.scheduleRenderUpdate(); + } + } + + public boolean wasActiveAndNeedsUpdate() { + return this.wasActiveAndNeedsUpdate; + } + + public void setWasActiveAndNeedsUpdate(boolean wasActiveAndNeedsUpdate) { + this.wasActiveAndNeedsUpdate = wasActiveAndNeedsUpdate; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/VoidMinerLogic.java b/src/main/java/com/fulltrix/gcyl/api/multi/VoidMinerLogic.java new file mode 100644 index 00000000..6ae946ed --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/multi/VoidMinerLogic.java @@ -0,0 +1,358 @@ +package com.fulltrix.gcyl.api.multi; + +import com.fulltrix.gcyl.machines.multi.miner.MetaTileEntityVoidMiner; +import com.fulltrix.gcyl.materials.GCYLMaterials; +import gregtech.api.capability.GregtechDataCodes; +import gregtech.api.capability.IMultipleTankHandler; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.multiblock.ICleanroomProvider; +import gregtech.api.metatileentity.multiblock.IMaintenance; +import gregtech.common.ConfigHolder; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagDouble; +import net.minecraft.nbt.NBTTagInt; +import net.minecraft.network.PacketBuffer; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.items.IItemHandlerModifiable; +import org.jetbrains.annotations.NotNull; + +import java.util.Collections; +import java.util.List; + +import static com.fulltrix.gcyl.recipes.categories.handlers.VoidMinerHandler.*; +import static gregtech.api.util.GTTransferUtils.addItemsToItemHandler; + +public class VoidMinerLogic { + private static final int CONSUME_START = 100; + private static final float MUD_MULTIPLIER = 1.22F; + private final MetaTileEntity metaTileEntity; + private final int minEnergyTier; + private final boolean hasMaintenance; + private boolean fluidOutputFull; + private boolean isActive; + private boolean isWorkingEnabled = true; + private boolean wasActiveAndNeedsUpdate; + private boolean hasNotEnoughEnergy; + private boolean overheat = false; + private final int maxTemperature; + private int maxProgress = 0; + private int progressTime = 0; + private int temperature = 0; + private boolean usingPyrotheum = true; + private boolean hasConsume = false; + + private int currentDrillingFluid = CONSUME_START; + + public VoidMinerLogic(MetaTileEntityVoidMiner metaTileEntity, int tier, int temp) { + this.metaTileEntity = metaTileEntity; + this.minEnergyTier = tier; + this.hasMaintenance = ConfigHolder.machines.enableMaintenance && + ((IMaintenance) metaTileEntity).hasMaintenanceMechanics(); + this.maxTemperature = temp; + } + + public void updateLogic() { + if (!this.isWorkingEnabled) { + if(temperature > 0) { + temperature--; + } + return; + } + + // all maintenance problems not fixed means the machine does not run + if (hasMaintenance && ((IMaintenance) metaTileEntity).getNumMaintenanceProblems() > 1) return; + + // drain the energy + if (overheat || !consumeEnergy(true) || fluidOutputFull) { + if (temperature > 0) { + temperature -= (int) (currentDrillingFluid / 100.0); + } + if (temperature == 0) { + overheat = false; + } + + FluidStack usedDrillingMudFluid = GCYLMaterials.UsedDrillingMud.getFluid((int) currentDrillingFluid); + int canFillUsedDrillingMud = getExportFluidHandler().fill(usedDrillingMudFluid, false); + if(canFillUsedDrillingMud != 0 && canFillUsedDrillingMud == (int) currentDrillingFluid) { + fluidOutputFull = false; + } + + if (currentDrillingFluid > CONSUME_START) { + currentDrillingFluid = (int) (currentDrillingFluid / MUD_MULTIPLIER); + } + if (currentDrillingFluid < CONSUME_START) { + currentDrillingFluid = CONSUME_START; + } + + if (progressTime >= 2) { + if (ConfigHolder.machines.recipeProgressLowEnergy) this.progressTime = 1; + else this.progressTime = Math.max(1, progressTime - 2); + } + hasNotEnoughEnergy = true; + + if (isActive) + setActive(false); + } else { + if (temperature > maxTemperature) { + overheat = true; + currentDrillingFluid = CONSUME_START; + return; + } + + int otherAmounts = currentDrillingFluid / 10; + + FluidStack pyrotheumFluid = GCYLMaterials.Pyrotheum.getFluid(otherAmounts); + FluidStack cryotheumFluid = GCYLMaterials.Cryotheum.getFluid(otherAmounts); + FluidStack drillingMudFluid = GCYLMaterials.DrillingMud.getFluid((int) currentDrillingFluid); + FluidStack usedDrillingMudFluid = GCYLMaterials.UsedDrillingMud.getFluid((int) currentDrillingFluid); + FluidStack canDrainPyrotheum = getImportFluidHandler().drain(pyrotheumFluid, false); + FluidStack canDrainCryotheum = getImportFluidHandler().drain(cryotheumFluid, false); + FluidStack canDrainDrillingMud = getImportFluidHandler().drain(drillingMudFluid, false); + int canFillUsedDrillingMud = getExportFluidHandler().fill(usedDrillingMudFluid, false); + //consume fluid + if (canDrainDrillingMud != null && canDrainDrillingMud.amount == (int) currentDrillingFluid) { + if(canFillUsedDrillingMud != 0 && canFillUsedDrillingMud == (int) currentDrillingFluid) { + fluidOutputFull = false; + } else { + setActive(false); + fluidOutputFull = true; + } + } else { + setActive(false); + return; + } + + if (!isActive) + setActive(true); + + consumeEnergy(false); + + progressTime++; + if (progressTime % getMaxProgress() != 0) return; + progressTime = 0; + + getImportFluidHandler().drain(drillingMudFluid, true); + getExportFluidHandler().fill(usedDrillingMudFluid, true); + + if (usingPyrotheum && canDrainPyrotheum != null && canDrainPyrotheum.amount == otherAmounts) { + getImportFluidHandler().drain(pyrotheumFluid, true); + temperature += (int) (currentDrillingFluid / 100.0); + currentDrillingFluid = (int) (currentDrillingFluid * MUD_MULTIPLIER); + hasConsume = true; + } else if (temperature > 0 && canDrainCryotheum != null && canDrainCryotheum.amount == otherAmounts) { + getImportFluidHandler().drain(cryotheumFluid, true); + currentDrillingFluid = (int) (currentDrillingFluid / MUD_MULTIPLIER); + temperature -= (int) (currentDrillingFluid / 100.0); + } + if (temperature < 0) { + temperature = 0; + } + if (currentDrillingFluid < CONSUME_START) { + currentDrillingFluid = CONSUME_START; + } + + if(!hasConsume && usingPyrotheum) { + float v = (float) (((MUD_MULTIPLIER - Math.floor(MUD_MULTIPLIER)) / 2.0) + Math.floor(MUD_MULTIPLIER)); + temperature -= (int) (currentDrillingFluid / 200.0); + currentDrillingFluid = (int) (currentDrillingFluid / v); + if (temperature < 0) { + temperature = 0; + } + if (currentDrillingFluid < CONSUME_START) { + currentDrillingFluid = CONSUME_START; + } + return; + } + + usingPyrotheum = !usingPyrotheum; + int nbOres = temperature / 1000; + if (nbOres == 0) { + return; + } + + List ores = getOres(); + Collections.shuffle(ores); + ores.stream().limit(10).peek(itemStack -> itemStack.setCount(nbOres * nbOres)).forEach(itemStack -> addItemsToItemHandler(getOutputInventory(), false, Collections.singletonList(itemStack))); + //ores.stream().limit(10).peek(itemStack -> itemStack.setCount(metaTileEntity.getWorld().rand.nextInt(nbOres * nbOres) + 1)).forEach(itemStack -> addItemsToItemHandler(getOutputInventory(), false, Collections.singletonList(itemStack))); + + + } + } + + protected IMultipleTankHandler getImportFluidHandler() { + return ((IVoidMinerProvider) metaTileEntity).getImportFluidHandler(); + } + + protected IMultipleTankHandler getExportFluidHandler() { + return ((IVoidMinerProvider) metaTileEntity).getExportFluidHandler(); + } + + protected IItemHandlerModifiable getOutputInventory() { + return ((IVoidMinerProvider) metaTileEntity).getOutputInventory(); + } + + List getOres() { + return switch (this.minEnergyTier) { + case 8 -> ORES; + case 9 -> ORES_2; + default -> ORES_3; + }; + } + + + protected boolean consumeEnergy(boolean simulate) { + return ((IVoidMinerProvider) metaTileEntity).drainEnergy(simulate); + } + + public void invalidate() { + this.progressTime = 0; + this.maxProgress = 0; + setActive(false); + } + + public boolean isActive() { + return this.isActive && isWorkingEnabled(); + } + + public void setActive(boolean active) { + if (this.isActive != active) { + this.isActive = active; + this.metaTileEntity.markDirty(); + World world = this.metaTileEntity.getWorld(); + if (world != null && !world.isRemote) { + this.metaTileEntity.writeCustomData(GregtechDataCodes.WORKABLE_ACTIVE, buf -> buf.writeBoolean(active)); + } + } + } + + public void setWorkingEnabled(boolean workingEnabled) { + this.isWorkingEnabled = workingEnabled; + this.metaTileEntity.markDirty(); + World world = this.metaTileEntity.getWorld(); + if (world != null && !world.isRemote) { + this.metaTileEntity.writeCustomData(GregtechDataCodes.WORKING_ENABLED, + buf -> buf.writeBoolean(workingEnabled)); + } + } + + public boolean isWorkingEnabled() { + return isWorkingEnabled; + } + + public boolean isWorking() { + return isActive && !hasNotEnoughEnergy && isWorkingEnabled; + } + + public int getProgressTime() { + return this.progressTime; + } + + public void setMaxProgress(int maxProgress) { + this.maxProgress = maxProgress; + } + + public int getMaxProgress() { + return this.maxProgress; + } + + public int getProgressPercent() { + return (int) ((1.0F * getProgressTime() / getMaxProgress()) * 100); + } + + public NBTTagCompound writeToNBT(@NotNull NBTTagCompound data) { + data.setTag("temperature", new NBTTagInt(temperature)); + data.setTag("currentDrillingFluid", new NBTTagDouble(currentDrillingFluid)); + data.setTag("overheat", new NBTTagInt(overheat ? 1 : 0)); + data.setBoolean("isActive", this.isActive); + data.setBoolean("isWorkingEnabled", this.isWorkingEnabled); + data.setBoolean("wasActiveAndNeedsUpdate", this.wasActiveAndNeedsUpdate); + data.setBoolean("fluidOutputFull", this.fluidOutputFull); + data.setBoolean("usingPyrotheum", this.usingPyrotheum); + data.setBoolean("hasConsume", this.hasConsume); + data.setInteger("progressTime", progressTime); + data.setInteger("maxProgress", maxProgress); + return data; + } + + public void readFromNBT(@NotNull NBTTagCompound data) { + this.temperature = data.getInteger("temperature"); + this.currentDrillingFluid = data.getInteger("currentDrillingFluid"); + this.overheat = data.getInteger("overheat") != 0; + this.isActive = data.getBoolean("isActive"); + this.isWorkingEnabled = data.getBoolean("isWorkingEnabled"); + this.wasActiveAndNeedsUpdate = data.getBoolean("wasActiveAndNeedsUpdate"); + this.usingPyrotheum = data.getBoolean("usingPyrotheum"); + this.fluidOutputFull = data.getBoolean("fluidOutputFull"); + this.hasConsume = data.getBoolean("hasConsume"); + this.progressTime = data.getInteger("progressTime"); + this.maxProgress = data.getInteger("maxProgress"); + } + + public void writeInitialSyncData(@NotNull PacketBuffer buf) { + buf.writeBoolean(this.isActive); + buf.writeBoolean(this.isWorkingEnabled); + buf.writeBoolean(this.wasActiveAndNeedsUpdate); + buf.writeBoolean(this.overheat); + buf.writeBoolean(this.fluidOutputFull); + buf.writeBoolean(this.usingPyrotheum); + buf.writeBoolean(this.hasConsume); + buf.writeInt(this.progressTime); + buf.writeInt(this.maxProgress); + buf.writeInt(this.temperature); + buf.writeInt(this.currentDrillingFluid); + } + + public void receiveInitialSyncData(@NotNull PacketBuffer buf) { + setActive(buf.readBoolean()); + setWorkingEnabled(buf.readBoolean()); + setWasActiveAndNeedsUpdate(buf.readBoolean()); + this.overheat = buf.readBoolean(); + this.fluidOutputFull = buf.readBoolean(); + this.usingPyrotheum = buf.readBoolean(); + this.hasConsume = buf.readBoolean(); + this.progressTime = buf.readInt(); + this.maxProgress = buf.readInt(); + this.temperature = buf.readInt(); + this.currentDrillingFluid = buf.readInt(); + } + + public void receiveCustomData(int dataId, PacketBuffer buf) { + if (dataId == GregtechDataCodes.IS_WORKING) { + setActive(buf.readBoolean()); + metaTileEntity.scheduleRenderUpdate(); + } + } + + public boolean wasActiveAndNeedsUpdate() { + return this.wasActiveAndNeedsUpdate; + } + + public void setWasActiveAndNeedsUpdate(boolean wasActiveAndNeedsUpdate) { + this.wasActiveAndNeedsUpdate = wasActiveAndNeedsUpdate; + } + + public boolean isOverheat() { + return this.overheat; + } + + public boolean isFluidOutputFull() { + return this.fluidOutputFull; + } + + public int getTemperature() { + return this.temperature; + } + + public int getMaxTemperature() { + return this.maxTemperature; + } + + public int getCurrentDrillingFluid() { + return this.currentDrillingFluid; + } + + public float getMudMultiplier() { return MUD_MULTIPLIER; } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/abilities/GCYLAbilities.java b/src/main/java/com/fulltrix/gcyl/api/multi/abilities/GCYLAbilities.java new file mode 100644 index 00000000..fb6cbd21 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/multi/abilities/GCYLAbilities.java @@ -0,0 +1,10 @@ +package com.fulltrix.gcyl.api.multi.abilities; + +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import net.minecraftforge.items.IItemHandlerModifiable; + +import static gregtech.api.metatileentity.multiblock.MultiblockAbility.ability; + +public class GCYLAbilities { + public static final MultiblockAbility DRILL_HOLDER = ability("drill_holder", IItemHandlerModifiable.class); +} diff --git a/src/main/java/com/fulltrix/gcyl/api/pattern/GCYLTraceabilityPredicate.java b/src/main/java/com/fulltrix/gcyl/api/pattern/GCYLTraceabilityPredicate.java deleted file mode 100644 index 41681091..00000000 --- a/src/main/java/com/fulltrix/gcyl/api/pattern/GCYLTraceabilityPredicate.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.fulltrix.gcyl.api.pattern; - -import com.fulltrix.gcyl.api.GCYLAPI; -import com.fulltrix.gcyl.api.block.IFusionCoilBlockStats; -import gregtech.api.pattern.PatternStringError; -import gregtech.api.pattern.TraceabilityPredicate; -import gregtech.api.util.BlockInfo; -import net.minecraft.block.state.IBlockState; - -import java.util.Comparator; -import java.util.LinkedList; -import java.util.function.Supplier; - -public class GCYLTraceabilityPredicate { - public static Supplier FUSION_COILS = () -> new TraceabilityPredicate(blockWorldState -> { - IBlockState blockState = blockWorldState.getBlockState(); - if (GCYLAPI.FUSION_COILS.containsKey(blockState)) { - IFusionCoilBlockStats stats = GCYLAPI.FUSION_COILS.get(blockState); - Object currentCoil = blockWorldState.getMatchContext().getOrPut("CoilType", stats); - if (!currentCoil.equals(stats)) { - blockWorldState.setError(new PatternStringError("gregtech.multiblock.pattern.error.coils")); - return false; - } - blockWorldState.getMatchContext().getOrPut("VABlock", new LinkedList<>()).add(blockWorldState.getPos()); - return true; - } - return false; - }, () -> GCYLAPI.FUSION_COILS.entrySet().stream() - // sort to make autogenerated jei previews not pick random coils each game load - .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) - .map(entry -> new BlockInfo(entry.getKey(), null)) - .toArray(BlockInfo[]::new)) - .addTooltips("gregtech.multiblock.pattern.error.coils"); - - public GCYLTraceabilityPredicate() { - } - -} diff --git a/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java b/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java new file mode 100644 index 00000000..fc273d19 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java @@ -0,0 +1,145 @@ +package com.fulltrix.gcyl.api.pattern; + +import com.fulltrix.gcyl.api.GCYLAPI; +import com.fulltrix.gcyl.api.block.IComponentALTier; +import com.fulltrix.gcyl.api.block.IElevatorMotorTier; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.component_al.GCYLComponentALCasing; +import com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils; +import com.fulltrix.gcyl.blocks.metal.GCYLCleanroomCasing; +import gregtech.api.GregTechAPI; +import gregtech.api.block.ICleanroomFilter; +import gregtech.api.pattern.PatternStringError; +import gregtech.api.pattern.TraceabilityPredicate; +import gregtech.api.util.BlockInfo; +import gregtech.common.blocks.BlockCleanroomCasing; +import gregtech.common.blocks.MetaBlocks; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import org.apache.commons.lang3.ArrayUtils; + +import java.util.Arrays; +import java.util.Comparator; +import java.util.LinkedList; +import java.util.function.Supplier; + +public class TraceabilityPredicates { + private static final Supplier ADV_FUSION_COIL_PRED = + () -> new TraceabilityPredicate(blockWorldState -> { + IBlockState blockState = blockWorldState.getBlockState(); + Block block = blockState.getBlock(); + if (block instanceof GCYLFusionCoils) { + GCYLFusionCoils.CasingType casingType = ((GCYLFusionCoils) blockState.getBlock()).getState(blockState); + Object coil = blockWorldState.getMatchContext().getOrPut("AdvFusionCoilTier", casingType); + if (!coil.toString().equals(casingType.getName())) { + blockWorldState.setError(new PatternStringError("gregtech.multiblock.pattern.error.adv_fusion_coils")); + return false; + } + blockWorldState.getMatchContext().getOrPut("VABlock", new LinkedList<>()).add(blockWorldState.getPos()); + return true; + } + return false; + }, () -> ArrayUtils.addAll( + Arrays.stream(GCYLFusionCoils.CasingType.values()) + .map(type -> new BlockInfo(GCYLMetaBlocks.FUSION_COILS.getState(type), null)) + .toArray(BlockInfo[]::new))) + .addTooltips(""); + + private static final Supplier FILTER_CASING_PRED = + () -> new TraceabilityPredicate(blockWorldState -> { + IBlockState blockState = blockWorldState.getBlockState(); + if (GregTechAPI.CLEANROOM_FILTERS.containsKey(blockState)) { + ICleanroomFilter cleanroomFilter = GregTechAPI.CLEANROOM_FILTERS.get(blockState); + if (cleanroomFilter.getCleanroomType() == null) return false; + + ICleanroomFilter currentFilter = blockWorldState.getMatchContext().getOrPut("FilterType", + cleanroomFilter); + if (!currentFilter.getCleanroomType().equals(cleanroomFilter.getCleanroomType())) { + blockWorldState.setError(new PatternStringError("gregtech.multiblock.pattern.error.filters")); + return false; + } + blockWorldState.getMatchContext().getOrPut("VABlock", new LinkedList<>()).add(blockWorldState.getPos()); + return true; + } + + if (GCYLAPI.GCYL_FILTER_CASINGS.containsKey(blockState)) { + ICleanroomFilter cleanroomFilter = GCYLAPI.GCYL_FILTER_CASINGS.get(blockState); + if (cleanroomFilter.getCleanroomType() == null) return false; + + ICleanroomFilter currentFilter = blockWorldState.getMatchContext().getOrPut("FilterType", + cleanroomFilter); + + if (!currentFilter.getCleanroomType().equals(cleanroomFilter.getCleanroomType())) { + blockWorldState.setError(new PatternStringError("gregtech.multiblock.pattern.error.filters")); + return false; + } else { + blockWorldState.getMatchContext().getOrPut("VABlock", new LinkedList<>()).add(blockWorldState.getPos()); + return true; + } + } + return false; + }, () -> ArrayUtils.addAll( + GregTechAPI.CLEANROOM_FILTERS.entrySet().stream() + .filter(entry -> entry.getValue().getCleanroomType() != null) + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .map(entry -> new BlockInfo(entry.getKey(), null)) + .toArray(BlockInfo[]::new), + GCYLAPI.GCYL_FILTER_CASINGS.entrySet().stream() + .filter(entry -> entry.getValue().getCleanroomType() != null) + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .map(entry -> new BlockInfo(entry.getKey(), null)) + .toArray(BlockInfo[]::new))) + .addTooltips("gregtech.multiblock.pattern.error.filters"); + + private static final Supplier COMPONENT_AL_PREDICATE = + () -> new TraceabilityPredicate(blockWorldState -> { + IBlockState blockState = blockWorldState.getBlockState(); + if (GCYLAPI.COMPONENT_AL_CASINGS.containsKey(blockState)) { + IComponentALTier tier = GCYLAPI.COMPONENT_AL_CASINGS.get(blockState); + Object casing = blockWorldState.getMatchContext().getOrPut("ComponentALTier", tier); + if (!casing.equals(tier)) { + blockWorldState.setError(new PatternStringError("gregtech.multiblock.pattern.error.component_al_tier")); + return false; + } + blockWorldState.getMatchContext().getOrPut("VBlock", new LinkedList<>()).add(blockWorldState.getPos()); + return true; + } + return false; + }, () -> GCYLAPI.COMPONENT_AL_CASINGS.entrySet().stream() + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .map(entry -> new BlockInfo(entry.getKey(), null)) + .toArray(BlockInfo[]::new)) + .addTooltips("gcyl.multiblock.pattern.error.component_al_casings"); + + private static final Supplier ELEVATOR_MOTOR_PREDICATE = + () -> new TraceabilityPredicate(blockWorldState -> { + IBlockState blockState = blockWorldState.getBlockState(); + if (GCYLAPI.ELEVATOR_MOTORS.containsKey(blockState)) { + IElevatorMotorTier tier = GCYLAPI.ELEVATOR_MOTORS.get(blockState); + Object casing = blockWorldState.getMatchContext().getOrPut("ElevatorMotorTier", tier); + if (!casing.equals(tier)) { + blockWorldState.setError(new PatternStringError("gregtech.multiblock.pattern.error.elevator_motor_tier")); + return false; + } + blockWorldState.getMatchContext().getOrPut("VBlock", new LinkedList<>()).add(blockWorldState.getPos()); + return true; + } + return false; + }, () -> GCYLAPI.ELEVATOR_MOTORS.entrySet().stream() + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .map(entry -> new BlockInfo(entry.getKey(), null)) + .toArray(BlockInfo[]::new)) + .addTooltips("gcyl.multiblock.pattern.error.elevator_motor_tier"); + + public static TraceabilityPredicate advFusionCoils() { + return ADV_FUSION_COIL_PRED.get(); + } + + public static TraceabilityPredicate filterCasings() { return FILTER_CASING_PRED.get(); } + + public static TraceabilityPredicate componentALCasings() {return COMPONENT_AL_PREDICATE.get(); } + + public static TraceabilityPredicate elevatorMotors() {return ELEVATOR_MOTOR_PREDICATE.get(); } + + +} diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/CachedRecipes.java b/src/main/java/com/fulltrix/gcyl/api/recipes/CachedRecipes.java new file mode 100644 index 00000000..a1365476 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/CachedRecipes.java @@ -0,0 +1,170 @@ +package com.fulltrix.gcyl.api.recipes; + +import com.fulltrix.gcyl.Tags; +import gregtech.api.recipes.Recipe; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.Materials; +import gregtech.api.unification.material.properties.OreProperty; +import gregtech.api.unification.material.properties.PropertyKey; +import gregtech.api.unification.ore.OrePrefix; +import gregtech.api.unification.stack.UnificationEntry; +import gregtech.common.ConfigHolder; +import it.unimi.dsi.fastutil.objects.Object2ObjectMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import java.util.*; + +import static gregtech.api.recipes.RecipeMaps.*; + +public class CachedRecipes { + + private static List ores = new ArrayList<>(); + private static List crushed = new ArrayList<>(); + private static List crushedPurified = new ArrayList<>(); + private static List crushedCentrifuged = new ArrayList<>(); + private static List dustImpure = new ArrayList<>(); + private static List dustPure = new ArrayList<>(); + + public static Object2ObjectMap cachedMaceratorOreRecipes = new Object2ObjectOpenHashMap<>(); + public static Object2ObjectMap cachedMaceratorCrushedRecipes = new Object2ObjectOpenHashMap<>(); + public static Object2ObjectMap cachedMaceratorCrushedPurifiedRecipes = new Object2ObjectOpenHashMap<>(); + public static Object2ObjectMap cachedMaceratorCrushedCentrifugedRecipes = new Object2ObjectOpenHashMap<>(); + public static Object2ObjectMap cachedWasherRecipes = new Object2ObjectOpenHashMap<>(); + public static Object2ObjectMap cachedThermalCentrifugeCrushedRecipes = new Object2ObjectOpenHashMap<>(); + public static Object2ObjectMap cachedThermalCentrifugeCrushedPurifiedRecipes = new Object2ObjectOpenHashMap<>(); + public static Object2ObjectMap cachedCentrifugePureRecipes = new Object2ObjectOpenHashMap<>(); + public static Object2ObjectMap cachedCentrifugeImpureRecipes = new Object2ObjectOpenHashMap<>(); + + + public static void register() { + OrePrefix.ore.addProcessingHandler(PropertyKey.ORE, CachedRecipes::processOre); + OrePrefix.crushed.addProcessingHandler(PropertyKey.ORE, CachedRecipes::processCrushed); + OrePrefix.crushedPurified.addProcessingHandler(PropertyKey.ORE, CachedRecipes::processPurified); + OrePrefix.crushedCentrifuged.addProcessingHandler(PropertyKey.ORE, CachedRecipes::processCrushedCentrifuged); + OrePrefix.dustImpure.addProcessingHandler(PropertyKey.ORE, CachedRecipes::processDustImpure); + OrePrefix.dustPure.addProcessingHandler(PropertyKey.ORE, CachedRecipes::processDustPure); + } + + private static void processOre(OrePrefix orePrefix, Material material, OreProperty property) { + + OrePrefix currentOre = OrePrefix.ore; + + if (ConfigHolder.worldgen.allUniqueStoneTypes) { + + } + else + ores.add(OreDictUnifier.get(new UnificationEntry(currentOre, material))); + + } + + private static void processCrushed(OrePrefix orePrefix, Material material, OreProperty property) { + OrePrefix currentOre = OrePrefix.crushed; + + crushed.add(OreDictUnifier.get(currentOre, material)); + } + + private static void processPurified(OrePrefix orePrefix, Material material, OreProperty property) { + OrePrefix currentOre = OrePrefix.crushedPurified; + + crushedPurified.add(OreDictUnifier.get(currentOre, material)); + } + + private static void processCrushedCentrifuged(OrePrefix orePrefix, Material material, OreProperty property) { + OrePrefix currentOre = OrePrefix.crushedCentrifuged; + + crushedCentrifuged.add(OreDictUnifier.get(currentOre, material)); + } + + private static void processDustImpure(OrePrefix orePrefix, Material material, OreProperty property) { + OrePrefix currentOre = OrePrefix.dustImpure; + + dustImpure.add(OreDictUnifier.get(currentOre, material)); + } + + private static void processDustPure(OrePrefix orePrefix, Material material, OreProperty property) { + OrePrefix currentOre = OrePrefix.dustPure; + + dustPure.add(OreDictUnifier.get(currentOre, material)); + } + + + public static void cacheRecipesForOPF() { + cacheMaceratorRecipes(); + cacheWasherRecipes(); + cacheThermalCentrifuge(); + cacheCentrifugeRecipes(); + } + + private static void cacheMaceratorRecipes() { + for(ItemStack item : ores) { + Recipe recipe = MACERATOR_RECIPES.findRecipe(32, Collections.singletonList(item), Collections.emptyList()); + cachedMaceratorOreRecipes.put(item.getItem(), recipe); + } + + for(ItemStack item : crushed) { + Recipe recipe = MACERATOR_RECIPES.findRecipe(32, Collections.singletonList(item), Collections.emptyList()); + + cachedMaceratorCrushedRecipes.put(item.getMetadata() + item.getItem().getCreatorModId(item), recipe); + } + + for(ItemStack item : crushedPurified) { + Recipe recipe = MACERATOR_RECIPES.findRecipe(32, Collections.singletonList(item), Collections.emptyList()); + + cachedMaceratorCrushedPurifiedRecipes.put(item.getMetadata() + item.getItem().getCreatorModId(item), recipe); + + } + + for(ItemStack item : crushedCentrifuged) { + Recipe recipe = MACERATOR_RECIPES.findRecipe(32, Collections.singletonList(item), Collections.emptyList()); + + + cachedMaceratorCrushedCentrifugedRecipes.put(item.getMetadata() + item.getItem().getCreatorModId(item), recipe); + + } + } + + private static void cacheWasherRecipes() { + for(ItemStack item : crushed) { + Recipe recipe = ORE_WASHER_RECIPES.findRecipe(32, Collections.singletonList(item), Collections.singletonList(Materials.DistilledWater.getFluid(100))); + + cachedWasherRecipes.put(item.getMetadata() + item.getItem().getCreatorModId(item), recipe); + + } + } + + private static void cacheThermalCentrifuge() { + for(ItemStack item : crushedPurified) { + Recipe recipe = THERMAL_CENTRIFUGE_RECIPES.findRecipe(32, Collections.singletonList(item), Collections.emptyList()); + + cachedThermalCentrifugeCrushedPurifiedRecipes.put(item.getMetadata() + item.getItem().getCreatorModId(item), recipe); + + } + + for(ItemStack item : crushed) { + Recipe recipe = THERMAL_CENTRIFUGE_RECIPES.findRecipe(32, Collections.singletonList(item), Collections.emptyList()); + + cachedThermalCentrifugeCrushedRecipes.put(item.getMetadata() + item.getItem().getCreatorModId(item), recipe); + + } + } + + private static void cacheCentrifugeRecipes() { + for(ItemStack item : dustImpure) { + Recipe recipe = CENTRIFUGE_RECIPES.findRecipe(32, Collections.singletonList(item), Collections.emptyList()); + + cachedCentrifugeImpureRecipes.put(item.getMetadata() + item.getItem().getCreatorModId(item), recipe); + + } + + for(ItemStack item : dustPure) { + Recipe recipe = CENTRIFUGE_RECIPES.findRecipe(32, Collections.singletonList(item), Collections.emptyList()); + + cachedCentrifugePureRecipes.put(item.getMetadata() + item.getItem().getCreatorModId(item), recipe); + + } + } + +} diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/GCYLMaterialFlags.java b/src/main/java/com/fulltrix/gcyl/api/recipes/GCYLMaterialFlags.java new file mode 100644 index 00000000..23b004e0 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/GCYLMaterialFlags.java @@ -0,0 +1,16 @@ +package com.fulltrix.gcyl.api.recipes; + +import gregtech.api.unification.material.info.MaterialFlag; +import gregtech.api.unification.material.properties.PropertyKey; + +public class GCYLMaterialFlags { + + public static final MaterialFlag NO_MIXER_RECIPE; + + private GCYLMaterialFlags() { + } + + static { + NO_MIXER_RECIPE = (new MaterialFlag.Builder("no_mixer_recipes")).requireProps(new PropertyKey[]{PropertyKey.BLAST}).build(); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/GCYLMaterialRecipeHandler.java b/src/main/java/com/fulltrix/gcyl/api/recipes/GCYLMaterialRecipeHandler.java new file mode 100644 index 00000000..3cc03a25 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/GCYLMaterialRecipeHandler.java @@ -0,0 +1,24 @@ +package com.fulltrix.gcyl.api.recipes; + +import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.properties.PropertyKey; +import gregtech.api.unification.ore.OrePrefix; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class GCYLMaterialRecipeHandler { + + private GCYLMaterialRecipeHandler() {} + + public static void register() { + OrePrefix.dust.addProcessingHandler(GCYLPropertyKey.GENERATE_MIXER, GCYLMaterialRecipeHandler::generateMixerRecipes); + } + + public static void generateMixerRecipes(@Nullable OrePrefix unused, @NotNull Material material, + @NotNull MixerProperty property) { + if (material.hasProperty(PropertyKey.BLAST)) { + property.getRecipeProducer().produce(material, material.getProperty(PropertyKey.BLAST)); + } + } +} + diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/GCYLPropertyKey.java b/src/main/java/com/fulltrix/gcyl/api/recipes/GCYLPropertyKey.java new file mode 100644 index 00000000..417734e9 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/GCYLPropertyKey.java @@ -0,0 +1,13 @@ +package com.fulltrix.gcyl.api.recipes; + +import gregicality.multiblocks.api.unification.properties.AlloyBlastProperty; +import gregtech.api.unification.material.properties.PropertyKey; + +public class GCYLPropertyKey { + + public static final PropertyKey GENERATE_MIXER = new PropertyKey<>("mixer", MixerProperty.class); + + private GCYLPropertyKey() { + } + +} diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/GCYLRecipeMaps.java b/src/main/java/com/fulltrix/gcyl/api/recipes/GCYLRecipeMaps.java new file mode 100644 index 00000000..b870955a --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/GCYLRecipeMaps.java @@ -0,0 +1,226 @@ +package com.fulltrix.gcyl.api.recipes; + +//import com.fulltrix.tjfcore.recipes.impl.NuclearReactorBuilder; + +import com.fulltrix.gcyl.api.recipes.builders.AdvFusionRecipeBuilder; +import com.fulltrix.gcyl.api.recipes.builders.ComponentALRecipeBuilder; +import com.fulltrix.gcyl.api.recipes.builders.DeepMinerBuilder; +import com.fulltrix.gcyl.api.recipes.builders.LaserMinerBuilder; +import com.fulltrix.gcyl.api.recipes.ui.ComponentALRecipeUI; +import gregtech.api.GTValues; +import gregtech.api.gui.GuiTextures; +import gregtech.api.gui.widgets.ProgressWidget; +import gregtech.api.gui.widgets.ProgressWidget.MoveType; +import gregtech.api.recipes.RecipeMap; +import gregtech.api.recipes.RecipeMapBuilder; +import gregtech.api.recipes.builders.ComputationRecipeBuilder; +import gregtech.api.recipes.builders.FuelRecipeBuilder; +import gregtech.api.recipes.builders.SimpleRecipeBuilder; +import gregtech.core.sound.GTSoundEvents; +import net.minecraft.init.SoundEvents; + +import static supercritical.api.recipes.SCRecipeMaps.GAS_CENTRIFUGE_RECIPES; +import static gregtech.api.recipes.RecipeMaps.*; + +public final class GCYLRecipeMaps { + + private GCYLRecipeMaps() { + } + + public static final RecipeMap BIO_REACTOR_RECIPES = new RecipeMapBuilder<>("bio_reactor", + new SimpleRecipeBuilder()) + .itemInputs(3) + .itemOutputs(3) + .fluidInputs(5) + .fluidOutputs(2) + .progressBar(GuiTextures.PROGRESS_BAR_ARROW_MULTIPLE) + .sound(GTSoundEvents.ELECTROLYZER) + .build(); + + public static final RecipeMap CHEMICAL_DEHYDRATOR_RECIPES = new RecipeMapBuilder<>("chemical_dehydrator", + new SimpleRecipeBuilder()) + .itemInputs(2) + .itemOutputs(9) + .fluidInputs(2) + .fluidOutputs(2) + .progressBar(GuiTextures.PROGRESS_BAR_SIFT, MoveType.VERTICAL_INVERTED) + .sound(SoundEvents.BLOCK_SAND_PLACE) + .build(); + + public static final RecipeMap DECAY_CHAMBERS_RECIPES = new RecipeMapBuilder<>("decay_chamber", + new SimpleRecipeBuilder()) + .itemInputs(2) + .itemOutputs(4) + .fluidInputs(1) + .fluidOutputs(1) + .progressBar(GuiTextures.PROGRESS_BAR_HAMMER, ProgressWidget.MoveType.VERTICAL) + .sound(GTSoundEvents.ARC) + .build(); + + public static final RecipeMap ADV_FUSION_RECIPES = new RecipeMapBuilder<>("adv_fusion", + new AdvFusionRecipeBuilder()) + .fluidInputs(3) + .fluidOutputs(3) + .progressBar(GuiTextures.PROGRESS_BAR_FUSION) + .sound(GTSoundEvents.ARC) + .build(); + + public static final RecipeMap STELLAR_FORGE_RECIPES = new RecipeMapBuilder<>("stellar_forge", + new SimpleRecipeBuilder()) + .itemInputs(3) + .itemOutputs(2) + .fluidInputs(3) + .fluidOutputs(2) + .progressBar(GuiTextures.PROGRESS_BAR_ARROW_MULTIPLE) + .sound(SoundEvents.ENTITY_GENERIC_EXPLODE) + .build(); + + public static final RecipeMap PLASMA_CONDENSER_RECIPES = new RecipeMapBuilder<>("plasma_condenser", + new SimpleRecipeBuilder()) + .itemInputs(2) + .itemOutputs(2) + .fluidInputs(2) + .fluidOutputs(2) + .progressBar(GuiTextures.PROGRESS_BAR_BATH, ProgressWidget.MoveType.HORIZONTAL) + .sound(GTSoundEvents.COOLING) + .build(); + + public static final RecipeMap CHEMICAL_PLANT_RECIPES = new RecipeMapBuilder<>("chemical_plant", + new SimpleRecipeBuilder()) + .itemInputs(6) + .itemOutputs(4) + .fluidInputs(5) + .fluidOutputs(4) + .progressBar(GuiTextures.PROGRESS_BAR_BATH, ProgressWidget.MoveType.HORIZONTAL) + .sound(GTSoundEvents.CHEMICAL_REACTOR) + .build(); + + public static final RecipeMap ELECTRIC_IMPLOSION_RECIPES = new RecipeMapBuilder<>("electric_implosion", + new SimpleRecipeBuilder().duration(1).EUt(GTValues.VA[GTValues.UEV])) + .itemInputs(2) + .itemOutputs(2) + .sound(SoundEvents.ENTITY_GENERIC_EXPLODE) + .build(); + + //TODO: implement recipe overlap with mixer map + public static final RecipeMap ADVANCED_MIXER_RECIPES = new RecipeMapBuilder<>("large_mixer", + new SimpleRecipeBuilder()) + .itemInputs(9) + .itemOutputs(1) + .fluidInputs(6) + .fluidOutputs(1) + .progressBar(GuiTextures.PROGRESS_BAR_MIXER, MoveType.CIRCULAR) + .sound(GTSoundEvents.MIXER) + .build(); + + //TODO: implement recipe overlap with centrifuge map + public static final RecipeMap ADVANCED_CENTRIFUGE_RECIPES = new RecipeMapBuilder<>("large_centrifuge", + new SimpleRecipeBuilder()) + .itemInputs(2) + .itemOutputs(6) + .fluidInputs(2) + .fluidOutputs(6) + .itemSlotOverlay(GuiTextures.EXTRACTOR_OVERLAY, false, false) + .itemSlotOverlay(GuiTextures.CANISTER_OVERLAY, false, true) + .fluidSlotOverlay(GuiTextures.CENTRIFUGE_OVERLAY, false, true) + .progressBar(GuiTextures.PROGRESS_BAR_EXTRACT, MoveType.HORIZONTAL) + .sound(GTSoundEvents.CENTRIFUGE) + .build(); + + //TODO: ? + /* + public static final RecipeMap ADVANCED_ENGRAVER_RECIPES = new RecipeMap<>("advanced_engraver", + 2, 2, 1, 1, new SimpleRecipeBuilder(), false) + .setSlotOverlay(false, false, true, GuiTextures.LENS_OVERLAY) + .setSound(GTSoundEvents.ELECTROLYZER); + + */ + + public static final RecipeMap HYPER_REACTOR_FUELS = new RecipeMapBuilder<>("hyper_reactor", + new FuelRecipeBuilder()) + .fluidInputs(1) + .allowEmptyOutputs() + .sound(GTSoundEvents.COOLING) + .build(); + + public static final RecipeMap NAQUADAH_REACTOR_FUELS = new RecipeMapBuilder<>("naquadah_reactor", + new FuelRecipeBuilder()) + .fluidInputs(1) + .allowEmptyOutputs() + .sound(GTSoundEvents.COOLING) + .build(); + + public static final RecipeMap ROCKET_FUEL_RECIPES = new RecipeMapBuilder<>("rocket_fuel", + new FuelRecipeBuilder()) + .fluidInputs(1) + .allowEmptyOutputs() + .sound(GTSoundEvents.COMBUSTION) + .build(); + + public static final RecipeMap DEEP_MINER_RECIPES = new RecipeMapBuilder<>("deep_miner", + new DeepMinerBuilder()) + .itemInputs(6) + .itemOutputs(12) + .fluidInputs(3) + .fluidOutputs(3) + .sound(GTSoundEvents.MINER) + .build(); + + public static final RecipeMap GREENHOUSE_RECIPES = new RecipeMapBuilder<>("greenhouse", + new SimpleRecipeBuilder()) + .itemInputs(3) + .itemOutputs(3) + .fluidInputs(2) + .build(); + + public static final RecipeMap LASER_MINER_RECIPES = new RecipeMapBuilder<>("laser_miner", + new LaserMinerBuilder()) + .itemInputs(4) + .itemOutputs(16) + .build(); + + public static final RecipeMap COSMIC_RAY_DETECTOR_RECIPES = new RecipeMapBuilder<>("cosmic_ray_detector", + new ComputationRecipeBuilder()) + .itemInputs(1) + .itemOutputs(9) + .fluidOutputs(1) + .sound(GTSoundEvents.ARC) + .build(); + + public static final RecipeMap FISHER_RECIPES = new RecipeMapBuilder<>("fisher", + new SimpleRecipeBuilder()) + .itemInputs(2) + .itemOutputs(6) + .sound(SoundEvents.ENTITY_BOAT_PADDLE_WATER) + .build(); + + public static final RecipeMap COMPONENT_AL_RECIPES = new RecipeMapComponentAL<>("component_al_recipes", + new ComponentALRecipeBuilder(), ComponentALRecipeUI::new); + + public static final RecipeMap ASSEMBLER_MODULE_RECIPES = new RecipeMapBuilder<>("assembler_module", + new SimpleRecipeBuilder()) + .itemInputs(16) + .itemOutputs(1) + .build(); + + + + public static void modifyMaps() { + LASER_ENGRAVER_RECIPES.setMaxFluidInputs(1); + LASER_ENGRAVER_RECIPES.setMaxFluidOutputs(1); + + BLAST_RECIPES.setMaxInputs(4); + + EXTRACTOR_RECIPES.setMaxInputs(2); + + GAS_CENTRIFUGE_RECIPES.setMaxFluidOutputs(3); + + CIRCUIT_ASSEMBLER_RECIPES.setMaxInputs(7); + + POLARIZER_RECIPES.setMaxFluidInputs(1); + POLARIZER_RECIPES.setMaxFluidOutputs(1); + + MIXER_RECIPES.setMaxOutputs(2); + } + +} diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/ITier.java b/src/main/java/com/fulltrix/gcyl/api/recipes/ITier.java new file mode 100644 index 00000000..916b6337 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/ITier.java @@ -0,0 +1,5 @@ +package com.fulltrix.gcyl.api.recipes; + +public interface ITier { + int getTier(); +} diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/MixerProperty.java b/src/main/java/com/fulltrix/gcyl/api/recipes/MixerProperty.java new file mode 100644 index 00000000..0a2770cd --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/MixerProperty.java @@ -0,0 +1,26 @@ +package com.fulltrix.gcyl.api.recipes; + +import gregicality.multiblocks.api.recipes.alloyblast.AlloyBlastRecipeProducer; +import gregtech.api.unification.material.properties.IMaterialProperty; +import gregtech.api.unification.material.properties.MaterialProperties; +import gregtech.api.unification.material.properties.PropertyKey; +import org.jetbrains.annotations.NotNull; + +public class MixerProperty implements IMaterialProperty { + private MixerRecipeProducer recipeProducer = MixerRecipeProducer.DEFAULT_PRODUCER; + + public MixerProperty() {} + + public @NotNull MixerRecipeProducer getRecipeProducer() { + return this.recipeProducer; + } + + public void setRecipeProducer(@NotNull MixerRecipeProducer recipeProducer) { + this.recipeProducer = recipeProducer; + } + + @Override + public void verifyProperty(MaterialProperties materialProperties) { + materialProperties.ensureSet(PropertyKey.BLAST); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/MixerPropertyAddition.java b/src/main/java/com/fulltrix/gcyl/api/recipes/MixerPropertyAddition.java new file mode 100644 index 00000000..59ee53a6 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/MixerPropertyAddition.java @@ -0,0 +1,42 @@ +package com.fulltrix.gcyl.api.recipes; + +import gregicality.multiblocks.api.unification.GCYMMaterialFlags; +import gregicality.multiblocks.api.unification.properties.AlloyBlastProperty; +import gregicality.multiblocks.api.unification.properties.AlloyBlastPropertyAddition; +import gregicality.multiblocks.api.unification.properties.GCYMPropertyKey; +import gregtech.api.GregTechAPI; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.properties.BlastProperty; +import gregtech.api.unification.material.properties.PropertyKey; +import gregtech.api.unification.stack.MaterialStack; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class MixerPropertyAddition { + + private MixerPropertyAddition() {} + + public static void init() { + for (Material material : GregTechAPI.materialManager.getRegisteredMaterials()) { + if (!material.hasFlag(GCYLMaterialFlags.NO_MIXER_RECIPE)) { + addMixerRecipeProperty(material); + } + } + } + + private static void addMixerRecipeProperty(@NotNull Material material) { + final List components = material.getMaterialComponents(); + // ignore materials which are not alloys + if (components.size() < 2) return; + + BlastProperty blastProperty = material.getProperty(PropertyKey.BLAST); + if (blastProperty == null) return; + + material.setProperty(GCYLPropertyKey.GENERATE_MIXER, new MixerProperty()); + } + + private static boolean isMaterialStackFluidOnly(@NotNull MaterialStack ms) { + return !ms.material.hasProperty(PropertyKey.DUST) && ms.material.hasProperty(PropertyKey.FLUID); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/MixerRecipeProducer.java b/src/main/java/com/fulltrix/gcyl/api/recipes/MixerRecipeProducer.java new file mode 100644 index 00000000..2f14427f --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/MixerRecipeProducer.java @@ -0,0 +1,110 @@ +package com.fulltrix.gcyl.api.recipes; + +import gregtech.api.GTValues; +import gregtech.api.recipes.RecipeBuilder; +import gregtech.api.recipes.RecipeMaps; +import gregtech.api.recipes.builders.SimpleRecipeBuilder; +import gregtech.api.recipes.ingredients.IntCircuitIngredient; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.properties.BlastProperty; +import gregtech.api.unification.material.properties.PropertyKey; +import gregtech.api.unification.ore.OrePrefix; +import gregtech.api.unification.stack.MaterialStack; +import net.minecraft.item.ItemStack; +import org.jetbrains.annotations.NotNull; + +import static gregtech.api.unification.ore.OrePrefix.dust; + +//TODO Fix recipe durations +public class MixerRecipeProducer { + + public static final MixerRecipeProducer DEFAULT_PRODUCER = new MixerRecipeProducer(); + + + public void produce(@NotNull Material material, @NotNull BlastProperty blastProperty) { + + final int componentAmount = material.getMaterialComponents().size(); + + if (componentAmount < 2) + return; + + //Item output = OreDictUnifier.get(dust, material, outputAmount); + + RecipeBuilder builder; + + if(componentAmount > 5) { + builder = createBuilder(blastProperty, material, true); + } + else { + builder = createBuilder(blastProperty, material, false); + } + + int outputAmount = addInputs(material, builder); + if (outputAmount <= 0) return; + + buildRecipes(OreDictUnifier.get(dust, material, outputAmount), outputAmount, componentAmount, builder); + + } + + @SuppressWarnings("MethodMayBeStatic") + protected @NotNull SimpleRecipeBuilder createBuilder(@NotNull BlastProperty property, @NotNull Material material, boolean large) { + SimpleRecipeBuilder builder; + if(large) { + builder = GCYLRecipeMaps.ADVANCED_MIXER_RECIPES.recipeBuilder(); + } + else { + builder = RecipeMaps.MIXER_RECIPES.recipeBuilder(); + } + + int duration = property.getDurationOverride(); + if (duration < 0) duration = Math.max(1, (int) (material.getMass() * property.getBlastTemperature() / 100L)); + builder.duration(duration); + + int EUt = property.getEUtOverride(); + if (EUt < 0) EUt = GTValues.VA[GTValues.MV]; + builder.EUt(EUt); + + return builder; + + } + + protected int addInputs(@NotNull Material material, @NotNull RecipeBuilder builder) { + int outputAmount = 0; + int fluidAmount = 0; + for (MaterialStack materialStack : material.getMaterialComponents()) { + final Material msMat = materialStack.material; + final int msAmount = (int) materialStack.amount; + + if (msMat.hasProperty(PropertyKey.DUST)) { + builder.input(OrePrefix.dust, msMat, msAmount); + } else if (msMat.hasProperty(PropertyKey.FLUID)) { + if (fluidAmount >= 2) return -1; // more than 2 fluids won't fit in the machine + fluidAmount++; + // assume all fluids have 1000mB/mol, since other quantities should be as an item input + builder.fluidInputs(msMat.getFluid(1000 * msAmount)); + } else return -1; // no fluid or item prop means no valid recipe + outputAmount += msAmount; + } + return outputAmount; + } + + protected void buildRecipes(@NotNull ItemStack itemStack, int outputAmount, + int componentAmount, + @NotNull RecipeBuilder builder) { + // add the fluid output with the correct amount + builder.outputs(itemStack); + + // apply alloy blast duration reduction: 3/4 + int duration = (int) (builder.getDuration() * outputAmount * (0.02)); + + builder.notConsumable(new IntCircuitIngredient(getCircuitNum(componentAmount))) + .duration(duration) + .buildAndRegister(); + } + + protected int getCircuitNum(int componentAmount) { + return componentAmount; + } + +} diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/RecipeMapComponentAL.java b/src/main/java/com/fulltrix/gcyl/api/recipes/RecipeMapComponentAL.java new file mode 100644 index 00000000..a7db6ab8 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/RecipeMapComponentAL.java @@ -0,0 +1,15 @@ +package com.fulltrix.gcyl.api.recipes; + +import gregtech.api.recipes.RecipeBuilder; +import gregtech.api.recipes.RecipeMap; +import gregtech.api.recipes.ui.RecipeMapUIFunction; +import gregtech.core.sound.GTSoundEvents; +import org.jetbrains.annotations.NotNull; + +public class RecipeMapComponentAL> extends RecipeMap { + public RecipeMapComponentAL(@NotNull String unlocalizedName, @NotNull R defaultRecipeBuilder, + @NotNull RecipeMapUIFunction recipeMapUI) { + super(unlocalizedName, defaultRecipeBuilder, recipeMapUI, 12, 1, 12, 0); + setSound(GTSoundEvents.ASSEMBLER); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/impl/AdvFusionRecipeBuilder.java b/src/main/java/com/fulltrix/gcyl/api/recipes/builders/AdvFusionRecipeBuilder.java similarity index 52% rename from src/main/java/com/fulltrix/gcyl/recipes/impl/AdvFusionRecipeBuilder.java rename to src/main/java/com/fulltrix/gcyl/api/recipes/builders/AdvFusionRecipeBuilder.java index 95af0b79..227ef9c5 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/impl/AdvFusionRecipeBuilder.java +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/builders/AdvFusionRecipeBuilder.java @@ -1,11 +1,11 @@ -package com.fulltrix.gcyl.recipes.impl; +package com.fulltrix.gcyl.api.recipes.builders; -import com.fulltrix.gcyl.recipes.recipeproperties.AdvFusionCoilProperty; -import com.fulltrix.gcyl.recipes.recipeproperties.AdvFusionEUReturnProperty; +import com.fulltrix.gcyl.api.recipes.properties.AdvFusionCoilProperty; +import com.fulltrix.gcyl.api.recipes.properties.AdvFusionEUReturnProperty; import gregtech.api.recipes.Recipe; import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.RecipeMap; -import gregtech.api.recipes.recipeproperties.FusionEUToStartProperty; +import gregtech.api.recipes.properties.impl.FusionEUToStartProperty; import gregtech.api.util.EnumValidationResult; import gregtech.api.util.GTLog; import net.minecraftforge.fluids.Fluid; @@ -49,7 +49,8 @@ public AdvFusionRecipeBuilder copy() { return new AdvFusionRecipeBuilder(this); } - public boolean applyProperty(@NotNull String key, Object value) { + //TODO change from CT? + public boolean applyPropertyCT(@NotNull String key, Object value) { if (key.equals(FusionEUToStartProperty.KEY)) { this.EUToStart(((Number) value).longValue()); return true; @@ -58,7 +59,7 @@ public boolean applyProperty(@NotNull String key, Object value) { if (key.equals(AdvFusionCoilProperty.KEY)) { this.AdvCoilTier(((Number) value).intValue()); } - return super.applyProperty(key, value); + return super.applyPropertyCT(key, value); } public AdvFusionRecipeBuilder EUToStart(long EUToStart) { @@ -91,17 +92,17 @@ public AdvFusionRecipeBuilder EUReturn(int percentage) { public long getEUToStart() { return this.recipePropertyStorage == null ? 0L : - this.recipePropertyStorage.getRecipePropertyValue(FusionEUToStartProperty.getInstance(), 0L); + this.recipePropertyStorage.get(FusionEUToStartProperty.getInstance(), 0L); } public int getAdvCoilTier() { return this.recipePropertyStorage == null ? 0 : - this.recipePropertyStorage.getRecipePropertyValue(AdvFusionCoilProperty.getInstance(), 0); + this.recipePropertyStorage.get(AdvFusionCoilProperty.getInstance(), 0); } public int getEUReturn() { return this.recipePropertyStorage == null ? 0 : - this.recipePropertyStorage.getRecipePropertyValue(AdvFusionEUReturnProperty.getInstance(), 0); + this.recipePropertyStorage.get(AdvFusionEUReturnProperty.getInstance(), 0); } @Override @@ -136,116 +137,4 @@ public String toString() { .append(AdvFusionEUReturnProperty.getInstance().getKey(), getEUReturn()) .toString(); } - - /* - private int coilTier; - private long euStart; - public static Map COOLANTS = new HashMap<>(); - private int euReturn; - - - public AdvFusionRecipeBuilder(Recipe recipe, RecipeMap recipeMap) { - super(recipe, recipeMap); - this.coilTier = recipe.getIntegerProperty("coil_tier"); - this.euStart = recipe.getProperty("eu_to_start"); - this.euReturn = recipe.getIntegerProperty("eu_return"); - } - - - - public AdvFusionRecipeBuilder(RecipeBuilder recipeBuilder) { - super(recipeBuilder); - } - - public AdvFusionRecipeBuilder(RecipeBuilder recipeBuilder, int coilTier, long euStart, int euReturn) { - super(recipeBuilder); - this.coilTier = coilTier; - this.euStart = euStart; - this.euReturn = euReturn; - } - - - - @Override - public boolean applyProperty(String key, Object value) { - switch (key) { - case "coilTier": - this.coilTier(((Number) value).intValue()); - return true; - case "eu_to_start": - this.euStart(((Number) value).longValue()); - return true; - case "euReturn": - this.euReturn(((Number) value).intValue()); - return true; - } - return false; - } - - public AdvFusionRecipeBuilder coilTier(int coilTier) { - if (coilTier <= 0) { - recipeStatus = EnumValidationResult.INVALID; - } - this.coilTier = coilTier; - this.euStart = this.euStart == 0 ? (int) (16 * 10000000 * Math.pow(2, coilTier)) : this.euStart; - return this; - } - - public AdvFusionRecipeBuilder euStart(long eu) { - if (eu <= 0) { - recipeStatus = EnumValidationResult.INVALID; - } - this.euStart = eu; - return this; - } - - public AdvFusionRecipeBuilder euReturn(int percentage) { - if (percentage < 0) { - recipeStatus = EnumValidationResult.INVALID; - } - this.euReturn = percentage; - return this; - } - - @Override - public ValidationResult build() { - return ValidationResult.newResult(finalizeAndValidate(), - new Recipe(inputs, outputs, chancedOutputs, fluidInputs, fluidOutputs, - ImmutableMap.of("coil_tier", this.coilTier, "eu_to_start", this.euStart, "eu_return", this.euReturn), - duration, EUt, hidden)); - } - - @Override - public void buildAndRegister() { - if (fluidInputs.size() == 2) { - if (euReturn > 0) { - long eu = (euStart + ((long) EUt) * duration) * euReturn / 100; - for (FluidStack fluidStack : COOLANTS.keySet()) { - FluidStack fluidInput = fluidStack.copy(); - int amount = Math.max((int) ((eu / (2048 * 10000)) * fluidInput.amount), 1); - fluidInput.amount = amount; - FluidStack fluidOutput = new FluidStack(COOLANTS.get(fluidStack), amount); - recipeMap.addRecipe(this.copy() - .fluidInputs(fluidInput) - .fluidOutputs(fluidOutput) - .build()); - } - } else { - recipeMap.addRecipe(this.build()); - } - } else { - recipeMap.addRecipe(this.build()); - } - } - - @Override - public String toString() { - return new ToStringBuilder(this) - .appendSuper(super.toString()) - .append("coil_tier", coilTier) - .append("eu_to_start", euStart) - .toString(); - } - - */ } diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/builders/ComponentALRecipeBuilder.java b/src/main/java/com/fulltrix/gcyl/api/recipes/builders/ComponentALRecipeBuilder.java new file mode 100644 index 00000000..39165f38 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/builders/ComponentALRecipeBuilder.java @@ -0,0 +1,90 @@ +package com.fulltrix.gcyl.api.recipes.builders; + + +import com.fulltrix.gcyl.api.recipes.properties.ComponentALProperty; +import gregtech.api.recipes.Recipe; +import gregtech.api.recipes.RecipeBuilder; +import gregtech.api.recipes.RecipeMap; +import gregtech.api.recipes.properties.impl.ComputationProperty; +import gregtech.api.recipes.properties.impl.TotalComputationProperty; +import gregtech.api.util.EnumValidationResult; +import gregtech.api.util.GTLog; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.jetbrains.annotations.NotNull; + +public class ComponentALRecipeBuilder extends RecipeBuilder { + public ComponentALRecipeBuilder(){} + + public ComponentALRecipeBuilder(Recipe recipe, RecipeMap recipeMap) { + super(recipe, recipeMap); + } + + public ComponentALRecipeBuilder(RecipeBuilder recipeBuilder) { + super(recipeBuilder); + } + + @Override + public ComponentALRecipeBuilder copy() { + return new ComponentALRecipeBuilder(this); + } + + public boolean applyPropertyCT(@NotNull String key, Object value) { + if (key.equals(ComponentALProperty.KEY)) { + this.CasingTier(((Number) value).intValue()); + return true; + } + if (key.equals(ComputationProperty.KEY)) { + this.CWUt(((Number) value).intValue()); + return true; + } + if (key.equals(TotalComputationProperty.KEY)) { + this.totalCWU(((Number) value).intValue()); + return true; + } + + return super.applyPropertyCT(key, value); + } + + public ComponentALRecipeBuilder CasingTier(int tier) { + if (tier < 0) { + GTLog.logger.error("Casing tier cannot be less than 0", new IllegalArgumentException()); + recipeStatus = EnumValidationResult.INVALID; + } + this.applyProperty(ComponentALProperty.getInstance(), tier); + return this; + } + + public int getCasingTier() { + return this.recipePropertyStorage == null ? 0 : + this.recipePropertyStorage.get(ComponentALProperty.getInstance(), 0); + } + + @Override + public String toString() { + return new ToStringBuilder(this) + .appendSuper(super.toString()) + .append(ComponentALProperty.getInstance().getKey(), getCasingTier()) + .toString(); + } + + public ComponentALRecipeBuilder CWUt(int cwut) { + if (cwut < 0) { + GTLog.logger.error("CWU/t cannot be less than 0", new Throwable()); + recipeStatus = EnumValidationResult.INVALID; + } + this.applyProperty(ComputationProperty.getInstance(), cwut); + return this; + } + + /** + * The total computation for this recipe. If desired, this should be used instead of a call to duration(). + */ + public ComponentALRecipeBuilder totalCWU(int totalCWU) { + if (totalCWU < 0) { + GTLog.logger.error("Total CWU cannot be less than 0", new Throwable()); + recipeStatus = EnumValidationResult.INVALID; + } + this.applyProperty(TotalComputationProperty.getInstance(), totalCWU); + return duration(totalCWU); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/impl/DeepMinerBuilder.java b/src/main/java/com/fulltrix/gcyl/api/recipes/builders/DeepMinerBuilder.java similarity index 81% rename from src/main/java/com/fulltrix/gcyl/recipes/impl/DeepMinerBuilder.java rename to src/main/java/com/fulltrix/gcyl/api/recipes/builders/DeepMinerBuilder.java index b90789ef..7d153d9e 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/impl/DeepMinerBuilder.java +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/builders/DeepMinerBuilder.java @@ -1,6 +1,6 @@ -package com.fulltrix.gcyl.recipes.impl; +package com.fulltrix.gcyl.api.recipes.builders; -import com.fulltrix.gcyl.recipes.recipeproperties.GCYLTemperatureProperty; +import com.fulltrix.gcyl.api.recipes.properties.GCYLTemperatureProperty; import gregtech.api.recipes.Recipe; import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.RecipeMap; @@ -25,12 +25,13 @@ public DeepMinerBuilder copy() { return new DeepMinerBuilder(this); } - public boolean applyProperty(@NotNull String key, Object value) { + //TODO Change from CT? + public boolean applyPropertyCT(@NotNull String key, @NotNull Object value) { if (key.equals("temperature")) { this.temperature(((Number)value).intValue()); return true; } else { - return super.applyProperty(key, value); + return super.applyPropertyCT(key, value); } } @@ -45,7 +46,7 @@ public DeepMinerBuilder temperature(int temperature) { } public int getTemperature() { - return this.recipePropertyStorage == null ? 0 : (Integer)this.recipePropertyStorage.getRecipePropertyValue(GCYLTemperatureProperty.getInstance(), 0); + return this.recipePropertyStorage == null ? 0 : (Integer)this.recipePropertyStorage.get(GCYLTemperatureProperty.getInstance(), 0); } public String toString() { diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/builders/LaserMinerBuilder.java b/src/main/java/com/fulltrix/gcyl/api/recipes/builders/LaserMinerBuilder.java new file mode 100644 index 00000000..7b6d24ed --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/builders/LaserMinerBuilder.java @@ -0,0 +1,79 @@ +package com.fulltrix.gcyl.api.recipes.builders; + +import com.fulltrix.gcyl.api.recipes.properties.AdvFusionCoilProperty; +import gregtech.api.recipes.Recipe; +import gregtech.api.recipes.RecipeBuilder; +import gregtech.api.recipes.RecipeMap; +import gregtech.api.recipes.properties.impl.ComputationProperty; +import gregtech.api.recipes.properties.impl.TotalComputationProperty; +import gregtech.api.util.EnumValidationResult; +import gregtech.api.util.GTLog; +import org.jetbrains.annotations.NotNull; + +public class LaserMinerBuilder extends RecipeBuilder { + + public LaserMinerBuilder() { + } + + public LaserMinerBuilder(Recipe recipe, RecipeMap recipeMap) { + super(recipe, recipeMap); + } + + public LaserMinerBuilder(RecipeBuilder recipeBuilder) { super(recipeBuilder);} + + @Override + public LaserMinerBuilder copy() {return new LaserMinerBuilder(this);} + + + @Override + public boolean applyPropertyCT(@NotNull String key, Object value) { + if (key.equals(ComputationProperty.KEY)) { + this.CWUt(((Number) value).intValue()); + return true; + } + if (key.equals(TotalComputationProperty.KEY)) { + this.totalCWU(((Number) value).intValue()); + return true; + } + + if (key.equals(AdvFusionCoilProperty.KEY)) { + this.AdvCoilTier(((Number) value).intValue()); + } + return super.applyPropertyCT(key, value); + } + + public int getAdvCoilTier() { + return this.recipePropertyStorage == null ? 0 : + this.recipePropertyStorage.get(AdvFusionCoilProperty.getInstance(), 0); + } + + public LaserMinerBuilder AdvCoilTier(int tier) { + if (tier < 0) { + GTLog.logger.error("Adv coil tier cannot be less than 0", new IllegalArgumentException()); + recipeStatus = EnumValidationResult.INVALID; + } + this.applyProperty(AdvFusionCoilProperty.getInstance(), tier); + return this; + } + + public LaserMinerBuilder CWUt(int cwut) { + if (cwut < 0) { + GTLog.logger.error("CWU/t cannot be less than 0", new Throwable()); + recipeStatus = EnumValidationResult.INVALID; + } + this.applyProperty(ComputationProperty.getInstance(), cwut); + return this; + } + + /** + * The total computation for this recipe. If desired, this should be used instead of a call to duration(). + */ + public LaserMinerBuilder totalCWU(int totalCWU) { + if (totalCWU < 0) { + GTLog.logger.error("Total CWU cannot be less than 0", new Throwable()); + recipeStatus = EnumValidationResult.INVALID; + } + this.applyProperty(TotalComputationProperty.getInstance(), totalCWU); + return duration(totalCWU); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/recipeproperties/AdvFusionCoilProperty.java b/src/main/java/com/fulltrix/gcyl/api/recipes/properties/AdvFusionCoilProperty.java similarity index 75% rename from src/main/java/com/fulltrix/gcyl/recipes/recipeproperties/AdvFusionCoilProperty.java rename to src/main/java/com/fulltrix/gcyl/api/recipes/properties/AdvFusionCoilProperty.java index 60740f82..86c93de3 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/recipeproperties/AdvFusionCoilProperty.java +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/properties/AdvFusionCoilProperty.java @@ -1,10 +1,14 @@ -package com.fulltrix.gcyl.recipes.recipeproperties; +package com.fulltrix.gcyl.api.recipes.properties; -import gregtech.api.recipes.recipeproperties.RecipeProperty; +import gregtech.api.recipes.properties.RecipeProperty; import gregtech.api.util.TextFormattingUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.I18n; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagInt; +import net.minecraft.nbt.NBTTagLong; import org.apache.commons.lang3.Validate; +import org.jetbrains.annotations.NotNull; import java.util.Map; import java.util.TreeMap; @@ -43,6 +47,16 @@ public static void registerAdvFusionTier(int tier, String shortName) { registeredAdvFusionTiers.put(tier, shortName); } + @Override + public @NotNull NBTBase serialize(@NotNull Object o) { + return new NBTTagInt(castValue(o)); + } + + @Override + public @NotNull Object deserialize(@NotNull NBTBase nbtBase) { + return ((NBTTagInt) nbtBase).getInt(); + } + @Override public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) { minecraft.fontRenderer.drawString(I18n.format("gregtech.recipe.adv_fusion_coil_tier", diff --git a/src/main/java/com/fulltrix/gcyl/recipes/recipeproperties/AdvFusionEUReturnProperty.java b/src/main/java/com/fulltrix/gcyl/api/recipes/properties/AdvFusionEUReturnProperty.java similarity index 73% rename from src/main/java/com/fulltrix/gcyl/recipes/recipeproperties/AdvFusionEUReturnProperty.java rename to src/main/java/com/fulltrix/gcyl/api/recipes/properties/AdvFusionEUReturnProperty.java index a0c4f6d0..975b949b 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/recipeproperties/AdvFusionEUReturnProperty.java +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/properties/AdvFusionEUReturnProperty.java @@ -1,9 +1,12 @@ -package com.fulltrix.gcyl.recipes.recipeproperties; +package com.fulltrix.gcyl.api.recipes.properties; -import gregtech.api.recipes.recipeproperties.RecipeProperty; +import gregtech.api.recipes.properties.RecipeProperty; import gregtech.api.util.TextFormattingUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.I18n; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagInt; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; @@ -35,6 +38,16 @@ public static void setEUReturn(int percent) { EUReturn.add(percent); } + @Override + public @NotNull NBTBase serialize(@NotNull Object o) { + return new NBTTagInt(castValue(o)); + } + + @Override + public @NotNull Object deserialize(@NotNull NBTBase nbtBase) { + return ((NBTTagInt) nbtBase).getInt(); + } + @Override public void drawInfo(Minecraft minecraft, int x, int y, int color, Object percent) { minecraft.fontRenderer.drawString(I18n.format("gregtech.recipe.adv_fusion_eu_return", diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/properties/ComponentALProperty.java b/src/main/java/com/fulltrix/gcyl/api/recipes/properties/ComponentALProperty.java new file mode 100644 index 00000000..ae593047 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/properties/ComponentALProperty.java @@ -0,0 +1,63 @@ +package com.fulltrix.gcyl.api.recipes.properties; + +import gregtech.api.recipes.properties.RecipeProperty; +import gregtech.api.util.TextFormattingUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagInt; +import org.apache.commons.lang3.Validate; +import org.jetbrains.annotations.NotNull; + +import java.util.Map; +import java.util.TreeMap; + +public class ComponentALProperty extends RecipeProperty { + public static final String KEY = "component_al_casing_tier"; + + private static final TreeMap registeredCasingTiers = new TreeMap<>(); + + private static ComponentALProperty INSTANCE; + + protected ComponentALProperty() { super(KEY, Integer.class);} + + public static ComponentALProperty getInstance() { + if (INSTANCE == null) { + INSTANCE = new ComponentALProperty(); + } + + return INSTANCE; + } + + private static String getCasingTier(Integer tier) { + Map.Entry mapEntry = registeredCasingTiers.ceilingEntry(tier); + + if (mapEntry == null) { + throw new IllegalArgumentException("oopz"); + } + + return String.format(" %s", mapEntry.getValue()); + } + + public static void registerCasingTier(int tier, String shortName) { + Validate.notNull(shortName); + registeredCasingTiers.put(tier, shortName); + } + + @Override + public @NotNull NBTBase serialize(@NotNull Object o) { + return new NBTTagInt(castValue(o)); + } + + @Override + public @NotNull Object deserialize(@NotNull NBTBase nbtBase) { + return ((NBTTagInt) nbtBase).getInt(); + } + + @Override + public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) { + minecraft.fontRenderer.drawString(I18n.format("gregtech.recipe.component_al_casing_tier", + TextFormattingUtil.formatLongToCompactString(castValue(value))) + getCasingTier(castValue(value)), x, y, + color); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/recipeproperties/GCYLScanProperty.java b/src/main/java/com/fulltrix/gcyl/api/recipes/properties/GCYLScanProperty.java similarity index 55% rename from src/main/java/com/fulltrix/gcyl/recipes/recipeproperties/GCYLScanProperty.java rename to src/main/java/com/fulltrix/gcyl/api/recipes/properties/GCYLScanProperty.java index d4c5659d..e59b2c2f 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/recipeproperties/GCYLScanProperty.java +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/properties/GCYLScanProperty.java @@ -1,8 +1,10 @@ -package com.fulltrix.gcyl.recipes.recipeproperties; +package com.fulltrix.gcyl.api.recipes.properties; -import gregtech.api.recipes.recipeproperties.RecipeProperty; +import gregtech.api.recipes.properties.RecipeProperty; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.I18n; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagInt; import org.jetbrains.annotations.NotNull; public class GCYLScanProperty extends RecipeProperty { @@ -20,6 +22,26 @@ public static GCYLScanProperty getInstance() { return INSTANCE; } + @Override + public @NotNull NBTBase serialize(@NotNull Object o) { + int thing = 0; + + if((boolean) o) + thing = 1; + + return new NBTTagInt(thing); + } + + @Override + public @NotNull Object deserialize(@NotNull NBTBase nbtBase) { + int thing = ((NBTTagInt) nbtBase).getInt(); + + if(thing == 0) + return false; + else + return true; + } + @Override public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) { minecraft.fontRenderer.drawString(I18n.format("gcyl.recipe.scan_for_deep_miner"), x, y, color); diff --git a/src/main/java/com/fulltrix/gcyl/recipes/recipeproperties/GCYLTemperatureProperty.java b/src/main/java/com/fulltrix/gcyl/api/recipes/properties/GCYLTemperatureProperty.java similarity index 61% rename from src/main/java/com/fulltrix/gcyl/recipes/recipeproperties/GCYLTemperatureProperty.java rename to src/main/java/com/fulltrix/gcyl/api/recipes/properties/GCYLTemperatureProperty.java index c3aea8dc..63e2d7af 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/recipeproperties/GCYLTemperatureProperty.java +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/properties/GCYLTemperatureProperty.java @@ -1,9 +1,11 @@ -package com.fulltrix.gcyl.recipes.recipeproperties; +package com.fulltrix.gcyl.api.recipes.properties; -import gregtech.api.recipes.recipeproperties.RecipeProperty; -import gregtech.api.recipes.recipeproperties.TemperatureProperty; +import gregtech.api.recipes.properties.RecipeProperty; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.I18n; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagInt; +import org.jetbrains.annotations.NotNull; public class GCYLTemperatureProperty extends RecipeProperty { public static final String KEY = "temperature"; @@ -22,6 +24,16 @@ public static GCYLTemperatureProperty getInstance() { return INSTANCE; } + @Override + public @NotNull NBTBase serialize(@NotNull Object o) { + return new NBTTagInt(castValue(o)); + } + + @Override + public @NotNull Object deserialize(@NotNull NBTBase nbtBase) { + return ((NBTTagInt) nbtBase).getInt(); + } + @Override public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) { minecraft.fontRenderer.drawString(I18n.format("gcyl.recipe.temperature", value), x, y, color); diff --git a/src/main/java/com/fulltrix/gcyl/api/recipes/ui/ComponentALRecipeUI.java b/src/main/java/com/fulltrix/gcyl/api/recipes/ui/ComponentALRecipeUI.java new file mode 100644 index 00000000..1476f9c7 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/recipes/ui/ComponentALRecipeUI.java @@ -0,0 +1,63 @@ +package com.fulltrix.gcyl.api.recipes.ui; + +import com.fulltrix.gcyl.client.ClientHandler; +import gregtech.api.capability.impl.FluidTankList; +import gregtech.api.gui.GuiTextures; +import gregtech.api.gui.ModularUI; +import gregtech.api.gui.widgets.ProgressWidget; +import gregtech.api.gui.widgets.SlotWidget; +import gregtech.api.recipes.RecipeMap; +import gregtech.api.recipes.ui.RecipeMapUI; +import net.minecraftforge.items.IItemHandlerModifiable; +import org.jetbrains.annotations.NotNull; + +public class ComponentALRecipeUI> extends RecipeMapUI { + public ComponentALRecipeUI(@NotNull R recipeMap) { + super(recipeMap, false, false, false, false, false); + setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, ProgressWidget.MoveType.HORIZONTAL); + } + + @Override + @NotNull + public ModularUI.Builder createJeiUITemplate(IItemHandlerModifiable importItems, IItemHandlerModifiable exportItems, + FluidTankList importFluids, FluidTankList exportFluids, int yOffset) { + ModularUI.Builder builder = ModularUI.builder(GuiTextures.BACKGROUND, 176, 176) + .widget(new ProgressWidget(100, 62, 0, 72, 20, ClientHandler.PROGRESS_BAR_COMPONENT_AL, + ProgressWidget.MoveType.HORIZONTAL)); + this.addInventorySlotGroup(builder, importItems, importFluids, false, yOffset); + this.addInventorySlotGroup(builder, exportItems, exportFluids, true, yOffset); + return builder; + } + + @Override + protected void addInventorySlotGroup(@NotNull ModularUI.Builder builder, + @NotNull IItemHandlerModifiable itemHandler, + @NotNull FluidTankList fluidHandler, boolean isOutputs, int yOffset) { + int startInputsX = 80 - 4 * 18; + int startInputsY = 37 - 2 * 18; + + if (!isOutputs) { + // item input slots + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 3; j++) { + int slotIndex = i * 3 + j; + addSlot(builder, startInputsX + 18 * j, startInputsY + 18 * i, slotIndex, itemHandler, fluidHandler, + false, false); + } + } + + int startFluidX = startInputsX + 18 * 4; + int startFluidY = startInputsY + 18; + for (int i = 0; i < 3; i++) { + for(int j = 0; j < 4; j++) { + int slotIndex = i * 4 + j; + addSlot(builder, startFluidX + 18 * j, startFluidY + 18 * i, slotIndex, itemHandler, fluidHandler, true, false); + } + } + + } else { + // output slot + addSlot(builder, startInputsX + 18 * 7, 1, 0, itemHandler, fluidHandler, false, true); + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/util/IResearchContainer.java b/src/main/java/com/fulltrix/gcyl/api/util/IResearchContainer.java new file mode 100644 index 00000000..a6807161 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/util/IResearchContainer.java @@ -0,0 +1,11 @@ +package com.fulltrix.gcyl.api.util; + +import java.util.List; + +public interface IResearchContainer { + public void setResearchId(List inputResearchIds); + + public List getResearchIds(); + + public void clearResearch(); +} diff --git a/src/main/java/com/fulltrix/gcyl/api/util/IWirelessEnergyContainer.java b/src/main/java/com/fulltrix/gcyl/api/util/IWirelessEnergyContainer.java new file mode 100644 index 00000000..945b966c --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/util/IWirelessEnergyContainer.java @@ -0,0 +1,16 @@ +package com.fulltrix.gcyl.api.util; + +import java.math.BigInteger; + +public interface IWirelessEnergyContainer { + + long changeEnergy(long differenceAmount); + + default long addEnergy(long energyToAdd) { return changeEnergy(energyToAdd); } + + default long remove(long energyToRemove) { return changeEnergy(-energyToRemove); } + + long getEnergyStored(); + + +} diff --git a/src/main/java/com/fulltrix/gcyl/api/util/VirtualEnergyRegistry.java b/src/main/java/com/fulltrix/gcyl/api/util/VirtualEnergyRegistry.java new file mode 100644 index 00000000..a8cc49e9 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/util/VirtualEnergyRegistry.java @@ -0,0 +1,171 @@ +package com.fulltrix.gcyl.api.util; + +import gregtech.api.GTValues; +import gregtech.api.util.GTLog; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapStorage; +import net.minecraft.world.storage.WorldSavedData; +import net.minecraftforge.common.util.INBTSerializable; + +import javax.annotation.Nonnull; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicLong; + +public class VirtualEnergyRegistry extends WorldSavedData { + + private static final String DATA_ID = GTValues.MODID + ".energy_data"; + + protected static Map> containerMap = new HashMap<>(); + + + public VirtualEnergyRegistry() { + super(DATA_ID); + } + + public VirtualEnergyRegistry(String name) {super(name);} + + public static void clearMaps() { + containerMap.clear(); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + if (nbt.hasKey("Public")) { + NBTTagCompound publicContainers = nbt.getCompoundTag("Public"); + for (String key : publicContainers.getKeySet()) { + NBTTagCompound containerCompound = publicContainers.getCompoundTag(key); + VirtualEnergyRegistry.getContainerCreate(key, null).deserializeNBT(containerCompound); + } + } + if (nbt.hasKey("Private")) { + NBTTagCompound privateContainerUUIDs = nbt.getCompoundTag("Private"); + for (String uuidStr : privateContainerUUIDs.getKeySet()) { + UUID uuid = UUID.fromString(uuidStr); + NBTTagCompound privateContainers = privateContainerUUIDs.getCompoundTag(uuidStr); + for (String key : privateContainers.getKeySet()) { + NBTTagCompound containerCompound = privateContainers.getCompoundTag(key); + VirtualEnergyRegistry.getContainerCreate(key, uuid).deserializeNBT(containerCompound); + } + } + } + } + + @Nonnull + @Override + public NBTTagCompound writeToNBT(NBTTagCompound compound) { + compound.setTag("Private", new NBTTagCompound()); + containerMap.forEach( (uuid, map) -> { + NBTTagCompound mapCompound = new NBTTagCompound(); + map.forEach( (key, container) -> { + NBTTagCompound containerCompound = container.serializeNBT(); + mapCompound.setTag(key, containerCompound); + }); + if (mapCompound.getSize() > 0) { + if (uuid == null) { + compound.setTag("Public", mapCompound); + } else { + compound.getCompoundTag("Private").setTag(uuid.toString(), mapCompound); + } + } + }); + return compound; + } + + @Override + public boolean isDirty() { + // can't think of a good way to mark dirty other than always + return true; + } + + public static VirtualEnergyContainer getContainer(String key, UUID uuid) { + return containerMap.get(uuid).get(key); + } + + public static Map> getContainerMap() { + return containerMap; + } + + public static VirtualEnergyContainer getContainerCreate(String key, UUID uuid) { + if (!containerMap.containsKey(uuid) || !containerMap.get(uuid).containsKey(key)) { + addContainer(key, uuid); + } + return getContainer(key, uuid); + } + + public static void addContainer(String key, UUID uuid) { + if (containerMap.containsKey(uuid) && containerMap.get(uuid).containsKey(key)) { + GTLog.logger.warn("Overwriting virtual container " + key + "/" + (uuid == null ? "null" :uuid.toString()) + ", this might cause item loss!"); + } else if (!containerMap.containsKey(uuid)) { + containerMap.put(uuid, new HashMap<>()); + } + containerMap.get(uuid).put(key, new VirtualEnergyContainer()); + } + + public static void delContainer(String key, UUID uuid, boolean removeContainer) { + if (containerMap.containsKey(uuid) && containerMap.get(uuid).containsKey(key)) { + boolean isEmpty = true; + IWirelessEnergyContainer container = containerMap.get(uuid).get(key); + + //TODO: SET ENERGY TO ZERO? + + if (removeContainer || isEmpty) { + containerMap.get(uuid).remove(key); + if (containerMap.get(uuid).size() == 0) { + containerMap.remove(uuid); + } + } + } else { + GTLog.logger.warn("Attempted to delete container " + key + "/" + (uuid == null ? "null" :uuid.toString()) + ", which does not exist!"); + } + } + + public static void initializeStorage(World world) { + MapStorage storage = world.getMapStorage(); + VirtualEnergyRegistry instance = (VirtualEnergyRegistry) storage.getOrLoadData(VirtualEnergyRegistry.class, DATA_ID); + + if (instance == null) { + instance = new VirtualEnergyRegistry(); + storage.setData(DATA_ID, instance); + } + } + + + public static class VirtualEnergyContainer implements IWirelessEnergyContainer,INBTSerializable { + + private AtomicLong totalWirelessEnergy = new AtomicLong(0); + + public VirtualEnergyContainer() {} + + @Override + public long changeEnergy(long l) { + AtomicLong temp = new AtomicLong(totalWirelessEnergy.get()); + temp.addAndGet(l); + + if (temp.get() < totalWirelessEnergy.get() && l > 0) { + totalWirelessEnergy.set(Long.MAX_VALUE); + return Long.MAX_VALUE; + } else + return totalWirelessEnergy.addAndGet(l); + } + + @Override + public long getEnergyStored() { + return totalWirelessEnergy.get(); + } + + @Override + public NBTTagCompound serializeNBT() { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setLong("Energy", totalWirelessEnergy.longValue()); + return nbt; + } + + @Override + public void deserializeNBT(NBTTagCompound nbt) { + totalWirelessEnergy.set(nbt.getLong("Energy")); + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/util/VirtualResearchRegistry.java b/src/main/java/com/fulltrix/gcyl/api/util/VirtualResearchRegistry.java new file mode 100644 index 00000000..31aa16b2 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/util/VirtualResearchRegistry.java @@ -0,0 +1,179 @@ +package com.fulltrix.gcyl.api.util; + +import gregtech.api.GTValues; +import gregtech.api.util.GTLog; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapStorage; +import net.minecraft.world.storage.WorldSavedData; +import net.minecraftforge.common.util.Constants; +import net.minecraftforge.common.util.INBTSerializable; + +import javax.annotation.Nonnull; +import java.util.*; + +public class VirtualResearchRegistry extends WorldSavedData { + + private static final String DATA_ID = GTValues.MODID + ".research_data"; + + protected static Map> containerMap = new HashMap<>(); + + public VirtualResearchRegistry() {super(DATA_ID);} + + public VirtualResearchRegistry(String name) {super(name);} + + public static void clearMaps() { + containerMap.clear(); + } + + + @Override + public void readFromNBT(NBTTagCompound nbt) { + if (nbt.hasKey("Public")) { + NBTTagCompound publicContainers = nbt.getCompoundTag("Public"); + for (String key : publicContainers.getKeySet()) { + NBTTagCompound containerCompound = publicContainers.getCompoundTag(key); + VirtualResearchRegistry.getContainerCreate(key, null).deserializeNBT(containerCompound); + } + } + if (nbt.hasKey("Private")) { + NBTTagCompound privateContainerUUIDs = nbt.getCompoundTag("Private"); + for (String uuidStr : privateContainerUUIDs.getKeySet()) { + UUID uuid = UUID.fromString(uuidStr); + NBTTagCompound privateContainers = privateContainerUUIDs.getCompoundTag(uuidStr); + for (String key : privateContainers.getKeySet()) { + NBTTagCompound containerCompound = privateContainers.getCompoundTag(key); + VirtualResearchRegistry.getContainerCreate(key, uuid).deserializeNBT(containerCompound); + } + } + } + } + + @Nonnull + @Override + public NBTTagCompound writeToNBT(NBTTagCompound compound) { + compound.setTag("Private", new NBTTagCompound()); + containerMap.forEach( (uuid, map) -> { + NBTTagCompound mapCompound = new NBTTagCompound(); + map.forEach( (key, container) -> { + NBTTagCompound containerCompound = container.serializeNBT(); + mapCompound.setTag(key, containerCompound); + }); + if (mapCompound.getSize() > 0) { + if (uuid == null) { + compound.setTag("Public", mapCompound); + } else { + compound.getCompoundTag("Private").setTag(uuid.toString(), mapCompound); + } + } + }); + return compound; + } + + @Override + public boolean isDirty() { + // can't think of a good way to mark dirty other than always + return true; + } + + public static VirtualResearchRegistry.VirtualResearchContainer getContainer(String key, UUID uuid) { + return containerMap.get(uuid).get(key); + } + + public static Map> getContainerMap() { + return containerMap; + } + + public static VirtualResearchRegistry.VirtualResearchContainer getContainerCreate(String key, UUID uuid) { + if (!containerMap.containsKey(uuid) || !containerMap.get(uuid).containsKey(key)) { + addContainer(key, uuid); + } + return getContainer(key, uuid); + } + + public static void addContainer(String key, UUID uuid) { + if (containerMap.containsKey(uuid) && containerMap.get(uuid).containsKey(key)) { + GTLog.logger.warn("Overwriting virtual container " + key + "/" + (uuid == null ? "null" :uuid.toString()) + ", this might cause item loss!"); + } else if (!containerMap.containsKey(uuid)) { + containerMap.put(uuid, new HashMap<>()); + } + containerMap.get(uuid).put(key, new VirtualResearchRegistry.VirtualResearchContainer()); + } + + public static void delContainer(String key, UUID uuid, boolean removeContainer) { + if (containerMap.containsKey(uuid) && containerMap.get(uuid).containsKey(key)) { + boolean isEmpty = true; + IResearchContainer container = containerMap.get(uuid).get(key); + + //TODO: Clear research? + + if (removeContainer || isEmpty) { + containerMap.get(uuid).remove(key); + if (containerMap.get(uuid).size() == 0) { + containerMap.remove(uuid); + } + } + } else { + GTLog.logger.warn("Attempted to delete container " + key + "/" + (uuid == null ? "null" :uuid.toString()) + ", which does not exist!"); + } + } + + public static void initializeStorage(World world) { + MapStorage storage = world.getMapStorage(); + VirtualResearchRegistry instance = (VirtualResearchRegistry) storage.getOrLoadData(VirtualResearchRegistry.class, DATA_ID); + + if (instance == null) { + instance = new VirtualResearchRegistry(); + storage.setData(DATA_ID, instance); + } + } + + public static class VirtualResearchContainer implements IResearchContainer, INBTSerializable { + + private List researchIds = new ArrayList<>(); + + public VirtualResearchContainer() {} + + @Override + public void setResearchId(List inputResearchIds) { + researchIds = inputResearchIds; + } + + @Override + public List getResearchIds() { + return researchIds; + } + + @Override + public void clearResearch() { + researchIds.clear(); + } + + @Override + public NBTTagCompound serializeNBT() { + NBTTagList nbtTagList = new NBTTagList(); + for(int i = 0; i < researchIds.size(); i++) { + if(!researchIds.get(i).isEmpty()) { + NBTTagCompound researchTag = new NBTTagCompound(); + researchTag.setString("ResearchSlot", researchIds.get(i)); + nbtTagList.appendTag(researchTag); + } + } + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setTag("Research", nbtTagList); + return nbt; + } + + @Override + public void deserializeNBT(NBTTagCompound nbt) { + NBTTagList tagList = nbt.getTagList("Research", Constants.NBT.TAG_COMPOUND); + for(int i = 0; i < tagList.tagCount(); i++) { + NBTTagCompound researchTags = tagList.getCompoundTagAt(i); + String slot = researchTags.getString("ResearchSlot"); + researchIds.set(i, slot); + } + } + + } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/worldgen/PacketVirtualOreVeinList.java b/src/main/java/com/fulltrix/gcyl/api/worldgen/PacketVirtualOreVeinList.java new file mode 100644 index 00000000..c35dd021 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/worldgen/PacketVirtualOreVeinList.java @@ -0,0 +1,59 @@ +package com.fulltrix.gcyl.api.worldgen; + +import gregtech.api.network.IClientExecutor; +import gregtech.api.network.IPacket; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraftforge.fml.common.network.ByteBufUtils; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.HashMap; +import java.util.Map; + +public class PacketVirtualOreVeinList implements IPacket, IClientExecutor { + + private Map map; + + @SuppressWarnings("unused") + public PacketVirtualOreVeinList() {} + + public PacketVirtualOreVeinList(HashMap map) { + this.map = map; + } + + @Override + public void encode(PacketBuffer buf) { + buf.writeVarInt(map.size()); + for (Map.Entry entry : map.entrySet()) { + NBTTagCompound tag = entry.getKey().writeToNBT(); + tag.setInteger("weight", entry.getValue()); + ByteBufUtils.writeTag(buf, tag); + } + } + + @Override + public void decode(PacketBuffer buf) { + this.map = new HashMap<>(); + int size = buf.readVarInt(); + for (int i = 0; i < size; i++) { + NBTTagCompound tag = ByteBufUtils.readTag(buf); + if (tag == null || tag.isEmpty()) continue; + + VirtualOreVeinHandler.VirtualOreVeinWorldEntry entry = VirtualOreVeinHandler.VirtualOreVeinWorldEntry + .readFromNBT(tag); + this.map.put(entry, tag.getInteger("weight")); + } + } + + @SideOnly(Side.CLIENT) + @Override + public void executeClient(NetHandlerPlayClient handler) { + VirtualOreVeinHandler.virtualOreVeinList.clear(); + for (Map.Entry entry : map.entrySet()) { + VirtualOreVeinHandler.virtualOreVeinList.put(entry.getKey().getDefinition(), entry.getValue()); + } + } + +} diff --git a/src/main/java/com/fulltrix/gcyl/api/worldgen/VirtualOreDepositDefinition.java b/src/main/java/com/fulltrix/gcyl/api/worldgen/VirtualOreDepositDefinition.java new file mode 100644 index 00000000..c8ca85eb --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/worldgen/VirtualOreDepositDefinition.java @@ -0,0 +1,180 @@ +package com.fulltrix.gcyl.api.worldgen; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import gregtech.api.unification.material.Material; +import gregtech.api.util.GTLog; +import gregtech.api.util.LocalizationUtils; +import gregtech.api.worldgen.config.IWorldgenDefinition; +import gregtech.api.worldgen.config.OreDepositDefinition; +import gregtech.api.worldgen.config.WorldConfigUtils; +import gregtech.core.unification.material.internal.MaterialRegistryManager; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectList; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.biome.Biome; +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Function; +import java.util.function.Predicate; + +public class VirtualOreDepositDefinition implements IWorldgenDefinition { + + private final String depositName; + + private int weight; // weight value for determining which vein will appear + private String assignedName; // vein name for JEI display + private String description; // vein description for JEI display + private final int[] yields = new int[2]; // the [minimum, maximum) yields + private final List storedMaterials = new ArrayList<>(); // the materials which the vein contains + private final ObjectList multipliers = new ObjectArrayList<>(); + private Function biomeWeightModifier = OreDepositDefinition.NO_BIOME_INFLUENCE; + private Predicate dimensionFilter = OreDepositDefinition.PREDICATE_SURFACE_WORLD; + + public VirtualOreDepositDefinition(String depositName) { + this.depositName = depositName; + } + + @Override + public boolean initializeFromConfig(@NotNull JsonObject configRoot) { + // the weight value for determining which vein will appear + this.weight = configRoot.get("weight").getAsInt(); + // the [minimum, maximum) yield of the vein + this.yields[0] = configRoot.get("yield").getAsJsonObject().get("min").getAsInt(); + this.yields[1] = configRoot.get("yield").getAsJsonObject().get("max").getAsInt(); + + // the fluid which the vein contains + JsonArray jsonMaterialList = configRoot.get("materials").getAsJsonArray(); + + for(JsonElement jsonElement : jsonMaterialList) { + Material material = MaterialRegistryManager.getInstance().getMaterial(jsonElement.getAsString()); + if (material != null) { + this.storedMaterials.add(material); + } else { + GTLog.logger.error("Virtual Ore Vein {} cannot have a null material!", this.depositName, + new RuntimeException()); + return false; + } + } + + JsonArray jsonMultiplierList = configRoot.get("multiplier").getAsJsonArray(); + + for(JsonElement jsonElement : jsonMultiplierList) { + if (jsonElement.getAsFloat() > 0) { + this.multipliers.add(jsonElement.getAsFloat()); + } else { + GTLog.logger.error("Multiplier cannot be less than or equal to 0!", this.depositName, + new RuntimeException()); + return false; + } + } + + // vein name for JEI display + if (configRoot.has("name")) { + this.assignedName = LocalizationUtils.format(configRoot.get("name").getAsString()); + } + // vein description for JEI display + if (configRoot.has("description")) { + this.description = configRoot.get("description").getAsString(); + } + // additional weighting changes determined by biomes + if (configRoot.has("biome_modifier")) { + this.biomeWeightModifier = WorldConfigUtils.createBiomeWeightModifier(configRoot.get("biome_modifier")); + } + // filtering of dimensions to determine where the vein can generate + if (configRoot.has("dimension_filter")) { + this.dimensionFilter = WorldConfigUtils.createWorldPredicate(configRoot.get("dimension_filter")); + } + VirtualOreVeinHandler.addVirtualOreDeposit(this); + return true; + } + + @Override + public String getDepositName() { + return depositName; + } + + public String getAssignedName() { + return assignedName; + } + + public String getDescription() { + return description; + } + + public int getWeight() { + return weight; + } + + @SuppressWarnings("unused") + public int[] getYields() { + return yields; + } + + public int getMinimumYield() { + return yields[0]; + } + + public int getMaximumYield() { + return yields[1]; + } + + public List getStoredMaterials() { + return storedMaterials; + } + + public ObjectList getMultipliers() { + return multipliers; + } + + public Function getBiomeWeightModifier() { + return biomeWeightModifier; + } + + public Predicate getDimensionFilter() { + return dimensionFilter; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof VirtualOreDepositDefinition)) + return false; + + VirtualOreDepositDefinition objDeposit = (VirtualOreDepositDefinition) obj; + if (this.weight != objDeposit.getWeight()) + return false; + if (this.getMinimumYield() != objDeposit.getMinimumYield()) + return false; + if (this.getMaximumYield() != objDeposit.getMaximumYield()) + return false; + if (!this.storedMaterials.equals(objDeposit.getStoredMaterials())) + return false; + if (!this.multipliers.equals(objDeposit.getMultipliers())) + return false; + if ((this.assignedName == null && objDeposit.getAssignedName() != null) || + (this.assignedName != null && objDeposit.getAssignedName() == null) || + (this.assignedName != null && objDeposit.getAssignedName() != null && + !this.assignedName.equals(objDeposit.getAssignedName()))) + return false; + if ((this.description == null && objDeposit.getDescription() != null) || + (this.description != null && objDeposit.getDescription() == null) || + (this.description != null && objDeposit.getDescription() != null && + !this.description.equals(objDeposit.getDescription()))) + return false; + if ((this.biomeWeightModifier == null && objDeposit.getBiomeWeightModifier() != null) || + (this.biomeWeightModifier != null && objDeposit.getBiomeWeightModifier() == null) || + (this.biomeWeightModifier != null && objDeposit.getBiomeWeightModifier() != null && + !this.biomeWeightModifier.equals(objDeposit.getBiomeWeightModifier()))) + return false; + if ((this.dimensionFilter == null && objDeposit.getDimensionFilter() != null) || + (this.dimensionFilter != null && objDeposit.getDimensionFilter() == null) || + (this.dimensionFilter != null && objDeposit.getDimensionFilter() != null && + !this.dimensionFilter.equals(objDeposit.getDimensionFilter()))) + return false; + + return super.equals(obj); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/worldgen/VirtualOreVeinHandler.java b/src/main/java/com/fulltrix/gcyl/api/worldgen/VirtualOreVeinHandler.java new file mode 100644 index 00000000..2c2c72e0 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/worldgen/VirtualOreVeinHandler.java @@ -0,0 +1,270 @@ +package com.fulltrix.gcyl.api.worldgen; + +import gregtech.api.GregTechAPI; +import gregtech.api.unification.material.Material; +import gregtech.api.util.FileUtility; +import gregtech.api.util.GTLog; +import gregtech.api.util.random.XoShiRo256PlusPlusRandom; +import gregtech.api.worldgen.bedrockFluids.ChunkPosDimension; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectList; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.biome.Biome; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.*; + +public class VirtualOreVeinHandler { + + public static final LinkedHashMap virtualOreVeinList = new LinkedHashMap<>(); + private final static Map> totalWeightMap = new HashMap<>(); + public static HashMap veinCache = new HashMap<>(); + + public static int saveDataVersion; + + public static final int MAX_VIRTUAL_ORE_SAVE_DATA_VERSION = 2; + + public static final int VEIN_CHUNK_SIZE = 3; // veins are 8x8 chunk squares + + + @Nullable + public static VirtualOreVeinHandler.VirtualOreVeinWorldEntry getVirtualOreVeinWorldEntry(@NotNull World world, int chunkX, int chunkZ) { + if (world.isRemote) + return null; + + ChunkPosDimension coords = new ChunkPosDimension(world.provider.getDimension(), getVeinCoord(chunkX), + getVeinCoord(chunkZ)); + + VirtualOreVeinHandler.VirtualOreVeinWorldEntry worldEntry = veinCache.get(coords); + if (worldEntry == null) { + VirtualOreDepositDefinition definition = null; + + int query = world.getChunk(getVeinCoord(chunkX), getVeinCoord(chunkZ)).getRandomWithSeed(90210).nextInt(); + + Biome biome = world.getBiomeForCoordsBody(new BlockPos(chunkX << 4, 64, chunkZ << 4)); + int totalWeight = getTotalWeight(world.provider, biome); + if (totalWeight > 0) { + int weight = Math.abs(query % totalWeight); + for (Map.Entry entry : virtualOreVeinList.entrySet()) { + int veinWeight = entry.getValue() + entry.getKey().getBiomeWeightModifier().apply(biome); + if (veinWeight > 0 && entry.getKey().getDimensionFilter().test(world.provider)) { + weight -= veinWeight; + if (weight < 0) { + definition = entry.getKey(); + break; + } + } + } + } + + if(definition == null) { + return null; + } + + ObjectList maximumYields = new ObjectArrayList<>(); + + for(float i : definition.getMultipliers()) { + + Random random = new XoShiRo256PlusPlusRandom(31L * 31 * chunkX + chunkZ * 31L + Long.hashCode(world.getSeed())); + + int maximumYield = 0; + if (definition != null) { + if (definition.getMaximumYield() * i - definition.getMinimumYield() <= 0) { + maximumYield = definition.getMinimumYield(); + } else { + maximumYield = random.nextInt((int) (definition.getMaximumYield() * i - definition.getMinimumYield())) + + definition.getMinimumYield(); + } + maximumYield = (int) Math.min(maximumYield, definition.getMaximumYield() * i); + } + + maximumYields.add(maximumYield); + } + + worldEntry = new VirtualOreVeinHandler.VirtualOreVeinWorldEntry(definition, maximumYields, maximumYields); + veinCache.put(coords, worldEntry); + } + return worldEntry; + } + + public static int getTotalWeight(@NotNull WorldProvider provider, Biome biome) { + int dim = provider.getDimension(); + if (!totalWeightMap.containsKey(dim)) { + totalWeightMap.put(dim, new HashMap<>()); + } + + Map dimMap = totalWeightMap.get(dim); + int biomeID = Biome.getIdForBiome(biome); + + if (dimMap.containsKey(biomeID)) { + return dimMap.get(biomeID); + } + + int totalWeight = 0; + for (Map.Entry entry : virtualOreVeinList.entrySet()) { + if (entry.getKey().getDimensionFilter().test(provider)) { + totalWeight += entry.getKey().getBiomeWeightModifier().apply(biome); + totalWeight += entry.getKey().getWeight(); + } + } + + // make sure the vein can generate if no biome weighting is added + if (totalWeight == 0 && !virtualOreVeinList.isEmpty()) + GTLog.logger.error("Virtual Ore Vein weight was 0 in biome {}", biome.biomeName); + + dimMap.put(biomeID, totalWeight); + return totalWeight; + } + + public static void addVirtualOreDeposit(VirtualOreDepositDefinition definition) { + virtualOreVeinList.put(definition, definition.getWeight()); + } + + public static void recalculateChances(boolean mutePackets) { + totalWeightMap.clear(); + if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER && !mutePackets) { + HashMap packetMap = new HashMap<>(); + for (Map.Entry entry : VirtualOreVeinHandler.veinCache + .entrySet()) { + if (entry.getKey() != null && entry.getValue() != null) + packetMap.put(entry.getValue(), entry.getValue().getDefinition().getWeight()); + } + GregTechAPI.networkHandler.sendToAll(new PacketVirtualOreVeinList(packetMap)); + } + } + + public static ObjectList getYield(World world, int chunkX, int chunkZ) { + VirtualOreVeinHandler.VirtualOreVeinWorldEntry info = getVirtualOreVeinWorldEntry(world, chunkX, chunkZ); + if (info == null) return null; + return info.getYield(); + } + + public static ObjectList getOperationsRemaining(World world, int chunkX, int chunkZ) { + VirtualOreVeinHandler.VirtualOreVeinWorldEntry info = getVirtualOreVeinWorldEntry(world, chunkX, chunkZ); + if (info == null) return null; + return info.getOperationsRemaining(); + } + + /* + public static ObjectList getMultipliers(World world, int chunkX, int chunkZ) { + VirtualOreVeinHandler.VirtualOreVeinWorldEntry info = getVirtualOreVeinWorldEntry(world, chunkX, chunkZ); + if(info == null) return 0; + return info.getMultipliers + } + + */ + + @Nullable + public static List getMaterialsInChunk(World world, int chunkX, int chunkZ) { + VirtualOreVeinHandler.VirtualOreVeinWorldEntry info = getVirtualOreVeinWorldEntry(world, chunkX, chunkZ); + if (info == null || info.getDefinition() == null) return null; + return info.getDefinition().getStoredMaterials(); + } + + public static void depleteVein(World world, int chunkX, int chunkZ, int amount, int layer, boolean ignoreVeinStats) { + VirtualOreVeinHandler.VirtualOreVeinWorldEntry info = getVirtualOreVeinWorldEntry(world, chunkX, chunkZ); + if (info == null) return; + + //TODO: what is this + if (ignoreVeinStats) { + info.decreaseOperations(amount, layer); + return; + } + + VirtualOreDepositDefinition definition = info.getDefinition(); + + // prevent division by zero, veins that never deplete don't need updating + if (definition == null) + return; + + info.decreaseOperations(amount, layer); + VirtualOreVeinSaveData.setDirty(); + } + + public static int getVeinCoord(int chunkCoord) { + if (saveDataVersion >= 2) { + return Math.floorDiv(chunkCoord, VEIN_CHUNK_SIZE); + } + return chunkCoord / VEIN_CHUNK_SIZE; + } + + + public static class VirtualOreVeinWorldEntry { + private VirtualOreDepositDefinition vein; + private ObjectList yield; + + private ObjectList operationsRemaining; + + public VirtualOreVeinWorldEntry(VirtualOreDepositDefinition vein, ObjectList yield, ObjectList operationsRemaining) { + this.vein = vein; + this.yield = yield; + this.operationsRemaining = operationsRemaining; + } + + private VirtualOreVeinWorldEntry() {} + + public VirtualOreDepositDefinition getDefinition() {return this.vein;} + + public ObjectList getYield() { + return this.yield; + } + + public ObjectList getOperationsRemaining() { + return this.operationsRemaining; + } + + public void setOperationsRemaining(int operationsRemaining, int layer) { + this.operationsRemaining.set(layer, operationsRemaining); + } + + public void decreaseOperations(int amount, int layer) { + operationsRemaining.set(layer, Math.max(0, operationsRemaining.get(layer) - amount)); + } + + public NBTTagCompound writeToNBT() { + NBTTagCompound tag = new NBTTagCompound(); + tag.setIntArray("yield", yield.stream().mapToInt(Integer::intValue).toArray()); + tag.setIntArray("operationsRemaining", operationsRemaining.stream().mapToInt(Integer::intValue).toArray()); + if (vein != null) { + tag.setString("vein", vein.getDepositName()); + } + return tag; + } + + @NotNull + public static VirtualOreVeinHandler.VirtualOreVeinWorldEntry readFromNBT(@NotNull NBTTagCompound tag) { + VirtualOreVeinHandler.VirtualOreVeinWorldEntry info = new VirtualOreVeinHandler.VirtualOreVeinWorldEntry(); + + int[] tempYield = tag.getIntArray("yield"); + int[] operationsRemaining = tag.getIntArray("operationsRemaining"); + + ObjectList ObjectYield = new ObjectArrayList<>(); + ObjectList ObjectOperationsRemaining = new ObjectArrayList<>(); + + for(int i = 0; i < tempYield.length; i++) { + ObjectYield.add(tempYield[i]); + ObjectOperationsRemaining.add(operationsRemaining[i]); + } + + info.yield = ObjectYield; + info.operationsRemaining = ObjectOperationsRemaining; + + if (tag.hasKey("vein")) { + String s = tag.getString("vein"); + for (VirtualOreDepositDefinition definition : virtualOreVeinList.keySet()) { + // old save data can have deposit names with native separators, get rid of those + if (FileUtility.nativeSepToSlash(s).equalsIgnoreCase(definition.getDepositName())) + info.vein = definition; + } + } + + return info; + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/api/worldgen/VirtualOreVeinSaveData.java b/src/main/java/com/fulltrix/gcyl/api/worldgen/VirtualOreVeinSaveData.java new file mode 100644 index 00000000..7d1e11f6 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/api/worldgen/VirtualOreVeinSaveData.java @@ -0,0 +1,75 @@ +package com.fulltrix.gcyl.api.worldgen; + +import com.fulltrix.gcyl.Tags; +import gregtech.api.worldgen.bedrockFluids.ChunkPosDimension; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.storage.WorldSavedData; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; +import org.jetbrains.annotations.NotNull; + +import java.util.Map; + +public class VirtualOreVeinSaveData extends WorldSavedData { + + private static VirtualOreVeinSaveData INSTANCE; + + public static final String dataName = Tags.MODID + ".virtualOreVeinData"; + + public VirtualOreVeinSaveData(String s) { + super(s); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + NBTTagList veinList = nbt.getTagList("veinInfo", 10); + VirtualOreVeinHandler.veinCache.clear(); + for (int i = 0; i < veinList.tagCount(); i++) { + NBTTagCompound tag = veinList.getCompoundTagAt(i); + ChunkPosDimension coords = ChunkPosDimension.readFromNBT(tag); + if (coords != null) { + VirtualOreVeinHandler.VirtualOreVeinWorldEntry info = VirtualOreVeinHandler.VirtualOreVeinWorldEntry + .readFromNBT(tag.getCompoundTag("info")); + VirtualOreVeinHandler.veinCache.put(coords, info); + } + } + + if (nbt.hasKey("version")) { + VirtualOreVeinHandler.saveDataVersion = nbt.getInteger("version"); + } else if (veinList.isEmpty()) { + // there are no veins, so there is no data to be changed or lost by bumping the version + VirtualOreVeinHandler.saveDataVersion = VirtualOreVeinHandler.MAX_VIRTUAL_ORE_SAVE_DATA_VERSION; + } else { + // version number was added to the save data with version 2 + VirtualOreVeinHandler.saveDataVersion = 1; + } + } + + @Override + public @NotNull NBTTagCompound writeToNBT(@NotNull NBTTagCompound nbt) { + NBTTagList oilList = new NBTTagList(); + for (Map.Entry e : VirtualOreVeinHandler.veinCache + .entrySet()) { + if (e.getKey() != null && e.getValue() != null) { + NBTTagCompound tag = e.getKey().writeToNBT(); + tag.setTag("info", e.getValue().writeToNBT()); + oilList.appendTag(tag); + } + } + nbt.setTag("veinInfo", oilList); + nbt.setInteger("version", VirtualOreVeinHandler.saveDataVersion); + + return nbt; + } + + public static void setDirty() { + if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER && INSTANCE != null) + INSTANCE.markDirty(); + } + + public static void setInstance(VirtualOreVeinSaveData in) { + if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) + INSTANCE = in; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/worldgen/WorldGenRegister.java b/src/main/java/com/fulltrix/gcyl/api/worldgen/WorldGenRegister.java similarity index 58% rename from src/main/java/com/fulltrix/gcyl/worldgen/WorldGenRegister.java rename to src/main/java/com/fulltrix/gcyl/api/worldgen/WorldGenRegister.java index 5f8d702b..a5459af9 100644 --- a/src/main/java/com/fulltrix/gcyl/worldgen/WorldGenRegister.java +++ b/src/main/java/com/fulltrix/gcyl/api/worldgen/WorldGenRegister.java @@ -1,12 +1,20 @@ -package com.fulltrix.gcyl.worldgen; +package com.fulltrix.gcyl.api.worldgen; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import gregtech.api.GTValues; +import gregtech.api.util.FileUtility; import gregtech.api.util.GTLog; +import gregtech.api.worldgen.config.BedrockFluidDepositDefinition; +import gregtech.api.worldgen.config.IWorldgenDefinition; +import gregtech.api.worldgen.config.OreDepositDefinition; import gregtech.api.worldgen.config.WorldGenRegistry; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import net.minecraftforge.fml.common.Loader; import org.apache.commons.io.IOUtils; +import org.jetbrains.annotations.NotNull; import java.io.FileNotFoundException; import java.io.IOException; @@ -14,15 +22,20 @@ import java.net.URISyntaxException; import java.net.URL; import java.nio.file.*; +import java.util.ArrayList; import java.util.Collections; +import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; public class WorldGenRegister { - private static final int FLUID_VEIN_VERSION = 2; - private static final int ORE_VEIN_VERSION = 1; + public static final WorldGenRegister INSTANCE = new WorldGenRegister(); + private static final int VIRTUAL_ORE_VEIN_VERSION = 2; private final Int2ObjectMap namedDimensions = new Int2ObjectOpenHashMap<>(); + private final List registeredVirutalOreVeinsDefinitions = new ArrayList<>(); + private final List removedVirtualOreVeinDefinitions = new ArrayList<>(); + private final List addonRegisteredVirtualOreVeinDefinitions = new ArrayList<>(); public static void init() throws IOException { @@ -40,6 +53,11 @@ public static void init() throws IOException { WorldGenRegistry.INSTANCE.reinitializeRegisteredVeins(); + try { + INSTANCE.reinitializeRegisteredVirtualOreVeins(); + } catch (IOException | RuntimeException exception) { + GTLog.logger.fatal("Failed to initialize worldgen registry.", exception); + } } private static void removeGTConfigs() throws IOException { @@ -47,7 +65,7 @@ private static void removeGTConfigs() throws IOException { Path worldgenVeinRootPath = configPath.resolve("worldgen/vein"); Path worldgenFluidRootPath = configPath.resolve("worldgen/fluid"); Path gtUnpacked = configPath.resolve("worldgen_extracted.json"); - Path extractedLock = configPath.resolve("worldgen_extracted_gcyl"); + Path extractedLock = configPath.resolve("worldgen_extracted_gcyl.json"); String[] dims = new String[]{"end", "nether", "overworld"}; if (Files.exists(gtUnpacked) && !Files.exists(extractedLock)) { for (String dim : dims) { @@ -136,26 +154,206 @@ private static void removeGTConfigs() throws IOException { } } + public void reinitializeRegisteredVirtualOreVeins() throws IOException { + GTLog.logger.info("Reloading ore generation files from config..."); + registeredVirutalOreVeinsDefinitions.clear(); + Path configPath = Loader.instance().getConfigDir().toPath().resolve(GTValues.MODID); + // The Path for the file used to name dimensions for the JEI ore gen page + Path dimensionsFile = configPath.resolve("dimensions.json"); + // The folder where worldgen definitions are stored + Path worldgenRootPath = configPath.resolve("worldgen"); + // Lock file used to determine if the worldgen files need to be regenerated + // This is used to ensure modifications to ore gen in modpacks are not overwritten + Path jarFileExtractLock = configPath.resolve("worldgen_extracted_gcyl.json"); + if (!Files.exists(worldgenRootPath)) + Files.createDirectories(worldgenRootPath); + + // Remove the old extract lock file if it exists to remove clutter + Path jarFileExtractLockOLD = configPath.resolve("worldgen_extracted.txt"); + Files.deleteIfExists(jarFileExtractLockOLD); + + // The folder where all physical veins are stored + Path virtualPath = worldgenRootPath.resolve("virtual"); + if (!Files.exists(virtualPath)) + Files.createDirectories(virtualPath); + + // Checks if the dimension file exists. If not, creates the file and extracts the defaults from the mod jar + if (!Files.exists(dimensionsFile)) { + Files.createFile(dimensionsFile); + extractJarVeinDefinitions(configPath, dimensionsFile); + } + + if (Files.exists(jarFileExtractLock)) { + JsonObject extractLock = FileUtility.tryExtractFromFile(jarFileExtractLock); + if (extractLock != null) { + boolean needsUpdate = false; + if (extractLock.get("virtualOreVersion").getAsInt() != VIRTUAL_ORE_VEIN_VERSION) { + extractJarVeinDefinitions(configPath, virtualPath); + needsUpdate = true; + } + // bump the version(s) on the lock file if needed + if (needsUpdate) { + extractJarVeinDefinitions(configPath, jarFileExtractLock); + } + } + } else { + // force an override here as needed for updating legacy config blocks + if (VIRTUAL_ORE_VEIN_VERSION > 1) { + extractJarVeinDefinitions(configPath, virtualPath); + } + // create extraction lock since it doesn't exist + Files.createFile(jarFileExtractLock); + extractJarVeinDefinitions(configPath, jarFileExtractLock); + } + + // attempt extraction if worldgen root directory is empty + boolean shouldExtract; + try (Stream stream = Files.list(worldgenRootPath.resolve(virtualPath))) { + shouldExtract = !stream.findFirst().isPresent(); + } + if (shouldExtract) { + extractJarVeinDefinitions(configPath, virtualPath); + } + + // Read the dimensions name from the dimensions file + gatherNamedDimensions(dimensionsFile); + + // Will always fail when called from initializeRegistry + // Placed here to delete the file before being gathered and having its definition initialized + if (!removedVirtualOreVeinDefinitions.isEmpty()) { + removeExistingFiles(virtualPath, removedVirtualOreVeinDefinitions); + } + + // Gather the worldgen vein files from the various folders in the config + List virtualOreVeinFiles; + try (Stream stream = Files.walk(virtualPath)) { + virtualOreVeinFiles = stream.filter(path -> path.toString().endsWith(".json")) + .filter(Files::isRegularFile) + .collect(Collectors.toList()); + } + + for (Path worldgenDefinition : virtualOreVeinFiles) { + + // Tries to extract the json worldgen definition from the file + JsonObject element = FileUtility.tryExtractFromFile(worldgenDefinition); + if (element == null) { + break; + } + + // Finds the file name to create the Definition with, using a consistent separator character + String depositName = FileUtility + .nativeSepToSlash(virtualPath.relativize(worldgenDefinition).toString()); + + try { + // Creates the deposit definition and initializes various components based on the json entries in the + // file + VirtualOreDepositDefinition deposit = new VirtualOreDepositDefinition(depositName); + // Adds the registered definition to the list of all registered definitions + if (deposit.initializeFromConfig(element)) { + registeredVirutalOreVeinsDefinitions.add(deposit); + } + } catch (RuntimeException exception) { + GTLog.logger.error("Failed to parse worldgen definition {} on path {}", depositName, worldgenDefinition, + exception); + } + } + + addAddonFiles(worldgenRootPath, addonRegisteredVirtualOreVeinDefinitions, registeredVirutalOreVeinsDefinitions); + + GTLog.logger.info("Loaded {} virtual ore worldgen definitions", registeredVirutalOreVeinsDefinitions.size()); + GTLog.logger.info("Loaded {} virtual ore worldgen definitions from addon mods", + addonRegisteredVirtualOreVeinDefinitions.size()); + GTLog.logger.info("Loaded {} total worldgen definitions", + registeredVirutalOreVeinsDefinitions.size() + registeredVirutalOreVeinsDefinitions.size()); + } + + private static void addAddonFiles(Path root, @NotNull List definitions, + @NotNull List registeredDefinitions) { + Iterator it = definitions.iterator(); + while (it.hasNext()) { + T definition = it.next(); + + JsonObject element = FileUtility + .tryExtractFromFile(root.resolve(FileUtility.slashToNativeSep(definition.getDepositName()))); + + if (element == null) { + GTLog.logger.error("Addon mod tried to register bad ore definition at {}", definition.getDepositName()); + it.remove(); + continue; + } + + try { + definition.initializeFromConfig(element); + registeredDefinitions.add(definition); + } catch (RuntimeException exception) { + GTLog.logger.error("Failed to parse addon worldgen definition {}", definition.getDepositName(), + exception); + } + } + } + + private static void removeExistingFiles(Path root, @NotNull List definitions) { + for (IWorldgenDefinition definition : definitions) { + Path filePath = root.resolve(Paths.get(FileUtility.slashToNativeSep(definition.getDepositName()))); + + try { + if (Files.exists(filePath)) { + Files.delete(filePath); + GTLog.logger.info("Removed oregen file at {}", definition.getDepositName()); + } + } catch (IOException exception) { + GTLog.logger.error("Failed to remove oregen file at {}", definition.getDepositName()); + } + } + } + private static void copyCustomConfigs() throws IOException { Path configPath = Loader.instance().getConfigDir().toPath().resolve(GTValues.MODID); Path worldgenVeinRootPath = configPath.resolve("worldgen/vein"); Path worldgenFluidRootPath = configPath.resolve("worldgen/fluid"); - Path jarFileExtractLock = configPath.resolve("worldgen_extracted_gcyl"); + Path worldgenVirtualRootPath = configPath.resolve("worldgen/virtual"); + Path jarFileExtractLock = configPath.resolve("worldgen_extracted_gcyl.json"); if (!Files.exists(worldgenVeinRootPath)) { Files.createDirectories(worldgenVeinRootPath); } + if (!Files.exists(worldgenFluidRootPath)) { + Files.createDirectories(worldgenFluidRootPath); + } + + if (!Files.exists(worldgenVirtualRootPath)) { + Files.createDirectories(worldgenVirtualRootPath); + } if (!Files.exists(jarFileExtractLock) || !Files.list(worldgenVeinRootPath).peek(path -> GTLog.logger.info(path)).findFirst().isPresent()) { if (!Files.exists(jarFileExtractLock)) { Files.createFile(jarFileExtractLock); + extractJarVeinDefinitions(configPath, jarFileExtractLock); } WorldGenRegister.extractJarVeinDefinitions(configPath, worldgenVeinRootPath); WorldGenRegister.extractJarVeinDefinitions(configPath, worldgenFluidRootPath); + WorldGenRegister.extractJarVeinDefinitions(configPath, worldgenVirtualRootPath); } } + private void gatherNamedDimensions(Path dimensionsFile) { + JsonObject element = FileUtility.tryExtractFromFile(dimensionsFile); + if (element == null) { + return; + } + + try { + JsonArray dims = element.getAsJsonArray("dims"); + for (JsonElement dim : dims) { + namedDimensions.put(dim.getAsJsonObject().get("dimID").getAsInt(), + dim.getAsJsonObject().get("dimName").getAsString()); + } + } catch (RuntimeException exception) { + GTLog.logger.error("Failed to parse named dimensions", exception); + } + } + private static void extractJarVeinDefinitions(Path configPath, Path targetPath) throws IOException { // The path of the worldgen folder in the config folder @@ -164,6 +362,8 @@ private static void extractJarVeinDefinitions(Path configPath, Path targetPath) Path oreVeinRootPath = worldgenRootPath.resolve("vein"); // The path of the bedrock fluid vein folder in the config folder Path bedrockFluidVeinRootPath = worldgenRootPath.resolve("fluid"); + // The path of the virtual ore vein folder in the config folder + Path virtualOreVeinRootPath = worldgenRootPath.resolve("virtual"); // The path of the named dimensions file in the config folder Path dimensionsRootPath = configPath.resolve("dimensions.json"); // THe path of the lock file in the config folder @@ -176,17 +376,21 @@ private static void extractJarVeinDefinitions(Path configPath, Path targetPath) // The Path for representing the worldgen folder in the assets folder in the Gregtech resources folder in // the jar Path worldgenJarRootPath; - // The Path for representing the vein folder in the vein folder in the assets folder in the Gregtech + // The Path for representing the vein folder in the vein folder in the assets folder in the Gcyl // resources folder in the jar Path oreVeinJarRootPath; - // The Path for representing the fluid folder in the vein folder in the assets folder in the Gregtech + // The Path for representing the fluid folder in the vein folder in the assets folder in the Gcyl // resources folder in the jar Path bedrockFluidJarRootPath; + // The Path for representing the virtual folder in the vein folder in the assets folder in the Gcyl + // resources folder in the jar + Path virtualOreJarRootPath; if (sampleUri.getScheme().equals("jar") || sampleUri.getScheme().equals("zip")) { zipFileSystem = FileSystems.newFileSystem(sampleUri, Collections.emptyMap()); worldgenJarRootPath = zipFileSystem.getPath("/assets/gcyl/worldgen"); oreVeinJarRootPath = zipFileSystem.getPath("/assets/gcyl/worldgen/vein"); bedrockFluidJarRootPath = zipFileSystem.getPath("/assets/gcyl/worldgen/fluid"); + virtualOreJarRootPath = zipFileSystem.getPath("/assets/gcyl/worldgen/virtual"); } else if (sampleUri.getScheme().equals("file")) { URL url = WorldGenRegistry.class.getResource("/assets/gcyl/worldgen"); if (url == null) throw new FileNotFoundException("Could not find /assets/gcyl/worldgen"); @@ -199,6 +403,10 @@ private static void extractJarVeinDefinitions(Path configPath, Path targetPath) url = WorldGenRegistry.class.getResource("/assets/gcyl/worldgen/fluid"); if (url == null) throw new FileNotFoundException("Could not find /assets/gcyl/worldgen/fluid"); bedrockFluidJarRootPath = Paths.get(url.toURI()); + + url = WorldGenRegistry.class.getResource("/assets/gcyl/worldgen/virtual"); + if (url == null) throw new FileNotFoundException("Could not find /assets/gcyl/worldgen/virtual"); + virtualOreJarRootPath = Paths.get(url.toURI()); } else { throw new IllegalStateException( "Unable to locate absolute path to worldgen root directory: " + sampleUri); @@ -239,6 +447,24 @@ private static void extractJarVeinDefinitions(Path configPath, Path targetPath) } GTLog.logger.info("Extracted {} builtin worldgen bedrock fluid definitions into fluid folder", jarFiles.size()); + } else if (targetPath.compareTo(virtualOreVeinRootPath) == 0) { + GTLog.logger.info("Attempting extraction of standard worldgen definitions from {} to {}", + virtualOreJarRootPath, virtualOreVeinRootPath); + // Find all the default worldgen files in the assets folder + List jarFiles; + try (Stream stream = Files.walk(virtualOreJarRootPath)) { + jarFiles = stream.filter(Files::isRegularFile).collect(Collectors.toList()); + } + + // Replaces or creates the default worldgen files + for (Path jarFile : jarFiles) { + Path worldgenPath = virtualOreVeinRootPath + .resolve(virtualOreJarRootPath.relativize(jarFile).toString()); + Files.createDirectories(worldgenPath.getParent()); + Files.copy(jarFile, worldgenPath, StandardCopyOption.REPLACE_EXISTING); + } + GTLog.logger.info("Extracted {} builtin worldgen virtual ore definitions into virtual folder", + jarFiles.size()); } // Attempts to extract the named dimensions json folder else if (targetPath.compareTo(dimensionsRootPath) == 0) { @@ -275,5 +501,7 @@ else if (targetPath.compareTo(extractLockPath) == 0) { } } - + public static List getVirtualOreDepositDefinitions() { + return Collections.unmodifiableList(INSTANCE.registeredVirutalOreVeinsDefinitions); + } } diff --git a/src/main/java/com/fulltrix/gcyl/item/GCYLExplosive.java b/src/main/java/com/fulltrix/gcyl/blocks/GCYLExplosive.java similarity index 96% rename from src/main/java/com/fulltrix/gcyl/item/GCYLExplosive.java rename to src/main/java/com/fulltrix/gcyl/blocks/GCYLExplosive.java index e513b31a..35d55492 100644 --- a/src/main/java/com/fulltrix/gcyl/item/GCYLExplosive.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/GCYLExplosive.java @@ -1,4 +1,4 @@ -package com.fulltrix.gcyl.item; +package com.fulltrix.gcyl.blocks; import gregtech.api.block.VariantBlock; import net.minecraft.block.SoundType; diff --git a/src/main/java/com/fulltrix/gcyl/item/GCYLHeatingCoil.java b/src/main/java/com/fulltrix/gcyl/blocks/GCYLHeatingCoil.java similarity index 96% rename from src/main/java/com/fulltrix/gcyl/item/GCYLHeatingCoil.java rename to src/main/java/com/fulltrix/gcyl/blocks/GCYLHeatingCoil.java index 91c118b0..95a077e7 100644 --- a/src/main/java/com/fulltrix/gcyl/item/GCYLHeatingCoil.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/GCYLHeatingCoil.java @@ -1,4 +1,4 @@ -package com.fulltrix.gcyl.item; +package com.fulltrix.gcyl.blocks; import com.fulltrix.gcyl.materials.GCYLMaterials; import gregtech.api.block.IHeatingCoilBlockStats; @@ -60,7 +60,7 @@ public void addInformation(@Nonnull ItemStack itemStack, @Nullable World worldIn lines.add(I18n.format("tile.wire_coil.tooltip_heat", coilType.coilTemperature)); if (TooltipHelper.isShiftDown()) { - int coilTier = coilType.ordinal(); + int coilTier = coilType.ordinal() + 6; lines.add(I18n.format("tile.wire_coil.tooltip_smelter")); lines.add(I18n.format("tile.wire_coil.tooltip_parallel_smelter", coilType.level * 32)); int EUt = MetaTileEntityMultiSmelter.getEUtForParallel(MetaTileEntityMultiSmelter.getMaxParallel(coilType.getLevel()), coilType.getEnergyDiscount()); @@ -81,7 +81,7 @@ public boolean canCreatureSpawn(@Nonnull IBlockState state, @Nonnull IBlockAcces @Override - protected boolean isBloomEnabled(GCYLHeatingCoil.CoilType value) { + public boolean isBloomEnabled(GCYLHeatingCoil.CoilType value) { return ConfigHolder.client.coilsActiveEmissiveTextures; } @@ -129,7 +129,7 @@ public int getEnergyDiscount() { @Override public int getTier() { - return this.ordinal(); + return this.ordinal() + 6; } @Nullable diff --git a/src/main/java/com/fulltrix/gcyl/item/GCYLMetaBlocks.java b/src/main/java/com/fulltrix/gcyl/blocks/GCYLMetaBlocks.java similarity index 68% rename from src/main/java/com/fulltrix/gcyl/item/GCYLMetaBlocks.java rename to src/main/java/com/fulltrix/gcyl/blocks/GCYLMetaBlocks.java index 11a5190a..f94a3e51 100644 --- a/src/main/java/com/fulltrix/gcyl/item/GCYLMetaBlocks.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/GCYLMetaBlocks.java @@ -1,11 +1,12 @@ -package com.fulltrix.gcyl.item; - -import com.fulltrix.gcyl.item.fusion.GCYLCryostatCasing; -import com.fulltrix.gcyl.item.fusion.GCYLDivertorCasing; -import com.fulltrix.gcyl.item.fusion.GCYLFusionCasing; -import com.fulltrix.gcyl.item.fusion.GCYLVacuumCasing; -import com.fulltrix.gcyl.item.metal.MetalCasing1; -import com.fulltrix.gcyl.item.metal.MetalCasing2; +package com.fulltrix.gcyl.blocks; + +import com.fulltrix.gcyl.blocks.component_al.GCYLComponentALCasing; +import com.fulltrix.gcyl.blocks.elevator.ElevatorCasing; +import com.fulltrix.gcyl.blocks.elevator.ElevatorCasingTiered; +import com.fulltrix.gcyl.blocks.fusion.*; +import com.fulltrix.gcyl.blocks.metal.GCYLCleanroomCasing; +import com.fulltrix.gcyl.blocks.metal.MetalCasing1; +import com.fulltrix.gcyl.blocks.metal.MetalCasing2; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.block.model.ModelResourceLocation; @@ -20,6 +21,7 @@ public class GCYLMetaBlocks { public static GCYLMultiblockCasing2 MULTIBLOCK_CASING2; //public static GCYLTransparentCasing TRANSPARENT_CASING; public static GCYLHeatingCoil HEATING_COIL; + public static GCYLFusionCoils FUSION_COILS; public static GCYLFusionCasing FUSION_CASING; public static GCYLVacuumCasing VACUUM_CASING; public static GCYLDivertorCasing DIVERTOR_CASING; @@ -29,7 +31,10 @@ public class GCYLMetaBlocks { public static GCYLReactorCasing REACTOR_CASING; public static MetalCasing1 METAL_CASING_1; public static MetalCasing2 METAL_CASING_2; - + public static GCYLCleanroomCasing GCYL_CLEANROOM_CASING; + public static GCYLComponentALCasing GCYL_COMPONENT_AL_CASING; + public static ElevatorCasing ELEVATOR_CASING; + public static ElevatorCasingTiered ELEVATOR_CASING_TIERED; public static void init() { HEATING_COIL = new GCYLHeatingCoil(); @@ -41,6 +46,9 @@ public static void init() { MULTIBLOCK_CASING2 = new GCYLMultiblockCasing2(); MULTIBLOCK_CASING2.setRegistryName("gcyl_multiblock_casing2"); + FUSION_COILS = new GCYLFusionCoils(); + FUSION_COILS.setRegistryName("gcyl_fusion_coil"); + FUSION_CASING = new GCYLFusionCasing(); FUSION_CASING.setRegistryName("gcyl_fusion_casing"); @@ -68,6 +76,17 @@ public static void init() { REACTOR_CASING = new GCYLReactorCasing(); REACTOR_CASING.setRegistryName("gcyl_reactor_casing"); + GCYL_CLEANROOM_CASING = new GCYLCleanroomCasing(); + GCYL_CLEANROOM_CASING.setRegistryName("gcyl_cleanroom_casing"); + + GCYL_COMPONENT_AL_CASING = new GCYLComponentALCasing(); + GCYL_COMPONENT_AL_CASING.setRegistryName("gcyl_component_al_casing"); + + ELEVATOR_CASING = new ElevatorCasing(); + ELEVATOR_CASING.setRegistryName("elevator_casing"); + ELEVATOR_CASING_TIERED = new ElevatorCasingTiered(); + ELEVATOR_CASING_TIERED.setRegistryName("elevator_casing_tiered"); + } @SideOnly(Side.CLIENT) @@ -75,6 +94,7 @@ public static void registerItemModels() { registerItemModel(MULTIBLOCK_CASING2); //registerItemModel(TRANSPARENT_CASING); + //registerItemModel(FUSION_CASING); registerItemModel(FUSION_CASING); registerItemModel(VACUUM_CASING); registerItemModel(DIVERTOR_CASING); @@ -84,9 +104,13 @@ public static void registerItemModels() { registerItemModel(METAL_CASING_1); registerItemModel(METAL_CASING_2); registerItemModel(REACTOR_CASING); + registerItemModel(GCYL_CLEANROOM_CASING); + registerItemModel(GCYL_COMPONENT_AL_CASING); + registerItemModel(ELEVATOR_CASING); + registerItemModel(ELEVATOR_CASING_TIERED); HEATING_COIL.onModelRegister(); - + FUSION_COILS.onModelRegister(); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/com/fulltrix/gcyl/item/GCYLMultiblockCasing2.java b/src/main/java/com/fulltrix/gcyl/blocks/GCYLMultiblockCasing2.java similarity index 90% rename from src/main/java/com/fulltrix/gcyl/item/GCYLMultiblockCasing2.java rename to src/main/java/com/fulltrix/gcyl/blocks/GCYLMultiblockCasing2.java index b7f745e2..cf691d5b 100644 --- a/src/main/java/com/fulltrix/gcyl/item/GCYLMultiblockCasing2.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/GCYLMultiblockCasing2.java @@ -1,4 +1,4 @@ -package com.fulltrix.gcyl.item; +package com.fulltrix.gcyl.blocks; import gregtech.api.block.VariantBlock; import net.minecraft.block.SoundType; @@ -29,7 +29,8 @@ public boolean canCreatureSpawn(@Nonnull IBlockState state, @Nonnull IBlockAcces public enum CasingType implements IStringSerializable { BIO_REACTOR("bio_reactor_casing", -1), - STELLAR_CONTAINMENT("stellar_containment", -1); + STELLAR_CONTAINMENT("stellar_containment", -1), + SEABORGIUM_SUBSTATION("seaborgium_substation_casing", -1); private final String name; private final int tier; diff --git a/src/main/java/com/fulltrix/gcyl/item/GCYLReactorCasing.java b/src/main/java/com/fulltrix/gcyl/blocks/GCYLReactorCasing.java similarity index 97% rename from src/main/java/com/fulltrix/gcyl/item/GCYLReactorCasing.java rename to src/main/java/com/fulltrix/gcyl/blocks/GCYLReactorCasing.java index 61498833..0a8900db 100644 --- a/src/main/java/com/fulltrix/gcyl/item/GCYLReactorCasing.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/GCYLReactorCasing.java @@ -1,4 +1,4 @@ -package com.fulltrix.gcyl.item; +package com.fulltrix.gcyl.blocks; import gregtech.api.block.VariantBlock; import net.minecraft.block.SoundType; diff --git a/src/main/java/com/fulltrix/gcyl/item/GCYLSimpleBlock.java b/src/main/java/com/fulltrix/gcyl/blocks/GCYLSimpleBlock.java similarity index 96% rename from src/main/java/com/fulltrix/gcyl/item/GCYLSimpleBlock.java rename to src/main/java/com/fulltrix/gcyl/blocks/GCYLSimpleBlock.java index aecdbe45..7e02565d 100644 --- a/src/main/java/com/fulltrix/gcyl/item/GCYLSimpleBlock.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/GCYLSimpleBlock.java @@ -1,4 +1,4 @@ -package com.fulltrix.gcyl.item; +package com.fulltrix.gcyl.blocks; import gregtech.api.block.VariantBlock; import net.minecraft.block.SoundType; diff --git a/src/main/java/com/fulltrix/gcyl/item/GCYLTransparentCasing.java b/src/main/java/com/fulltrix/gcyl/blocks/GCYLTransparentCasing.java similarity index 98% rename from src/main/java/com/fulltrix/gcyl/item/GCYLTransparentCasing.java rename to src/main/java/com/fulltrix/gcyl/blocks/GCYLTransparentCasing.java index 1f782f98..99861df6 100644 --- a/src/main/java/com/fulltrix/gcyl/item/GCYLTransparentCasing.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/GCYLTransparentCasing.java @@ -1,4 +1,4 @@ -package com.fulltrix.gcyl.item; +package com.fulltrix.gcyl.blocks; import gregtech.api.block.VariantBlock; import gregtech.api.items.toolitem.ToolClasses; diff --git a/src/main/java/com/fulltrix/gcyl/blocks/component_al/GCYLComponentALCasing.java b/src/main/java/com/fulltrix/gcyl/blocks/component_al/GCYLComponentALCasing.java new file mode 100644 index 00000000..c440651b --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/blocks/component_al/GCYLComponentALCasing.java @@ -0,0 +1,95 @@ +package com.fulltrix.gcyl.blocks.component_al; + +import com.fulltrix.gcyl.api.block.IComponentALTier; +import gregtech.api.block.IStateHarvestLevel; +import gregtech.api.block.VariantBlock; +import gregtech.api.items.toolitem.ToolClasses; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import org.jetbrains.annotations.NotNull; + +import javax.annotation.Nonnull; + +public class GCYLComponentALCasing extends VariantBlock { + public GCYLComponentALCasing() { + super(Material.IRON); + setTranslationKey("gcyl_component_al_casing"); + setHardness(5.0f); + setResistance(10.0f); + setSoundType(SoundType.METAL); + setDefaultState(getState(CasingType.CASING_LV)); + } + + @Override + public boolean canCreatureSpawn(@Nonnull IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EntityLiving.SpawnPlacementType type) { + return false; + } + + public enum CasingType implements IStringSerializable, IStateHarvestLevel, IComponentALTier { + + CASING_LV("lv", 3), + CASING_MV("mv", 3), + CASING_HV("hv", 3), + CASING_EV("ev", 3), + CASING_IV("iv", 3), + CASING_LuV("luv", 3), + CASING_ZPM("zpm", 3), + CASING_UV("uv", 3), + CASING_UHV("uhv", 3), + CASING_UEV("uev", 3), + CASING_UIV("uiv", 3), + CASING_UXV("uxv", 3), + CASING_OpV("opv", 3), + CASING_MAX("max", 3); + + private final int harvestLevel; + private final String name; + + CasingType(String name, int harvestLevel) { + this.name = name; + this.harvestLevel = harvestLevel; + } + @NotNull + @Override + public String getName() { + return this.name; + } + + @Override + public int getHarvestLevel(IBlockState state) { + return harvestLevel; + } + + @Override + public String getHarvestTool(IBlockState state) { + return ToolClasses.WRENCH; + } + + @Override + public int getTier() {return this.ordinal(); } + + public CasingType getCasingByTier(int tier) { + return switch (tier) { + case(2)-> CASING_MV; + case(3)-> CASING_HV; + case(4)-> CASING_EV; + case(5)-> CASING_IV; + case(6)-> CASING_LuV; + case(7)-> CASING_ZPM; + case(8)-> CASING_UV; + case(9)-> CASING_UHV; + case(10)-> CASING_UEV; + case(11)-> CASING_UIV; + case(12)-> CASING_UXV; + case(13)-> CASING_OpV; + case(14)-> CASING_MAX; + default -> CASING_LV; + }; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/fulltrix/gcyl/item/fusion/GCYLFusionCasing.java b/src/main/java/com/fulltrix/gcyl/blocks/elevator/ElevatorCasing.java similarity index 55% rename from src/main/java/com/fulltrix/gcyl/item/fusion/GCYLFusionCasing.java rename to src/main/java/com/fulltrix/gcyl/blocks/elevator/ElevatorCasing.java index 61fcfff0..ac13be03 100644 --- a/src/main/java/com/fulltrix/gcyl/item/fusion/GCYLFusionCasing.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/elevator/ElevatorCasing.java @@ -1,5 +1,6 @@ -package com.fulltrix.gcyl.item.fusion; +package com.fulltrix.gcyl.blocks.elevator; +import com.fulltrix.gcyl.blocks.fusion.GCYLCryostatCasing; import gregtech.api.block.VariantBlock; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; @@ -12,16 +13,15 @@ import javax.annotation.Nonnull; -//TODO: make coils have bloom while working. -public class GCYLFusionCasing extends VariantBlock { - public GCYLFusionCasing() { +public class ElevatorCasing extends VariantBlock { + public ElevatorCasing() { super(Material.IRON); - setTranslationKey("gcyl_fusion_casing"); + setTranslationKey("gcyl_elevator_casing"); setHardness(5.0f); setResistance(10.0f); setSoundType(SoundType.METAL); - setHarvestLevel("wrench", 2); - setDefaultState(getState(CasingType.ADV_FUSION_CASING)); + setHarvestLevel("wrench", 3); + setDefaultState(getState(ElevatorCasing.CasingType.HIGH_STRENGTH_CONCRETE)); } @Override @@ -31,17 +31,11 @@ public boolean canCreatureSpawn(@Nonnull IBlockState state, @Nonnull IBlockAcces public enum CasingType implements IStringSerializable { - ADV_FUSION_CASING("adv_fusion_casing"), - //FUSION_COIL_2("fusion_coil_2"), - //FUSION_COIL_3("fusion_coil_3"), - ADV_FUSION_COIL_1("adv_fusion_coil_1"), - ADV_FUSION_COIL_2("adv_fusion_coil_2"), - ADV_FUSION_COIL_3("adv_fusion_coil_3"), - ADV_FUSION_COIL_4("adv_fusion_coil_4"), - ADV_FUSION_COIL_5("adv_fusion_coil_5"), - BLANKET_BASE("blanket_base"), - FUSION_BLANKET("fusion_blanket"), - BREEDING_BLANKET("breeding_blanket"); + HIGH_STRENGTH_CONCRETE("concrete_strong"), + ELEVATOR_BASE_CASING("elevator_base"), + ELEVATOR_INTERNAL_STRUCTURE("elevator_internal"), + ELEVATOR_SUPPORT_STRUCTURE("elevator_support"), + ELEVATOR_CABLE("elevator_cable"); private final String name; @@ -56,4 +50,5 @@ public enum CasingType implements IStringSerializable { } } + } diff --git a/src/main/java/com/fulltrix/gcyl/blocks/elevator/ElevatorCasingTiered.java b/src/main/java/com/fulltrix/gcyl/blocks/elevator/ElevatorCasingTiered.java new file mode 100644 index 00000000..d0db3684 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/blocks/elevator/ElevatorCasingTiered.java @@ -0,0 +1,57 @@ +package com.fulltrix.gcyl.blocks.elevator; + +import com.fulltrix.gcyl.api.block.IElevatorMotorTier; +import gregtech.api.block.VariantBlock; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import org.jetbrains.annotations.NotNull; + +import javax.annotation.Nonnull; + +public class ElevatorCasingTiered extends VariantBlock { + public ElevatorCasingTiered() { + super(Material.IRON); + setTranslationKey("gcyl_elevator_casing_tiered"); + setHardness(5.0f); + setResistance(10.0f); + setSoundType(SoundType.METAL); + setHarvestLevel("wrench", 3); + setDefaultState(getState(ElevatorCasingTiered.CasingType.ELEVATOR_MOTOR_1)); + } + + @Override + public boolean canCreatureSpawn(@Nonnull IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EntityLiving.SpawnPlacementType type) { + return false; + } + + public enum CasingType implements IStringSerializable, IElevatorMotorTier { + + ELEVATOR_MOTOR_1("elevator_motor_1"), + ELEVATOR_MOTOR_2("elevator_motor_2"), + ELEVATOR_MOTOR_3("elevator_motor_3"), + ELEVATOR_MOTOR_4("elevator_motor_4"), + ELEVATOR_MOTOR_5("elevator_motor_5"); + + + private final String name; + + CasingType(String name) { + this.name = name; + } + + @Override + public @NotNull String getName() { + return this.name; + } + + @Override + public int getTier() { + return this.ordinal(); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/fulltrix/gcyl/item/fusion/GCYLCryostatCasing.java b/src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLCryostatCasing.java similarity index 97% rename from src/main/java/com/fulltrix/gcyl/item/fusion/GCYLCryostatCasing.java rename to src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLCryostatCasing.java index b7c21592..3febe9b0 100644 --- a/src/main/java/com/fulltrix/gcyl/item/fusion/GCYLCryostatCasing.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLCryostatCasing.java @@ -1,4 +1,4 @@ -package com.fulltrix.gcyl.item.fusion; +package com.fulltrix.gcyl.blocks.fusion; import gregtech.api.block.VariantBlock; import net.minecraft.block.SoundType; diff --git a/src/main/java/com/fulltrix/gcyl/item/fusion/GCYLDivertorCasing.java b/src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLDivertorCasing.java similarity index 97% rename from src/main/java/com/fulltrix/gcyl/item/fusion/GCYLDivertorCasing.java rename to src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLDivertorCasing.java index 840e872a..6541fdf2 100644 --- a/src/main/java/com/fulltrix/gcyl/item/fusion/GCYLDivertorCasing.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLDivertorCasing.java @@ -1,4 +1,4 @@ -package com.fulltrix.gcyl.item.fusion; +package com.fulltrix.gcyl.blocks.fusion; import gregtech.api.block.VariantBlock; import net.minecraft.block.SoundType; diff --git a/src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLFusionCasing.java b/src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLFusionCasing.java new file mode 100644 index 00000000..3d6537c0 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLFusionCasing.java @@ -0,0 +1,62 @@ +package com.fulltrix.gcyl.blocks.fusion; + +import gregtech.api.block.IStateHarvestLevel; +import gregtech.api.block.VariantBlock; +import gregtech.api.items.toolitem.ToolClasses; +import net.minecraft.block.SoundType; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import org.jetbrains.annotations.NotNull; + +import javax.annotation.Nonnull; + +public class GCYLFusionCasing extends VariantBlock { + public GCYLFusionCasing() { + super(net.minecraft.block.material.Material.IRON); + setTranslationKey("gcyl_fusion_casing"); + setHardness(5.0f); + setResistance(10.0f); + setSoundType(SoundType.METAL); + setDefaultState(getState(CasingType.ADV_FUSION_CASING)); + } + + @Override + public boolean canCreatureSpawn(@Nonnull IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EntityLiving.SpawnPlacementType type) { + return false; + } + + public enum CasingType implements IStringSerializable, IStateHarvestLevel { + + ADV_FUSION_CASING("adv_fusion_casing", 3), + BLANKET_BASE("blanket_base", 3), + FUSION_BLANKET("fusion_blanket", 3), + BREEDING_BLANKET("breeding_blanket", 3); + + private final int harvestLevel; + private final String name; + + CasingType(String name, int harvestLevel) { + this.name = name; + this.harvestLevel = harvestLevel; + } + @NotNull + @Override + public String getName() { + return this.name; + } + + @Override + public int getHarvestLevel(IBlockState state) { + return harvestLevel; + } + + @Override + public String getHarvestTool(IBlockState state) { + return ToolClasses.WRENCH; + } + + } +} \ No newline at end of file diff --git a/src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLFusionCoils.java b/src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLFusionCoils.java new file mode 100644 index 00000000..3f749702 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLFusionCoils.java @@ -0,0 +1,71 @@ +package com.fulltrix.gcyl.blocks.fusion; + +import gregtech.api.block.IStateHarvestLevel; +import gregtech.api.block.VariantActiveBlock; +import gregtech.api.items.toolitem.ToolClasses; +import net.minecraft.block.SoundType; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import org.jetbrains.annotations.NotNull; + +import javax.annotation.Nonnull; + +//TODO: make coils have bloom while working. +public class GCYLFusionCoils extends VariantActiveBlock { + public GCYLFusionCoils() { + super(net.minecraft.block.material.Material.IRON); + setTranslationKey("gcyl_fusion_casing"); + setHardness(5.0f); + setResistance(10.0f); + setSoundType(SoundType.METAL); + setDefaultState(getState(CasingType.ADV_FUSION_COIL_1)); + } + + @Override + public boolean canCreatureSpawn(@Nonnull IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EntityLiving.SpawnPlacementType type) { + return false; + } + + + public enum CasingType implements IStringSerializable, IStateHarvestLevel { + + ADV_FUSION_COIL_1("adv_fusion_coil_1", 3), + ADV_FUSION_COIL_2("adv_fusion_coil_2", 3), + ADV_FUSION_COIL_3("adv_fusion_coil_3", 4), + ADV_FUSION_COIL_4("adv_fusion_coil_4", 4), + ADV_FUSION_COIL_5("adv_fusion_coil_5", 5); + + private final int harvestLevel; + private final String name; + + CasingType(String name, int harvestLevel) { + this.name = name; + this.harvestLevel = harvestLevel; + } + @NotNull + @Override + public String getName() { + return this.name; + } + + @NotNull + @Override + public String toString() { + return getName(); + } + + @Override + public int getHarvestLevel(IBlockState state) { + return harvestLevel; + } + + @Override + public String getHarvestTool(IBlockState state) { + return ToolClasses.WRENCH; + } + + } +} diff --git a/src/main/java/com/fulltrix/gcyl/item/fusion/GCYLVacuumCasing.java b/src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLVacuumCasing.java similarity index 97% rename from src/main/java/com/fulltrix/gcyl/item/fusion/GCYLVacuumCasing.java rename to src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLVacuumCasing.java index c9cd6c14..a170caca 100644 --- a/src/main/java/com/fulltrix/gcyl/item/fusion/GCYLVacuumCasing.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/fusion/GCYLVacuumCasing.java @@ -1,4 +1,4 @@ -package com.fulltrix.gcyl.item.fusion; +package com.fulltrix.gcyl.blocks.fusion; import gregtech.api.block.VariantBlock; import net.minecraft.block.SoundType; diff --git a/src/main/java/com/fulltrix/gcyl/blocks/metal/GCYLCleanroomCasing.java b/src/main/java/com/fulltrix/gcyl/blocks/metal/GCYLCleanroomCasing.java new file mode 100644 index 00000000..a11ed53f --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/blocks/metal/GCYLCleanroomCasing.java @@ -0,0 +1,104 @@ +package com.fulltrix.gcyl.blocks.metal; + +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; +import gregtech.api.GTValues; +import gregtech.api.block.ICleanroomFilter; +import gregtech.api.block.IStateHarvestLevel; +import gregtech.api.block.VariantBlock; +import gregtech.api.metatileentity.multiblock.CleanroomType; +import gregtech.client.utils.TooltipHelper; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.World; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class GCYLCleanroomCasing extends VariantBlock implements IStateHarvestLevel { + + public GCYLCleanroomCasing() { + super(Material.IRON); + this.setTranslationKey("cleanroom_casing"); + this.setHardness(2.0F); + this.setResistance(8.0F); + this.setSoundType(SoundType.METAL); + this.setDefaultState(this.getState(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO3)); + } + + public int getHarvestLevel(@NotNull IBlockState state) { + return state == this.getState(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO3) ? 2 : 1; + } + + public @Nullable String getHarvestTool(@NotNull IBlockState state) { + return state == this.getState(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO3) ? "pickaxe" : "wrench"; + } + + public void addInformation(@NotNull ItemStack stack, @Nullable World player, @NotNull List tooltip, @NotNull ITooltipFlag advanced) { + super.addInformation(stack, player, tooltip, advanced); + if (stack.isItemEqual(this.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO3))) { + tooltip.add(I18n.format("tile.cleanroom_casing.filter_iso_3.tooltip", new Object[0])); + tooltip.add(TooltipHelper.BLINKING_RED + I18n.format("tile.cleanroom_casing.warning")); + } + + if (stack.isItemEqual(this.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO2))) { + tooltip.add(I18n.format("tile.cleanroom_casing.filter_iso_2.tooltip", new Object[0])); + tooltip.add(TooltipHelper.BLINKING_RED + I18n.format("tile.cleanroom_casing.warning")); + } + + if (stack.isItemEqual(this.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO1))) { + tooltip.add(I18n.format("tile.cleanroom_casing.filter_iso_1.tooltip", new Object[0])); + tooltip.add(TooltipHelper.BLINKING_RED + I18n.format("tile.cleanroom_casing.warning")); + } + + if (stack.isItemEqual(this.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO0))) { + tooltip.add(I18n.format("tile.cleanroom_casing.filter_iso_0.tooltip", new Object[0])); + tooltip.add(TooltipHelper.BLINKING_RED + I18n.format("tile.cleanroom_casing.warning")); + } + + } + + public static enum CasingType implements IStringSerializable, ICleanroomFilter { + FILTER_CASING_ISO3("filter_casing_iso_3", GCYLCleanroomType.ISO3, GTValues.UV), + FILTER_CASING_ISO2("filter_casing_iso_2", GCYLCleanroomType.ISO2, GTValues.UHV), + FILTER_CASING_ISO1("filter_casing_iso_1", GCYLCleanroomType.ISO1, GTValues.UEV), + FILTER_CASING_ISO0("filter_casing_iso_0", GCYLCleanroomType.ISO0, GTValues.UIV); + + + private final String name; + private final CleanroomType cleanroomType; + private final int minTier; + + CasingType(String name, CleanroomType cleanroomType, int minTier) { + this.name = name; + this.cleanroomType = cleanroomType; + this.minTier = minTier; + } + + public @NotNull String getName() { + return this.name; + } + + public @NotNull String toString() { + return this.getName(); + } + + @Override + public @Nullable CleanroomType getCleanroomType() { + return this.cleanroomType; + } + + @Override + public int getTier() { return this.ordinal() + 2;} + + @Override + public int getMinTier() { + return this.minTier; + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/item/metal/MetalCasing1.java b/src/main/java/com/fulltrix/gcyl/blocks/metal/MetalCasing1.java similarity index 91% rename from src/main/java/com/fulltrix/gcyl/item/metal/MetalCasing1.java rename to src/main/java/com/fulltrix/gcyl/blocks/metal/MetalCasing1.java index 57fa2a5a..028b2193 100644 --- a/src/main/java/com/fulltrix/gcyl/item/metal/MetalCasing1.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/metal/MetalCasing1.java @@ -1,4 +1,4 @@ -package com.fulltrix.gcyl.item.metal; +package com.fulltrix.gcyl.blocks.metal; import gregtech.api.block.VariantBlock; @@ -40,7 +40,9 @@ public enum CasingType implements IStringSerializable { HASTELLOY_N("casing_hastelloy_n", HastelloyN), NITINOL_60("casing_nitinol_60", Nitinol60), INCOLOY_813("casing_incoloy_813", Incoloy813), - HASTELLOY_K243("casing_hastelloy_k243", HastelloyK243); + HASTELLOY_K243("casing_hastelloy_k243", HastelloyK243), + MARAGING_STEEL_250("casing_maraging_steel_250", MaragingSteel250), + INCONEL_625("casing_inconel_625", Inconel625); diff --git a/src/main/java/com/fulltrix/gcyl/item/metal/MetalCasing2.java b/src/main/java/com/fulltrix/gcyl/blocks/metal/MetalCasing2.java similarity index 90% rename from src/main/java/com/fulltrix/gcyl/item/metal/MetalCasing2.java rename to src/main/java/com/fulltrix/gcyl/blocks/metal/MetalCasing2.java index aee292b7..c2b2f622 100644 --- a/src/main/java/com/fulltrix/gcyl/item/metal/MetalCasing2.java +++ b/src/main/java/com/fulltrix/gcyl/blocks/metal/MetalCasing2.java @@ -1,4 +1,4 @@ -package com.fulltrix.gcyl.item.metal; +package com.fulltrix.gcyl.blocks.metal; import gregtech.api.block.VariantBlock; import gregtech.api.unification.material.Material; @@ -28,7 +28,8 @@ public enum CasingType implements IStringSerializable { QUANTUM("casing_quantum", Quantum), TRITANIUM("casing_tritanium", Tritanium), ENRICHED_NAQUADAH_ALLOY("casing_enriched_naquadah_alloy", EnrichedNaquadahAlloy), - NAQUADRIA("casing_naquadria", Naquadria); + NAQUADRIA("casing_naquadria", Naquadria), + IRIDIUM("casing_iridium", Iridium); private final String name; private final Material material; @@ -49,9 +50,6 @@ public Material getMaterial() { public ICubeRenderer getTexture() { switch (name) { - case "casing_staballoy" -> { - return STABALLOY_CASING; - } case "casing_quantum" -> { return QUANTUM_CASING; } @@ -64,6 +62,9 @@ public ICubeRenderer getTexture() { case "casing_naquadria" -> { return NAQUADRIA_CASING; } + case "casing_iridium" -> { + return IRIDIUM_CASING; + } default -> { return STABALLOY_CASING; } diff --git a/src/main/java/com/fulltrix/gcyl/client/ClientHandler.java b/src/main/java/com/fulltrix/gcyl/client/ClientHandler.java index bacb5541..e486388e 100644 --- a/src/main/java/com/fulltrix/gcyl/client/ClientHandler.java +++ b/src/main/java/com/fulltrix/gcyl/client/ClientHandler.java @@ -1,8 +1,11 @@ package com.fulltrix.gcyl.client; +import com.cleanroommc.modularui.drawable.UITexture; import com.fulltrix.gcyl.GCYLCore; +import gregtech.api.gui.resources.TextureArea; import gregtech.client.renderer.texture.cube.OrientedOverlayRenderer; import gregtech.client.renderer.texture.cube.SimpleOverlayRenderer; +import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.relauncher.Side; @@ -22,6 +25,7 @@ public class ClientHandler { public static SimpleOverlayRenderer HASTELLOY_N_CASING; public static SimpleOverlayRenderer INCOLOY_813_CASING; public static SimpleOverlayRenderer NAQUADRIA_CASING; + public static SimpleOverlayRenderer IRIDIUM_CASING; public static SimpleOverlayRenderer HYPER_CASING; public static SimpleOverlayRenderer HYPER_CASING_2; public static SimpleOverlayRenderer ENRICHED_NAQUADAH_ALLOY_CASING; @@ -30,12 +34,36 @@ public class ClientHandler { public static SimpleOverlayRenderer NITINOL_60_CASING; public static SimpleOverlayRenderer HASTELLOY_K243_CASING; public static SimpleOverlayRenderer MAINTENANCE_OVERLAY_STERILE_CLEANING; + public static SimpleOverlayRenderer MAINTENANCE_OVERLAY_ISO3_CLEANING; + public static SimpleOverlayRenderer MAINTENANCE_OVERLAY_ISO2_CLEANING; + public static SimpleOverlayRenderer MAINTENANCE_OVERLAY_ISO1_CLEANING; public static SimpleOverlayRenderer CLADDED_REACTOR_CASING; public static SimpleOverlayRenderer ENDER_ITEM_LINK; + public static SimpleOverlayRenderer WIRELESS_ENERGY_HATCH; + public static SimpleOverlayRenderer WIRELESS_ENERGY_HATCH_4A; + public static SimpleOverlayRenderer WIRELESS_ENERGY_HATCH_16A; + public static SimpleOverlayRenderer WIRELESS_ENERGY_HATCH_OFF; + public static SimpleOverlayRenderer WIRELESS_DATA_HATCH; + public static SimpleOverlayRenderer SEABORGIUM_SUBSTATION_CASING; + public static SimpleOverlayRenderer MARAGING_STEEL_250_CASING; + public static SimpleOverlayRenderer INCONEL_625_CASING; + public static SimpleOverlayRenderer ELEVATOR_CASING; + public static SimpleOverlayRenderer PUMP_MODULE_OVERLAY; + public static SimpleOverlayRenderer MINING_MODULE_OVERLAY; + public static SimpleOverlayRenderer ASSEMBLER_MODULE_OVERLAY; public static OrientedOverlayRenderer NAQADAH_OVERLAY; public static OrientedOverlayRenderer ROCKET_OVERLAY; + public static final TextureArea PROGRESS_BAR_COMPONENT_AL = TextureArea.fullImage("textures/gui/progress_bar/progress_bar_component_al.png"); + public static final TextureArea PROGRESS_BAR_MINING_MODULE = TextureArea.fullImage("textures/gui/progress_bar/progress_bar_mining_module.png"); + public static final UITexture BUTTON_ELEVATOR_EXTENSION = UITexture.fullImage("textures/gui/widget/space_elevator_extension.png"); + public static final UITexture BUTTON_ELEVATOR_TELEPORT = UITexture.fullImage("textures/gui/widget/planet_teleport.png"); + public static final UITexture BUTTON_ENABLE_STATIC = UITexture.fullImage("textures/gui/widget/button_power_enable_static.png"); + public static final UITexture BUTTON_DISABLE_STATIC = UITexture.fullImage("textures/gui/widget/button_power_disable_static.png"); + public static final UITexture BUTTON_CYCLE = UITexture.fullImage("textures/gui/widget/button_cycle.png"); + public static final UITexture BUTTON_WHITE_BLACK_LIST = UITexture.fullImage("textures/gui/widget/button_white_black_list.png"); + private ClientHandler() { } @@ -49,6 +77,7 @@ public static void preInit() { BIO_REACTOR = new SimpleOverlayRenderer("casings/solid/bio_reactor_casing"); FUSION_TEXTURE = new SimpleOverlayRenderer("casings/fusion/machine_casing_fusion_glass"); + SEABORGIUM_SUBSTATION_CASING = new SimpleOverlayRenderer("casings/solid/seaborgium_substation_casing"); ORGANIC_REPLICATOR_OVERLAY = new OrientedOverlayRenderer("machines/organic_replicator"); FUSION_REACTOR_OVERLAY = new OrientedOverlayRenderer("machines/fusion_reactor"); @@ -57,8 +86,19 @@ public static void preInit() { FREEZER_OVERLAY = new OrientedOverlayRenderer("machines/freezer"); MAINTENANCE_OVERLAY_STERILE_CLEANING = new SimpleOverlayRenderer("overlay/machine/overlay_maintenance_sterile_cleaning"); + MAINTENANCE_OVERLAY_ISO3_CLEANING = new SimpleOverlayRenderer("overlay/machine/overlay_maintenance_iso_3_cleaning"); + MAINTENANCE_OVERLAY_ISO2_CLEANING = new SimpleOverlayRenderer("overlay/machine/overlay_maintenance_iso_2_cleaning"); + MAINTENANCE_OVERLAY_ISO1_CLEANING = new SimpleOverlayRenderer("overlay/machine/overlay_maintenance_iso_1_cleaning"); + ENDER_ITEM_LINK = new SimpleOverlayRenderer("cover/overlay_ender_item_link"); + + WIRELESS_ENERGY_HATCH = new SimpleOverlayRenderer("overlay/machine/overlay_wireless_energy"); + WIRELESS_ENERGY_HATCH_4A = new SimpleOverlayRenderer("overlay/machine/overlay_wireless_energy_4a"); + WIRELESS_ENERGY_HATCH_16A = new SimpleOverlayRenderer("overlay/machine/overlay_wireless_energy_16a"); + WIRELESS_ENERGY_HATCH_OFF = new SimpleOverlayRenderer("overlay/machine/overlay_wireless_energy_off"); + WIRELESS_DATA_HATCH = new SimpleOverlayRenderer("overlay/machine/overlay_wireless_data"); + //MetaCasing1 STABALLOY_CASING = new SimpleOverlayRenderer("casings/metal_casings/staballoy"); QUANTUM_CASING = new SimpleOverlayRenderer("casings/metal_casings/quantum"); @@ -70,11 +110,20 @@ public static void preInit() { INCOLOY_813_CASING = new SimpleOverlayRenderer("casings/metal_casings/incoloy_813"); NITINOL_60_CASING = new SimpleOverlayRenderer("casings/metal_casings/nitinol_60"); HASTELLOY_K243_CASING = new SimpleOverlayRenderer("casings/metal_casings/hastelloy_k243"); + MARAGING_STEEL_250_CASING = new SimpleOverlayRenderer("casings/metal_casings/maraging_steel_250"); + INCONEL_625_CASING = new SimpleOverlayRenderer("casings/metal_casings/inconel_625"); ENRICHED_NAQUADAH_ALLOY_CASING = new SimpleOverlayRenderer("casings/metal_casings/enriched_naquadah_alloy"); NAQUADRIA_CASING = new SimpleOverlayRenderer("casings/metal_casings/naquadria"); + IRIDIUM_CASING = new SimpleOverlayRenderer("casings/metal_casings/iridium"); HYPER_CASING = new SimpleOverlayRenderer("casings/solid/hyper_casing"); HYPER_CASING_2 = new SimpleOverlayRenderer("casings/solid/hyper_casing_2"); CLADDED_REACTOR_CASING = new SimpleOverlayRenderer("casings/solid/cladded_reactor_casing"); + + //ELEVATOR + ELEVATOR_CASING = new SimpleOverlayRenderer("gcyl:casings/elevator/elevator_base"); + PUMP_MODULE_OVERLAY = new SimpleOverlayRenderer("gcyl:overlay/elevator/pump"); + MINING_MODULE_OVERLAY = new SimpleOverlayRenderer("gcyl:overlay/elevator/mining"); + ASSEMBLER_MODULE_OVERLAY = new SimpleOverlayRenderer("gcyl:overlay/elevator/assembler"); } } diff --git a/src/main/java/com/fulltrix/gcyl/covers/CoverEnderItemLink.java b/src/main/java/com/fulltrix/gcyl/covers/CoverEnderItemLink.java index f31edd57..29705bf0 100644 --- a/src/main/java/com/fulltrix/gcyl/covers/CoverEnderItemLink.java +++ b/src/main/java/com/fulltrix/gcyl/covers/CoverEnderItemLink.java @@ -5,22 +5,25 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; +import com.cleanroommc.modularui.api.drawable.IDrawable; import com.cleanroommc.modularui.api.drawable.IKey; import com.cleanroommc.modularui.api.widget.IWidget; import com.cleanroommc.modularui.drawable.DynamicDrawable; import com.cleanroommc.modularui.drawable.Rectangle; +import com.cleanroommc.modularui.factory.GuiData; import com.cleanroommc.modularui.factory.SidedPosGuiData; import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.screen.UISettings; import com.cleanroommc.modularui.utils.Color; import com.cleanroommc.modularui.value.sync.*; -import com.cleanroommc.modularui.widgets.FluidSlot; -import com.cleanroommc.modularui.widgets.ItemSlot; +import com.cleanroommc.modularui.widgets.ListWidget; +import com.cleanroommc.modularui.widgets.TextWidget; import com.cleanroommc.modularui.widgets.ToggleButton; import com.cleanroommc.modularui.widgets.layout.Column; import com.cleanroommc.modularui.widgets.layout.Grid; import com.cleanroommc.modularui.widgets.layout.Row; +import com.cleanroommc.modularui.widgets.slot.ItemSlot; import com.cleanroommc.modularui.widgets.textfield.TextFieldWidget; -import com.fulltrix.gcyl.CommonProxy; import com.fulltrix.gcyl.api.util.ItemContainerSwitchShim; import com.fulltrix.gcyl.api.util.VirtualContainerRegistry; import com.fulltrix.gcyl.client.ClientHandler; @@ -30,16 +33,11 @@ import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverWithUI; import gregtech.api.cover.CoverableView; -import gregtech.api.gui.GuiTextures; -import gregtech.api.gui.ModularUI; -import gregtech.api.gui.widgets.*; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.mui.GTGuiTextures; import gregtech.api.mui.GTGuis; import gregtech.api.util.GTTransferUtils; -import gregtech.client.renderer.texture.Textures; import gregtech.common.covers.CoverConveyor; -import gregtech.common.covers.CoverPump; import gregtech.common.covers.filter.ItemFilterContainer; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -285,19 +283,19 @@ public void openUI(EntityPlayerMP player) { public boolean usesMui2() { return true; } + @Override - public ModularPanel buildUI(SidedPosGuiData guiData, GuiSyncManager guiSyncManager) { + public ModularPanel buildUI(SidedPosGuiData guiData, PanelSyncManager guiSyncManager, UISettings settings) { var panel = GTGuis.createPanel(this, 176, 208); getItemFilterContainer().setMaxTransferSize(1); return panel.child(CoverWithUI.createTitleRow(getPickItem())) .bindPlayerInventory() - .child(createWidgets(panel, guiSyncManager)); - + .child(createWidgets(guiData, guiSyncManager)); } - protected Column createWidgets(ModularPanel panel, GuiSyncManager syncManager) { + protected Column createWidgets(GuiData guiData, PanelSyncManager syncManager) { var isPrivate = new BooleanSyncValue(this::isPrivate, this::setPrivate); isPrivate.updateCacheFromSource(true); @@ -313,18 +311,12 @@ protected Column createWidgets(ModularPanel panel, GuiSyncManager syncManager) { syncManager.registerSlotGroup("item_inv", this.linkedShim.getSlots()); int rowSize = this.linkedShim.getSlots(); - List itemSlots = new ArrayList<>(); + List itemSlots = new ArrayList<>(); for (int i = 0; i < rowSize; i++) { - itemSlots.add(new ItemSlot().slot(SyncHandlers.itemSlot(this.linkedShim, i).slotGroup("item_inv"))); - itemSlots.get(i).setEnabled(false); //disable faulty itemslots + itemSlots.add(new ItemSlot().slot(SyncHandlers.itemSlot(this.linkedShim, i).accessibility(false, false))); } - List> widgets = new ArrayList<>(); - widgets.add(new ArrayList<>()); - widgets.get(0).addAll(itemSlots); - - - return new Column().coverChildrenHeight().top(24) + return (Column) new Column().coverChildrenHeight().top(24) .margin(7, 0).widthRel(1f) .child(new Row().marginBottom(2) .coverChildrenHeight() @@ -361,7 +353,7 @@ protected Column createWidgets(ModularPanel panel, GuiSyncManager syncManager) { .height(18) .minElementMargin(0, 0) .minColWidth(18).minRowHeight(18) - .matrix(widgets))) + .row(itemSlots))) .child(new Row().marginBottom(2) .coverChildrenHeight() .child(new ToggleButton() @@ -372,7 +364,8 @@ protected Column createWidgets(ModularPanel panel, GuiSyncManager syncManager) { .color(Color.WHITE.darker(1))) .widthRel(0.6f) .left(0))) - .child(getItemFilterContainer().initUI(panel, syncManager)) + // TODO UI AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH + .child(getItemFilterContainer().initUI(guiData, syncManager)) .child(new EnumRowBuilder<>(CoverConveyor.ConveyorMode.class) .value(conveyorMode) .overlay(GTGuiTextures.CONVEYOR_MODE_OVERLAY) diff --git a/src/main/java/com/fulltrix/gcyl/covers/GCYLCoverBehaviors.java b/src/main/java/com/fulltrix/gcyl/covers/GCYLCoverBehaviors.java index a35258b2..284b54ea 100644 --- a/src/main/java/com/fulltrix/gcyl/covers/GCYLCoverBehaviors.java +++ b/src/main/java/com/fulltrix/gcyl/covers/GCYLCoverBehaviors.java @@ -1,12 +1,8 @@ package com.fulltrix.gcyl.covers; -import com.fulltrix.gcyl.item.GCYLCoreItem; import com.fulltrix.gcyl.item.GCYLCoreItems; -import gregtech.api.GTValues; -import gregtech.api.cover.CoverBase; -import gregtech.common.covers.CoverBehaviors; -import static com.fulltrix.gcyl.GCYLUtility.gcylId; +import static com.fulltrix.gcyl.api.GCYLUtility.gcylId; import static gregtech.api.GTValues.*; import static gregtech.common.covers.CoverBehaviors.registerBehavior; diff --git a/src/main/java/com/fulltrix/gcyl/item/GCYLCoreItem.java b/src/main/java/com/fulltrix/gcyl/item/GCYLCoreItem.java index 37b66428..c9b900bc 100644 --- a/src/main/java/com/fulltrix/gcyl/item/GCYLCoreItem.java +++ b/src/main/java/com/fulltrix/gcyl/item/GCYLCoreItem.java @@ -1,11 +1,14 @@ package com.fulltrix.gcyl.item; +import com.fulltrix.gcyl.api.items.WirelessElectricStats; import com.fulltrix.gcyl.item.behaviors.MinerDataItemBehavior; +import gregtech.api.GTValues; import gregtech.api.items.metaitem.StandardMetaItem; import gregtech.api.unification.material.MarkerMaterials; import gregtech.api.unification.material.MarkerMaterials.Tier; import gregtech.api.unification.ore.OrePrefix; import gregtech.common.items.behaviors.DataItemBehavior; +import net.minecraft.item.ItemStack; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; import static gregtech.api.unification.material.MarkerMaterials.Tier.*; @@ -102,6 +105,7 @@ public void registerSubItems() { BOULE_RUTHERFORDIUM = addItem(341, "boule.rutherfordium"); UNSTABLE_STAR = addItem(343, "unstable.star"); + NUCLEAR_STAR = addItem(344, "nuclear.star"); CONVEYOR_MODULE_MAX = addItem(353, "conveyor.module.max"); @@ -374,9 +378,84 @@ public void registerSubItems() { COVER_ENDER_ITEM_LINK = addItem(620, "cover.ender.item_link"); + VOLTAGE_COIL_UHV = addItem(621, "voltage_coil.uhv"); + VOLTAGE_COIL_UEV = addItem(622, "voltage_coil.uev"); + VOLTAGE_COIL_UIV = addItem(623, "voltage_coil.uiv"); + VOLTAGE_COIL_UXV = addItem(624, "voltage_coil.uxv"); + VOLTAGE_COIL_OpV = addItem(625, "voltage_coil.opv"); + VOLTAGE_COIL_MAX = addItem(626, "voltage_coil.max"); + + BIO_CELLS = addItem(627, "bio_cells"); + BIO_BOARD = addItem(628, "board.bio"); + BIO_CIRCUIT_BOARD = addItem(629, "board_circuit.bio"); + ADVANCED_CRYSTAL_SOC = addItem(630, "crystal.asoc"); + LIVING_SOC = addItem(631, "living.soc"); + LIVING_BIO_SOC = addItem(632, "living_bio.soc"); + BIO_WAFER = addItem(633, "wafer.bio"); + + NPIC_WAFER = addItem(634,"wafer.npic"); + PPIC_WAFER = addItem(635,"wafer.ppic"); + QPIC_WAFER = addItem(636,"wafer.qpic"); + NPIC = addItem(637,"npic"); + PPIC = addItem(638,"ppic"); + QPIC = addItem(639,"qpic"); + + WIRELESS_BATTERY_UV = addItem(640, "wireless_battery_uv").addComponents(WirelessElectricStats.createRechargeableBattery(20_000_000_000L, GTValues.UV)).setModelAmount(8); + /* + 641 + 642 + 643 + 644 + 645 + 646 + */ + + MINING_DRONE_1 = addItem(647, "mining_drone.1"); + MINING_DRONE_2 = addItem(648, "mining_drone.2"); + MINING_DRONE_3 = addItem(649, "mining_drone.3"); + MINING_DRONE_4 = addItem(650, "mining_drone.4"); + MINING_DRONE_5 = addItem(651, "mining_drone.5"); + MINING_DRONE_6 = addItem(652, "mining_drone.6"); + MINING_DRONE_7 = addItem(653, "mining_drone.7"); + MINING_DRONE_8 = addItem(654, "mining_drone.8"); + MINING_DRONE_9 = addItem(655, "mining_drone.9"); + MINING_DRONE_10 = addItem(656, "mining_drone.10"); + MINING_DRONE_11 = addItem(657, "mining_drone.11"); + MINING_DRONE_12 = addItem(658, "mining_drone.12"); + MINING_DRONE_13 = addItem(659, "mining_drone.13"); + MINING_DRONE_14 = addItem(660, "mining_drone.14"); + + + GENERIC_CIRCUIT_ULV = addItem(661, "generic_circuit.ulv").setUnificationData(OrePrefix.circuit, Tier.ULV); + GENERIC_CIRCUIT_LV = addItem(662, "generic_circuit.lv").setUnificationData(OrePrefix.circuit, Tier.LV); + GENERIC_CIRCUIT_MV = addItem(663, "generic_circuit.mv").setUnificationData(OrePrefix.circuit, Tier.MV); + GENERIC_CIRCUIT_HV = addItem(664, "generic_circuit.hv").setUnificationData(OrePrefix.circuit, Tier.HV); + GENERIC_CIRCUIT_EV = addItem(665, "generic_circuit.ev").setUnificationData(OrePrefix.circuit, Tier.EV); + GENERIC_CIRCUIT_IV = addItem(666, "generic_circuit.iv").setUnificationData(OrePrefix.circuit, Tier.IV); + GENERIC_CIRCUIT_LuV = addItem(667, "generic_circuit.luv").setUnificationData(OrePrefix.circuit, Tier.LuV); + GENERIC_CIRCUIT_ZPM = addItem(668, "generic_circuit.zpm").setUnificationData(OrePrefix.circuit, Tier.ZPM); + GENERIC_CIRCUIT_UV = addItem(669, "generic_circuit.uv").setUnificationData(OrePrefix.circuit, Tier.UV); + GENERIC_CIRCUIT_UHV = addItem(670, "generic_circuit.uhv").setUnificationData(OrePrefix.circuit, Tier.UHV); + GENERIC_CIRCUIT_UEV = addItem(671, "generic_circuit.uev").setUnificationData(OrePrefix.circuit, Tier.UEV); + GENERIC_CIRCUIT_UIV = addItem(672, "generic_circuit.uiv").setUnificationData(OrePrefix.circuit, Tier.UIV); + GENERIC_CIRCUIT_UXV = addItem(673, "generic_circuit.uxv").setUnificationData(OrePrefix.circuit, Tier.UXV); + GENERIC_CIRCUIT_OpV = addItem(674, "generic_circuit.opv").setUnificationData(OrePrefix.circuit, Tier.OpV); + GENERIC_CIRCUIT_MAX = addItem(675, "generic_circuit.max").setUnificationData(OrePrefix.circuit, Tier.MAX); + + + + PYROLYTIC_CARBON = addItem(16, "pyrolytic_carbon"); MICA_SHEET = addItem(26, "mica_sheet"); MICA_INSULATOR_SHEET = addItem(27, "mica_insulator_sheet"); MICA_INSULATOR_FOIL = addItem(28, "mica_insulator_foil"); + + } + @Override + public boolean hasEffect(ItemStack itemStack) { + return super.hasEffect(itemStack) + || itemStack.getMetadata() == UNSTABLE_STAR.getStackForm().getMetadata() + || itemStack.getMetadata() == NUCLEAR_STAR.getStackForm().getMetadata() + || itemStack.getMetadata() == WIRELESS_BATTERY_UV.getStackForm().getMetadata(); } } diff --git a/src/main/java/com/fulltrix/gcyl/item/GCYLCoreItems.java b/src/main/java/com/fulltrix/gcyl/item/GCYLCoreItems.java index 3d549d9c..bdd2f3bd 100644 --- a/src/main/java/com/fulltrix/gcyl/item/GCYLCoreItems.java +++ b/src/main/java/com/fulltrix/gcyl/item/GCYLCoreItems.java @@ -13,9 +13,6 @@ public class GCYLCoreItems { private static final List> ITEMS = MetaItem.getMetaItems(); public static MetaItem.MetaValueItem COMPRESSED_COKE_CLAY; - public static MetaItem.MetaValueItem ENERGY_MODULE; - public static MetaItem.MetaValueItem ENERGY_CLUSTER; - public static MetaItem.MetaValueItem MAX_BATTERY; public static MetaItem.MetaValueItem SMD_CAPACITOR_REFINED; public static MetaItem.MetaValueItem SMD_CAPACITOR_NANO; @@ -216,6 +213,7 @@ public class GCYLCoreItems { public static MetaItem.MetaValueItem BOULE_RUTHERFORDIUM; public static MetaItem.MetaValueItem UNSTABLE_STAR; + public static MetaItem.MetaValueItem NUCLEAR_STAR; public static MetaItem.MetaValueItem CONVEYOR_MODULE_MAX; public static MetaItem.MetaValueItem ELECTRIC_MOTOR_MAX; public static MetaItem.MetaValueItem ELECTRIC_PISTON_MAX; @@ -432,6 +430,63 @@ public class GCYLCoreItems { public static MetaItem.MetaValueItem TOOL_DATA_DEEP_MINER_MODULE; public static MetaItem.MetaValueItem TOOL_DATA_DEEP_MINER_COMPLEX; public static MetaItem.MetaValueItem COVER_ENDER_ITEM_LINK; + public static MetaItem.MetaValueItem VOLTAGE_COIL_UHV; + public static MetaItem.MetaValueItem VOLTAGE_COIL_UEV; + public static MetaItem.MetaValueItem VOLTAGE_COIL_UIV; + public static MetaItem.MetaValueItem VOLTAGE_COIL_UXV; + public static MetaItem.MetaValueItem VOLTAGE_COIL_OpV; + public static MetaItem.MetaValueItem VOLTAGE_COIL_MAX; + + public static MetaItem.MetaValueItem BIO_CELLS; + public static MetaItem.MetaValueItem BIO_BOARD; + public static MetaItem.MetaValueItem BIO_CIRCUIT_BOARD; + public static MetaItem.MetaValueItem ADVANCED_CRYSTAL_SOC; + public static MetaItem.MetaValueItem LIVING_SOC; + public static MetaItem.MetaValueItem LIVING_BIO_SOC; + public static MetaItem.MetaValueItem BIO_WAFER; + + public static MetaItem.MetaValueItem NPIC_WAFER; + public static MetaItem.MetaValueItem PPIC_WAFER; + public static MetaItem.MetaValueItem QPIC_WAFER; + public static MetaItem.MetaValueItem NPIC; + public static MetaItem.MetaValueItem PPIC; + public static MetaItem.MetaValueItem QPIC; + + public static MetaItem.MetaValueItem WIRELESS_BATTERY_UV; + + public static MetaItem.MetaValueItem MINING_DRONE_1; + public static MetaItem.MetaValueItem MINING_DRONE_2; + public static MetaItem.MetaValueItem MINING_DRONE_3; + public static MetaItem.MetaValueItem MINING_DRONE_4; + public static MetaItem.MetaValueItem MINING_DRONE_5; + public static MetaItem.MetaValueItem MINING_DRONE_6; + public static MetaItem.MetaValueItem MINING_DRONE_7; + public static MetaItem.MetaValueItem MINING_DRONE_8; + public static MetaItem.MetaValueItem MINING_DRONE_9; + public static MetaItem.MetaValueItem MINING_DRONE_10; + public static MetaItem.MetaValueItem MINING_DRONE_11; + public static MetaItem.MetaValueItem MINING_DRONE_12; + public static MetaItem.MetaValueItem MINING_DRONE_13; + public static MetaItem.MetaValueItem MINING_DRONE_14; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_ULV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_LV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_MV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_HV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_EV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_IV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_LuV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_ZPM; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_UV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_UHV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_UEV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_UIV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_UXV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_OpV; + public static MetaItem.MetaValueItem GENERIC_CIRCUIT_MAX; + + + + public static void init() { GCYLCoreItem item = new GCYLCoreItem(); diff --git a/src/main/java/com/fulltrix/gcyl/jei/JEIGCYLPlugin.java b/src/main/java/com/fulltrix/gcyl/jei/JEIGCYLPlugin.java index d51206ba..bdc27e6c 100644 --- a/src/main/java/com/fulltrix/gcyl/jei/JEIGCYLPlugin.java +++ b/src/main/java/com/fulltrix/gcyl/jei/JEIGCYLPlugin.java @@ -1,19 +1,49 @@ package com.fulltrix.gcyl.jei; +import com.fulltrix.gcyl.GCYLConfig; +import com.fulltrix.gcyl.Tags; +import com.fulltrix.gcyl.api.worldgen.VirtualOreDepositDefinition; +import com.fulltrix.gcyl.api.worldgen.WorldGenRegister; +import com.fulltrix.gcyl.jei.category.SpaceMiningCategory; +import com.fulltrix.gcyl.jei.category.SpacePumpCategory; +import com.fulltrix.gcyl.jei.category.VirtualOresCategory; +import com.fulltrix.gcyl.jei.category.VoidMinerCategory; +import com.fulltrix.gcyl.machines.GCYLTileEntities; +import com.fulltrix.gcyl.machines.multi.multiblockpart.MetaTileEntityWirelessEnergyHatch; +import com.fulltrix.gcyl.recipes.categories.elevator.SpaceMiningRecipes; import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; +import gregtech.api.GTValues; +import gregtech.api.recipes.RecipeMaps; +import gregtech.api.recipes.category.GTRecipeCategory; import gregtech.api.unification.OreDictUnifier; import gregtech.api.unification.material.Material; import gregtech.api.unification.ore.OrePrefix; import gregtech.common.blocks.MetaBlocks; import gregtech.common.items.MetaItems; +import gregtech.common.metatileentities.MetaTileEntities; import mezz.jei.api.*; import mezz.jei.api.ingredients.IIngredientBlacklist; import mezz.jei.api.ingredients.IIngredientRegistry; +import mezz.jei.api.recipe.IRecipeCategoryRegistration; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Map; +import static com.fulltrix.gcyl.machines.GCYLTileEntities.MINING_MODULE; +import static com.fulltrix.gcyl.machines.GCYLTileEntities.WIRELESS_ENERGY_HATCH_OUTPUT; +import static com.fulltrix.gcyl.recipes.categories.elevator.SpaceMiningRecipes.HASH_TO_ITEMS; +import static com.fulltrix.gcyl.recipes.categories.elevator.SpaceMiningRecipes.SPACE_MINING_RECIPES; +import static com.fulltrix.gcyl.recipes.categories.elevator.SpacePumpRecipes.GAS_SIPHON_RECIPES; +import static com.fulltrix.gcyl.recipes.categories.elevator.SpacePumpRecipes.getPlanetNameByID; +import static com.fulltrix.gcyl.recipes.categories.handlers.VoidMinerHandler.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.common.blocks.BlockWireCoil.CoilType.*; import static gregtech.common.items.MetaItems.*; @@ -25,19 +55,141 @@ public class JEIGCYLPlugin implements IModPlugin { private IIngredientBlacklist itemBlacklist; private IIngredientRegistry iItemRegistry; public static IJeiRuntime jeiRuntime; + public static IGuiHelper guiHelper; + + @Override + public void registerCategories(@NotNull IRecipeCategoryRegistration registry) { + guiHelper = registry.getJeiHelpers().getGuiHelper(); + + registry.addRecipeCategories(new SpaceMiningCategory(registry.getJeiHelpers().getGuiHelper())); + registry.addRecipeCategories(new SpacePumpCategory(registry.getJeiHelpers().getGuiHelper())); + registry.addRecipeCategories(new VoidMinerCategory(registry.getJeiHelpers().getGuiHelper())); + registry.addRecipeCategories(new VirtualOresCategory(registry.getJeiHelpers().getGuiHelper())); + + @Nullable GTRecipeCategory category = GTRecipeCategory.getByName(RecipeMaps.BLAST_RECIPES.unlocalizedName); + if (category != null) { + category.jeiIcon(MetaTileEntities.ELECTRIC_BLAST_FURNACE.getStackForm()); + } + } + @Override public void register(IModRegistry registry) { itemBlacklist = registry.getJeiHelpers().getIngredientBlacklist(); iItemRegistry = registry.getIngredientRegistry(); + //VIRTUAL ORES + List virtualVeins = WorldGenRegister.getVirtualOreDepositDefinitions(); + List virtualOresInfos = new ArrayList<>(); + for(VirtualOreDepositDefinition definition : virtualVeins) { + virtualOresInfos.add(new VirtualOresInfo(definition)); + } + + String virtualVeinSpawnID = Tags.MODID + "." + "virtual_ores"; + registry.addRecipes(virtualOresInfos, virtualVeinSpawnID); + registry.addRecipeCatalyst(MetaItems.PROSPECTOR_LV.getStackForm(), virtualVeinSpawnID); + registry.addRecipeCatalyst(MetaItems.PROSPECTOR_HV.getStackForm(), virtualVeinSpawnID); + registry.addRecipeCatalyst(MetaItems.PROSPECTOR_LUV.getStackForm(), virtualVeinSpawnID); + + + + //SPACE MINING + String spaceMineID = Tags.MODID + "." + "space_mining"; + List spaceMiningInfo1 = new ArrayList<>(); + List spaceMiningInfo2 = new ArrayList<>(); + List spaceMiningInfo3 = new ArrayList<>(); + + for(Map.Entry> entry : SPACE_MINING_RECIPES.entrySet()) { + Integer key = entry.getKey(); + List recipe = entry.getValue(); + + List inputs = HASH_TO_ITEMS.get(key); + + for(SpaceMiningRecipes.SpaceMiningRecipePartTwo recipeIterate : recipe) { + spaceMiningInfo1.add(new SpaceMiningInfo(inputs, recipeIterate)); + + /* + if(recipeIterate.getMinModuleTier() > 2) { + spaceMiningInfo3.add(new SpaceMiningInfo(inputs, recipeIterate)); + } else if(recipeIterate.getMinModuleTier() > 1) { + spaceMiningInfo3.add(new SpaceMiningInfo(inputs, recipeIterate)); + spaceMiningInfo2.add(new SpaceMiningInfo(inputs, recipeIterate)); + } else { + spaceMiningInfo3.add(new SpaceMiningInfo(inputs, recipeIterate)); + spaceMiningInfo2.add(new SpaceMiningInfo(inputs, recipeIterate)); + spaceMiningInfo1.add(new SpaceMiningInfo(inputs, recipeIterate)); + } + + */ + } + } + + registry.addRecipes(spaceMiningInfo1, spaceMineID); + //registry.addRecipes(spaceMiningInfo2, spaceMineID); + //registry.addRecipes(spaceMiningInfo3, spaceMineID); + registry.addRecipeCatalyst(MINING_MODULE[0].getStackForm(), spaceMineID); + registry.addRecipeCatalyst(MINING_MODULE[1].getStackForm(), spaceMineID); + registry.addRecipeCatalyst(MINING_MODULE[2].getStackForm(), spaceMineID); + + + + List spacePumpInfos = new ArrayList<>(); + for(Map.Entry entry : GAS_SIPHON_RECIPES.entrySet()) { + String key = entry.getKey(); + FluidStack value = entry.getValue(); + + int planetID = 0; + int fluidID = 0; + + int index = key.indexOf(','); + char[] arr = key.toCharArray(); + + StringBuilder stringBuilderPlanet = new StringBuilder(); + StringBuilder stringBuilderFluid = new StringBuilder(); + + for(int i = 0; i < arr.length; i++) { + if(i < index) { + stringBuilderPlanet.append(arr[i]); + } + + if(i > index) { + stringBuilderFluid.append(arr[i]); + } + } + planetID = Integer.parseInt(stringBuilderPlanet.toString()); + fluidID = Integer.parseInt(stringBuilderFluid.toString()); + spacePumpInfos.add(new SpacePumpInfo(getPlanetNameByID(planetID), planetID, fluidID, value)); + } + + + String spacePumpID = Tags.MODID + "." + "space_pump_fluids"; + registry.addRecipes(spacePumpInfos, spacePumpID); + registry.addRecipeCatalyst(GCYLTileEntities.PUMP_MODULE[0].getStackForm(), spacePumpID); + registry.addRecipeCatalyst(GCYLTileEntities.PUMP_MODULE[1].getStackForm(), spacePumpID); + registry.addRecipeCatalyst(GCYLTileEntities.PUMP_MODULE[2].getStackForm(), spacePumpID); + + + String voidMinerID = Tags.MODID + "." + "void_miner_ores"; + List voidMinerInfo1 = new ArrayList<>(); + List voidMinerInfo2 = new ArrayList<>(); + List voidMinerInfo3 = new ArrayList<>(); + + voidMinerInfo1.add(new VoidMinerInfo(ORES, 0)); + voidMinerInfo2.add(new VoidMinerInfo(ORES_2, 1)); + voidMinerInfo3.add(new VoidMinerInfo(ORES_3, 2)); + registry.addRecipes(voidMinerInfo1, voidMinerID); + registry.addRecipes(voidMinerInfo2, voidMinerID); + registry.addRecipes(voidMinerInfo3, voidMinerID); + registry.addRecipeCatalyst(GCYLTileEntities.VOID_MINER[0].getStackForm(), voidMinerID); + registry.addRecipeCatalyst(GCYLTileEntities.VOID_MINER[1].getStackForm(), voidMinerID); + registry.addRecipeCatalyst(GCYLTileEntities.VOID_MINER[2].getStackForm(), voidMinerID); } @Override - public void onRuntimeAvailable(IJeiRuntime jeiRuntime) { - this.jeiRuntime = jeiRuntime; + public void onRuntimeAvailable(@NotNull IJeiRuntime jeiRuntime) { + JEIGCYLPlugin.jeiRuntime = jeiRuntime; itemBlacklist.addIngredientToBlacklist(GCYMMetaTileEntities.LARGE_MIXER.getStackForm()); itemBlacklist.addIngredientToBlacklist(GCYMMetaTileEntities.LARGE_CENTRIFUGE.getStackForm()); @@ -74,19 +226,22 @@ public void onRuntimeAvailable(IJeiRuntime jeiRuntime) { itemBlacklist.addIngredientToBlacklist(CIRCUIT_ASSEMBLER[i].getStackForm()); } - + if(!GCYLConfig.Misc.enableWirelessDynamos) { + for (MetaTileEntityWirelessEnergyHatch metaTileEntityWirelessEnergyHatch : WIRELESS_ENERGY_HATCH_OUTPUT) { + itemBlacklist.addIngredientToBlacklist(metaTileEntityWirelessEnergyHatch.getStackForm()); + } + } //The list has to be in this order for some godforsaken reason TODO: make it work on manganese phosphide all the way. hide fluids //hide old superconductors List oldSuperConductors = Arrays.asList(UraniumTriplatinum, RutheniumTriniumAmericiumNeutronate, EnrichedNaquadahTriniumEuropiumDuranide, UraniumRhodiumDinaquadide, - IndiumTinBariumTitaniumCuprate, SamariumIronArsenicOxide, SamariumIronArsenicOxide, MercuryBariumCalciumCuprate, MagnesiumDiboride, ManganesePhosphide); + IndiumTinBariumTitaniumCuprate, SamariumIronArsenicOxide, MercuryBariumCalciumCuprate, MagnesiumDiboride, ManganesePhosphide); for(Material mat : oldSuperConductors) { superConductorRemoval(mat); } - } private void superConductorRemoval(Material mat) { @@ -96,6 +251,7 @@ private void superConductorRemoval(Material mat) { itemBlacklist.addIngredientToBlacklist(OreDictUnifier.get(OrePrefix.wireGtOctal, mat)); itemBlacklist.addIngredientToBlacklist(OreDictUnifier.get(OrePrefix.wireGtHex, mat)); itemBlacklist.addIngredientToBlacklist(OreDictUnifier.get(OrePrefix.ingot, mat)); + if (!mat.equals(ManganesePhosphide)) itemBlacklist.addIngredientToBlacklist(OreDictUnifier.get(OrePrefix.ingotHot, mat)); itemBlacklist.addIngredientToBlacklist(OreDictUnifier.get(OrePrefix.block, mat)); itemBlacklist.addIngredientToBlacklist(OreDictUnifier.get(OrePrefix.dustSmall, mat)); diff --git a/src/main/java/com/fulltrix/gcyl/jei/SpaceMiningInfo.java b/src/main/java/com/fulltrix/gcyl/jei/SpaceMiningInfo.java new file mode 100644 index 00000000..c5519dff --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/jei/SpaceMiningInfo.java @@ -0,0 +1,118 @@ +package com.fulltrix.gcyl.jei; + +import com.fulltrix.gcyl.recipes.categories.elevator.SpaceMiningRecipes; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.ore.OrePrefix; +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidUtil; +import org.eclipse.xtext.xbase.lib.Pair; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import static com.fulltrix.gcyl.recipes.categories.elevator.SpaceMiningRecipes.SPACE_MINING_RECIPES; +import static gregtech.api.unification.material.Materials.*; + +//TODO add bucket stuff +public class SpaceMiningInfo implements IRecipeWrapper { + + private final List> groupedInputsAsItemStacks = new ArrayList<>(); + private final List> groupedOutputsAsItemStacks = new ArrayList<>(); + private final List> fluidList = new ArrayList<>(); + private final List> bucketList = new ArrayList<>(); + private SpaceMiningRecipes.SpaceMiningRecipePartTwo recipe; + private ItemStack drone; + private int tier; + + + public SpaceMiningInfo(List inputs, SpaceMiningRecipes.SpaceMiningRecipePartTwo recipe) { + this.recipe = recipe; + this.tier = recipe.getMinModuleTier(); + + for(ItemStack input : inputs) { + this.groupedInputsAsItemStacks.add(Arrays.asList(input)); + } + + for(Pair pair : recipe.getOutputs()) { + this.groupedOutputsAsItemStacks.add(Collections.singletonList(OreDictUnifier.get(OrePrefix.ore, pair.getKey(), pair.getValue()))); + } + + this.fluidList.addAll(Arrays.asList(Arrays.asList(Helium.getPlasma(1000), Bismuth.getPlasma(500), Radon.getPlasma(300)))); + } + + + @Override + public void getIngredients(IIngredients ingredients) { + ingredients.setInputLists(VanillaTypes.ITEM, groupedInputsAsItemStacks); + ingredients.setOutputLists(VanillaTypes.ITEM, groupedOutputsAsItemStacks); + + ingredients.setInputLists(VanillaTypes.FLUID, fluidList); + + + /* + ItemStack bucket = FluidUtil.getFilledBucket(fluid); + if (!bucket.isEmpty()) { + bucketList.add(Collections.singletonList(bucket)); + ingredients.setInputLists(VanillaTypes.ITEM, bucketList); + ingredients.setOutputLists(VanillaTypes.ITEM, bucketList); + } + + */ + } + + public int getTier() { + return this.tier; + } + + public int getOutputCount() { + return groupedOutputsAsItemStacks.size(); + } + + public int getInputCount() { + return groupedInputsAsItemStacks.size(); + } + + public long getTotalEU() { + return this.recipe.getDuration() * this.recipe.getEUt(); + } + + public long getEUt() { + return this.recipe.getEUt(); + } + + public int getDuration() { + return this.recipe.getDuration(); + } + + public int getMinDistance() { + return this.recipe.getMinDistance(); + } + + public int getMaxDistance() { + return this.recipe.getMaxDistance(); + } + + public int getMinSize() { + return this.recipe.getMinSize(); + } + + public int getMaxSize() { + return this.recipe.getMaxSize(); + } + + public int getMinCWUt() { + return this.recipe.getComputation(); + } + + public int getWeight() { + return this.recipe.getWeight(); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/jei/SpacePumpInfo.java b/src/main/java/com/fulltrix/gcyl/jei/SpacePumpInfo.java new file mode 100644 index 00000000..bddd9f3a --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/jei/SpacePumpInfo.java @@ -0,0 +1,67 @@ +package com.fulltrix.gcyl.jei; + +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidUtil; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class SpacePumpInfo implements IRecipeWrapper { + + private final String planet; + private final int planetID; + private final int fluidID; + private final FluidStack fluid; + private final List> fluidList = new ArrayList<>(); + private final List> bucketList = new ArrayList<>(); + + public SpacePumpInfo(String planet, int planetID, int fluidID, FluidStack fluid) { + this.planet = planet; + this.planetID = planetID; + this.fluidID = fluidID; + this.fluid = fluid; + + List fluidList2 = new ArrayList<>(); + fluidList2.add(fluid); + fluidList.add(fluidList2); + } + + + @Override + public void getIngredients(IIngredients ingredients) { + ingredients.setInputLists(VanillaTypes.FLUID, fluidList); + ingredients.setOutputLists(VanillaTypes.FLUID, fluidList); + + ItemStack bucket = FluidUtil.getFilledBucket(fluid); + if (!bucket.isEmpty()) { + bucketList.add(Collections.singletonList(bucket)); + ingredients.setInputLists(VanillaTypes.ITEM, bucketList); + ingredients.setOutputLists(VanillaTypes.ITEM, bucketList); + } + } + + public void addTooltip(int slotIndex, boolean input, Object ingredient, List tooltip) { + + } + + public String getPlanet() { + return planet; + } + + public int getPlanetID() { + return planetID; + } + + public int getFluidID() { + return fluidID; + } + + public FluidStack getFluid() { + return fluid; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/jei/VirtualOresInfo.java b/src/main/java/com/fulltrix/gcyl/jei/VirtualOresInfo.java new file mode 100644 index 00000000..45ac2a3c --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/jei/VirtualOresInfo.java @@ -0,0 +1,100 @@ +package com.fulltrix.gcyl.jei; + +import com.fulltrix.gcyl.api.worldgen.VirtualOreDepositDefinition; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.ore.OrePrefix; +import gregtech.api.util.FileUtility; +import gregtech.api.worldgen.config.BedrockFluidDepositDefinition; +import gregtech.integration.jei.utils.JEIResourceDepositCategoryUtils; +import it.unimi.dsi.fastutil.objects.ObjectList; +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.item.ItemStack; +import net.minecraft.world.biome.Biome; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.function.Function; + +public class VirtualOresInfo implements IRecipeWrapper { + + private final VirtualOreDepositDefinition definition; + private String name; + private final String description; + private final int weight; + private final int[] yields; // the [minimum, maximum) yields + private final ObjectList multipliers; + private final Function biomeFunction; + private final List materials; + private final List> groupedOutputsAsItemStacks = new ArrayList<>(); + + public VirtualOresInfo(VirtualOreDepositDefinition definition) { + this.definition = definition; + + this.name = definition.getAssignedName(); + if (this.name == null) { + this.name = FileUtility.trimFileName(definition.getDepositName()); + } + + this.description = definition.getDescription(); + + this.weight = definition.getWeight(); + + this.yields = definition.getYields(); + + this.materials = definition.getStoredMaterials(); + + this.multipliers = definition.getMultipliers(); + + this.biomeFunction = definition.getBiomeWeightModifier(); + + + for(Material material : this.materials) { + this.groupedOutputsAsItemStacks.add(Collections.singletonList(OreDictUnifier.get(OrePrefix.ore, material))); + } + + + } + + @Override + public void getIngredients(IIngredients ingredients) { + ingredients.setOutputLists(VanillaTypes.ITEM, groupedOutputsAsItemStacks); + } + + public void addTooltip(int slotIndex, boolean input, Object ingredient, List tooltip) { + if (description != null) { + tooltip.add(description); + } + tooltip.addAll(JEIResourceDepositCategoryUtils.createSpawnPageBiomeTooltip(biomeFunction, weight)); + } + + public VirtualOreDepositDefinition getDefinition() { + return definition; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public int getWeight() { + return weight; + } + + public int[] getYields() { + return yields; + } + + public ObjectList getMultipliers() {return multipliers;} + + public List getMaterials() {return materials;} + + +} diff --git a/src/main/java/com/fulltrix/gcyl/jei/VoidMinerInfo.java b/src/main/java/com/fulltrix/gcyl/jei/VoidMinerInfo.java new file mode 100644 index 00000000..cd989119 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/jei/VoidMinerInfo.java @@ -0,0 +1,36 @@ +package com.fulltrix.gcyl.jei; + +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class VoidMinerInfo implements IRecipeWrapper { + private final List> groupedInputsAsItemStacks = new ArrayList<>(); + private final List> groupedOutputsAsItemStacks = new ArrayList<>(); + private final int tier; + + public VoidMinerInfo(List ores, int tier) { + this.groupedInputsAsItemStacks.add(ores); + this.groupedOutputsAsItemStacks.add(ores); + this.tier = tier; + } + + @Override + public void getIngredients(IIngredients ingredients) { + ingredients.setInputLists(VanillaTypes.ITEM, groupedInputsAsItemStacks); + ingredients.setOutputLists(VanillaTypes.ITEM, groupedOutputsAsItemStacks); + } + + public int getOutputCount() { + return groupedOutputsAsItemStacks.size(); + } + + public int getTier() { + return this.tier; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/jei/category/SpaceMiningCategory.java b/src/main/java/com/fulltrix/gcyl/jei/category/SpaceMiningCategory.java new file mode 100644 index 00000000..71a636af --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/jei/category/SpaceMiningCategory.java @@ -0,0 +1,189 @@ +package com.fulltrix.gcyl.jei.category; + +import com.fulltrix.gcyl.client.ClientHandler; +import com.fulltrix.gcyl.jei.SpaceMiningInfo; +import gregtech.api.GTValues; +import gregtech.api.gui.GuiTextures; +import gregtech.api.util.GTUtility; +import gregtech.integration.jei.basic.BasicRecipeCategory; +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.api.gui.IGuiFluidStackGroup; +import mezz.jei.api.gui.IGuiItemStackGroup; +import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import org.jetbrains.annotations.NotNull; + +public class SpaceMiningCategory extends BasicRecipeCategory { + + protected final IDrawable slot; + protected final IDrawable fluidSlot; + protected final IDrawable progressBar; + private static final int SLOT_CENTER = 79; + private static final int SLOT_WIDTH = 18; + private static final int SLOT_HEIGHT = 18; + private static final int TEXT_START_X = 5; + private static final int START_POS_Y = 80; + protected int outputCount; + protected int inputCount; + protected int tier; + protected long totalEU; + protected long EUt; + protected int duration; + protected int minDistance; + protected int maxDistance; + protected int minSize; + protected int maxSize; + protected int CWUt; + protected int weight; + + public SpaceMiningCategory(IGuiHelper guiHelper) { + super("space_mining", + "space_mining.name", + guiHelper.createBlankDrawable(176,166), + guiHelper); + + this.slot = guiHelper.drawableBuilder(GuiTextures.SLOT.imageLocation, 0, 0, 18, 18).setTextureSize(18, 18) + .build(); + + this.fluidSlot = guiHelper.drawableBuilder(GuiTextures.FLUID_SLOT.imageLocation, 0, 0, 18, 18).setTextureSize(18,18) + .build(); + + this.progressBar = guiHelper.drawableBuilder(ClientHandler.PROGRESS_BAR_MINING_MODULE.imageLocation, 0, 0, 23,63).setTextureSize(23,63) + .build(); + } + + + + @Override + public IRecipeWrapper getRecipeWrapper(SpaceMiningInfo recipe) { + return recipe; + } + + @Override + public void setRecipe(IRecipeLayout recipeLayout, SpaceMiningInfo recipeWrapper, IIngredients ingredients) { + IGuiItemStackGroup itemStackGroup = recipeLayout.getItemStacks(); + IGuiFluidStackGroup fluidStackGroup = recipeLayout.getFluidStacks(); + int baseYPos = 19; + + //Drone + itemStackGroup.init(0, true, 4 * SLOT_WIDTH + SLOT_CENTER - 6, 9); + + //Inputs + int count = 1; + for(int i = 0; i < 2; i++) { + for (int j = 0; j < 2; j++) { + if(count < recipeWrapper.getInputCount()) { + itemStackGroup.init(count, true, j * SLOT_WIDTH + 9, i * SLOT_HEIGHT); + count++; + } else + break; + } + } + + //Fluid Inputs + fluidStackGroup.init(0, true, 10, 46, 16, 16, 1, false, null); + + //Outputs + int oldCount = count; + for(int i = 0; i < 4; i++) { + for(int j = 0; j < 4; j++) { + if(count < recipeWrapper.getOutputCount() + oldCount) { + itemStackGroup.init(count, false, SLOT_CENTER + j * SLOT_WIDTH - 11, i * SLOT_HEIGHT); + count++; + } else + break; + } + } + + itemStackGroup.set(ingredients); + fluidStackGroup.set(ingredients); + this.inputCount = recipeWrapper.getInputCount(); + this.outputCount = recipeWrapper.getOutputCount(); + this.tier = recipeWrapper.getTier(); + + this.totalEU = recipeWrapper.getTotalEU(); + this.EUt = recipeWrapper.getEUt(); + this.duration = recipeWrapper.getDuration(); + this.minDistance = recipeWrapper.getMinDistance(); + this.maxDistance = recipeWrapper.getMaxDistance(); + this.minSize = recipeWrapper.getMinSize(); + this.maxSize = recipeWrapper.getMaxSize(); + this.CWUt = recipeWrapper.getMinCWUt(); + this.weight = recipeWrapper.getWeight(); + } + + @Override + public void drawExtras(@NotNull Minecraft minecraft) { + + + //Inputs + for(int i = 0; i < 2; i++) { + for(int j = 0; j < 2; j++) { + this.slot.draw(minecraft, j * SLOT_WIDTH + 9, i * SLOT_HEIGHT); + } + } + + //Fluid Input + this.fluidSlot.draw(minecraft, 9, 45); + this.fluidSlot.draw(minecraft, SLOT_WIDTH + 9, 45); + + //Outputs + for(int i = 0; i < 4; i++) { + for(int j = 0; j < 4; j++) { + this.slot.draw(minecraft, SLOT_CENTER + j * SLOT_WIDTH - 11, i * SLOT_HEIGHT); + } + } + + //Drone Slot + this.slot.draw(minecraft, 4 * SLOT_WIDTH + SLOT_CENTER - 6, 9); + + //Progress Bar + this.progressBar.draw(minecraft, SLOT_WIDTH + 27, 0); + + + String totalEUName = I18n.format("gcyl.jei.space_miner.total_eu", totalEU); + minecraft.fontRenderer.drawString(totalEUName, TEXT_START_X, START_POS_Y, 0x111111); + + String EUtName = I18n.format("gcyl.jei.space_miner.eut", EUt, GTValues.VN[GTUtility.getTierByVoltage(EUt)]); + minecraft.fontRenderer.drawString(EUtName, TEXT_START_X, START_POS_Y + FONT_HEIGHT + 1, 0x111111); + + String durationName = I18n.format("gcyl.jei.space_miner.duration", duration / 20.0); + minecraft.fontRenderer.drawString(durationName, TEXT_START_X, START_POS_Y + 2 * FONT_HEIGHT + 1, 0x111111); + + String tierName = I18n.format("gcyl.jei.space_miner.tier", getTierString(tier)); + minecraft.fontRenderer.drawString(tierName, TEXT_START_X, START_POS_Y+ 3 * FONT_HEIGHT + 1, 0x111111); + + String distanceName = I18n.format("gcyl.jei.space_miner.distance", minDistance, maxDistance); + minecraft.fontRenderer.drawString(distanceName, TEXT_START_X, START_POS_Y+ 4 * FONT_HEIGHT + 1, 0x111111); + + String sizeName = I18n.format("gcyl.jei.space_miner.size", minSize, maxSize); + minecraft.fontRenderer.drawString(sizeName, TEXT_START_X, START_POS_Y+ 5 * FONT_HEIGHT + 1, 0x111111); + + String CWUtName = I18n.format("gcyl.jei.space_miner.cwut", CWUt); + minecraft.fontRenderer.drawString(CWUtName, TEXT_START_X, START_POS_Y+ 6 * FONT_HEIGHT + 1, 0x111111); + + String weightName = I18n.format("gcyl.jei.space_miner.weight", weight); + minecraft.fontRenderer.drawString(weightName, TEXT_START_X, START_POS_Y+ 7 * FONT_HEIGHT + 1, 0x111111); + + + } + + private String getTierString(int tier) { + return switch (tier) { + case (1) -> "I"; + case (2) -> "II"; + case (3) -> "III"; + default -> null; + }; + } + + + @Override + public @NotNull String getModName() { + return "gcyl"; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/jei/category/SpacePumpCategory.java b/src/main/java/com/fulltrix/gcyl/jei/category/SpacePumpCategory.java new file mode 100644 index 00000000..1966dac6 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/jei/category/SpacePumpCategory.java @@ -0,0 +1,109 @@ +package com.fulltrix.gcyl.jei.category; + +import com.fulltrix.gcyl.Tags; +import com.fulltrix.gcyl.jei.SpacePumpInfo; +import gregtech.api.gui.GuiTextures; +import gregtech.api.util.GTStringUtils; +import gregtech.api.util.TextFormattingUtil; +import gregtech.integration.jei.basic.BasicRecipeCategory; +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.api.gui.IGuiFluidStackGroup; +import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraftforge.fluids.FluidStack; +import org.jetbrains.annotations.NotNull; + +import java.util.Collections; +import java.util.List; + +public class SpacePumpCategory extends BasicRecipeCategory { + private static final int SLOT_CENTER = 79; + private static final int TEXT_START_X = 5; + private static final int START_POS_Y = 40; + + private String planet; + private FluidStack fluid; + private int planetID; + private int fluidID; + private int fluidAmount; + + protected final IDrawable slot; + + private int planetLength; + private int planetIDLength; + private int fluidIDLength; + private int fluidAmountLength; + + + public SpacePumpCategory(IGuiHelper guiHelper) { + super("space_pump_fluids", + "space_pump.name", + guiHelper.createBlankDrawable(176, 166), + guiHelper); + + this.slot = guiHelper.drawableBuilder(GuiTextures.SLOT.imageLocation, 0, 0, 18, 18).setTextureSize(18, 18) + .build(); + } + + + @Override + public void setRecipe(@NotNull IRecipeLayout recipeLayout, SpacePumpInfo spacePumpInfo, @NotNull IIngredients ingredients) { + IGuiFluidStackGroup fluidStackGroup = recipeLayout.getFluidStacks(); + + fluidStackGroup.init(0, true, SLOT_CENTER, 19, 16, 16, 1, false, null); + + fluidStackGroup.addTooltipCallback(spacePumpInfo::addTooltip); + fluidStackGroup.set(ingredients); + + this.planet = spacePumpInfo.getPlanet(); + this.planetID = spacePumpInfo.getPlanetID(); + this.fluidID = spacePumpInfo.getFluidID(); + this.fluid = spacePumpInfo.getFluid(); + this.fluidAmount = spacePumpInfo.getFluid().amount; + } + + @NotNull + @Override + public IRecipeWrapper getRecipeWrapper(@NotNull SpacePumpInfo spacePumpInfo) { + return spacePumpInfo; + } + + @Override + public void drawExtras(@NotNull Minecraft minecraft) { + GTStringUtils.drawCenteredStringWithCutoff(fluid.getLocalizedName(), minecraft.fontRenderer, 176); + + this.slot.draw(minecraft, SLOT_CENTER - 1, 18); + + String planetName = I18n.format("gcyl.jei.space_pump_planet_name", planet); + planetLength = minecraft.fontRenderer.getStringWidth(planetName); + minecraft.fontRenderer.drawString(planetName, TEXT_START_X, START_POS_Y, 0x111111); + + String planetIDName = I18n.format("gcyl.jei.space_pump_planet_number", planetID); + planetIDLength = minecraft.fontRenderer.getStringWidth(planetIDName); + minecraft.fontRenderer.drawString(planetIDName, TEXT_START_X, START_POS_Y + FONT_HEIGHT + 1, 0x111111); + + String fluidIDName = I18n.format("gcyl.jei.space_pump_fluid_number", fluidID); + fluidIDLength = minecraft.fontRenderer.getStringWidth(fluidIDName); + minecraft.fontRenderer.drawString(fluidIDName, TEXT_START_X, START_POS_Y + 2 * FONT_HEIGHT + 1, 0x111111); + + String fluidAmountName = I18n.format("gcyl.jei.space_pump_fluid_amount", TextFormattingUtil.formatNumbers(fluidAmount)); + fluidAmountLength = minecraft.fontRenderer.getStringWidth(fluidAmountName); + minecraft.fontRenderer.drawString(fluidAmountName, TEXT_START_X, START_POS_Y + 3 * FONT_HEIGHT + 1, 0x111111); + } + + @NotNull + @Override + public List getTooltipStrings(int mouseX, int mouseY) { + return Collections.emptyList(); + } + + @Override + public @NotNull String getModName() { + return Tags.MODID; + } +} + diff --git a/src/main/java/com/fulltrix/gcyl/jei/category/VirtualOresCategory.java b/src/main/java/com/fulltrix/gcyl/jei/category/VirtualOresCategory.java new file mode 100644 index 00000000..e0a0ff62 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/jei/category/VirtualOresCategory.java @@ -0,0 +1,117 @@ +package com.fulltrix.gcyl.jei.category; + +import com.fulltrix.gcyl.jei.VirtualOresInfo; +import com.fulltrix.gcyl.jei.VoidMinerInfo; +import gregtech.api.GTValues; +import gregtech.api.gui.GuiTextures; +import gregtech.api.unification.material.Material; +import gregtech.api.util.GTStringUtils; +import gregtech.api.util.GTUtility; +import gregtech.api.worldgen.config.WorldGenRegistry; +import gregtech.integration.jei.basic.BasicRecipeCategory; +import gregtech.integration.jei.utils.JEIResourceDepositCategoryUtils; +import it.unimi.dsi.fastutil.objects.ObjectList; +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.api.gui.IGuiItemStackGroup; +import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class VirtualOresCategory extends BasicRecipeCategory { + private static final int TEXT_START_X = 18; + private static final int START_POS_Y = 50; + + private static final int FONT_HEIGHT = 18; + + protected final IDrawable slot; + private static final int SLOT_CENTER = 79; + private String veinName; + private int weight; + private int[] yields; + private ObjectList multipliers; + private List materials; + private int[] dimensions; + private int weightLength; + private int minYieldLength; + private int maxYieldLength; + + public VirtualOresCategory(IGuiHelper guiHelper) { + super("virtual_ores", + "virtual_ores.name", + guiHelper.createBlankDrawable(176,166), + guiHelper); + + this.slot = guiHelper.drawableBuilder(GuiTextures.SLOT.imageLocation, 0, 0, 18, 18).setTextureSize(18, 18) + .build(); + } + + + @Override + public void setRecipe(IRecipeLayout recipeLayout, VirtualOresInfo recipeWrapper, @NotNull IIngredients ingredients) { + IGuiItemStackGroup itemStackGroup = recipeLayout.getItemStacks(); + int baseYPos = START_POS_Y - 4; + int baseXPos = TEXT_START_X - 21; + + itemStackGroup.init(0, false, baseXPos, baseYPos); + itemStackGroup.init(1, false, baseXPos, baseYPos + 18); + itemStackGroup.init(2, false, baseXPos, baseYPos + 18 * 2); + itemStackGroup.init(3, false, baseXPos, baseYPos + 18 * 3); + + itemStackGroup.addTooltipCallback(recipeWrapper::addTooltip); + itemStackGroup.set(ingredients); + + this.veinName = recipeWrapper.getName(); + this.weight = recipeWrapper.getWeight(); + this.yields = recipeWrapper.getYields(); + this.multipliers = recipeWrapper.getMultipliers(); + this.materials = recipeWrapper.getMaterials(); + + this.dimensions = JEIResourceDepositCategoryUtils.getAllRegisteredDimensions( + recipeWrapper.getDefinition().getDimensionFilter()); + } + + @NotNull + @Override + public IRecipeWrapper getRecipeWrapper(@NotNull VirtualOresInfo recipe) { + return recipe; + } + + @Override + public void drawExtras(@NotNull Minecraft minecraft) { + GTStringUtils.drawCenteredStringWithCutoff(veinName, minecraft.fontRenderer, 176); + + for(int i = 0; i < materials.size(); i++) { + String layerName = I18n.format("gcyl.jei.virtual_layer", i+1, materials.get(i).getLocalizedName(), yields[0], (int) (yields[1] * multipliers.get(i))); + minecraft.fontRenderer.drawString(layerName, TEXT_START_X, START_POS_Y + i * FONT_HEIGHT + 1, 0x111111); + } + + String weightString = I18n.format("gcyl.jei.space_miner.weight", weight); + int weightLength = minecraft.fontRenderer.getStringWidth(weightString); + minecraft.fontRenderer.drawString(weightString, TEXT_START_X, START_POS_Y + materials.size() * FONT_HEIGHT + 1, 0x111111); + + + String veinDimension = I18n.format("gregtech.jei.fluid.dimension") + " "; + int dimensionLength = minecraft.fontRenderer.getStringWidth(veinDimension); + minecraft.fontRenderer.drawString(veinDimension, TEXT_START_X, START_POS_Y + (materials.size()+1) * FONT_HEIGHT + 1, 0x111111); + + JEIResourceDepositCategoryUtils.drawMultiLineCommaSeparatedDimensionList(WorldGenRegistry.getNamedDimensions(), + dimensions, + minecraft.fontRenderer, + TEXT_START_X, + START_POS_Y + (this.materials.size()+1) * FONT_HEIGHT + 1, + TEXT_START_X + dimensionLength); + + } + + + @Override + public @NotNull String getModName() { + return "gcyl"; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/jei/category/VoidMinerCategory.java b/src/main/java/com/fulltrix/gcyl/jei/category/VoidMinerCategory.java new file mode 100644 index 00000000..556f8617 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/jei/category/VoidMinerCategory.java @@ -0,0 +1,82 @@ +package com.fulltrix.gcyl.jei.category; + +import com.fulltrix.gcyl.jei.VoidMinerInfo; +import gregtech.api.gui.GuiTextures; +import gregtech.api.util.GTStringUtils; +import gregtech.integration.jei.basic.BasicRecipeCategory; +import gregtech.integration.jei.utils.render.ItemStackTextRenderer; +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.api.gui.IGuiItemStackGroup; +import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import org.jetbrains.annotations.NotNull; + +public class VoidMinerCategory extends BasicRecipeCategory { + + protected final IDrawable slot; + private static final int SLOT_CENTER = 79; + private static final int NUM_OF_SLOTS = 20; + private static final int SLOT_WIDTH = 18; + private static final int SLOT_HEIGHT = 18; + protected int outputCount; + protected int tier; + + public VoidMinerCategory(IGuiHelper guiHelper) { + super("void_miner_ores", + "void_miner_ores.name", + guiHelper.createBlankDrawable(176,166), + guiHelper); + + this.slot = guiHelper.drawableBuilder(GuiTextures.SLOT.imageLocation, 0, 0, 18, 18).setTextureSize(18, 18) + .build(); + } + + @Override + public void setRecipe(IRecipeLayout recipeLayout, VoidMinerInfo recipeWrapper, @NotNull IIngredients ingredients) { + IGuiItemStackGroup itemStackGroup = recipeLayout.getItemStacks(); + int baseYPos = 19; + + + itemStackGroup.init(0, true, SLOT_CENTER, baseYPos); + itemStackGroup.set(ingredients); + this.outputCount = recipeWrapper.getOutputCount(); + this.tier = recipeWrapper.getTier(); + + } + @NotNull + @Override + public IRecipeWrapper getRecipeWrapper(@NotNull VoidMinerInfo recipe) { + return recipe; + } + + @Override + public void drawExtras(@NotNull Minecraft minecraft) { + GTStringUtils.drawCenteredStringWithCutoff(getNameByTier(this.tier), minecraft.fontRenderer, 176); + + int baseYPos = 19; + + // Selected Ore + this.slot.draw(minecraft, SLOT_CENTER, baseYPos); + + } + + @Override + public @NotNull String getModName() { + return "gcyl"; + } + + private String getNameByTier(int tier) { + if(tier == 0) + return I18n.format("gcyl.jei.void_miner_tier_1"); + if(tier == 1) + return I18n.format("gcyl.jei.void_miner_tier_2"); + if(tier == 2) + return I18n.format("gcyl.jei.void_miner_tier_3"); + + return null; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/GCYLTileEntities.java b/src/main/java/com/fulltrix/gcyl/machines/GCYLTileEntities.java index 5fbe4e37..d0f394fb 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/GCYLTileEntities.java +++ b/src/main/java/com/fulltrix/gcyl/machines/GCYLTileEntities.java @@ -1,39 +1,40 @@ package com.fulltrix.gcyl.machines; import com.fulltrix.gcyl.GCYLConfig; -import com.fulltrix.gcyl.GCYLUtility; +import com.fulltrix.gcyl.api.GCYLUtility; import com.fulltrix.gcyl.client.ClientHandler; import com.fulltrix.gcyl.machines.multi.MetaTileEntityBioReactor; import com.fulltrix.gcyl.machines.multi.MetaTileEntityCosmicRayDetector; import com.fulltrix.gcyl.machines.multi.MetaTileEntityElectricImplosion; import com.fulltrix.gcyl.machines.multi.MetaTileEntityStellarForge; import com.fulltrix.gcyl.machines.multi.advance.*; +import com.fulltrix.gcyl.machines.multi.advance.elevator.MetaTileEntitySpaceElevator; +import com.fulltrix.gcyl.machines.multi.advance.elevator.elevatormodules.MetaTileEntityAssemblerModule; +import com.fulltrix.gcyl.machines.multi.advance.elevator.elevatormodules.MetaTileEntityMiningModule; +import com.fulltrix.gcyl.machines.multi.advance.elevator.elevatormodules.MetaTileEntityPumpingModule; +import com.fulltrix.gcyl.machines.multi.generator.MetaTileEntityHyperReactor; +import com.fulltrix.gcyl.machines.multi.generator.MetaTileEntityLargeNaquadahReactor; +import com.fulltrix.gcyl.machines.multi.generator.MetaTileEntityLargeRocketEngine; import com.fulltrix.gcyl.machines.multi.miner.MetaTileEntityDeepMiner; +import com.fulltrix.gcyl.machines.multi.miner.MetaTileEntityLaserMiner; import com.fulltrix.gcyl.machines.multi.miner.MetaTileEntityVoidMiner; -import com.fulltrix.gcyl.machines.multi.multiblockpart.MetaTileEntityHPCAComputationPlus; -import com.fulltrix.gcyl.machines.multi.multiblockpart.MetaTileEntityHPCACoolingPlus; -import com.fulltrix.gcyl.machines.multi.multiblockpart.MetaTileEntitySterileCleaningMaintenanceHatch; -import com.fulltrix.gcyl.machines.multi.simple.MetaTileEntityChemicalPlant; -import com.fulltrix.gcyl.machines.multi.simple.MetaTileEntityDecayChamber; -import com.fulltrix.gcyl.machines.multi.simple.MetaTileEntityGreenhouse; -import com.fulltrix.gcyl.machines.multi.simple.MetaTileEntityPlasmaCondenser; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.machines.multi.miner.virtual.MetaTileEntityPrimitiveVirtual; +import com.fulltrix.gcyl.machines.multi.multiblockpart.*; +import com.fulltrix.gcyl.machines.multi.simple.*; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityParallelHatch; import gregtech.api.GTValues; import gregtech.api.metatileentity.SimpleGeneratorMetaTileEntity; import gregtech.api.metatileentity.SimpleMachineMetaTileEntity; import gregtech.api.util.GTUtility; import gregtech.client.renderer.texture.Textures; import gregtech.common.metatileentities.MetaTileEntities; -import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityEnergyHatch; -import gregtech.common.metatileentities.multi.multiblockpart.hpca.MetaTileEntityHPCAComputation; -import net.minecraft.util.ResourceLocation; +import gregtech.common.metatileentities.electric.MetaTileEntityDiode; -import static com.fulltrix.gcyl.GCYLUtility.gcylId; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.DEEP_MINER_RECIPES; +import static com.fulltrix.gcyl.api.GCYLUtility.gcylId; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static com.google.common.base.Ascii.toLowerCase; -import static com.ibm.icu.impl.locale.AsciiUtil.toLower; import static gregtech.api.util.GTUtility.gregtechId; -import static gregtech.api.util.GTUtility.toLowerCaseUnderscore; import static gregtech.common.metatileentities.MetaTileEntities.registerMetaTileEntity; public class GCYLTileEntities { @@ -55,11 +56,16 @@ public class GCYLTileEntities { public static MetaTileEntityCryogenicFreezer CRYOGENIC_FREEZER; public static MetaTileEntityOreFactory ORE_FACTORY; public static MetaTileEntityDeepMiner DEEP_MINER; + public static MetaTileEntityLaserMiner LASER_MINER; public static MetaTileEntityDecayChamber DECAY_CHAMBER; public static MetaTileEntityGreenhouse[] GREEN_HOUSE = new MetaTileEntityGreenhouse[2]; - public static MetaTileEntityMegaCleanroom MEGA_CLEANROOM; + public static MetaTileEntityParallelHatch[] GCYL_PARALLEL_HATCH = new MetaTileEntityParallelHatch[3]; + public static MetaTileEntityMegaCleanroom MEGA_CLEANROOM; public static MetaTileEntitySterileCleaningMaintenanceHatch STERILE_CLEANING_MAINTENANCE_HATCH; + public static MetaTileEntityISO3CleaningMaintenanceHatch ISO3_CLEANING_MAINTENANCE_HATCH; + public static MetaTileEntityISO2CleaningMaintenanceHatch ISO2_CLEANING_MAINTENANCE_HATCH; + public static MetaTileEntityISO1CleaningMaintenanceHatch ISO1_CLEANING_MAINTENANCE_HATCH; public static MetaTileEntityHPCACoolingPlus[] HPCA_COOLING_PLUS = new MetaTileEntityHPCACoolingPlus[7]; public static MetaTileEntityHPCAComputationPlus[] HPCA_COMPUTATION_PLUS = new MetaTileEntityHPCAComputationPlus[7]; @@ -67,12 +73,37 @@ public class GCYLTileEntities { public static SimpleGeneratorMetaTileEntity[] ROCKET_GENERATOR = new SimpleGeneratorMetaTileEntity[8]; /////////////////////////////////////////// - public static final MetaTileEntityEnergyHatch[] ENERGY_INPUT_HATCH_4A = new MetaTileEntityEnergyHatch[4]; // UEV, UIV, UXV, OPV - public static final MetaTileEntityEnergyHatch[] ENERGY_INPUT_HATCH_16A = new MetaTileEntityEnergyHatch[4]; - public static final MetaTileEntityEnergyHatch[] ENERGY_OUTPUT_HATCH_4A = new MetaTileEntityEnergyHatch[4]; - public static final MetaTileEntityEnergyHatch[] ENERGY_OUTPUT_HATCH_16A = new MetaTileEntityEnergyHatch[4]; + public static MetaTileEntityWirelessPowerSubstation WIRELESS_PSS; + public static MetaTileEntityWirelessEnergyHatch[] WIRELESS_ENERGY_HATCH_INPUT = new MetaTileEntityWirelessEnergyHatch[GTValues.V.length]; + public static MetaTileEntityWirelessEnergyHatch[] WIRELESS_ENERGY_HATCH_INPUT_4A = new MetaTileEntityWirelessEnergyHatch[GTValues.V.length - 4]; + public static MetaTileEntityWirelessEnergyHatch[] WIRELESS_ENERGY_HATCH_INPUT_16A = new MetaTileEntityWirelessEnergyHatch[GTValues.V.length - 5]; + public static MetaTileEntityWirelessEnergyHatch[] WIRELESS_ENERGY_HATCH_INPUT_64A = new MetaTileEntityWirelessEnergyHatch[GTValues.V.length - 5]; + public static MetaTileEntityWirelessEnergyHatch[] WIRELESS_ENERGY_HATCH_OUTPUT = new MetaTileEntityWirelessEnergyHatch[GTValues.V.length]; + + ///////////////////////////////////////////////// + public static MetaTileEntityWirelessDataHatch WIRELESS_DATA_HATCH; + public static MetaTileEntityWirelessDataBank WIRELESS_DATA_BANK; + ///////////////////////////////////////////////// + public static MetaTileEntityLargeAirCollector LARGE_AIR_COLLECTOR; + public static MetaTileEntityLargeFisher LARGE_FISHER; + public static MetaTileEntityLargeRockBreaker LARGE_ROCK_BREAKER; + public static MetaTileEntityComponentAL COMPONENT_ASSEMBLY_LINE; + + /////////////////////////////////////////////////// + public static MetaTileEntitySpaceElevator SPACE_ELEVATOR; + public static MetaTileEntityPumpingModule[] PUMP_MODULE = new MetaTileEntityPumpingModule[3]; + public static MetaTileEntityMiningModule[] MINING_MODULE = new MetaTileEntityMiningModule[3]; + public static MetaTileEntityAssemblerModule[] ASSEMBLER_MODULE = new MetaTileEntityAssemblerModule[3]; + + public static MetaTileEntityAdvancedAssline ADVANCED_ASSLINE; + + public static MetaTileEntityDrillHolder DRILL_HOLDER; + public static MetaTileEntityPrimitiveVirtual PRIMITIVE_VIRTUAL_MINER; + + public static MetaTileEntityDiode[] HIGH_DIODES = new MetaTileEntityDiode[GTValues.V.length - GTValues.IV]; - public static int id = 32000; + + public static int id = 0; public static void init() { @@ -108,7 +139,7 @@ public static void init() { LARGE_NAQUADAH_REACTOR = registerMetaTileEntity(++id, new MetaTileEntityLargeNaquadahReactor(gcylId("large_naquadah_reactor"))); - CHEMICAL_PLANT = registerMetaTileEntity(++id, new MetaTileEntityChemicalPlant(gcylId("chemical_plant"),false)); + CHEMICAL_PLANT = registerMetaTileEntity(++id, new MetaTileEntityChemicalPlant(gcylId("chemical_plant"),true)); LARGE_ROCKET_ENGINE = registerMetaTileEntity(++id, new MetaTileEntityLargeRocketEngine(gcylId("large_rocket_engine"))); @@ -118,7 +149,12 @@ public static void init() { DEEP_MINER = registerMetaTileEntity(++id, new MetaTileEntityDeepMiner(gcylId("deep_miner"), DEEP_MINER_RECIPES, false)); + LASER_MINER = registerMetaTileEntity(++id, new MetaTileEntityLaserMiner(gcylId("laser_miner"), LASER_MINER_RECIPES, false)); + STERILE_CLEANING_MAINTENANCE_HATCH = registerMetaTileEntity(++id, new MetaTileEntitySterileCleaningMaintenanceHatch(gcylId("maintenance_hatch_sterile_cleanroom_auto"))); + ISO3_CLEANING_MAINTENANCE_HATCH = registerMetaTileEntity(++id, new MetaTileEntityISO3CleaningMaintenanceHatch(gcylId("maintenance_hatch_iso_3_cleanroom_auto"))); + ISO2_CLEANING_MAINTENANCE_HATCH = registerMetaTileEntity(++id, new MetaTileEntityISO2CleaningMaintenanceHatch(gcylId("maintenance_hatch_iso_2_cleanroom_auto"))); + ISO1_CLEANING_MAINTENANCE_HATCH = registerMetaTileEntity(++id, new MetaTileEntityISO1CleaningMaintenanceHatch(gcylId("maintenance_hatch_iso_1_cleanroom_auto"))); DECAY_CHAMBER = registerMetaTileEntity(++id, new MetaTileEntityDecayChamber(gcylId("decay_chamber"), true)); @@ -127,6 +163,24 @@ public static void init() { MEGA_CLEANROOM = registerMetaTileEntity(++id, new MetaTileEntityMegaCleanroom(gcylId("mega_cleanroom"))); + WIRELESS_PSS = registerMetaTileEntity(++id, new MetaTileEntityWirelessPowerSubstation(gcylId("wireless_pss"))); + + for (int i = 0; i < WIRELESS_ENERGY_HATCH_OUTPUT.length; i++) { + String voltageName = GTValues.VN[i].toLowerCase(); + WIRELESS_ENERGY_HATCH_INPUT[i] = registerMetaTileEntity(++id, new MetaTileEntityWirelessEnergyHatch(gcylId("wireless_energy_hatch.input." + voltageName), i, 1, false)); + + if(i > 3) { + WIRELESS_ENERGY_HATCH_INPUT_4A[i - 4] = registerMetaTileEntity(++id, new MetaTileEntityWirelessEnergyHatch(gcylId("wireless_energy_hatch.input." + voltageName + ".4"), i, 4, false)); + } + + if(i > 4) { + WIRELESS_ENERGY_HATCH_INPUT_16A[i - 5] = registerMetaTileEntity(++id, new MetaTileEntityWirelessEnergyHatch(gcylId("wireless_energy_hatch.input." + voltageName + ".16"), i, 16, false)); + WIRELESS_ENERGY_HATCH_INPUT_64A[i - 5] = registerMetaTileEntity(++id, new MetaTileEntityWirelessEnergyHatch(gcylId("wireless_energy_hatch.input." + voltageName + ".64"), i, 64, false)); + } + + WIRELESS_ENERGY_HATCH_OUTPUT[i] = registerMetaTileEntity(++id, new MetaTileEntityWirelessEnergyHatch(gcylId("wireless_energy_hatch.output." + voltageName), i, 1, true)); + + } for(int i = 0; i < 7; i++) { HPCA_COOLING_PLUS[i] = registerMetaTileEntity(++id, new MetaTileEntityHPCACoolingPlus(gcylId("hpca.cooling_component." + toLowerCase(GTValues.VN[i+8])), i+8)); HPCA_COMPUTATION_PLUS[i] = registerMetaTileEntity(++id, new MetaTileEntityHPCAComputationPlus(gcylId("hpca.computation_component." + toLowerCase(GTValues.VN[i+8])), i+8)); @@ -159,7 +213,47 @@ public static void init() { ROCKET_GENERATOR[5] = registerMetaTileEntity(++id, new SimpleGeneratorMetaTileEntity(gcylId("rocket_generator.mk3"), GCYLRecipeMaps.ROCKET_FUEL_RECIPES, ClientHandler.ROCKET_OVERLAY, 6, GTUtility.genericGeneratorTankSizeFunction)); //} + GCYL_PARALLEL_HATCH[0] = registerMetaTileEntity(++id, new MetaTileEntityParallelHatch(gcylId(String.format("parallel_hatch.%s", GTValues.VN[GTValues.UEV])), GTValues.UHV)); + GCYL_PARALLEL_HATCH[1] = registerMetaTileEntity(++id, new MetaTileEntityParallelHatch(gcylId(String.format("parallel_hatch.%s", GTValues.VN[GTValues.UXV])), GTValues.UEV)); + GCYL_PARALLEL_HATCH[2] = registerMetaTileEntity(++id, new MetaTileEntityParallelHatch(gcylId(String.format("parallel_hatch.%s", GTValues.VN[GTValues.MAX])), GTValues.UIV)); MetaTileEntities.registerSimpleMetaTileEntity(DEHYDRATOR, ++id, "dehydrator", GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES, Textures.SIFTER_OVERLAY, true, GCYLUtility::gcylId, GTUtility.hvCappedTankSizeFunction); + + id = 131; + + WIRELESS_DATA_BANK = registerMetaTileEntity(++id, new MetaTileEntityWirelessDataBank(gcylId("wireless_data_bank"))); + WIRELESS_DATA_HATCH = registerMetaTileEntity(++id, new MetaTileEntityWirelessDataHatch(gcylId("wireless_data_hatch"), 11)); + + LARGE_AIR_COLLECTOR = registerMetaTileEntity(++id, new MetaTileEntityLargeAirCollector(gcylId("large_air_collector"))); + + LARGE_FISHER = registerMetaTileEntity(++id, new MetaTileEntityLargeFisher(gcylId("large_fisher"))); + + LARGE_ROCK_BREAKER = registerMetaTileEntity(++id, new MetaTileEntityLargeRockBreaker(gcylId("large_rock_breaker"))); + + COMPONENT_ASSEMBLY_LINE = registerMetaTileEntity(++id, new MetaTileEntityComponentAL(gcylId("component_assembly_line"))); + + SPACE_ELEVATOR = registerMetaTileEntity(++id, new MetaTileEntitySpaceElevator(gcylId("space_elevator"))); + PUMP_MODULE[0] = registerMetaTileEntity(++id, new MetaTileEntityPumpingModule(gcylId("pump_module_1"), 9,1,2)); + PUMP_MODULE[1] = registerMetaTileEntity(++id, new MetaTileEntityPumpingModule(gcylId("pump_module_2"), 11,2,3)); + PUMP_MODULE[2] = registerMetaTileEntity(++id, new MetaTileEntityPumpingModule(gcylId("pump_module_3"), 13,3,4)); + MINING_MODULE[0] = registerMetaTileEntity(++id, new MetaTileEntityMiningModule(gcylId("mining_module_1"),9,1,1, 2)); + MINING_MODULE[1] = registerMetaTileEntity(++id, new MetaTileEntityMiningModule(gcylId("mining_module_2"),11,2,2, 4)); + MINING_MODULE[2] = registerMetaTileEntity(++id, new MetaTileEntityMiningModule(gcylId("mining_module_3"),13,3,3, 8)); + ASSEMBLER_MODULE[0] = registerMetaTileEntity(++id, new MetaTileEntityAssemblerModule(gcylId("assembler_module_1"), ASSEMBLER_MODULE_RECIPES,9,1,1)); + ASSEMBLER_MODULE[1] = registerMetaTileEntity(++id, new MetaTileEntityAssemblerModule(gcylId("assembler_module_2"), ASSEMBLER_MODULE_RECIPES,11,2,3)); + ASSEMBLER_MODULE[2] = registerMetaTileEntity(++id, new MetaTileEntityAssemblerModule(gcylId("assembler_module_3"), ASSEMBLER_MODULE_RECIPES,13,3,5)); + + id+=10; + + ADVANCED_ASSLINE = registerMetaTileEntity(++id, new MetaTileEntityAdvancedAssline(gcylId("advanced_assline"))); + + DRILL_HOLDER = registerMetaTileEntity(++id, new MetaTileEntityDrillHolder(gcylId("drill_holder"))); + PRIMITIVE_VIRTUAL_MINER = registerMetaTileEntity(++id, new MetaTileEntityPrimitiveVirtual(gcylId("primitive_virtual_miner"))); + + for (int i = 0; i < HIGH_DIODES.length; i++) { + String diodeId = "diode.high." + GTValues.VN[i + GTValues.IV].toLowerCase(); + MetaTileEntityDiode diode = new MetaTileEntityDiode(gcylId(diodeId), i + GTValues.IV, 64); + HIGH_DIODES[i] = registerMetaTileEntity(++id, diode); + } } } \ No newline at end of file diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java index a4351c77..5d326e2c 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java @@ -1,14 +1,13 @@ package com.fulltrix.gcyl.machines.multi; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.client.ClientHandler; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; -import com.fulltrix.gcyl.item.GCYLMultiblockCasing2; -import com.fulltrix.gcyl.item.GCYLTransparentCasing; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.GCYLMultiblockCasing2; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; -import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.client.renderer.ICubeRenderer; @@ -20,10 +19,10 @@ import javax.annotation.Nonnull; -public class MetaTileEntityBioReactor extends RecipeMapMultiblockController { +public class MetaTileEntityBioReactor extends GCYLRecipeMapMultiblockController { public MetaTileEntityBioReactor(ResourceLocation metaTileEntityId) { - super(metaTileEntityId, GCYLRecipeMaps.BIO_REACTOR_RECIPES); + super(metaTileEntityId, GCYLRecipeMaps.BIO_REACTOR_RECIPES, false); } @Override @@ -37,15 +36,16 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEnti protected BlockPattern createStructurePattern() { //TODO: add tiered casings return FactoryBlockPattern.start() .aisle("XXXXX", "XGGGX", "XGGGX", "XGGGX", "XXXXX") - .aisle("XXXXX", "G###G", "G###G", "G###G", "XXXXX") - .aisle("XXXXX", "G###G", "G###G", "G###G", "XXXXX") - .aisle("XXXXX", "G###G", "G###G", "G###G", "XXXXX") + .aisle("XXXXX", "G###G", "G#T#G", "G###G", "XXXXX") + .aisle("XXXXX", "G#T#G", "GTTTG", "G#T#G", "XXXXX") + .aisle("XXXXX", "G###G", "G#T#G", "G###G", "XXXXX") .aisle("XXSXX", "XGGGX", "XGGGX", "XGGGX", "XXXXX") .where('S', selfPredicate()) .where('X', states(getCasingState()).setMinGlobalLimited(50).or(autoAbilities(true, true, true, true, true, true, false))) .where('L', states(getCasingState())) .where('#', air()) .where('G', states(MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.LAMINATED_GLASS))) + .where('T', tieredCasing()) .build(); } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java index 9512fe1f..65dccf14 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java @@ -1,38 +1,30 @@ package com.fulltrix.gcyl.machines.multi; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.IVertexOperation; -import codechicken.lib.vec.Matrix4; -import com.fulltrix.gcyl.materials.GCYLMaterials; +import com.fulltrix.gcyl.api.multi.GCYLComputationRecipeLogic; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils; import com.fulltrix.gcyl.client.ClientHandler; -import com.fulltrix.gcyl.item.metal.MetalCasing2; -import com.google.common.collect.Lists; -import gregtech.api.GTValues; +import com.fulltrix.gcyl.blocks.metal.MetalCasing2; import gregtech.api.capability.*; -import gregtech.api.capability.impl.EnergyContainerList; -import gregtech.api.capability.impl.FluidTankList; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; -import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; -import gregtech.api.pattern.TraceabilityPredicate; -import gregtech.api.util.GTUtility; +import gregtech.api.recipes.Recipe; +import gregtech.api.recipes.logic.OCParams; +import gregtech.api.recipes.properties.RecipePropertyStorage; +import gregtech.api.util.KeyUtil; import gregtech.client.renderer.ICubeRenderer; -import gregtech.common.blocks.BlockFusionCasing; -import gregtech.common.blocks.MetaBlocks; -import gregtech.core.sound.GTSoundEvents; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.PacketBuffer; -import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.SoundEvent; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3i; import net.minecraft.util.text.ITextComponent; @@ -40,7 +32,6 @@ import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; -import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.jetbrains.annotations.NotNull; @@ -48,44 +39,16 @@ import javax.annotation.Nullable; import java.util.List; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.COSMIC_RAY_DETECTOR_RECIPES; import static com.fulltrix.gcyl.materials.GCYLMaterials.BlackTitanium; import static com.fulltrix.gcyl.client.ClientHandler.QUANTUM_CASING; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.METAL_CASING_2; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_2; -public class MetaTileEntityCosmicRayDetector extends MultiblockWithDisplayBase implements IControllable { - public boolean isWorkingEnabled = false; - public boolean isActive = false; - protected IMultipleTankHandler exportFluidHandler; - private long maxVoltage = 0; - private boolean canSeeSky = false; - private boolean hasEnoughEnergy = false; - private IEnergyContainer energyContainer; - private int amount = 0; - public MetaTileEntityCosmicRayDetector(ResourceLocation metaTileEntityId) { //todo: tiering and gui - super(metaTileEntityId); - reinitializeStructurePattern(); - } - - @Override - protected void updateFormedValid() { - if (!getWorld().isRemote && this.getNumMaintenanceProblems() < 1 && isWorkingEnabled()) { - - if (getOffsetTimer() % 20 == 4) { - canSeeSky = canSeeSky(); - } - if (canSeeSky && !hasEnoughEnergy) { - if (getOffsetTimer() % 20 == 8) { - hasEnoughEnergy = drainEnergy(true); - } - } - - if (canSeeSky && hasEnoughEnergy) { - setActive(true); - drainEnergy(false); - } else - setActive(false); - } else - return; +public class MetaTileEntityCosmicRayDetector extends GCYLRecipeMapMultiblockController implements IOpticalComputationReceiver { + private IOpticalComputationProvider computationProvider; + public MetaTileEntityCosmicRayDetector(ResourceLocation metaTileEntityId) { + super(metaTileEntityId, COSMIC_RAY_DETECTOR_RECIPES, false); + this.recipeMapWorkable = new CosmicRayRecipeLogic(this); } private boolean canSeeSky() { @@ -115,179 +78,50 @@ protected BlockPattern createStructurePattern() { .aisle("###############", "###############", "###############", "###############", "###############", "###############", "###############", "######xxx######", "####xx###xx####", "###############") .aisle("###############", "###############", "###############", "###############", "###############", "###############", "###############", "###############", "######xxx######", "###############") .where('S', selfPredicate()) - .where('X', states(getCasingState()).setMinGlobalLimited(145).or(autoAbilities(true, true, true, false))) + .where('X', states(getCasingState()).setMinGlobalLimited(145).or(autoAbilities(true, true, true, true, false, true, false)).or(abilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION).setExactLimit(1))) .where('x', states(getSecondaryCasingState())) .where('C', frames(BlackTitanium)) - .where('c', states(MetaBlocks.FUSION_CASING.getState(BlockFusionCasing.CasingType.SUPERCONDUCTOR_COIL))) - .where('F', air()) - .where('E', air()) - .where('s', air()) + .where('c', states(GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3))) + .where('F', tieredCasing()) + .where('E', tieredCasing()) + .where('s', states(GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3))) .where('#', any()) .build(); } - public TraceabilityPredicate autoAbilities(boolean checkEnergyIn, - boolean checkMaintenance, - boolean checkFluidOut, - boolean checkMuffler) { - TraceabilityPredicate predicate = super.autoAbilities(checkMaintenance, checkMuffler); - - if (checkEnergyIn) { - predicate = predicate.or(abilities(MultiblockAbility.INPUT_ENERGY).setMinGlobalLimited(1) - .setMaxGlobalLimited(2) - .setPreviewCount(1)); - } - if (checkFluidOut) { - predicate = predicate.or(abilities(MultiblockAbility.EXPORT_FLUIDS).setPreviewCount(1)); + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + List providers = getAbilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION); + if (providers != null && providers.size() >= 1) { + computationProvider = providers.get(0); } - return predicate; - } - /* - public static Predicate fieldGenPredicate() { - return (blockWorldState) -> { - IBlockState blockState = blockWorldState.getBlockState(); - if (!(blockState.getBlock() instanceof FieldGenCasing)) { - return false; - } else { - FieldGenCasing motorCasing = (FieldGenCasing) blockState.getBlock(); - FieldGenCasing.CasingType tieredCasingType = motorCasing.getState(blockState); - FieldGenCasing.CasingType currentCasing = blockWorldState.getMatchContext().getOrPut("FieldGen", tieredCasingType); - return currentCasing.getName().equals(tieredCasingType.getName()); - } - }; - } - - public static Predicate emitterPredicate() { - return (blockWorldState) -> { - IBlockState blockState = blockWorldState.getBlockState(); - if (!(blockState.getBlock() instanceof EmitterCasing)) { - return false; - } else { - EmitterCasing motorCasing = (EmitterCasing) blockState.getBlock(); - EmitterCasing.CasingType tieredCasingType = motorCasing.getState(blockState); - EmitterCasing.CasingType currentCasing = blockWorldState.getMatchContext().getOrPut("Emitter", tieredCasingType); - return currentCasing.getName().equals(tieredCasingType.getName()); - } - }; - } - - public static Predicate sensorPredicate() { - return (blockWorldState) -> { - IBlockState blockState = blockWorldState.getBlockState(); - if (!(blockState.getBlock() instanceof SensorCasing)) { - return false; - } else { - SensorCasing motorCasing = (SensorCasing) blockState.getBlock(); - SensorCasing.CasingType tieredCasingType = motorCasing.getState(blockState); - SensorCasing.CasingType currentCasing = blockWorldState.getMatchContext().getOrPut("Sensor", tieredCasingType); - return currentCasing.getName().equals(tieredCasingType.getName()); - } - }; + if (computationProvider == null) { + invalidateStructure(); + } } - */ - @Override - protected void addDisplayText(List textList) { - if (this.isStructureFormed()) { - if (energyContainer != null && energyContainer.getEnergyCapacity() > 0) { - maxVoltage = energyContainer.getInputVoltage(); - if (maxVoltage >= getVoltage()) { - String voltageName = GTValues.VN[GTUtility.getTierByVoltage(maxVoltage)]; - textList.add(new TextComponentTranslation("gregtech.multiblock.max_energy_per_tick", maxVoltage, voltageName)); - } else if (!hasEnoughEnergy) - textList.add(new TextComponentTranslation("gregtech.multiblock.not_enough_energy").setStyle(new Style().setColor(TextFormatting.RED))); - } - if (!canSeeSky) - textList.add(new TextComponentTranslation("gcyl.multiblock.cosmic_ray_detector.tooltip.1") - .setStyle(new Style().setColor(TextFormatting.RED))); - if (exportFluidHandler.fill(GCYLMaterials.HeavyLeptonMix.getFluid(1), false) < 1) - textList.add(new TextComponentTranslation("gcyl.multiblock.cosmic_ray_detector.tooltip.8").setStyle(new Style().setColor(TextFormatting.RED))); - if (hasEnoughEnergy && canSeeSky) { - textList.add(new TextComponentTranslation("gcyl.multiblock.cosmic_ray_detector.tooltip.5", this.amount)); - } - } + protected void configureDisplayText(MultiblockUIBuilder builder) { + builder.structureFormed(isStructureFormed()) + .addCustom((keyManager, uiSyncer) -> { + if (!uiSyncer.syncBoolean(canSeeSky())) { + keyManager.add(KeyUtil.lang(TextFormatting.RED, "gcyl.multiblock.cosmic_ray_detector.tooltip.1")); + } + }); } + @Override public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { super.addInformation(stack, player, tooltip, advanced); tooltip.add(I18n.format("gcyl.multiblock.cosmic_ray_detector.tooltip.2")); tooltip.add(I18n.format("gcyl.multiblock.cosmic_ray_detector.tooltip.3")); tooltip.add(I18n.format("gcyl.multiblock.cosmic_ray_detector.tooltip.4")); - tooltip.add(I18n.format("gcyl.multiblock.cosmic_ray_detector.tooltip.6")); - tooltip.add(I18n.format("gcyl.multiblock.cosmic_ray_detector.tooltip.7")); - } - - /* - @Override - protected void formStructure(PatternMatchContext context) { - super.formStructure(context); - //EmitterCasing.CasingType emitter = context.getOrDefault("Emitter", EmitterCasing.CasingType.EMITTER_LV); - //SensorCasing.CasingType sensor = context.getOrDefault("Sensor", SensorCasing.CasingType.SENSOR_LV); - //FieldGenCasing.CasingType fieldGen = context.getOrDefault("FieldGen", FieldGenCasing.CasingType.FIELD_GENERATOR_LV); - //int min = Collections.min(Arrays.asList(emitter.getTier(), sensor.getTier(), fieldGen.getTier())); - //maxVoltage = (long) (Math.pow(4, min) * 8); - maxVoltage = energyContainer.getInputVoltage(); - this.initializeAbilities(); - amount = getAmount(); - } - */ - - @Override - protected void formStructure(PatternMatchContext context) { - super.formStructure(context); - initializeAbilities(); - amount = getAmount(); - } - - private int getAmount() { - double amount = Math.min(((double) this.getPos().getY()) / (256 - 5), 1); - amount = Math.max(amount, 0); - amount *= 35; - amount *= getOverclock(); - amount += 15; - return (int) amount; - } - - private void initializeAbilities() { - this.exportFluidHandler = new FluidTankList(true, getAbilities(MultiblockAbility.EXPORT_FLUIDS)); - this.energyContainer = new EnergyContainerList(getAbilities(MultiblockAbility.INPUT_ENERGY)); - } - - private void resetTileAbilities() { - this.exportFluidHandler = new FluidTankList(true); - this.energyContainer = new EnergyContainerList(Lists.newArrayList()); - } - - private boolean drainEnergy(boolean simulate) { - if (maxVoltage >= getVoltage() && energyContainer.getEnergyStored() >= getVoltage() && - exportFluidHandler.fill(GCYLMaterials.HeavyLeptonMix.getFluid(1), false) > 0) { - if (!simulate) { - energyContainer.removeEnergy(getVoltage() * getOverclock()); - exportFluidHandler.fill(GCYLMaterials.HeavyLeptonMix.getFluid(this.amount), true); - } - return true; - } - return false; - } - - public long getOverclock() { - int tierDifference = GTUtility.getTierByVoltage(energyContainer.getInputVoltage()) - GTValues.UHV; - return (long) Math.floor(Math.pow(4, tierDifference)); - } - - private long getVoltage() { - return GTValues.V[GTValues.UHV]; + tooltip.add(I18n.format("gcyl.multiblock.cosmic_ray_detector.tooltip.5")); } - @Override - public void invalidateStructure() { - super.invalidateStructure(); - this.maxVoltage = 0; - this.resetTileAbilities(); - } private IBlockState getCasingState() { return METAL_CASING_2.getState(MetalCasing2.CasingType.QUANTUM); @@ -303,11 +137,6 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { return QUANTUM_CASING; } - @Override - public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { - super.renderMetaTileEntity(renderState, translation, pipeline); - getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), this.isActive(), this.isWorkingEnabled); - } @SideOnly(Side.CLIENT) @Override @@ -321,87 +150,34 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEnti } @Override - public boolean isWorkingEnabled() { - return isWorkingEnabled; + public IOpticalComputationProvider getComputationProvider() { + return computationProvider; } - @Override - public void setWorkingEnabled(boolean isWorkingAllowed) { - this.isWorkingEnabled = isWorkingAllowed; - markDirty(); - World world = getWorld(); - if (world != null && !world.isRemote) { - writeCustomData(GregtechDataCodes.WORKING_ENABLED, buf -> buf.writeBoolean(isWorkingEnabled)); + private class CosmicRayRecipeLogic extends GCYLComputationRecipeLogic { + public CosmicRayRecipeLogic(RecipeMapMultiblockController metaTileEntity) { + super(metaTileEntity, ComputationType.STEADY); } - } - @Override - public boolean isActive() { - return super.isActive() && this.isWorkingEnabled; - } - - protected void setActive(boolean active) { - if (this.isActive != active) { - this.isActive = active; - markDirty(); - World world = getWorld(); - if (world != null && !world.isRemote) { - writeCustomData(GregtechDataCodes.WORKABLE_ACTIVE, buf -> buf.writeBoolean(active)); - } + @NotNull + @Override + public MetaTileEntityCosmicRayDetector getMetaTileEntity() { + return (MetaTileEntityCosmicRayDetector) super.getMetaTileEntity(); } - } - @Override - public SoundEvent getSound() { - return GTSoundEvents.ARC; - } - - @Override - public T getCapability(Capability capability, EnumFacing side) { - if (capability == GregtechTileCapabilities.CAPABILITY_CONTROLLABLE) { - return GregtechTileCapabilities.CAPABILITY_CONTROLLABLE.cast(this); - } - return super.getCapability(capability, side); - } + @Override + public boolean checkRecipe(@NotNull Recipe recipe) { + if (!super.checkRecipe(recipe)) + return false; - @Override - public void receiveCustomData(int dataId, PacketBuffer buf) { - super.receiveCustomData(dataId, buf); - if (dataId == GregtechDataCodes.WORKABLE_ACTIVE) { - this.isActive = buf.readBoolean(); - scheduleRenderUpdate(); - } else if (dataId == GregtechDataCodes.WORKING_ENABLED) { - this.isWorkingEnabled = buf.readBoolean(); - scheduleRenderUpdate(); + return getMetaTileEntity().canSeeSky(); } - } - - @Override - public void writeInitialSyncData(PacketBuffer buf) { - super.writeInitialSyncData(buf); - buf.writeBoolean(isActive); - buf.writeBoolean(this.isWorkingEnabled); - } - @Override - public void receiveInitialSyncData(PacketBuffer buf) { - super.receiveInitialSyncData(buf); - this.isActive = buf.readBoolean(); - this.isWorkingEnabled = buf.readBoolean(); - } + @Override + protected void modifyOverclockPre(@NotNull OCParams ocParams, @NotNull RecipePropertyStorage storage) { + super.modifyOverclockPre(ocParams, storage); - @Override - public NBTTagCompound writeToNBT(NBTTagCompound data) { - super.writeToNBT(data); - data.setBoolean("isActive", this.isActive); - data.setBoolean("isWorkingEnabled", this.isWorkingEnabled); - return data; - } - - @Override - public void readFromNBT(NBTTagCompound data) { - super.readFromNBT(data); - this.isActive = data.getBoolean("isActive"); - this.isWorkingEnabled = data.getBoolean("isWorkingEnabled"); + ocParams.setDuration(Math.max(1,ocParams.duration() - getMetaTileEntity().getPos().getY())); + } } } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityElectricImplosion.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityElectricImplosion.java index bfb58fb7..9c017d39 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityElectricImplosion.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityElectricImplosion.java @@ -1,7 +1,7 @@ package com.fulltrix.gcyl.machines.multi; -import com.fulltrix.gcyl.machines.multi.simple.GCYLRecipeMapMultiblockController; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregicality.multiblocks.api.render.GCYMTextures; import gregicality.multiblocks.common.block.GCYMMetaBlocks; import gregicality.multiblocks.common.block.blocks.BlockLargeMultiblockCasing; diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java index 9da1a019..b10e5bf6 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java @@ -1,21 +1,19 @@ package com.fulltrix.gcyl.machines.multi; import com.fulltrix.gcyl.client.ClientHandler; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; -import com.fulltrix.gcyl.item.GCYLMultiblockCasing2; -import com.fulltrix.gcyl.item.fusion.GCYLFusionCasing; -import com.fulltrix.gcyl.item.metal.MetalCasing2; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.blocks.GCYLMultiblockCasing2; +import com.fulltrix.gcyl.blocks.metal.MetalCasing2; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.util.KeyUtil; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.cube.OrientedOverlayRenderer; -import gregtech.common.blocks.BlockFusionCasing; -import gregtech.common.blocks.MetaBlocks; import net.minecraft.block.state.IBlockState; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; @@ -24,9 +22,10 @@ import javax.annotation.Nonnull; import java.util.List; +import static com.fulltrix.gcyl.api.pattern.TraceabilityPredicates.advFusionCoils; import static com.fulltrix.gcyl.client.ClientHandler.ENRICHED_NAQUADAH_ALLOY_CASING; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.METAL_CASING_2; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.MULTIBLOCK_CASING2; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_2; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.MULTIBLOCK_CASING2; public class MetaTileEntityStellarForge extends RecipeMapMultiblockController { //TODO implement tiering private long maxVoltage; @@ -56,7 +55,7 @@ protected BlockPattern createStructurePattern() { .where('M', air()) .where('C', states(getCasingState()).setMinGlobalLimited(130).or(autoAbilities(true, true, true, true, true, true, false))) .where('X', states(MULTIBLOCK_CASING2.getState(GCYLMultiblockCasing2.CasingType.STELLAR_CONTAINMENT))) - .where('F', states(MetaBlocks.FUSION_CASING.getState(BlockFusionCasing.CasingType.FUSION_COIL))) + .where('F', advFusionCoils()) .where('S', selfPredicate()) .where('#', any()) .build(); @@ -69,9 +68,10 @@ public void invalidateStructure() { } @Override - protected void addDisplayText(List textList) { - super.addDisplayText(textList); - textList.add(new TextComponentTranslation("gregtech.multiblock.universal.framework", this.maxVoltage)); + protected void configureDisplayText(MultiblockUIBuilder builder) { + builder.addCustom((keyManager, uiSyncer) -> { + keyManager.add(KeyUtil.lang("gregtech.multiblock.universal.framework", this.maxVoltage)); + }); } @Override diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvCentrifuge.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvCentrifuge.java index c90d5232..ca64a3a3 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvCentrifuge.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvCentrifuge.java @@ -1,6 +1,6 @@ package com.fulltrix.gcyl.machines.multi.advance; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; import gregicality.multiblocks.api.render.GCYMTextures; import gregicality.multiblocks.common.block.GCYMMetaBlocks; @@ -23,18 +23,17 @@ import static gregtech.api.util.RelativeDirection.*; -//TODO: hide or replace the gcym large centrifuge somehow - +//TODO: remove centrifuge map when small recipe maps work public class MetaTileEntityAdvCentrifuge extends GCYMRecipeMapMultiblockController { public MetaTileEntityAdvCentrifuge(ResourceLocation metaTileEntityId) { super(metaTileEntityId, - new RecipeMap[] { RecipeMaps.CENTRIFUGE_RECIPES, RecipeMaps.THERMAL_CENTRIFUGE_RECIPES, GCYLRecipeMaps.ADVANCED_CENTRIFUGE_RECIPES }); + new RecipeMap[] { RecipeMaps.THERMAL_CENTRIFUGE_RECIPES, GCYLRecipeMaps.ADVANCED_CENTRIFUGE_RECIPES, RecipeMaps.CENTRIFUGE_RECIPES }); } @Override public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHolder) { - return new MetaTileEntityLargeCentrifuge(this.metaTileEntityId); + return new MetaTileEntityAdvCentrifuge(this.metaTileEntityId); } @Override diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvFusionReactor.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvFusionReactor.java index 4c03d018..23152d84 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvFusionReactor.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvFusionReactor.java @@ -1,14 +1,20 @@ package com.fulltrix.gcyl.machines.multi.advance; +import com.cleanroommc.modularui.api.drawable.IDrawable; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.value.sync.DoubleSyncValue; +import com.cleanroommc.modularui.value.sync.LongSyncValue; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.cleanroommc.modularui.widgets.ProgressWidget; +import com.cleanroommc.modularui.widgets.layout.Column; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.client.ClientHandler; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; -import com.fulltrix.gcyl.item.fusion.GCYLCryostatCasing; -import com.fulltrix.gcyl.item.fusion.GCYLDivertorCasing; -import com.fulltrix.gcyl.item.fusion.GCYLFusionCasing; -import com.fulltrix.gcyl.item.fusion.GCYLVacuumCasing; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; -import com.fulltrix.gcyl.recipes.recipeproperties.AdvFusionCoilProperty; -import com.fulltrix.gcyl.recipes.recipeproperties.AdvFusionEUReturnProperty; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.fusion.*; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.machines.GCYLTileEntities; +import com.fulltrix.gcyl.api.recipes.properties.AdvFusionCoilProperty; +import com.fulltrix.gcyl.api.recipes.properties.AdvFusionEUReturnProperty; import com.google.common.util.concurrent.AtomicDouble; import gregtech.api.GTValues; import gregtech.api.capability.GregtechDataCodes; @@ -20,18 +26,24 @@ import gregtech.api.gui.widgets.ImageCycleButtonWidget; import gregtech.api.gui.widgets.ImageWidget; import gregtech.api.gui.widgets.IndicatorImageWidget; -import gregtech.api.gui.widgets.ProgressWidget; import gregtech.api.metatileentity.IFastRenderMetaTileEntity; import gregtech.api.metatileentity.ITieredMetaTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.*; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIFactory; +import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; +import gregtech.api.mui.GTGuiTextures; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; import gregtech.api.recipes.Recipe; -import gregtech.api.recipes.recipeproperties.FusionEUToStartProperty; -import gregtech.api.recipes.recipeproperties.IRecipePropertyStorage; +import gregtech.api.recipes.RecipeMap; +import gregtech.api.recipes.RecipeMaps; +import gregtech.api.recipes.logic.OCParams; +import gregtech.api.recipes.properties.RecipePropertyStorage; +import gregtech.api.recipes.properties.impl.FusionEUToStartProperty; +import gregtech.api.util.KeyUtil; import gregtech.api.util.RelativeDirection; import gregtech.api.util.TextComponentUtil; import gregtech.api.util.TextFormattingUtil; @@ -71,17 +83,18 @@ import java.util.Arrays; import java.util.List; import java.util.function.DoubleSupplier; +import java.util.function.UnaryOperator; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -public class MetaTileEntityAdvFusionReactor extends RecipeMapMultiblockController implements ITieredMetaTileEntity, IFastRenderMetaTileEntity, IBloomEffect { +public class MetaTileEntityAdvFusionReactor extends GCYLRecipeMapMultiblockController implements ITieredMetaTileEntity, IFastRenderMetaTileEntity, IBloomEffect, ProgressBarMultiblock { //TODO make this better. make coils independent of tier. fix bloom. make it be able to run regular fusion recipes. make recipe cancel if energy runs out private static final List HOT = Arrays.asList(SupercriticalSteam.getFluid(), SupercriticalSodiumPotassiumAlloy.getFluid(), SupercriticalFLiNaK.getFluid(), SupercriticalFLiBe.getFluid(), SupercriticalLeadBismuthEutectic.getFluid()); - private final FusionProgressSupplier progressBarSupplier; + //private final FusionProgressSupplier progressBarSupplier; protected static final int NO_COLOR = 0; private final int tier; @@ -97,7 +110,7 @@ public class MetaTileEntityAdvFusionReactor extends RecipeMapMultiblockControlle public MetaTileEntityAdvFusionReactor(ResourceLocation metaTileEntityId, int tier) { - super(metaTileEntityId, GCYLRecipeMaps.ADV_FUSION_RECIPES); + super(metaTileEntityId, new RecipeMap[] {GCYLRecipeMaps.ADV_FUSION_RECIPES, RecipeMaps.FUSION_RECIPES}, false); this.recipeMapWorkable = new AdvFusionRecipeLogic(this); this.tier = tier; this.energyContainer = new EnergyContainerHandler(this, 0, 0, 0, 0, 0) { @@ -108,7 +121,11 @@ public String getName() { return GregtechDataCodes.FUSION_REACTOR_ENERGY_CONTAINER_TRAIT; } }; - this.progressBarSupplier = new MetaTileEntityAdvFusionReactor.FusionProgressSupplier(); + //this.progressBarSupplier = new MetaTileEntityAdvFusionReactor.FusionProgressSupplier(); + } + @Override + public boolean isTiered() { + return false; } @Override @@ -134,20 +151,28 @@ protected BlockPattern createStructurePattern() { .where('C', states(getCoilState())) .where('X', states(getCasingState())) .where('d', states(getDivertorState()).or(metaTileEntities(Arrays + .stream(GCYLTileEntities.WIRELESS_ENERGY_HATCH_INPUT) + .filter(mte -> mte != null && tier <= mte.getTier() && mte.getTier() <= GTValues.MAX) + .toArray(MetaTileEntity[]::new)) + .or(metaTileEntities(Arrays .stream(MetaTileEntities.ENERGY_INPUT_HATCH) - .filter(mte -> mte != null && tier <= mte.getTier() && mte.getTier() <= GTValues.OpV) + .filter(mte -> mte != null && tier <= mte.getTier() && mte.getTier() <= GTValues.MAX) .toArray(MetaTileEntity[]::new)) - .setMinGlobalLimited(1).setPreviewCount(16))) + .setPreviewCount(16)))) .where('v', states(getVacuumState())) .where('c', states(getCryostatState())) .where('b', states(GCYLMetaBlocks.FUSION_CASING.getState(GCYLFusionCasing.CasingType.FUSION_BLANKET)) .or(abilities(MultiblockAbility.IMPORT_FLUIDS).setMinGlobalLimited(3).setMaxGlobalLimited(3).setPreviewCount(3)) .or(abilities(MultiblockAbility.EXPORT_FLUIDS).setMaxGlobalLimited(3).setPreviewCount(3))) .where('E', metaTileEntities(Arrays - .stream(MetaTileEntities.ENERGY_INPUT_HATCH) - .filter(mte -> mte != null && tier <= mte.getTier() && mte.getTier() <= GTValues.OpV) + .stream(GCYLTileEntities.WIRELESS_ENERGY_HATCH_INPUT) + .filter(mte -> mte != null && tier <= mte.getTier() && mte.getTier() <= GTValues.MAX) .toArray(MetaTileEntity[]::new)) - .setMinGlobalLimited(1).setPreviewCount(16)) + .or(metaTileEntities(Arrays + .stream(MetaTileEntities.ENERGY_INPUT_HATCH) + .filter(mte -> mte != null && tier <= mte.getTier() && mte.getTier() <= GTValues.MAX) + .toArray(MetaTileEntity[]::new))) + .setPreviewCount(16)) .where('I', states(getCasingState()).or(abilities(MultiblockAbility.IMPORT_FLUIDS).setMinGlobalLimited(3))) .where('i', states(getCasingState()).or(abilities(MultiblockAbility.EXPORT_FLUIDS))) .build(); @@ -216,15 +241,15 @@ public void addInformation(ItemStack stack, @Nullable World player, @NotNull Lis private IBlockState getCoilState() { if (tier == GTValues.UHV) - return GCYLMetaBlocks.FUSION_CASING.getState(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_1); + return GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_1); if (tier == GTValues.UEV) - return GCYLMetaBlocks.FUSION_CASING.getState(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_2); + return GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_2); if (tier == GTValues.UIV) - return GCYLMetaBlocks.FUSION_CASING.getState(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_3); + return GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3); if (tier == GTValues.UXV) - return GCYLMetaBlocks.FUSION_CASING.getState(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_4); + return GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_4); - return GCYLMetaBlocks.FUSION_CASING.getState(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_5); + return GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_5); } private IBlockState getCryostatState() { @@ -253,6 +278,9 @@ private IBlockState getDivertorState() { return GCYLMetaBlocks.DIVERTOR_CASING.getState(GCYLDivertorCasing.CasingType.DIVERTOR_5); } + private long getHeat() { + return heat; + } @@ -394,6 +422,95 @@ public int getTier() { return this.tier; } + @Override + protected MultiblockUIFactory createUIFactory() { + + /* + IDrawable title; + if (tier == GTValues.UHV) { + // MK1 + title = GTGuiTextures.FUSION_REACTOR_MK1_TITLE; + } else if (tier == GTValues.UEV) { + // MK2 + title = GTGuiTextures.FUSION_REACTOR_MK2_TITLE; + } else { + // MK3 + title = GTGuiTextures.FUSION_REACTOR_MK3_TITLE; + } + */ + + DoubleSyncValue progress = new DoubleSyncValue(recipeMapWorkable::getProgressPercent); + return new MultiblockUIFactory(this) + .setScreenHeight(138) + .disableDisplayText() + .addScreenChildren((parent, syncManager) -> { + var status = MultiblockUIFactory.builder("status", syncManager); + status.setAction(b -> b.structureFormed(true) + .setWorkingStatus(recipeMapWorkable.isWorkingEnabled(), recipeMapWorkable.isActive()) + .addWorkingStatusLine()); + parent.child(new Column() + .padding(4) + .expanded() + /* + .child(title.asWidget() + .marginBottom(8) + .size(69, 12)) + */ + .child(new com.cleanroommc.modularui.widgets.ProgressWidget() + .size(77, 77) + .tooltipAutoUpdate(true) + .tooltipBuilder(status::build) + .background(GTGuiTextures.FUSION_DIAGRAM.asIcon() + .size(89, 101) + .marginTop(11)) + .direction(ProgressWidget.Direction.CIRCULAR_CW) + .value(progress) + .texture(null, GTGuiTextures.FUSION_PROGRESS, 77)) + .child(GTGuiTextures.FUSION_LEGEND.asWidget() + .left(4) + .bottom(4) + .size(108, 41))); + }); + } + + @Override + public int getProgressBarCount() { + return 2; + } + + @Override + public void registerBars(List> bars, PanelSyncManager syncManager) { + LongSyncValue capacity = new LongSyncValue(energyContainer::getEnergyCapacity); + syncManager.syncValue("capacity", capacity); + LongSyncValue stored = new LongSyncValue(energyContainer::getEnergyStored); + syncManager.syncValue("stored", stored); + LongSyncValue heat = new LongSyncValue(this::getHeat); + syncManager.syncValue("heat", heat); + + bars.add(barTest -> barTest + .progress(() -> capacity.getLongValue() > 0 ? + 1.0 * stored.getLongValue() / capacity.getLongValue() : 0) + .texture(GTGuiTextures.PROGRESS_BAR_FUSION_ENERGY) + .tooltipBuilder(tooltip -> tooltip + .add(KeyUtil.lang(TextFormatting.GRAY, + "gregtech.multiblock.energy_stored", + stored.getLongValue(), capacity.getLongValue())))); + + bars.add(barTest -> barTest + .texture(GTGuiTextures.PROGRESS_BAR_FUSION_HEAT) + .tooltipBuilder(tooltip -> { + IKey heatInfo = KeyUtil.string(TextFormatting.AQUA, + "%,d / %,d EU", + heat.getLongValue(), capacity.getLongValue()); + tooltip.add(KeyUtil.lang(TextFormatting.GRAY, + "gregtech.multiblock.fusion_reactor.heat", + heatInfo)); + }) + .progress(() -> capacity.getLongValue() > 0 ? + 1.0 * heat.getLongValue() / capacity.getLongValue() : 0)); + } + + /* @Override protected ModularUI.Builder createUITemplate(EntityPlayer entityPlayer) { // Background @@ -436,7 +553,7 @@ protected ModularUI.Builder createUITemplate(EntityPlayer entityPlayer) { } */ - + /* // Fusion Diagram + Progress Bar builder.widget(new ImageWidget(55, 24, 89, 101, GuiTextures.FUSION_REACTOR_DIAGRAM).setIgnoreColor(true)); builder.widget(MetaTileEntityAdvFusionReactor.FusionProgressSupplier.Type.BOTTOM_LEFT.getWidget(this)); @@ -468,28 +585,7 @@ protected ModularUI.Builder createUITemplate(EntityPlayer entityPlayer) { builder.bindPlayerInventory(entityPlayer.inventory, 153); return builder; } - - private void addEnergyBarHoverText(List hoverList) { - ITextComponent energyInfo = TextComponentUtil.stringWithColor( - TextFormatting.AQUA, - TextFormattingUtil.formatNumbers(energyContainer.getEnergyStored()) + " / " + - TextFormattingUtil.formatNumbers(energyContainer.getEnergyCapacity()) + " EU"); - hoverList.add(TextComponentUtil.translationWithColor( - TextFormatting.GRAY, - "gregtech.multiblock.energy_stored", - energyInfo)); - } - - private void addHeatBarHoverText(List hoverList) { - ITextComponent heatInfo = TextComponentUtil.stringWithColor( - TextFormatting.RED, - TextFormattingUtil.formatNumbers(heat) + " / " + - TextFormattingUtil.formatNumbers(energyContainer.getEnergyCapacity())); - hoverList.add(TextComponentUtil.translationWithColor( - TextFormatting.GRAY, - "gregtech.multiblock.fusion_reactor.heat", - heatInfo)); - } + */ @Override public void receiveCustomData(int dataId, PacketBuffer buf) { @@ -541,10 +637,10 @@ public void renderBloomEffect(@NotNull BufferBuilder buffer, @NotNull EffectRend buffer.begin(GL11.GL_QUAD_STRIP, DefaultVertexFormats.POSITION_COLOR); RenderBufferHelper.renderRing(buffer, - getPos().getX() - context.cameraX() + relativeBack.getXOffset() * 7 + 0.5, + getPos().getX() - context.cameraX() + relativeBack.getXOffset() * 7 + 1.25, getPos().getY() - context.cameraY() + relativeBack.getYOffset() * 7 + 2.0, - getPos().getZ() - context.cameraZ() + relativeBack.getZOffset() * 7 + 1.5, - 4.5, 0.6, 10, 20, + getPos().getZ() - context.cameraZ() + relativeBack.getZOffset() * 7 + 0.75, + 5.0, 0.6, 10, 20, r, g, b, a, axis); Tessellator.getInstance().draw(); } @@ -612,128 +708,6 @@ public void postDraw(@NotNull BufferBuilder buffer) { } } - private static class FusionProgressSupplier { - - private final AtomicDouble tracker = new AtomicDouble(0.0); - private final ProgressWidget.TimedProgressSupplier bottomLeft; - private final DoubleSupplier topLeft; - private final DoubleSupplier topRight; - private final DoubleSupplier bottomRight; - - public FusionProgressSupplier() { - // Bottom Left, fill on [0, 0.25) - bottomLeft = new ProgressWidget.TimedProgressSupplier(200, 164, false) { - - @Override - public double getAsDouble() { - double val = super.getAsDouble(); - tracker.set(val); - if (val >= 0.25) { - return 1; - } - return 4 * val; - } - - @Override - public void resetCountdown() { - super.resetCountdown(); - tracker.set(0); - } - }; - - // Top Left, fill on [0.25, 0.5) - topLeft = () -> { - double val = tracker.get(); - if (val < 0.25) { - return 0; - } else if (val >= 0.5) { - return 1; - } - return 4 * (val - 0.25); - }; - - // Top Right, fill on [0.5, 0.75) - topRight = () -> { - double val = tracker.get(); - if (val < 0.5) { - return 0; - } else if (val >= 0.75) { - return 1; - } - return 4 * (val - 0.5); - }; - - // Bottom Right, fill on [0.75, 1.0] - bottomRight = () -> { - double val = tracker.get(); - if (val < 0.75) { - return 0; - } else if (val >= 1) { - return 1; - } - return 4 * (val - 0.75); - }; - } - - public void resetCountdown() { - bottomLeft.resetCountdown(); - } - - public DoubleSupplier getSupplier(Type type) { - return switch (type) { - case BOTTOM_LEFT -> bottomLeft; - case TOP_LEFT -> topLeft; - case TOP_RIGHT -> topRight; - case BOTTOM_RIGHT -> bottomRight; - }; - } - - private enum Type { - - BOTTOM_LEFT( - 61, 66, 35, 41, - GuiTextures.PROGRESS_BAR_FUSION_REACTOR_DIAGRAM_BL, ProgressWidget.MoveType.VERTICAL), - TOP_LEFT( - 61, 30, 41, 35, - GuiTextures.PROGRESS_BAR_FUSION_REACTOR_DIAGRAM_TL, ProgressWidget.MoveType.HORIZONTAL), - TOP_RIGHT( - 103, 30, 35, 41, - GuiTextures.PROGRESS_BAR_FUSION_REACTOR_DIAGRAM_TR, ProgressWidget.MoveType.VERTICAL_DOWNWARDS), - BOTTOM_RIGHT( - 97, 72, 41, 35, - GuiTextures.PROGRESS_BAR_FUSION_REACTOR_DIAGRAM_BR, ProgressWidget.MoveType.HORIZONTAL_BACKWARDS); - - private final int x; - private final int y; - private final int width; - private final int height; - private final TextureArea texture; - private final ProgressWidget.MoveType moveType; - - Type(int x, int y, int width, int height, TextureArea texture, ProgressWidget.MoveType moveType) { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - this.texture = texture; - this.moveType = moveType; - } - - public ProgressWidget getWidget(MetaTileEntityAdvFusionReactor instance) { - return new ProgressWidget( - () -> instance.recipeMapWorkable.isActive() ? - instance.progressBarSupplier.getSupplier(this).getAsDouble() : 0, - x, y, width, height, texture, moveType) - .setIgnoreColor(true) - .setHoverTextConsumer( - tl -> MultiblockDisplayText.builder(tl, instance.isStructureFormed()) - .setWorkingStatus(instance.recipeMapWorkable.isWorkingEnabled(), - instance.recipeMapWorkable.isActive()) - .addWorkingStatusLine()); - } - } - } - public class AdvFusionRecipeLogic extends MultiblockRecipeLogic { @@ -752,10 +726,10 @@ public void updateWorkable() { } @Override - protected double getOverclockingDurationDivisor() {return 2.0;} + protected double getOverclockingDurationFactor() {return 2.0;} @Override - protected double getOverclockingVoltageMultiplier() { + protected double getOverclockingVoltageFactor() { return 2.0D; } @@ -795,22 +769,34 @@ public boolean checkRecipe(@NotNull Recipe recipe) { } @Override - protected void modifyOverclockPre(int @NotNull [] values, @NotNull IRecipePropertyStorage storage) { - super.modifyOverclockPre(values, storage); + protected void modifyOverclockPre(@NotNull OCParams ocParams, @NotNull RecipePropertyStorage storage) { + super.modifyOverclockPre(ocParams, storage); // Limit the number of OCs to the difference in fusion reactor MK. // I.e., a MK2 reactor can overclock a MK1 recipe once, and a // MK3 reactor can overclock a MK2 recipe once, or a MK1 recipe twice. - long euToStart = storage.getRecipePropertyValue(FusionEUToStartProperty.getInstance(), 0L); + long euToStart = storage.get(FusionEUToStartProperty.getInstance(), 0L); int fusionTier = FusionEUToStartProperty.getFusionTier(euToStart); - int coilTier = storage.getRecipePropertyValue(AdvFusionCoilProperty.getInstance(), 0); - double euReturn = storage.getRecipePropertyValue(AdvFusionEUReturnProperty.getInstance(), 0); + int coilTier = storage.get(AdvFusionCoilProperty.getInstance(), 0); + double euReturn = storage.get(AdvFusionEUReturnProperty.getInstance(), 0); + long EUt = ocParams.eut(); + + if(coilTier != 0) { + if (fusionTier != 0) fusionTier = MetaTileEntityAdvFusionReactor.this.tier - fusionTier; + coilTier = MetaTileEntityAdvFusionReactor.this.coilTier - coilTier; + + ocParams.setOcAmount(ocParams.ocAmount()); - if (fusionTier != 0) fusionTier = MetaTileEntityAdvFusionReactor.this.tier - fusionTier; - if (coilTier != 0) coilTier = MetaTileEntityAdvFusionReactor.this.coilTier - coilTier; + ocParams.setEut((long) (EUt - (EUt * (euReturn / 100.0)))); + ocParams.setOcAmount(Math.min(fusionTier + coilTier, ocParams.ocAmount())); + } + else { + if (fusionTier != 0) fusionTier = MetaTileEntityAdvFusionReactor.this.tier - fusionTier; + + ocParams.setEut((long) (EUt - (EUt * (euReturn / 100.0)))); + ocParams.setOcAmount(Math.min(fusionTier * 2, ocParams.ocAmount())); + } - values[0] = (int) (values[0] - (values[0] * (euReturn / 100.0))); - values[2] = Math.min(fusionTier + coilTier, values[2]); } /* @@ -869,7 +855,7 @@ public void deserializeNBT(@NotNull NBTTagCompound compound) { @Override protected void setActive(boolean active) { if (active != isActive) { - MetaTileEntityAdvFusionReactor.this.progressBarSupplier.resetCountdown(); + //MetaTileEntityAdvFusionReactor.this.progressBarSupplier.resetCountdown(); } super.setActive(active); } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvMixer.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvMixer.java index dd5a7dca..583c1938 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvMixer.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvMixer.java @@ -1,6 +1,6 @@ package com.fulltrix.gcyl.machines.multi.advance; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; import gregicality.multiblocks.api.render.GCYMTextures; import gregicality.multiblocks.api.unification.GCYMMaterials; @@ -24,19 +24,18 @@ import net.minecraft.util.ResourceLocation; import org.jetbrains.annotations.NotNull; -//TODO: hide or replace gcym large mixer some how +//TODO: remove regular mixer recipes once small map is implemented public class MetaTileEntityAdvMixer extends GCYMRecipeMapMultiblockController { public MetaTileEntityAdvMixer(ResourceLocation metaTileEnttityID) { - super(metaTileEnttityID, - new RecipeMap[] {RecipeMaps.MIXER_RECIPES, GCYLRecipeMaps.ADVANCED_MIXER_RECIPES}); + super(metaTileEnttityID, new RecipeMap[] {RecipeMaps.MIXER_RECIPES, GCYLRecipeMaps.ADVANCED_MIXER_RECIPES}); } @Override public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHolder) { - return new MetaTileEntityLargeMixer(this.metaTileEntityId); + return new MetaTileEntityAdvMixer(this.metaTileEntityId); } @Override diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvancedAssline.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvancedAssline.java new file mode 100644 index 00000000..82a5a65b --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvancedAssline.java @@ -0,0 +1,648 @@ +package com.fulltrix.gcyl.machines.multi.advance; + +import codechicken.lib.raytracer.CuboidRayTraceResult; +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import codechicken.lib.vec.Vector3; +import gregtech.api.capability.GregtechDataCodes; +import gregtech.api.capability.IDataAccessHatch; +import gregtech.api.capability.IEnergyContainer; +import gregtech.api.capability.IMultipleTankHandler; +import gregtech.api.capability.impl.EnergyContainerList; +import gregtech.api.capability.impl.MultiblockRecipeLogic; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.pattern.BlockPattern; +import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.TraceabilityPredicate; +import gregtech.api.recipes.Recipe; +import gregtech.api.recipes.RecipeBuilder; +import gregtech.api.recipes.RecipeMaps; +import gregtech.api.recipes.ingredients.GTRecipeInput; +import gregtech.api.recipes.logic.OCParams; +import gregtech.api.recipes.logic.OCResult; +import gregtech.api.recipes.properties.RecipePropertyStorage; +import gregtech.api.recipes.properties.impl.ResearchProperty; +import gregtech.api.util.*; +import gregtech.client.particle.GTLaserBeamParticle; +import gregtech.client.particle.GTParticleManager; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.client.renderer.texture.Textures; +import gregtech.client.utils.TooltipHelper; +import gregtech.common.ConfigHolder; +import gregtech.common.blocks.BlockGlassCasing; +import gregtech.common.blocks.BlockMultiblockCasing; +import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; +import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityMultiFluidHatch; +import gregtech.core.sound.GTSoundEvents; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.IItemHandlerModifiable; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.lang.reflect.Field; +import java.util.*; +import java.util.function.Function; + +import static com.fulltrix.gcyl.api.GCYLUtility.gcylId; +import static gregtech.api.capability.GregtechDataCodes.STRUCTURE_FORMED; +import static gregtech.api.util.RelativeDirection.*; + +//TODO finish tooltip coloring +//TODO finish fixing hanging mechanic +public class MetaTileEntityAdvancedAssline extends RecipeMapMultiblockController { + + private static final int HANG_DURATION = 100; + private static final ResourceLocation LASER_LOCATION = gcylId("textures/fx/laser/laser.png"); + private static final ResourceLocation LASER_HEAD_LOCATION = gcylId("textures/fx/laser/laser_start.png"); + + @SideOnly(Side.CLIENT) + private GTLaserBeamParticle[][] beamParticles; + private int beamCount; + private int beamTime; + + private int mode = 0; + + public MetaTileEntityAdvancedAssline(ResourceLocation metaTileEntityId) { + super(metaTileEntityId, RecipeMaps.ASSEMBLY_LINE_RECIPES); + this.recipeMapWorkable = mode == 0 ? new AdvancedAsslineRecipeLogic(this) : new MultiblockRecipeLogic(this); + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEntity) { + return new MetaTileEntityAdvancedAssline(metaTileEntityId); + } + + @NotNull + @Override + protected BlockPattern createStructurePattern() { + FactoryBlockPattern pattern = FactoryBlockPattern.start(FRONT, UP, RIGHT) + .aisle("FIF", "RTR", "SAG", " Y ") + .aisle("FIF", "RTR", "DAG", " Y ").setRepeatable(3, 15) + .aisle("FOF", "RTR", "DAG", " Y ") + .where('S', selfPredicate()) + .where('F', states(getCasingState()) + .or(autoAbilities(false, true, false, false, false, false, false)) + .or(fluidInputPredicate().setExactLimit(1))) + .where('O', abilities(MultiblockAbility.EXPORT_ITEMS) + .addTooltips("gregtech.multiblock.pattern.location_end")) + .where('Y', states(getCasingState()) + .or(abilities(MultiblockAbility.INPUT_ENERGY, MultiblockAbility.INPUT_LASER) + .setMinGlobalLimited(1) + .setMaxGlobalLimited(3))) + .where('I', metaTileEntities(MetaTileEntities.STOCKING_BUS_ME)) + .where('G', states(getGrateState())) + .where('A', + states(MetaBlocks.MULTIBLOCK_CASING + .getState(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_CONTROL))) + .where('R', states(MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.FUSION_GLASS))) + .where('T', + states(MetaBlocks.MULTIBLOCK_CASING + .getState(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_LINE_CASING))) + .where('D', dataHatchPredicate()) + .where(' ', any()); + return pattern.build(); + } + @NotNull + private static IBlockState getCasingState() { + return MetaBlocks.MULTIBLOCK_CASING.getState(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_CONTROL); + } + + @NotNull + private static IBlockState getGrateState() { + return MetaBlocks.MULTIBLOCK_CASING.getState(BlockMultiblockCasing.MultiblockCasingType.GRATE_CASING); + } + + @NotNull + private static TraceabilityPredicate fluidInputPredicate() { + // block multi-fluid hatches if ordered fluids is enabled + if (ConfigHolder.machines.orderedFluidAssembly) { + return metaTileEntities(MultiblockAbility.REGISTRY.get(MultiblockAbility.IMPORT_FLUIDS).stream() + .filter(mte -> !(mte instanceof MetaTileEntityMultiFluidHatch)) + .toArray(MetaTileEntity[]::new)) + .setMaxGlobalLimited(4); + } + return metaTileEntities(MetaTileEntities.STOCKING_HATCH_ME); + } + + @NotNull + private static TraceabilityPredicate dataHatchPredicate() { + // if research is enabled, require the data hatch, otherwise use a grate instead + if (ConfigHolder.machines.enableResearch) { + return abilities(MultiblockAbility.DATA_ACCESS_HATCH, MultiblockAbility.OPTICAL_DATA_RECEPTION) + .setExactLimit(1) + .or(states(getGrateState())); + } + return states(getGrateState()); + } + + @Override + protected Function multiblockPartSorter() { + // player's right when looking at the controller, but the controller's left + return RelativeDirection.LEFT.getSorter(getFrontFacing(), getUpwardsFacing(), isFlipped()); + } + + @SideOnly(Side.CLIENT) + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { + if (sourcePart != null) { + // part rendering + if (sourcePart instanceof IDataAccessHatch) { + return Textures.GRATE_CASING_STEEL_FRONT; + } else { + return Textures.SOLID_STEEL_CASING; + } + } else { + // controller rendering + if (isStructureFormed()) { + return Textures.GRATE_CASING_STEEL_FRONT; + } else { + return Textures.SOLID_STEEL_CASING; + } + } + } + @Override + protected void initializeAbilities() { + super.initializeAbilities(); + List powerInput = new ArrayList<>(getAbilities(MultiblockAbility.INPUT_ENERGY)); + powerInput.addAll(getAbilities(MultiblockAbility.INPUT_LASER)); + this.energyContainer = new EnergyContainerList(powerInput); + } + + @Override + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + super.renderMetaTileEntity(renderState, translation, pipeline); + getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), + recipeMapWorkable.isActive(), recipeMapWorkable.isWorkingEnabled()); + } + + @Override + public SoundEvent getBreakdownSound() { + return GTSoundEvents.BREAKDOWN_MECHANICAL; + } + + @Override + public void update() { + super.update(); + if (ConfigHolder.client.shader.assemblyLineParticles) { + if (getRecipeMapWorkable().isWorking()) { + int maxBeams = getAbilities(MultiblockAbility.IMPORT_ITEMS).size() + 1; + int maxProgress = getRecipeMapWorkable().getMaxProgress(); + + // Each beam should be visible for an equal amount of time, which is derived from the maximum number of + // beams and the maximum progress in the recipe. + int beamTime = Math.max(1, maxProgress / maxBeams); + + int beamCount = Math.min(maxBeams, getRecipeMapWorkable().getProgress() / beamTime + 1); + + if (beamCount != this.beamCount) { + if (beamCount < this.beamCount) { + // if beam count decreases, the last beam in the queue needs to be removed for the sake of fade + // time. + this.beamCount = Math.max(0, beamCount - 1); + writeCustomData(GregtechDataCodes.UPDATE_PARTICLE, this::writeParticles); + } + this.beamTime = beamTime; + this.beamCount = beamCount; + writeCustomData(GregtechDataCodes.UPDATE_PARTICLE, this::writeParticles); + } + } else if (beamCount != 0) { + this.beamTime = 0; + this.beamCount = 0; + writeCustomData(GregtechDataCodes.UPDATE_PARTICLE, this::writeParticles); + } + } + } + + @Override + public void onRemoval() { + super.onRemoval(); + if (getWorld().isRemote && beamParticles != null) { + for (GTLaserBeamParticle[] particle : beamParticles) { + if (particle[0] != null) { + particle[0].setExpired(); + particle[1].setExpired(); + } + } + beamParticles = null; + } + } + + private void writeParticles(@NotNull PacketBuffer buf) { + buf.writeVarInt(beamCount); + buf.writeVarInt(beamTime); + } + + @SideOnly(Side.CLIENT) + private void readParticles(@NotNull PacketBuffer buf) { + beamCount = buf.readVarInt(); + beamTime = buf.readVarInt(); + if (beamParticles == null) { + beamParticles = new GTLaserBeamParticle[17][2]; + } + BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(getPos()); + + EnumFacing relativeUp = RelativeDirection.UP.getRelativeFacing(getFrontFacing(), getUpwardsFacing(), + isFlipped()); + EnumFacing relativeLeft = RelativeDirection.LEFT.getRelativeFacing(getFrontFacing(), getUpwardsFacing(), + isFlipped()); + boolean negativeUp = relativeUp.getAxisDirection() == EnumFacing.AxisDirection.NEGATIVE; + + for (int i = 0; i < beamParticles.length; i++) { + GTLaserBeamParticle particle = beamParticles[i][0]; + if (i < beamCount && particle == null) { + pos.setPos(getPos()); + if (negativeUp) { + // correct for the position of the block corresponding to its negative side + pos.move(relativeUp.getOpposite()); + } + Vector3 startPos = new Vector3() + .add(pos.move(relativeLeft, i)) + .add( // offset by 0.5 in both non-"upwards" directions + relativeUp.getAxis() == EnumFacing.Axis.X ? 0 : 0.5, + relativeUp.getAxis() == EnumFacing.Axis.Y ? 0 : 0.5, + relativeUp.getAxis() == EnumFacing.Axis.Z ? 0 : 0.5); + Vector3 endPos = startPos.copy() + .subtract(relativeUp.getXOffset(), relativeUp.getYOffset(), relativeUp.getZOffset()); + + beamParticles[i][0] = createALParticles(startPos, endPos); + + pos.setPos(getPos()); + if (negativeUp) { + pos.move(relativeUp.getOpposite()); + } + startPos = new Vector3() + .add(pos.move(relativeLeft, i) + .move(getFrontFacing().getOpposite(), 2)) + .add( // offset by 0.5 in both non-"upwards" directions + relativeUp.getAxis() == EnumFacing.Axis.X ? 0 : 0.5, + relativeUp.getAxis() == EnumFacing.Axis.Y ? 0 : 0.5, + relativeUp.getAxis() == EnumFacing.Axis.Z ? 0 : 0.5); + endPos = startPos.copy() + .subtract(relativeUp.getXOffset(), relativeUp.getYOffset(), relativeUp.getZOffset()); + + beamParticles[i][1] = createALParticles(startPos, endPos); + + // Don't forget to add particles + GTParticleManager.INSTANCE.addEffect(beamParticles[i][0]); + GTParticleManager.INSTANCE.addEffect(beamParticles[i][1]); + + } else if (i >= beamCount && particle != null) { + particle.setExpired(); + beamParticles[i][0] = null; + beamParticles[i][1].setExpired(); + beamParticles[i][1] = null; + } + } + } + + @NotNull + @SideOnly(Side.CLIENT) + private GTLaserBeamParticle createALParticles(Vector3 startPos, Vector3 endPos) { + return new GTLaserBeamParticle(this, startPos, endPos, beamTime) + .setBody(LASER_LOCATION) + .setBeamHeight(0.125f) + // Try commenting or adjusting on the next four lines to see what happens + .setDoubleVertical(true) + .setHead(LASER_HEAD_LOCATION) + .setHeadWidth(0.1f) + .setEmit(0.2f); + } + + @Override + public void writeInitialSyncData(PacketBuffer buf) { + super.writeInitialSyncData(buf); + writeParticles(buf); + } + + @Override + public void receiveInitialSyncData(PacketBuffer buf) { + super.receiveInitialSyncData(buf); + readParticles(buf); + } + + @Override + public void receiveCustomData(int dataId, PacketBuffer buf) { + if (dataId == GregtechDataCodes.UPDATE_PARTICLE) { + readParticles(buf); + } else { + super.receiveCustomData(dataId, buf); + } + } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound data) { + super.writeToNBT(data); + data.setInteger("mode", this.mode); + if(this.mode == 0) { + data.setInteger("parallel", this.recipeMapWorkable.getParallelLimit()); + data.setInteger("wait", ((AdvancedAsslineRecipeLogic) this.recipeMapWorkable).wait); + data.setBoolean("hang", ((AdvancedAsslineRecipeLogic) this.recipeMapWorkable).hang); + } + return data; + } + + @Override + public void readFromNBT(NBTTagCompound data) { + super.readFromNBT(data); + this.mode = data.getInteger("mode"); + if(this.mode == 0) { + ((AdvancedAsslineRecipeLogic) this.recipeMapWorkable).parallelCount = data.getInteger("parallel"); + ((AdvancedAsslineRecipeLogic) this.recipeMapWorkable).wait = data.getInteger("wait"); + ((AdvancedAsslineRecipeLogic) this.recipeMapWorkable).hang = data.getBoolean("hang"); + } + } + + @Override + public boolean checkRecipe(@NotNull Recipe recipe, boolean consumeIfSuccess) { + if (consumeIfSuccess) return true; // don't check twice + + List inputs = recipe.getInputs(); + List itemInputInventory = getAbilities(MultiblockAbility.IMPORT_ITEMS); + + if (itemInputInventory.size() < inputs.size()) return false; + + + if (!ConfigHolder.machines.enableResearch || !recipe.hasProperty(ResearchProperty.getInstance())) { + return super.checkRecipe(recipe, consumeIfSuccess); + } + + return isRecipeAvailable(getAbilities(MultiblockAbility.DATA_ACCESS_HATCH), recipe) || + isRecipeAvailable(getAbilities(MultiblockAbility.OPTICAL_DATA_RECEPTION), recipe); + } + + private static boolean isRecipeAvailable(@NotNull Iterable hatches, + @NotNull Recipe recipe) { + for (IDataAccessHatch hatch : hatches) { + // creative hatches do not need to check, they always have the recipe + if (hatch.isCreative()) return true; + + // hatches need to have the recipe available + if (hatch.isRecipeAvailable(recipe)) return true; + } + return false; + } + + @Override + public void addInformation(ItemStack stack, @Nullable World world, @NotNull List tooltip, + boolean advanced) { + tooltip.add(I18n.format("gcyl.machine.advanced_assline.tooltip.8")); + tooltip.add(I18n.format("gcyl.machine.advanced_assline.tooltip.1")); + tooltip.add(I18n.format("gcyl.machine.advanced_assline.tooltip.2")); + tooltip.add(I18n.format("gcyl.machine.advanced_assline.tooltip.6")); + tooltip.add(I18n.format("gcyl.machine.advanced_assline.tooltip.3")); + tooltip.add(I18n.format("gcyl.machine.advanced_assline.tooltip.9")); + tooltip.add(I18n.format("gcyl.machine.advanced_assline.tooltip.7")); + tooltip.add(I18n.format("gcyl.machine.advanced_assline.tooltip.4")); + tooltip.add(I18n.format("gcyl.machine.advanced_assline.tooltip.5")); + tooltip.add(I18n.format("gregtech.machine.power_substation.tooltip6") + TooltipHelper.RAINBOW_SLOW + + I18n.format("gregtech.machine.power_substation.tooltip6.5")); + } + + + @Override + public boolean onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, EnumFacing facing, + CuboidRayTraceResult hitResult) { + if (!getWorld().isRemote && !this.recipeMapWorkable.isActive()) { + + if (this.mode == 0) { + this.mode = 1; + this.recipeMapWorkable = new MultiblockRecipeLogic(this); + playerIn.sendStatusMessage(TextComponentUtil.translationWithColor(TextFormatting.WHITE, "AL Mode"), false); + } else { + this.mode = 0; + this.recipeMapWorkable = new AdvancedAsslineRecipeLogic(this); + playerIn.sendStatusMessage(TextComponentUtil.translationWithColor(TextFormatting.WHITE, "AAL Mode"), false); + } + + } + return true; + } + + protected class AdvancedAsslineRecipeLogic extends MultiblockRecipeLogic { + + private final MetaTileEntityAdvancedAssline advancedAssline; + private int parallelCount = 1; + private boolean hang = false; + private int wait = 0; + + public AdvancedAsslineRecipeLogic(RecipeMapMultiblockController metaTileEntity) { + super(metaTileEntity); + this.advancedAssline = (MetaTileEntityAdvancedAssline) metaTileEntity; + } + + @Override + public int getParallelLimit() { + return Math.min(getAbilities(MultiblockAbility.IMPORT_ITEMS).size(), parallelCount); + } + + @Override + public void updateWorkable() { + super.updateWorkable(); + if(wait > 0 && !isWorkingEnabled()) { + wait--; + } + + if(hang && isActive()) { + this.setWorkingEnabled(false); + hang = false; + } + else if(wait == 0) { + this.setWorkingEnabled(true); + } + + if(!advancedAssline.isActive()) { + parallelCount = 1; + } + } + + @Override + public long getMaxParallelVoltage() { + return Long.MAX_VALUE; + } + + @Override + protected void runOverclockingLogic(@NotNull OCParams params, @NotNull OCResult result, + @NotNull RecipePropertyStorage propertyStorage, long maxVoltage) { + + double duration = params.duration(); + double eut = params.eut(); + int ocAmount = params.ocAmount(); + double parallel = 1; + int parallelIterAmount = 0; + boolean shouldParallel = false; + double voltageFactor = 4.3; + double durationFactor = getOverclockingDurationFactor(); + + while (ocAmount-- > 0) { + double potentialEUt = eut * voltageFactor; + if (potentialEUt > maxVoltage) { + break; + } + eut = potentialEUt; + + if (shouldParallel) { + parallel /= durationFactor; + parallelIterAmount++; + } else { + double potentialDuration = duration * durationFactor; + if (potentialDuration < 1) { + parallel /= durationFactor; + parallelIterAmount++; + shouldParallel = true; + } else { + duration = potentialDuration; + } + } + + voltageFactor += 0.3; + } + + result.init((long) (eut / Math.pow(voltageFactor, parallelIterAmount)), (int) duration, (int) parallel, + (long) eut); + } + + @Override + protected void modifyOverclockPre(@NotNull OCParams ocParams, @NotNull RecipePropertyStorage storage) { + ocParams.setDuration((int) (ocParams.duration() * 1.2)); + } + + @Override + public long getMaximumOverclockVoltage() { + IEnergyContainer energyContainer = advancedAssline.getEnergyContainer(); + return (long) ((energyContainer.getInputVoltage() * (energyContainer.getInputAmperage() == 2 ? 1 : energyContainer.getInputAmperage())) * ((double) parallelCount / (getAbilities(MultiblockAbility.IMPORT_ITEMS).size()))); + } + + @Override + public void applyParallelBonus(@NotNull RecipeBuilder builder) { + builder.EUt(builder.getEUt()); + } + + @Override + public void completeRecipe() { + super.completeRecipe(); + if(parallelCount < getAbilities(MultiblockAbility.IMPORT_ITEMS).size()) { + parallelCount++; + } + } + + public boolean checkParallelRecipe(@NotNull Recipe recipe) { + // check ordered items + if (ConfigHolder.machines.orderedAssembly) { + List inputs = recipe.getInputs(); + List itemInputInventory = getAbilities(MultiblockAbility.IMPORT_ITEMS); + + for (int i = 0; i < inputs.size(); i++) { + IItemHandlerModifiable inventory = itemInputInventory.get(i); + boolean oneSuccess = false; + for (int j = 0; j < inventory.getSlots(); j++) { + oneSuccess = inputs.get(i).acceptsStack(inventory.getStackInSlot(j)); + if(oneSuccess && inputs.get(i).getAmount() > inventory.getStackInSlot(j).getCount()) { + return false; + } + if (oneSuccess) break; + } + if (!oneSuccess) return false; + } + } + return true; + } + + private void hangMachine() { + parallelCount = 1; + hang = true; + wait = HANG_DURATION; + } + + @Override + protected Recipe setupAndConsumeRecipeInputs(@NotNull Recipe recipe, + @NotNull IItemHandlerModifiable importInventory) { + + IMultipleTankHandler importFluids = this.getInputTank(); + + calculateOverclock(recipe); + + Field field; + try { + field = this.getClass().getDeclaredField("ocResult"); + } catch (NoSuchFieldException e) { + throw new RuntimeException(e); + } + field.setAccessible(true); + + OCResult ocResult; + try { + ocResult = (OCResult) field.get(this); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + + modifyOverclockPost(ocResult, recipe.propertyStorage()); + + if (!hasEnoughPower(ocResult.eut(), ocResult.duration())) { + hangMachine(); + return null; + } + + IItemHandlerModifiable exportInventory = getOutputInventory(); + IMultipleTankHandler exportFluids = getOutputTank(); + + // We have already trimmed outputs and chanced outputs at this time + // Attempt to merge all outputs + chanced outputs into the output bus, to prevent voiding chanced outputs + if (!metaTileEntity.canVoidRecipeItemOutputs() && + !GTTransferUtils.addItemsToItemHandler(exportInventory, true, recipe.getAllItemOutputs())) { + this.isOutputsFull = true; + return null; + } + + // We have already trimmed fluid outputs at this time + if (!metaTileEntity.canVoidRecipeFluidOutputs() && + !GTTransferUtils.addFluidsToFluidHandler(exportFluids, true, recipe.getAllFluidOutputs())) { + this.isOutputsFull = true; + return null; + } + + this.isOutputsFull = false; + if (recipe.matches(false, importInventory, importFluids)) { + List itemInputInventory = getAbilities(MultiblockAbility.IMPORT_ITEMS); + + for(int i = 0; i < getParallelLimit(); i++) { + if(itemInputInventory.get(i).getStackInSlot(0).isEmpty()) { + setWorkingEnabled(false); + return null; + } + } + + + if (recipe.matches(true, importInventory, importFluids)) { + this.metaTileEntity.addNotifiedInput(importInventory); + return recipe; + } else { + hangMachine(); + return null; + } + + } + return null; + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityComponentAL.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityComponentAL.java new file mode 100644 index 00000000..60e85305 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityComponentAL.java @@ -0,0 +1,281 @@ +package com.fulltrix.gcyl.machines.multi.advance; + +import com.fulltrix.gcyl.api.block.IComponentALTier; +import com.fulltrix.gcyl.api.recipes.ITier; +import com.fulltrix.gcyl.api.recipes.properties.ComponentALProperty; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.component_al.GCYLComponentALCasing; +import com.fulltrix.gcyl.blocks.metal.GCYLCleanroomCasing; +import com.fulltrix.gcyl.blocks.metal.MetalCasing2; +import com.fulltrix.gcyl.client.ClientHandler; +import gregtech.api.GTValues; +import gregtech.api.block.ICleanroomFilter; +import gregtech.api.capability.IOpticalComputationHatch; +import gregtech.api.capability.IOpticalComputationProvider; +import gregtech.api.capability.IOpticalComputationReceiver; +import gregtech.api.capability.impl.ComputationRecipeLogic; +import gregtech.api.capability.impl.MultiblockRecipeLogic; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; +import gregtech.api.pattern.BlockPattern; +import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.MultiblockShapeInfo; +import gregtech.api.pattern.PatternMatchContext; +import gregtech.api.recipes.Recipe; +import gregtech.api.util.KeyUtil; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.common.blocks.*; +import gregtech.common.metatileentities.MetaTileEntities; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.NotNull; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static com.fulltrix.gcyl.api.pattern.TraceabilityPredicates.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.COMPONENT_AL_RECIPES; +import static com.fulltrix.gcyl.machines.GCYLTileEntities.COMPONENT_ASSEMBLY_LINE; +import static gregtech.api.unification.material.Materials.TungstenSteel; +import static gregtech.api.util.RelativeDirection.*; + +//TODO implement filter bonus, laser hatches +public class MetaTileEntityComponentAL extends RecipeMapMultiblockController implements ITier, IOpticalComputationReceiver { + + private IOpticalComputationProvider computationProvider; + private int tier; + private int filterTier; + + public MetaTileEntityComponentAL(ResourceLocation metaTileEntityId) { + super(metaTileEntityId, COMPONENT_AL_RECIPES); + this.recipeMapWorkable = new ComponentALRecipeLogic(this); + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { + return new MetaTileEntityComponentAL(metaTileEntityId); + } + + @Override + protected BlockPattern createStructurePattern() { + return FactoryBlockPattern.start(RIGHT, UP, FRONT) + .aisle("CCCCCCCCC","C##F#F##C","C##CCC##C","C##CCC##C","C#######C","C#######C","CC#CCC#CC","#CCCSCCC#","###CCC###","#########") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TCCCCCT#","#########") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","GP#####PG","GP#CCC#PG","GP#####PG","GP#####PG","GP##B##PG","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","CP#####PC","CP#CCC#PC","CP#####PC","CP#####PC","CP##B##PC","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","GP#####PG","GP#CCC#PG","GP#####PG","GP#####PG","GP##B##PG","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","CP#####PC","CP#CCC#PC","CP#####PC","CP#####PC","CP##B##PC","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","GP#####PG","GP#CCC#PG","GP#####PG","GP#####PG","GP##B##PG","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","CP#####PC","CP#CCC#PC","CP#####PC","CP#####PC","CP##B##PC","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","GP#####PG","GP#CCC#PG","GP#####PG","GP#####PG","GP##B##PG","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G##F#F##G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TCCCCCT#","#########") + .aisle("CCCCCCCCC","C##CCC##C","C#######C","C#######C","C#######C","C#######C","CC#####CC","#CCCCCCC#","#########","#########") + .where('S', selfPredicate()) + .where('F', frames(TungstenSteel)) + .where('G', states(MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.LAMINATED_GLASS))) + .where('T', filterCasings()) + .where('I', componentALCasings()) + .where('A', states(MetaBlocks.MULTIBLOCK_CASING.getState(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_CONTROL))) + .where('B', states(MetaBlocks.MULTIBLOCK_CASING.getState(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_LINE_CASING))) + .where('P', states(MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.POLYTETRAFLUOROETHYLENE_PIPE))) + .where('C', states(GCYLMetaBlocks.METAL_CASING_2.getState(MetalCasing2.CasingType.IRIDIUM)) + .setMinGlobalLimited(630) + .or(autoAbilities(true,true,true,true,true,false,false)) + .or(abilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION).setExactLimit(1))) + .where('#', air()) + .build(); + } + + @Override + public List getMatchingShapes() { + ArrayList shapeInfo = new ArrayList<>(); + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder(RIGHT, DOWN, FRONT) + .aisle("CCCCCCCCC","C##F#F##C","C##CZC##C","C##CCC##C","C#######C","C#######C","CC#CCC#CC","#CCCSCCC#","###CWC###","#########") + .aisle("YCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TMCCCET#","#########") + .aisle("YCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("YCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","GP#####PG","GP#CCC#PG","GP#####PG","GP#####PG","GP##B##PG","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","CP#####PC","CP#CCC#PC","CP#####PC","CP#####PC","CP##B##PC","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","GP#####PG","GP#CCC#PG","GP#####PG","GP#####PG","GP##B##PG","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","CP#####PC","CP#CCC#PC","CP#####PC","CP#####PC","CP##B##PC","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","GP#####PG","GP#CCC#PG","GP#####PG","GP#####PG","GP##B##PG","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","CP#####PC","CP#CCC#PC","CP#####PC","CP#####PC","CP##B##PC","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","GP#####PG","GP#CCC#PG","GP#####PG","GP#####PG","GP##B##PG","CPP#A#PPC","T#PPAPP#T","#TC###CT#","###III###") + .aisle("CCCCCCCCC","G##F#F##G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#A###A#G","GB#####BG","GB#####BG","CB#####BC","T#######T","#TC###CT#","###CIC###") + .aisle("CCCCCCCCC","G#######G","G##CCC##G","G#######G","G#######G","G#######G","C#######C","T#######T","#TCCCCCT#","#########") + .aisle("CCCCCCCCC","C##CXC##C","C#######C","C#######C","C#######C","C#######C","CC#####CC","#CCCCCCC#","#########","#########") + .where('S', COMPONENT_ASSEMBLY_LINE, EnumFacing.NORTH) + .where('F', MetaBlocks.FRAMES.get(TungstenSteel).getBlock(TungstenSteel)) + .where('G', MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.LAMINATED_GLASS)) + .where('A', MetaBlocks.MULTIBLOCK_CASING.getState(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_CONTROL)) + .where('B', MetaBlocks.MULTIBLOCK_CASING.getState(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_LINE_CASING)) + .where('P', MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.POLYTETRAFLUOROETHYLENE_PIPE)) + .where('C', GCYLMetaBlocks.METAL_CASING_2.getState(MetalCasing2.CasingType.IRIDIUM)) + .where('#', Blocks.AIR.getDefaultState()) + .where('M', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[9], EnumFacing.NORTH) + .where('Z', MetaTileEntities.ITEM_IMPORT_BUS[5], EnumFacing.NORTH) + .where('X', MetaTileEntities.ITEM_EXPORT_BUS[5], EnumFacing.SOUTH) + .where('Y', MetaTileEntities.QUADRUPLE_IMPORT_HATCH[GTValues.ZPM], EnumFacing.EAST) + .where('T', MetaBlocks.CLEANROOM_CASING.getState(BlockCleanroomCasing.CasingType.FILTER_CASING)) + .where('W', MetaTileEntities.COMPUTATION_HATCH_RECEIVER, EnumFacing.NORTH); + + Arrays.stream(GCYLComponentALCasing.CasingType.values()) + .forEach(casingType -> shapeInfo + .add(builder.where('I', GCYLMetaBlocks.GCYL_COMPONENT_AL_CASING.getState(casingType)).build())); + + Arrays.stream(BlockCleanroomCasing.CasingType.values()) + .filter(casingType -> !casingType.equals(BlockCleanroomCasing.CasingType.PLASCRETE) && !casingType.equals(BlockCleanroomCasing.CasingType.FILTER_CASING)) + .forEach(casingType -> shapeInfo + .add(builder.where('T', MetaBlocks.CLEANROOM_CASING.getState(casingType)).build())); + + Arrays.stream(GCYLCleanroomCasing.CasingType.values()) + .forEach(casingType -> shapeInfo + .add(builder.where('T', GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getState(casingType)).build())); + + return shapeInfo; + } + + @SideOnly(Side.CLIENT) + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { + return ClientHandler.IRIDIUM_CASING; + } + + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + Object type = context.get("ComponentALTier"); + if(type instanceof IComponentALTier) { + this.tier = ((IComponentALTier) type).getTier() + 1; + } + else + this.tier = 0; + + List providers = getAbilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION); + if (providers != null && providers.size() >= 1) { + computationProvider = providers.get(0); + } + + if (computationProvider == null) { + invalidateStructure(); + } + + this.filterTier = ((ICleanroomFilter) context.get("FilterType")).getTier(); + } + + @Override + public boolean canBeDistinct() { + return true; + } + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + this.tier = 0; + } + + @Override + public int getTier() { + return this.tier; + } + + @Override + protected void configureDisplayText(MultiblockUIBuilder builder) { + builder.addCustom((keyManager, uiSyncer) -> { + keyManager.add(KeyUtil.lang("gcyl.multiblock.coal.max_recipe_tier", GTValues.VN[this.tier])); + }); + } + + @Override + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + tooltip.add(I18n.format("gcyl.multiblock.coal.description.1")); + tooltip.add(I18n.format("gcyl.multiblock.coal.description.2")); + //tooltip.add(I18n.format("gcyl.multiblock.coal.description.3")); + } + + @Override + public IOpticalComputationProvider getComputationProvider() { + return computationProvider; + } + + + private class ComponentALRecipeLogic extends ComputationRecipeLogic { + + MetaTileEntityComponentAL componentAL; + + public ComponentALRecipeLogic(MetaTileEntityComponentAL metaTileEntity) { + super(metaTileEntity, ComputationType.STEADY); + this.componentAL = metaTileEntity; + } + + @Override + public boolean checkRecipe(@NotNull Recipe recipe) { + if (!super.checkRecipe(recipe)) + return false; + + return recipe.getProperty(ComponentALProperty.getInstance(), 0) <= tier; + } + + @Override + public double getSpeedBonus() { + return Math.pow(0.9, this.componentAL.filterTier); + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java index 34989851..1bad95dc 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java @@ -93,9 +93,6 @@ protected OrientedOverlayRenderer getFrontOverlay() { public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { super.addInformation(stack, player, tooltip, advanced); tooltip.add(I18n.format("gregtech.multiblock.cryogenic_freezer.description")); - tooltip.add(I18n.format("gtadditions.multiblock.universal.tooltip.1", this.recipeMap.getLocalizedName())); - tooltip.add(I18n.format("gtadditions.multiblock.universal.tooltip.2", 20 / 100.0)); - tooltip.add(I18n.format("gtadditions.multiblock.universal.tooltip.3", 60 / 100.0)); tooltip.add(I18n.format("gregtech.multiblock.vol_cryo.description")); } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeAirCollector.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeAirCollector.java new file mode 100644 index 00000000..2bec9efc --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeAirCollector.java @@ -0,0 +1,170 @@ +package com.fulltrix.gcyl.machines.multi.advance; + +import com.fulltrix.gcyl.client.ClientHandler; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.metal.GCYLCleanroomCasing; +import com.fulltrix.gcyl.blocks.metal.MetalCasing1; +import com.fulltrix.gcyl.machines.GCYLTileEntities; +import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; +import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; +import gregtech.api.GTValues; +import gregtech.api.block.ICleanroomFilter; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.pattern.BlockPattern; +import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.MultiblockShapeInfo; +import gregtech.api.pattern.PatternMatchContext; +import gregtech.api.recipes.logic.OCParams; +import gregtech.api.recipes.properties.RecipePropertyStorage; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.client.renderer.texture.Textures; +import gregtech.client.utils.TooltipHelper; +import gregtech.common.ConfigHolder; +import gregtech.common.blocks.BlockCleanroomCasing; +import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static com.fulltrix.gcyl.api.pattern.TraceabilityPredicates.filterCasings; +import static gregtech.api.recipes.RecipeMaps.GAS_COLLECTOR_RECIPES; + +public class MetaTileEntityLargeAirCollector extends GCYMRecipeMapMultiblockController { + + private int filterTier = 0; + + public MetaTileEntityLargeAirCollector(ResourceLocation metaTileEntityId) { + super(metaTileEntityId, GAS_COLLECTOR_RECIPES); + this.recipeMapWorkable = new LargeAirCollectorRecipeLogic(this); + } + @Override + public boolean isTiered() { + return false; + } + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + this.filterTier = 0; + } + + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + this.filterTier = ((ICleanroomFilter) context.get("FilterType")).getTier(); + } + + @Override + protected @NotNull BlockPattern createStructurePattern() { + return FactoryBlockPattern.start() + .aisle("XXX", "XXX", "FFF") + .aisle("XXX", "X#X", "FFF") + .aisle("XXX", "XSX", "FFF") + .where('S', selfPredicate()) + .where('X', states(getCasingState()).setMinGlobalLimited(10).or(autoAbilities())) + .where('F', filterCasings()) + .where('#', air()) + .build(); + } + + protected IBlockState getCasingState() { + return GCYLMetaBlocks.METAL_CASING_1.getState(MetalCasing1.CasingType.MARAGING_STEEL_250); + } + + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { + return ClientHandler.MARAGING_STEEL_250_CASING; + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEntity) { + return new MetaTileEntityLargeAirCollector(metaTileEntityId); + } + + @SideOnly(Side.CLIENT) + @NotNull + @Override + protected ICubeRenderer getFrontOverlay() { + return Textures.GAS_COLLECTOR_OVERLAY; + } + + @Override + public List getMatchingShapes() { + ArrayList shapeInfo = new ArrayList<>(); + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder() + .aisle("XXX", "XXX", "FFF") + .aisle("XXX", "X#X", "FFF") + .aisle("EPM", "ISO", "FFF") + .where('X', getCasingState()) + .where('S', GCYLTileEntities.LARGE_AIR_COLLECTOR, EnumFacing.NORTH) + .where('#', Blocks.AIR.getDefaultState()) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[GTValues.IV], EnumFacing.NORTH) + .where('M', + () -> ConfigHolder.machines.enableMaintenance ? MetaTileEntities.MAINTENANCE_HATCH : + getCasingState(), + EnumFacing.NORTH) + .where('P', GCYMMetaTileEntities.PARALLEL_HATCH[0], EnumFacing.NORTH) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[0], EnumFacing.NORTH) + .where('O', MetaTileEntities.FLUID_EXPORT_HATCH[5], EnumFacing.NORTH); + + + Arrays.stream(BlockCleanroomCasing.CasingType.values()) + .filter(casingType -> !casingType.equals(BlockCleanroomCasing.CasingType.PLASCRETE)) + .forEach(casingType -> shapeInfo + .add(builder.where('F', MetaBlocks.CLEANROOM_CASING.getState(casingType)).build())); + + Arrays.stream(GCYLCleanroomCasing.CasingType.values()) + .forEach(casingType -> shapeInfo + .add(builder.where('F', GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getState(casingType)).build())); + + return shapeInfo; + } + + @Override + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gcyl.machine.large_air_collector.tooltip.1")); + + if (TooltipHelper.isCtrlDown()) { + tooltip.add(I18n.format("gcyl.machine.large_air_collector.tooltip.2")); + tooltip.add(I18n.format("gcyl.machine.large_air_collector.tooltip.3")); + } else { + tooltip.add(I18n.format("gregtech.machine.cleanroom.tooltip.hold_ctrl")); + } + } + + private class LargeAirCollectorRecipeLogic extends GCYMMultiblockRecipeLogic { + private final MetaTileEntityLargeAirCollector largeAirCollector; + + public LargeAirCollectorRecipeLogic(GCYMRecipeMapMultiblockController metaTilEntity) { + super(metaTilEntity); + this.largeAirCollector = (MetaTileEntityLargeAirCollector) metaTilEntity; + } + + + @Override + protected void modifyOverclockPre(@NotNull OCParams ocParams, @NotNull RecipePropertyStorage storage) { + super.modifyOverclockPre(ocParams, storage); + + ocParams.setDuration((int) Math.max(1, ocParams.duration() / (largeAirCollector.filterTier + 1.0))); + ocParams.setEut((long) (ocParams.eut() / (largeAirCollector.filterTier + 1.0))); + + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeFisher.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeFisher.java new file mode 100644 index 00000000..7c6d0e2a --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeFisher.java @@ -0,0 +1,104 @@ +package com.fulltrix.gcyl.machines.multi.advance; + +import com.fulltrix.gcyl.GCYLConfig; +import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; +import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; +import gregicality.multiblocks.api.render.GCYMTextures; +import gregicality.multiblocks.common.block.GCYMMetaBlocks; +import gregicality.multiblocks.common.block.blocks.BlockLargeMultiblockCasing; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.pattern.BlockPattern; +import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.recipes.Recipe; +import gregtech.client.renderer.ICubeRenderer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Arrays; +import java.util.List; + +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.FISHER_RECIPES; +import static net.minecraft.init.Blocks.WATER; + +//TODO optimize +public class MetaTileEntityLargeFisher extends GCYMRecipeMapMultiblockController { + + private static final String[] VALID_BIOMES = GCYLConfig.multis.largeFisher.whitelistedBiomes; + public MetaTileEntityLargeFisher(ResourceLocation metaTileEntityId) { + super(metaTileEntityId, FISHER_RECIPES); + this.recipeMapWorkable = new FisherRecipeLogic(this); + } + @Override + public boolean isTiered() { + return false; + } + + @Override + protected @NotNull BlockPattern createStructurePattern() { + return FactoryBlockPattern.start() + .aisle("WWWWW","XXXXX").setRepeatable(4) + .aisle("WWWWW","XXSXX") + .where('X', states(getCasingState()).setMinGlobalLimited(20).or(autoAbilities())) + .where('S', selfPredicate()) + .where('#', any()) + .where('W', states(WATER.getDefaultState())) + .build(); + + } + + protected IBlockState getCasingState() { + return GCYMMetaBlocks.LARGE_MULTIBLOCK_CASING.getState(BlockLargeMultiblockCasing.CasingType.WATERTIGHT_CASING); + } + + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { + return GCYMTextures.WATERTIGHT_CASING; + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEntity) { + return new MetaTileEntityLargeFisher(metaTileEntityId); + } + + @Override + public void addInformation(ItemStack stack, @Nullable World player, @NotNull List tooltip, + boolean advanced) { + StringBuilder r = new StringBuilder(); + for(int i = 0 ; i < GCYLConfig.multis.largeFisher.whitelistedBiomes.length; i++ ) { + r.append(GCYLConfig.multis.largeFisher.whitelistedBiomes[i]); + if(i != GCYLConfig.multis.largeFisher.whitelistedBiomes.length - 1) + r.append(", "); + } + + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gcyl.machine.large_fisher.tooltip.1")); + tooltip.add(I18n.format("gcyl.machine.large_fisher.tooltip.2", r)); + } + + private class FisherRecipeLogic extends GCYMMultiblockRecipeLogic { + + MetaTileEntityLargeFisher largeFisher; + + public FisherRecipeLogic(RecipeMapMultiblockController tileEntity) { + super(tileEntity); + this.largeFisher = (MetaTileEntityLargeFisher) tileEntity; + } + + @Override + public boolean checkRecipe(@NotNull Recipe recipe) { + if (!super.checkRecipe(recipe)) + return false; + + return Arrays.asList(VALID_BIOMES).contains(this.largeFisher.getWorld().getBiome(this.largeFisher.getPos()).biomeName); + } + + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeRockBreaker.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeRockBreaker.java new file mode 100644 index 00000000..04632168 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeRockBreaker.java @@ -0,0 +1,157 @@ +package com.fulltrix.gcyl.machines.multi.advance; + +import com.fulltrix.gcyl.client.ClientHandler; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.metal.MetalCasing1; +import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; +import gregicality.multiblocks.api.metatileentity.GCYMMultiblockAbility; +import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; +import gregtech.api.capability.IMultipleTankHandler; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.pattern.BlockPattern; +import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.unification.material.Materials; +import gregtech.api.util.GTUtility; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.common.blocks.BlockGlassCasing; +import gregtech.common.blocks.MetaBlocks; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +import static com.fulltrix.gcyl.materials.GCYLMaterials.Inconel625; +import static gregtech.api.recipes.RecipeMaps.ROCK_BREAKER_RECIPES; +import static net.minecraft.init.Blocks.LAVA; +import static net.minecraft.init.Blocks.WATER; + +public class MetaTileEntityLargeRockBreaker extends GCYMRecipeMapMultiblockController { + + public MetaTileEntityLargeRockBreaker(ResourceLocation metaTileEntityId) { + super(metaTileEntityId, ROCK_BREAKER_RECIPES); + this.recipeMapWorkable = new RockBreakerRecipeLogic(this); + } + + @Override + public boolean isTiered() { + return false; + } + + @Override + protected @NotNull BlockPattern createStructurePattern() { + return FactoryBlockPattern.start() + .aisle("XXXXX", "F###F", "F###F", "F###F", "XXXXX") + .aisle("XXXXX", "#GGG#", "#GGG#", "#GGG#", "XXXXX") + .aisle("XXXXX", "#GWG#", "#GXG#", "#GLG#", "XXMXX") + .aisle("XXXXX", "#GGG#", "#GGG#", "#GGG#", "XXXXX") + .aisle("XXSXX", "F###F", "F###F", "F###F", "XXXXX") + .where('S', selfPredicate()) + .where('X', states(getCasingState()).setMinGlobalLimited(18) + .or(abilities(MultiblockAbility.IMPORT_FLUIDS).setMinGlobalLimited(1).setMaxGlobalLimited(2)) + .or(abilities(MultiblockAbility.IMPORT_ITEMS).setExactLimit(1)) + .or(abilities(MultiblockAbility.EXPORT_ITEMS).setExactLimit(1)) + .or(abilities(GCYMMultiblockAbility.PARALLEL_HATCH).setMaxGlobalLimited(1)) + .or(abilities(MultiblockAbility.INPUT_ENERGY).setMinGlobalLimited(1).setMaxGlobalLimited(2)) + .or(abilities(MultiblockAbility.MAINTENANCE_HATCH).setExactLimit(1))) + .where('M', abilities(MultiblockAbility.MUFFLER_HATCH)) + .where('F', frames(Inconel625)) + .where('G', states(MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.FUSION_GLASS))) + .where('W', states(WATER.getDefaultState())) + .where('L', states(LAVA.getDefaultState())) + .where('#', any()) + .build(); + } + + @Override + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gcyl.machine.large_rock_breaker.tooltip.1")); + } + + protected IBlockState getCasingState() { + return GCYLMetaBlocks.METAL_CASING_1.getState(MetalCasing1.CasingType.INCONEL_625); + } + + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { + return ClientHandler.INCONEL_625_CASING; + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEntity) { + return new MetaTileEntityLargeRockBreaker(metaTileEntityId); + } + + private class RockBreakerRecipeLogic extends GCYMMultiblockRecipeLogic { + + MetaTileEntityLargeRockBreaker largeRockBreaker; + + public RockBreakerRecipeLogic(RecipeMapMultiblockController tileEntity) { + super(tileEntity); + this.largeRockBreaker = (MetaTileEntityLargeRockBreaker) tileEntity; + } + + protected FluidStack getLava() { + return Materials.Lava.getFluid((int) Math.pow(3, GTUtility.getTierByVoltage(this.largeRockBreaker.energyContainer.getInputVoltage()))); + } + + protected boolean checkLava() { + IMultipleTankHandler inputTank = largeRockBreaker.getInputFluidInventory(); + if(getLava().isFluidStackIdentical(inputTank.drain(getLava(), false))) { + return true; + } + else { + invalidate(); + return false; + } + } + + protected void drainLava() { + largeRockBreaker.getInputFluidInventory().drain(getLava(), true); + } + + protected FluidStack getWater() { + return Materials.Water.getFluid((int) Math.pow(3,GTUtility.getTierByVoltage(this.largeRockBreaker.energyContainer.getInputVoltage()))); + } + + protected boolean checkWater() { + IMultipleTankHandler inputTank = largeRockBreaker.getInputFluidInventory(); + if(getWater().isFluidStackIdentical(inputTank.drain(getWater(), false))) { + return true; + } + else { + invalidate(); + return false; + } + } + + protected void drainWater() { + largeRockBreaker.getInputFluidInventory().drain(getWater(), true); + } + + @Override + protected boolean shouldSearchForRecipes() { + return super.shouldSearchForRecipes() && checkLava() && checkWater(); + } + + @Override + protected boolean canProgressRecipe() { + if(checkLava() && checkWater() && largeRockBreaker.isActive()) { + drainLava(); + drainWater(); + } + + return super.canProgressRecipe() && checkLava() && checkWater(); + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityMegaCleanroom.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityMegaCleanroom.java index 9fcb857b..8001f84e 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityMegaCleanroom.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityMegaCleanroom.java @@ -2,15 +2,26 @@ import appeng.core.AEConfig; import appeng.core.features.AEFeature; +import codechicken.lib.raytracer.CuboidRayTraceResult; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.metal.GCYLCleanroomCasing; +import com.fulltrix.gcyl.machines.GCYLTileEntities; import gregtech.api.GTValues; +import gregtech.api.block.ICleanroomFilter; import gregtech.api.capability.GregtechDataCodes; +import gregtech.api.capability.IEnergyContainer; import gregtech.api.capability.impl.CleanroomLogic; +import gregtech.api.capability.impl.EnergyContainerList; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.CleanroomType; +import gregtech.api.metatileentity.multiblock.ICleanroomProvider; import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.*; -import gregtech.api.util.Mods; +import gregtech.api.util.*; import gregtech.client.utils.TooltipHelper; import gregtech.common.ConfigHolder; import gregtech.common.blocks.BlockCleanroomCasing; @@ -18,27 +29,38 @@ import gregtech.common.blocks.MetaBlocks; import gregtech.common.metatileentities.MetaTileEntities; import gregtech.common.metatileentities.multi.electric.MetaTileEntityCleanroom; +import it.unimi.dsi.fastutil.objects.Object2IntMap; +import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import net.minecraft.block.BlockDoor; import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.PacketBuffer; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import static com.fulltrix.gcyl.api.pattern.TraceabilityPredicates.filterCasings; + //TODO: Decrease tps lag when they try to cheat it -public class MetaTileEntityMegaCleanroom extends MetaTileEntityCleanroom { +//TODO: fix the display text tooltip of usage +//TODO: make this not extend cleanroom and rewrite it to avoid BS +public class MetaTileEntityMegaCleanroom extends MetaTileEntityCleanroom implements ICleanroomProvider { public static final int MIN_RADIUS = 10; public static final int MIN_DEPTH = 9; private int lDist = 0; @@ -48,8 +70,21 @@ public class MetaTileEntityMegaCleanroom extends MetaTileEntityCleanroom { private int hDist = 0; private final CleanroomLogic cleanroomLogic; private CleanroomType cleanroomType = null; - + private ICleanroomFilter cleanroomFilter; + private IEnergyContainer energyContainer; private boolean initialForm = true; + + private static final Object2IntMap CleanroomTypeMap = new Object2IntOpenHashMap<>(); + + static { + CleanroomTypeMap.put(CleanroomType.CLEANROOM, 0); + CleanroomTypeMap.put(CleanroomType.STERILE_CLEANROOM, 1); + CleanroomTypeMap.put(GCYLCleanroomType.ISO3, 2); + CleanroomTypeMap.put(GCYLCleanroomType.ISO2, 3); + CleanroomTypeMap.put(GCYLCleanroomType.ISO1, 4); + CleanroomTypeMap.put(GCYLCleanroomType.ISO0, 5); + } + public MetaTileEntityMegaCleanroom(ResourceLocation metaTileEntityId) { super(metaTileEntityId); this.cleanroomLogic = new CleanroomLogic(this, GTValues.LV); @@ -119,52 +154,50 @@ public boolean updateStructureDimensions() { return true; } - /* - @Override - public void update() { - if (getOffsetTimer() % 100 == 0) { - super.update(); - } - } - */ + + @SubscribeEvent public void checkStructurePatternSave(WorldEvent.Save event) { this.initialForm = true; super.checkStructurePattern(); } + @Override public void checkStructurePattern() { - if((initialForm) || !isStructureFormed()) { + if((this.initialForm) || !isStructureFormed()) { this.initialForm = false; super.checkStructurePattern(); } } + @Override + public boolean onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, EnumFacing facing, + CuboidRayTraceResult hitResult) { + if (!getWorld().isRemote) { + super.checkStructurePattern(); + playerIn.sendStatusMessage(TextComponentUtil.translationWithColor(TextFormatting.WHITE,"gcyl.machine.cleanroom.screwdriver"), false); + } + return true; + } + @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); initializeAbilities(); - Object type = context.get("FilterType"); - if (type instanceof BlockCleanroomCasing.CasingType) { - BlockCleanroomCasing.CasingType casingType = (BlockCleanroomCasing.CasingType) type; - - if (casingType.equals(BlockCleanroomCasing.CasingType.FILTER_CASING)) { - this.cleanroomType = CleanroomType.CLEANROOM; - } else if (casingType.equals(BlockCleanroomCasing.CasingType.FILTER_CASING_STERILE)) { - this.cleanroomType = CleanroomType.STERILE_CLEANROOM; - } - } + this.cleanroomFilter = context.get("FilterType"); + this.cleanroomType = cleanroomFilter.getCleanroomType(); // max progress is based on the dimensions of the structure: (x^3)-(x^2) // taller cleanrooms take longer than wider ones // minimum of 100 is a 5x5x5 cleanroom: 125-25=100 ticks this.cleanroomLogic.setMaxProgress(Math.max(100, ((lDist + rDist + 1) * (bDist + fDist + 1) * hDist) - ((lDist + rDist + 1) * (bDist + fDist + 1)))); + this.cleanroomLogic.setMinEnergyTier(cleanroomFilter.getMinTier()); } @Override public boolean checkCleanroomType(@NotNull CleanroomType type) { - return type == this.cleanroomType; + return CleanroomTypeMap.get(type) <= CleanroomTypeMap.get(this.cleanroomType); } @NotNull @@ -277,11 +310,85 @@ protected BlockPattern createStructurePattern() { .or(abilities(MultiblockAbility.PASSTHROUGH_HATCH).setMaxGlobalLimited(30))) .where('K', wallPredicate) // the block beneath the controller must only be a casing for structure // dimension checks - .where('F', filterPredicate()) + .where('F', filterCasings()) .where(' ', innerPredicate()) .build(); } + @Override + public int getEnergyTier() { + return this.energyContainer == null ? 1 : Math.max(1, GTUtility.getFloorTierByVoltage(this.energyContainer.getInputVoltage())); + } + + @Override + public long getEnergyInputPerSecond() { + return this.energyContainer.getInputPerSec(); + } + + @Override + public boolean drainEnergy(boolean simulate) { + if(isStructureFormed()) { + long energyToDrain = this.isClean() ? (long) Math.max(4.0, GTValues.VAOC[this.getEnergyTier() - 1]) : GTValues.VAOC[this.getEnergyTier()]; + long resultEnergy = this.energyContainer.getEnergyStored() - energyToDrain; + if (resultEnergy >= 0L && resultEnergy <= this.energyContainer.getEnergyCapacity()) { + if (!simulate) { + this.energyContainer.changeEnergy(-energyToDrain); + } + + return true; + } else { + return false; + } + } + return false; + } + + @Override + protected void configureDisplayText(MultiblockUIBuilder builder) { + builder.setWorkingStatus(this.cleanroomLogic.isWorkingEnabled(), this.cleanroomLogic.isActive()) + .addEnergyUsageLine(this.energyContainer) + .addCustom((keyManager, uiSyncer) -> { + if (uiSyncer.syncBoolean(this.isStructureFormed())) { + //TODO get rid of this disgusting garbage + Field cleanAmountField; + try { + cleanAmountField = MetaTileEntityCleanroom.class.getDeclaredField("cleanAmount"); + } catch (NoSuchFieldException e) { + throw new RuntimeException(e); + } + cleanAmountField.setAccessible(true); + + int cleanAmount = 0; + try { + cleanAmount = (int) cleanAmountField.get(this); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + + IKey cleanState; + if (this.isClean()) { + cleanState = KeyUtil.lang(TextFormatting.GREEN, "gregtech.multiblock.cleanroom.clean_state", uiSyncer.syncInt(cleanAmount)); + } else { + cleanState = KeyUtil.lang(TextFormatting.DARK_RED, "gregtech.multiblock.cleanroom.dirty_state", uiSyncer.syncInt(cleanAmount)); + } + + keyManager.add(KeyUtil.lang(TextFormatting.GRAY, "gregtech.multiblock.cleanroom.clean_status", cleanState)); + + if (!this.cleanroomLogic.isVoltageHighEnough()) { + IKey energyNeeded = KeyUtil.string(GTValues.VNF[this.cleanroomFilter.getMinTier()]); + keyManager.add(KeyUtil.lang(TextFormatting.YELLOW, "gregtech.multiblock.cleanroom.low_tier", energyNeeded)); + } + } + }).addEnergyUsageExactLine(this.isClean() ? 4L : GTValues.VAOC[this.getEnergyTier()]) + .addWorkingStatusLine() + .addProgressLine(this.getProgress(), this.getMaxProgress()); + } + + @Override + protected void initializeAbilities() { + this.energyContainer = new EnergyContainerList(this.getAbilities(MultiblockAbility.INPUT_ENERGY)); + } + @Override public List getMatchingShapes() { ArrayList shapeInfo = new ArrayList<>(); @@ -309,7 +416,7 @@ public List getMatchingShapes() { .aisle("XXXXXXXXXMXEXXXXXXXXX", "XXXXXXXXXXOXXXXXXXXXX", "XXXXXXXXXXRXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXX") .where('X', MetaBlocks.CLEANROOM_CASING.getState(BlockCleanroomCasing.CasingType.PLASCRETE)) .where('G', MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.CLEANROOM_GLASS)) - .where('S', MetaTileEntities.CLEANROOM, EnumFacing.SOUTH) + .where('S', GCYLTileEntities.MEGA_CLEANROOM, EnumFacing.SOUTH) .where(' ', Blocks.AIR.getDefaultState()) .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[GTValues.ZPM], EnumFacing.SOUTH) .where('I', MetaTileEntities.PASSTHROUGH_HATCH_ITEM, EnumFacing.NORTH) @@ -330,6 +437,11 @@ public List getMatchingShapes() { .filter(casingType -> !casingType.equals(BlockCleanroomCasing.CasingType.PLASCRETE)) .forEach(casingType -> shapeInfo .add(builder.where('F', MetaBlocks.CLEANROOM_CASING.getState(casingType)).build())); + + Arrays.stream(GCYLCleanroomCasing.CasingType.values()) + .forEach(casingType -> shapeInfo + .add(builder.where('F', GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getState(casingType)).build())); + return shapeInfo; } @@ -344,8 +456,10 @@ public void addInformation(ItemStack stack, @Nullable World player, List if (TooltipHelper.isCtrlDown()) { tooltip.add(""); tooltip.add(I18n.format("gcyl.machine.cleanroom.tooltip.3")); + tooltip.add(I18n.format("gcyl.machine.cleanroom.tooltip.7")); tooltip.add(I18n.format("gcyl.machine.cleanroom.tooltip.4")); tooltip.add(I18n.format("gcyl.machine.cleanroom.tooltip.5")); + tooltip.add(I18n.format("gcyl.machine.cleanroom.tooltip.6")); tooltip.add(I18n.format("gregtech.machine.cleanroom.tooltip.5")); tooltip.add(I18n.format("gregtech.machine.cleanroom.tooltip.6")); tooltip.add(I18n.format("gregtech.machine.cleanroom.tooltip.7")); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityOreFactory.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityOreFactory.java index ab4ba187..f464f5bb 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityOreFactory.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityOreFactory.java @@ -4,8 +4,11 @@ import codechicken.lib.render.CCRenderState; import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Matrix4; +import com.fulltrix.gcyl.api.multi.IOreFactoryProvider; +import com.fulltrix.gcyl.api.multi.OreFactoryLogic; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.metal.MetalCasing2; import com.google.common.collect.Lists; -import gregtech.api.GTValues; import gregtech.api.capability.*; import gregtech.api.capability.impl.EnergyContainerList; import gregtech.api.capability.impl.FluidTankList; @@ -15,37 +18,26 @@ import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; import gregtech.api.pattern.TraceabilityPredicate; -import gregtech.api.recipes.Recipe; -import gregtech.api.recipes.RecipeMap; -import gregtech.api.unification.OreDictUnifier; -import gregtech.api.unification.material.Materials; -import gregtech.api.unification.ore.OrePrefix; -import gregtech.api.util.GTTransferUtils; import gregtech.api.util.GTUtility; +import gregtech.api.util.KeyUtil; +import gregtech.api.util.TextComponentUtil; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.Textures; -import gregtech.common.blocks.BlockGlassCasing; -import gregtech.common.blocks.BlockMachineCasing; -import gregtech.common.blocks.MetaBlocks; -import groovy.transform.NullCheck; +import gregtech.client.utils.TooltipHelper; +import gregtech.common.blocks.*; +import gregtech.core.sound.GTSoundEvents; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagInt; import net.minecraft.network.PacketBuffer; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; -import net.minecraft.util.NonNullList; -import net.minecraft.util.ResourceLocation; +import net.minecraft.util.*; import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.Style; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; @@ -56,38 +48,39 @@ import net.minecraftforge.items.ItemStackHandler; import org.jetbrains.annotations.NotNull; -import java.util.Collections; +import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; -import static java.util.Arrays.asList; +import static gregtech.api.unification.material.Materials.TungstenSteel; +import static gregtech.api.util.RelativeDirection.*; -//TODO: multiblock pattern. proper tiering. different processing durations. fluid input requirements. make sifting work. fix problems with input (does not take items from beyond the first slot) +//TODO: make sifting work. separate base textures so hatches can go elsewhere -public class MetaTileEntityOreFactory extends MultiblockWithDisplayBase implements IControllable { +public class MetaTileEntityOreFactory extends MultiblockWithDisplayBase implements IWorkable, IOreFactoryProvider { - protected IMultipleTankHandler inputFluidInventory; + private IMultipleTankHandler inputFluidInventory; private IItemHandlerModifiable inputInventory; - protected IItemHandlerModifiable outputInventory; + private IItemHandlerModifiable outputInventory; private IEnergyContainer energyContainer; protected final MetaTileEntity metaTileEntity; - private boolean isWorkingEnabled = true; - - private boolean isActive = false; - private int voltageTier; + private int tier; + + private long energyToDrain; - private int configuration = 0; + private OreFactoryLogic oreFactoryLogic; public MetaTileEntityOreFactory(ResourceLocation metaTileEntityId) { super(metaTileEntityId); this.metaTileEntity = this; - this.reinitializeStructurePattern(); + this.oreFactoryLogic = new OreFactoryLogic(this); } @Override @@ -95,24 +88,47 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { return new MetaTileEntityOreFactory(metaTileEntityId); } + @SideOnly(Side.CLIENT) + @Override + public SoundEvent getSound() { + return GTSoundEvents.MACERATOR; + } + + //EXAMPLE CONVERSION FROM GTNH STRUCTURE PATTERN TO CEU @Override protected BlockPattern createStructurePattern() { - return FactoryBlockPattern.start() - .aisle(" CCC ", " CCC ", " CCC ", " CCC ") - .aisle("CCCCC", "CDDDC", "C###C", "CGGGC") - .aisle("CCCCC", "CDDDC", "C###C", "CGGGC") - .aisle("CCCCC", "CDDDC", "C###C", "CGGGC") - .aisle(" CCC ", " CSC ", " CCC ", " CCC ") - .where('S', selfPredicate()) - .where('G', states(MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.TEMPERED_GLASS))) - .where('D', states(Blocks.DIRT.getDefaultState(), Blocks.GRASS.getDefaultState())) - .where('C', states(MetaBlocks.MACHINE_CASING.getState(BlockMachineCasing.MachineCasingType.ULV)) - .setMinGlobalLimited(42) - .or(autoAbilities(true, true, true, true, true, true ,false))) - .where('#', air()) + return FactoryBlockPattern.start(LEFT, FRONT, DOWN) + .aisle(" ", " ", " WWW ", " WWW ", " ", " ") + .aisle(" ", " sss ", " sppps", " sppps", " sss ", " ") + .aisle(" ", " sss ", " s s", " s s", " sss ", " ") + .aisle(" ", " sss ", " sppps", " sppps", " sss ", " ") + .aisle(" ", " sss ", " s s", " s s", " sss ", " ") + .aisle(" ", " sss ", " sppps", " sppps", " sss ", " ") + .aisle("iiiiii ", "iiiiiiisssi", "iiiiiis s", "iiiiiis s", "iiiiiiisssi", "iiiiii ") + .aisle("iggggi ", "gt t isssi", "g xx sppps", "g xx sppps", "gt t isssi", "iggggi ") + .aisle("iggggi ", "gt t isssi", "g xx s s", "g xx s s", "gt t isssi", "iggggi ") + .aisle("iggggi ", "gt t is~si", "g xx sppps", "g xx sppps", "gt t isssi", "iggggi ") + .aisle("iggggi ", "gt t isssi", "g xx s s", "g xx s s", "gt t isssi", "iggggi ") + .aisle("iiiiii ", "iiiiiiiiiii", "iiiiiiiiiii", "iiiiiiiiiii", "iiiiiiiiiii", "iiiiii ") + .where(' ', any()) + .where('i', states(GCYLMetaBlocks.METAL_CASING_2.getState(MetalCasing2.CasingType.IRIDIUM))) + .where('x', states(MetaBlocks.TURBINE_CASING.getState(BlockTurbineCasing.TurbineCasingType.STEEL_GEARBOX))) + .where('t', frames(TungstenSteel)) + .where('s', states(MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.STAINLESS_CLEAN)).setMinGlobalLimited(90) + .or(autoAbilities(false, true, true, true, true, false ,false) + .or(abilities(MultiblockAbility.INPUT_ENERGY, MultiblockAbility.INPUT_LASER).setExactLimit(1)))) + .where('W', states(MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.STAINLESS_CLEAN)).or(abilities(MultiblockAbility.MUFFLER_HATCH).setExactLimit(1))) + .where('p', states(MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.TUNGSTENSTEEL_PIPE))) + .where('~', selfPredicate()) + .where('g', states(MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.FUSION_GLASS))) .build(); } + @Override + public boolean hasMufflerMechanics() { + return true; + } + public TraceabilityPredicate autoAbilities(boolean checkEnergyIn, boolean checkMaintenance, boolean checkItemIn, @@ -146,21 +162,29 @@ public TraceabilityPredicate autoAbilities(boolean checkEnergyIn, @Override @SideOnly(Side.CLIENT) public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { - return Textures.VOLTAGE_CASINGS[9]; + return Textures.CLEAN_STAINLESS_STEEL_CASING; } @Override - protected void addDisplayText(List textList) { - if (this.isStructureFormed() && !this.hasMaintenanceProblems()) { - if (energyContainer != null && energyContainer.getEnergyCapacity() > 0) { - long maxVoltage = energyContainer.getInputVoltage(); - String voltageName = GTValues.VN[GTUtility.getTierByVoltage(maxVoltage)]; - textList.add(new TextComponentTranslation("gregtech.multiblock.max_energy_per_tick", maxVoltage, voltageName)); - } - textList.add(new TextComponentTranslation("gregtech.multiblock.universal.energy_used", voltageTier)); - } - - super.addDisplayText(textList); + protected void configureDisplayText(MultiblockUIBuilder builder) { + builder.addEnergyUsageLine(this.energyContainer) + .setWorkingStatus(oreFactoryLogic.isWorkingEnabled(), oreFactoryLogic.isActive()) + .addWorkingStatusLine() + .addCustom((keyManager, uiSyncer) -> { + keyManager.add(KeyUtil.lang(TextFormatting.YELLOW, "gcyl.machine.ore_factory.current_mode")); + if(this.oreFactoryLogic.getConfiguration() == 0) + keyManager.add(KeyUtil.lang(TextFormatting.YELLOW, "gcyl.machine.ore_factory.config.0")); + if(this.oreFactoryLogic.getConfiguration() == 1) + keyManager.add(KeyUtil.lang(TextFormatting.YELLOW, "gcyl.machine.ore_factory.config.1")); + if(this.oreFactoryLogic.getConfiguration() == 2) + keyManager.add(KeyUtil.lang(TextFormatting.YELLOW, "gcyl.machine.ore_factory.config.2")); + if(this.oreFactoryLogic.getConfiguration() == 3) + keyManager.add(KeyUtil.lang(TextFormatting.YELLOW, "gcyl.machine.ore_factory.config.3")); + if(this.oreFactoryLogic.getConfiguration() == 4) + keyManager.add(KeyUtil.lang(TextFormatting.YELLOW, "gcyl.machine.ore_factory.config.4")); + + keyManager.add(KeyUtil.lang(TextFormatting.AQUA, "gcyl.machine.ore_factory.max_amount", this.oreFactoryLogic.getComparator())); + }); } @Override @@ -168,10 +192,40 @@ public IItemHandlerModifiable getImportItems() { return this.inputInventory; } + @Override + public boolean shouldShowVoidingModeButton() { + return false; + } + @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); initializeAbilities(); + if(this.oreFactoryLogic.getConfiguration() == 0) { + this.oreFactoryLogic.setMaxProgress(20); + } + else if(this.oreFactoryLogic.getConfiguration() == 1) { + this.oreFactoryLogic.setMaxProgress(15); + } + /*else if(this.oreFactoryLogic.getConfiguration() == 2) { + this.oreFactoryLogic.setMaxProgress(1200); + }*/ + else if(this.oreFactoryLogic.getConfiguration() == 3) { + this.oreFactoryLogic.setMaxProgress(12); + } + else { + this.oreFactoryLogic.setMaxProgress(17); + } + + if(this.energyContainer.getInputVoltage() % 2147483647 == 0) { + long fix = this.energyContainer.getInputVoltage() / 2147483647; + this.tier = (int) (Math.log((this.energyContainer.getInputVoltage() + fix) * 2) / Math.log(4) - 2); + } + else { + this.tier = (int) (Math.log(this.energyContainer.getInputVoltage() * 2) / Math.log(4) - 2); + } + + this.energyToDrain = (long) (Math.pow(4, this.tier + 2) / 2.0); } public void setVoltageTier(int tier) { @@ -187,7 +241,9 @@ private void initializeAbilities() { this.inputFluidInventory = new FluidTankList(false, getAbilities(MultiblockAbility.IMPORT_FLUIDS)); this.inputInventory = new ItemHandlerList(getAbilities(MultiblockAbility.IMPORT_ITEMS)); this.outputInventory = new ItemHandlerList(getAbilities(MultiblockAbility.EXPORT_ITEMS)); - this.energyContainer = new EnergyContainerList(getAbilities(MultiblockAbility.INPUT_ENERGY)); + List powerInput = new ArrayList<>(getAbilities(MultiblockAbility.INPUT_ENERGY)); + powerInput.addAll(getAbilities(MultiblockAbility.INPUT_LASER)); + this.energyContainer = new EnergyContainerList(powerInput); this.setVoltageTier(GTUtility.getTierByVoltage(this.energyContainer.getInputVoltage())); } @@ -195,14 +251,24 @@ private void initializeAbilities() { public void invalidateStructure() { super.invalidateStructure(); resetTileAbilities(); + this.oreFactoryLogic.invalidate(); + } + + @Override + public int getProgress() { + return oreFactoryLogic.getProgressTime(); + } - if (this.isActive()) - this.setActive(false); + @Override + public int getMaxProgress() { + return oreFactoryLogic.getMaxProgress(); } + public int getProgressPercent() {return oreFactoryLogic.getProgressPercent();} + @Override public boolean isActive() { - return super.isActive() && this.isWorkingEnabled; + return super.isActive() && this.oreFactoryLogic.isActive(); } private void resetTileAbilities() { @@ -212,106 +278,89 @@ private void resetTileAbilities() { this.energyContainer = new EnergyContainerList(Lists.newArrayList()); } - private void insertItems(NonNullList itemDrops) { - if (GTTransferUtils.addItemsToItemHandler(metaTileEntity.getExportItems(), true, itemDrops)) { - GTTransferUtils.addItemsToItemHandler(metaTileEntity.getExportItems(), false, itemDrops); - } - } - @Override public boolean isWorkingEnabled() { - return isWorkingEnabled; + return this.oreFactoryLogic.isWorkingEnabled(); } @Override public void setWorkingEnabled(boolean isWorkingAllowed) { - this.isWorkingEnabled = isWorkingAllowed; - markDirty(); - World world = getWorld(); - if (world != null && !world.isRemote) { - writeCustomData(GregtechDataCodes.WORKING_ENABLED, buf -> buf.writeBoolean(isWorkingEnabled)); - } + this.oreFactoryLogic.setWorkingEnabled(isWorkingAllowed); } @Override public T getCapability(Capability capability, EnumFacing side) { - if (capability == GregtechTileCapabilities.CAPABILITY_CONTROLLABLE) { + if (capability == GregtechTileCapabilities.CAPABILITY_WORKABLE) + return GregtechTileCapabilities.CAPABILITY_WORKABLE.cast(this); + if (capability == GregtechTileCapabilities.CAPABILITY_CONTROLLABLE) return GregtechTileCapabilities.CAPABILITY_CONTROLLABLE.cast(this); - } return super.getCapability(capability, side); } - protected void setActive(boolean active) { - if (this.isActive != active) { - this.isActive = active; - markDirty(); - World world = getWorld(); - if (world != null && !world.isRemote) { - writeCustomData(GregtechDataCodes.WORKABLE_ACTIVE, buf -> buf.writeBoolean(active)); - } - } - } - - protected boolean drainStorages(boolean simulate) { - return drainEnergy(simulate) && consumeInput(simulate); - } - public boolean drainEnergy(boolean simulate) { - long energyToDrain = GTValues.VA[getEnergyTier()]; - long resultEnergy = energyContainer.getEnergyStored() - energyToDrain; + long resultEnergy = energyContainer.getEnergyStored() - this.energyToDrain; if (resultEnergy >= 0L && resultEnergy <= energyContainer.getEnergyCapacity()) { if (!simulate) - energyContainer.changeEnergy(-energyToDrain); + energyContainer.changeEnergy(-this.energyToDrain); return true; } return false; } - public int getEnergyTier() { - return GTUtility.getFloorTierByVoltage(energyContainer.getInputVoltage()); + @Override + public IMultipleTankHandler getImportFluidHandler() { + return this.inputFluidInventory; } - public boolean consumeInput(boolean simulate) { - - ItemStack itemStack = inputInventory.getStackInSlot(0); + @Override + public IItemHandlerModifiable getOutputInventory() { + return this.outputInventory; + } - if(itemStack != null) { - if(!simulate) { - inputInventory.extractItem(0, inputInventory.getStackInSlot(0).getCount(), false); - } - return true; - } + @Override + public IItemHandlerModifiable getInputInventory() { + return this.inputInventory; + } - return false; + @Override + public int getVoltageTier() { + return this.tier; } @Override public boolean onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, EnumFacing facing, CuboidRayTraceResult hitResult) { if(!getWorld().isRemote) { - if(configuration == 0) { - configuration = 1; + if(this.oreFactoryLogic.getConfiguration() == 0 && !this.oreFactoryLogic.isActive()) { + this.oreFactoryLogic.setConfiguration(1); + invalidateStructure(); playerIn.sendStatusMessage( new TextComponentTranslation("gcyl.machine.ore_factory.config.1"), false); } - else if(configuration == 1) { - configuration = 2; + /* + else if(this.oreFactoryLogic.getConfiguration() == 1 && !this.oreFactoryLogic.isActive()) { + this.oreFactoryLogic.setConfiguration(2); + invalidateStructure(); playerIn.sendStatusMessage( new TextComponentTranslation("gcyl.machine.ore_factory.config.2"), false); } - else if(configuration == 2) { - configuration = 3; + */ + else if(this.oreFactoryLogic.getConfiguration() == 1 && !this.oreFactoryLogic.isActive()) { + this.oreFactoryLogic.setConfiguration(3); + invalidateStructure(); playerIn.sendStatusMessage( new TextComponentTranslation("gcyl.machine.ore_factory.config.3"), false); } - else if(configuration == 3) { - configuration = 4; + else if(this.oreFactoryLogic.getConfiguration() == 3 && !this.oreFactoryLogic.isActive()) { + this.oreFactoryLogic.setConfiguration(4); + invalidateStructure(); playerIn.sendStatusMessage( new TextComponentTranslation("gcyl.machine.ore_factory.config.4"), false); } - else { - configuration = 0; + else if(!this.oreFactoryLogic.isActive()){ + this.oreFactoryLogic.setConfiguration(0); + invalidateStructure(); playerIn.sendStatusMessage( new TextComponentTranslation("gcyl.machine.ore_factory.config.0"), false); } @@ -319,144 +368,31 @@ else if(configuration == 3) { return true; } - protected void simulation(List drops, int fortuneLevel, RecipeMap map, int tier, List itemStack, List finalItemStack) { - if(itemStack != null) { - for (ItemStack item : itemStack) { - Recipe recipe = map.findRecipe(Long.MAX_VALUE, Collections.singletonList(item), Collections.emptyList()); - if (recipe != null && !recipe.getOutputs().isEmpty()) { - for (ItemStack outputStack : recipe.getResultItemOutputs(GTUtility.getTierByVoltage(recipe.getEUt()), tier, map)) { - outputStack = outputStack.copy(); - if (fortuneLevel > 0) { - outputStack.grow(outputStack.getCount() * fortuneLevel); - } - if (OreDictUnifier.getPrefix(outputStack) == OrePrefix.dust || OreDictUnifier.getPrefix(outputStack) == OrePrefix.gemExquisite) { - finalItemStack.add(outputStack); - } - else { - drops.add(outputStack); - } - } - } - } - } - } - - protected void simulationWash(List drops, int fortuneLevel, RecipeMap map, int tier, List itemStack, List finalItemStack) { - if(itemStack != null) { - for (ItemStack item : itemStack) { - Recipe recipe = map.findRecipe(Long.MAX_VALUE, Collections.singletonList(item), Collections.singletonList(Materials.DistilledWater.getFluid(100))); - if (recipe != null && !recipe.getOutputs().isEmpty()) { - for (ItemStack outputStack : recipe.getResultItemOutputs(GTUtility.getTierByVoltage(recipe.getEUt()), tier, map)) { - outputStack = outputStack.copy(); - if (fortuneLevel > 0) { - outputStack.grow(outputStack.getCount() * fortuneLevel); - } - if (OreDictUnifier.getPrefix(outputStack) == OrePrefix.dust) { - finalItemStack.add(outputStack); - } else { - drops.add(outputStack); - } - } - } + @Override + protected void updateFormedValid() { + if (!getWorld().isRemote) { + this.oreFactoryLogic.updateLogic(); + if(this.oreFactoryLogic.wasActiveAndNeedsUpdate()) { + this.oreFactoryLogic.setWasActiveAndNeedsUpdate(false); + this.oreFactoryLogic.setActive(false); } } } @Override - protected void updateFormedValid() { - if (!getWorld().isRemote && this.getNumMaintenanceProblems() < 1 && isWorkingEnabled) { - - for (int i = 0; i < inputInventory.getSlots(); i++) { - if(!inputInventory.getStackInSlot(i).isEmpty()) { - break; - } - if(i == inputInventory.getSlots() - 1) { - setActive(false); - return; - } - } - - if(!drainEnergy(true)) { - if(isActive) - setActive(false); - return; - } - - setActive(true); - - List drops = NonNullList.create(); - List drops1 = NonNullList.create(); - List drops2 = NonNullList.create(); - List drops3 = NonNullList.create(); - List finalOutput = NonNullList.create(); - NonNullList finalOutput2 = NonNullList.create(); - - if (configuration == 0) { - simulation(drops, 0, RecipeMap.getByName("macerator"), voltageTier, GTUtility.itemHandlerToList(metaTileEntity.getImportItems()), finalOutput); - simulationWash(drops1, 0, RecipeMap.getByName("ore_washer"), voltageTier, drops, finalOutput); - simulation(drops2, 0, RecipeMap.getByName("thermal_centrifuge"), voltageTier, drops1, finalOutput); - simulation(drops3, 0, RecipeMap.getByName("macerator"), voltageTier, drops2, finalOutput); - } - - if (configuration == 1) { - simulation(drops, 0, RecipeMap.getByName("macerator"), voltageTier, GTUtility.itemHandlerToList(metaTileEntity.getImportItems()), finalOutput); - simulation(drops1, 0, RecipeMap.getByName("ore_washer"), voltageTier, drops, finalOutput); - simulation(drops2, 0, RecipeMap.getByName("macerator"), voltageTier, drops1, finalOutput); - simulation(drops3, 0, RecipeMap.getByName("centrifuge"), voltageTier, drops2, finalOutput); - } - - if (configuration == 2) { - simulation(drops, 0, RecipeMap.getByName("macerator"), voltageTier, GTUtility.itemHandlerToList(metaTileEntity.getImportItems()), finalOutput); - simulationWash(drops1, 0, RecipeMap.getByName("ore_washer"), voltageTier, drops, finalOutput); - simulation(drops2, 0, RecipeMap.getByName("sifter"), voltageTier, drops1, finalOutput); - } - - if (configuration == 3) { - simulation(drops, 0, RecipeMap.getByName("macerator"), voltageTier, GTUtility.itemHandlerToList(metaTileEntity.getImportItems()), finalOutput); - simulation(drops1, 0, RecipeMap.getByName("macerator"), voltageTier, drops, finalOutput); - simulation(drops2, 0, RecipeMap.getByName("centrifuge"), voltageTier, drops1, finalOutput); - } - - if (configuration == 4) { - simulation(drops, 0, RecipeMap.getByName("macerator"), voltageTier, GTUtility.itemHandlerToList(metaTileEntity.getImportItems()), finalOutput); - simulation(drops1, 0, RecipeMap.getByName("thermal_centrifuge"), voltageTier, drops, finalOutput); - simulation(drops2, 0, RecipeMap.getByName("macerator"), voltageTier, drops1, finalOutput); - } - - //simulationPackager(finalOutput2, dustTiny) - - this.metaTileEntity.addNotifiedInput(this.inputInventory); - - if(configuration == 0 || configuration == 1) { - for (ItemStack outputStack : drops3) { - outputStack = outputStack.copy(); - outputStack.grow(outputStack.getCount() + 2 * inputInventory.getStackInSlot(0).getCount() - 2); - finalOutput2.add(outputStack); - } - } - else { - for (ItemStack outputStack : drops2) { - outputStack = outputStack.copy(); - outputStack.grow(outputStack.getCount() + 2 * inputInventory.getStackInSlot(0).getCount() - 2); - finalOutput2.add(outputStack); - } - } - - - for (ItemStack outputStack : finalOutput) { - outputStack = outputStack.copy(); - outputStack.grow(outputStack.getCount() + 2*inputInventory.getStackInSlot(0).getCount() - 2); - finalOutput2.add(outputStack); - } - - insertItems(finalOutput2); - drainEnergy(false); - consumeInput(false); - - - } - else - setActive(false); + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + tooltip.add(I18n.format("gcyl.multiblock.opf.description.1", this.oreFactoryLogic.getMaxParallel(), this.oreFactoryLogic.maxParallelTier())); + tooltip.add(TooltipHelper.RAINBOW_FAST + I18n.format("gcyl.multiblock.opf.description.10")); + tooltip.add(I18n.format("gcyl.multiblock.opf.description.6")); + tooltip.add(I18n.format("gcyl.multiblock.opf.description.2")); + tooltip.add(I18n.format("gcyl.multiblock.opf.description.9")); + tooltip.add(I18n.format("gcyl.multiblock.opf.description.7")); + tooltip.add(I18n.format("gcyl.multiblock.opf.description.8")); + tooltip.add(I18n.format("gcyl.multiblock.opf.description.3")); + //tooltip.add(I18n.format("gcyl.multiblock.opf.description.4")); + tooltip.add(I18n.format("gcyl.multiblock.opf.description.5")); + tooltip.add(I18n.format("gregtech.machine.power_substation.tooltip6") + TooltipHelper.RAINBOW_SLOW + + I18n.format("gregtech.machine.power_substation.tooltip6.5")); } @SideOnly(Side.CLIENT) @@ -468,50 +404,44 @@ protected void updateFormedValid() { @Override public void writeInitialSyncData(PacketBuffer buf) { super.writeInitialSyncData(buf); - buf.writeBoolean(isActive); - buf.writeBoolean(this.isWorkingEnabled); + this.oreFactoryLogic.writeInitialSyncData(buf); } @Override public void receiveInitialSyncData(PacketBuffer buf) { super.receiveInitialSyncData(buf); - this.isActive = buf.readBoolean(); - this.isWorkingEnabled = buf.readBoolean(); + this.oreFactoryLogic.receiveInitialSyncData(buf); } @Override public NBTTagCompound writeToNBT(NBTTagCompound data) { super.writeToNBT(data); - data.setBoolean("isActive", this.isActive); - data.setBoolean("isWorkingEnabled", this.isWorkingEnabled); - data.setInteger("configuration", this.configuration); - return data; + return this.oreFactoryLogic.writeToNBT(data); } @Override public void readFromNBT(NBTTagCompound data) { super.readFromNBT(data); - this.isActive = data.getBoolean("isActive"); - this.isWorkingEnabled = data.getBoolean("isWorkingEnabled"); - this.configuration = data.getInteger("configuration"); + this.oreFactoryLogic.readFromNBT(data); } @Override public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { super.renderMetaTileEntity(renderState, translation, pipeline); - getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), isActive, isWorkingEnabled); + getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), this.oreFactoryLogic.isActive(), this.oreFactoryLogic.isWorkingEnabled()); } @Override public void receiveCustomData(int dataId, PacketBuffer buf) { super.receiveCustomData(dataId, buf); if (dataId == GregtechDataCodes.WORKABLE_ACTIVE) { - this.isActive = buf.readBoolean(); + this.oreFactoryLogic.setActive(buf.readBoolean()); scheduleRenderUpdate(); } else if (dataId == GregtechDataCodes.WORKING_ENABLED) { - this.isWorkingEnabled = buf.readBoolean(); + this.oreFactoryLogic.setWorkingEnabled(buf.readBoolean()); scheduleRenderUpdate(); } + } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java index 84ec0eec..82a708e5 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java @@ -1,26 +1,38 @@ package com.fulltrix.gcyl.machines.multi.advance; import com.fulltrix.gcyl.materials.GCYLMaterials; -import com.fulltrix.gcyl.item.metal.MetalCasing1; +import com.fulltrix.gcyl.blocks.metal.MetalCasing1; import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; import gregicality.multiblocks.api.render.GCYMTextures; import gregtech.api.GTValues; import gregtech.api.block.IHeatingCoilBlockStats; +import gregtech.api.capability.IEnergyContainer; import gregtech.api.capability.IHeatingCoil; import gregtech.api.capability.IMultipleTankHandler; +import gregtech.api.capability.impl.EnergyContainerList; +import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.ParallelLogicType; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; import gregtech.api.recipes.Recipe; +import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.RecipeMaps; -import gregtech.api.recipes.recipeproperties.IRecipePropertyStorage; -import gregtech.api.recipes.recipeproperties.TemperatureProperty; +import gregtech.api.recipes.logic.OCParams; +import gregtech.api.recipes.logic.OCResult; +import gregtech.api.recipes.logic.OverclockingLogic; +import gregtech.api.recipes.machines.RecipeMapFurnace; +import gregtech.api.recipes.properties.RecipePropertyStorage; +import gregtech.api.recipes.properties.impl.TemperatureProperty; import gregtech.api.util.GTUtility; +import gregtech.api.util.KeyUtil; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.cube.OrientedOverlayRenderer; import gregtech.common.blocks.BlockWireCoil; @@ -34,28 +46,27 @@ import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.List; import static com.fulltrix.gcyl.client.ClientHandler.HASTELLOY_N_CASING; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.METAL_CASING_1; -import static gregtech.api.GTValues.ZPM; -import static gregtech.api.recipes.logic.OverclockingLogic.heatingCoilOverclockingLogic; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; + +import static gregtech.api.recipes.logic.OverclockingLogic.heatingCoilOC; //TODO: update ui & tooltip. improve performance -public class MetaTileEntityVolcanus extends GCYMRecipeMapMultiblockController implements IHeatingCoil { +public class MetaTileEntityVolcanus extends RecipeMapMultiblockController implements IHeatingCoil { - protected final MetaTileEntity metaTileEntity; private int blastFurnaceTemperature; public MetaTileEntityVolcanus(ResourceLocation metaTileEntityId) { super(metaTileEntityId, RecipeMaps.BLAST_RECIPES); this.recipeMapWorkable = new MetaTileEntityVolcanus.VolcanusRecipeLogic(this); - this.recipeMapWorkable.setMaximumOverclockVoltage(Math.min(this.energyContainer.getInputVoltage() , GTValues.V[ZPM])); - this.metaTileEntity = this; } @Override @@ -64,13 +75,10 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHol } @Override - protected void addDisplayText(List textList) { - if (isStructureFormed()) { - textList.add(new TextComponentTranslation("gregtech.multiblock.blast_furnace.max_temperature", - blastFurnaceTemperature) - .setStyle(new Style().setColor(TextFormatting.RED))); - } - super.addDisplayText(textList); + protected void configureDisplayText(MultiblockUIBuilder builder) { + builder.structureFormed(isStructureFormed()) + .addCustom((keyManager, uiSyncer) -> keyManager.add(KeyUtil.lang(TextFormatting.RED, "gregtech.multiblock.blast_furnace.max_temperature", + blastFurnaceTemperature))); } @Override @@ -89,11 +97,6 @@ protected void formStructure(PatternMatchContext context) { } - @Override - public boolean isTiered() { - return false; - } - @Override public void invalidateStructure() { super.invalidateStructure(); @@ -109,7 +112,10 @@ public boolean checkRecipe(@NotNull Recipe recipe, boolean consumeIfSuccess) { @Override public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { super.addInformation(stack, player, tooltip, advanced); - tooltip.add(I18n.format("gregtech.multiblock.volcanus.description")); + tooltip.add(I18n.format("gregtech.multiblock.volcanus.description.1")); + tooltip.add(I18n.format("gregtech.multiblock.volcanus.description.4")); + tooltip.add(I18n.format("gregtech.multiblock.volcanus.description.2")); + tooltip.add(I18n.format("gregtech.multiblock.volcanus.description.3")); tooltip.add(I18n.format("gregtech.machine.electric_blast_furnace.tooltip.1")); tooltip.add(I18n.format("gregtech.machine.electric_blast_furnace.tooltip.2")); tooltip.add(I18n.format("gregtech.machine.electric_blast_furnace.tooltip.3")); @@ -119,9 +125,10 @@ public void addInformation(ItemStack stack, @Nullable World player, List public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { return HASTELLOY_N_CASING; } - + @SideOnly(Side.CLIENT) + @NotNull @Override - protected @NotNull OrientedOverlayRenderer getFrontOverlay() { + protected OrientedOverlayRenderer getFrontOverlay() { return GCYMTextures.MEGA_BLAST_FURNACE_OVERLAY; } @@ -160,11 +167,11 @@ protected IBlockState getCasingState() { } @SuppressWarnings("InnerClassMayBeStatic") - private class VolcanusRecipeLogic extends GCYMMultiblockRecipeLogic { + private class VolcanusRecipeLogic extends MultiblockRecipeLogic { private final MetaTileEntityVolcanus volcanus; - public VolcanusRecipeLogic(GCYMRecipeMapMultiblockController metaTileEntity) { + public VolcanusRecipeLogic(RecipeMapMultiblockController metaTileEntity) { super(metaTileEntity); this.volcanus = (MetaTileEntityVolcanus) metaTileEntity; } @@ -204,20 +211,53 @@ protected boolean canProgressRecipe() { @Override public long getMaximumOverclockVoltage() { - return Math.min(volcanus.getEnergyContainer().getInputVoltage(), GTValues.V[ZPM]); + IEnergyContainer energyContainer = volcanus.getEnergyContainer(); + if (energyContainer instanceof EnergyContainerList) { + long voltage; + long amperage; + + voltage = energyContainer.getInputVoltage(); + amperage = energyContainer.getInputAmperage(); + + return amperage == 1L ? Math.min(GTValues.V[GTUtility.getFloorTierByVoltage(voltage)], GTValues.V[GTValues.ZPM]) : Math.min(voltage, GTValues.V[GTValues.ZPM]); + } else { + return Math.max(energyContainer.getInputVoltage(), energyContainer.getOutputVoltage()); + } + } + + @Override + public long getMaxParallelVoltage() { + return Long.MAX_VALUE; + } + + @Override + public int getParallelLimit() { + return 8; } @Override - protected int @NotNull [] runOverclockingLogic(@NotNull IRecipePropertyStorage propertyStorage, int recipeEUt, - long maxVoltage, int duration, int maxOverclocks) { - return heatingCoilOverclockingLogic(Math.abs(recipeEUt), - maxVoltage, - duration, - maxOverclocks, - ((IHeatingCoil) metaTileEntity).getCurrentTemperature(), - propertyStorage.getRecipePropertyValue(TemperatureProperty.getInstance(), 0)); + public void applyParallelBonus(@NotNull RecipeBuilder builder) { + long EUt = (long) (builder.getEUt() * 0.9); + + builder.EUt(EUt / builder.getParallel()) + .duration((int) (builder.getDuration() * (1.0F / 2.2F))); } + @Override + protected void modifyOverclockPre(@NotNull OCParams ocParams, @NotNull RecipePropertyStorage storage) { + super.modifyOverclockPre(ocParams, storage); + ocParams.setEut(OverclockingLogic.applyCoilEUtDiscount(ocParams.eut(), + ((IHeatingCoil) volcanus).getCurrentTemperature(), + storage.get(TemperatureProperty.getInstance(), 0))); + + } + + @Override + protected void runOverclockingLogic(@NotNull OCParams ocParams, @NotNull OCResult ocResult, + @NotNull RecipePropertyStorage propertyStorage, long maxVoltage) { + heatingCoilOC(ocParams, ocResult, maxVoltage, ((IHeatingCoil) volcanus).getCurrentTemperature(), + propertyStorage.get(TemperatureProperty.getInstance(), 0)); + } } } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityWirelessDataBank.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityWirelessDataBank.java new file mode 100644 index 00000000..51c89ae3 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityWirelessDataBank.java @@ -0,0 +1,471 @@ +package com.fulltrix.gcyl.machines.multi.advance; + +import codechicken.lib.raytracer.CuboidRayTraceResult; +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.fulltrix.gcyl.api.util.VirtualResearchRegistry; +import com.fulltrix.gcyl.client.ClientHandler; +import gregtech.api.GTValues; +import gregtech.api.capability.*; +import gregtech.api.capability.impl.EnergyContainerList; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; +import gregtech.api.pattern.BlockPattern; +import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.PatternMatchContext; +import gregtech.api.util.AssemblyLineManager; +import gregtech.api.util.KeyUtil; +import gregtech.api.util.TextComponentUtil; +import gregtech.api.util.TextFormattingUtil; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.client.renderer.texture.Textures; +import gregtech.client.utils.TooltipHelper; +import gregtech.common.ConfigHolder; +import gregtech.common.blocks.BlockComputerCasing; +import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; +import gregtech.common.metatileentities.multi.electric.MetaTileEntityDataBank; +import gregtech.core.sound.GTSoundEvents; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidTank; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.UUID; + +import static gregtech.api.metatileentity.multiblock.MultiblockAbility.IMPORT_FLUIDS; +import static gregtech.api.metatileentity.multiblock.MultiblockAbility.IMPORT_ITEMS; +import static gregtech.api.unification.material.Materials.PCBCoolant; + +//TODO fix sound even after disabling +public class MetaTileEntityWirelessDataBank extends MultiblockWithDisplayBase implements IControllable { + + private static final int EUT_PER_HATCH = GTValues.VA[GTValues.UEV]; + private static final int COOLANT_PER_HATCH = 100; + private IEnergyContainer energyContainer; + + private boolean isActive = false; + private boolean isWorkingEnabled = true; + protected boolean hasNotEnoughEnergy; + protected boolean hasNotEnoughCoolant; + private int energyUsage = 0; + private UUID playerUUID = null; + + private int coolantUsage = 0; + + private VirtualResearchRegistry.VirtualResearchContainer researchContainerWireless; + + public boolean initialize = true; + + + public MetaTileEntityWirelessDataBank(ResourceLocation metaTileEntityId) { + super(metaTileEntityId); + this.energyContainer = new EnergyContainerList(new ArrayList<>()); + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { + return new MetaTileEntityWirelessDataBank(metaTileEntityId); + } + + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + this.energyContainer = new EnergyContainerList(getAbilities(MultiblockAbility.INPUT_ENERGY)); + this.energyUsage = calculateEnergyUsage(); + this.coolantUsage = calculateCoolantUsage(); + } + + protected int calculateEnergyUsage() { + return EUT_PER_HATCH * this.getAbilities(IMPORT_ITEMS).size(); + } + + protected int calculateCoolantUsage() { + return COOLANT_PER_HATCH * this.getAbilities(IMPORT_ITEMS).size(); + } + + @NotNull + @Override + protected BlockPattern createStructurePattern() { + return FactoryBlockPattern.start() + .aisle("XDDDX", "XDDDX", "XDDDX") + .aisle("XDDDX", "XAAAX", "XDDDX") + .aisle("XCCCX", "XCSCX", "XCCCX") + .where('S', selfPredicate()) + .where('X', states(getOuterState())) + .where('D', states(getInnerState()).setMinGlobalLimited(3) + .or(metaTileEntities(MetaTileEntities.ITEM_IMPORT_BUS[GTValues.HV]).setMinGlobalLimited(1,1).setMaxGlobalLimited(8)) + .or(abilities(IMPORT_FLUIDS).setExactLimit(1))) + .where('A', states(getInnerState())) + .where('C', states(getFrontState()) + .setMinGlobalLimited(4) + .or(autoAbilities()) + .or(abilities(MultiblockAbility.INPUT_ENERGY) + .setMinGlobalLimited(1).setMaxGlobalLimited(2).setPreviewCount(1))) + .build(); + } + + @NotNull + private static IBlockState getOuterState() { + return MetaBlocks.COMPUTER_CASING.getState(BlockComputerCasing.CasingType.COMPUTER_HEAT_VENT); + } + + @NotNull + private static IBlockState getInnerState() { + return MetaBlocks.COMPUTER_CASING.getState(BlockComputerCasing.CasingType.ADVANCED_COMPUTER_CASING); + } + + private static IBlockState getFrontState() { + return MetaBlocks.COMPUTER_CASING.getState(BlockComputerCasing.CasingType.HIGH_POWER_CASING); + } + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + if(this.researchContainerWireless != null) { + this.researchContainerWireless.clearResearch(); + } + this.energyContainer = new EnergyContainerList(new ArrayList<>()); + this.energyUsage = 0; + this.coolantUsage = 0; + } + + protected int getEnergyUsage() { + return energyUsage; + } + protected int getCoolantUsage() {return coolantUsage;} + + @Override + public boolean isActive() { + return super.isActive() && this.isActive; + } + + public void setActive(boolean active) { + if (this.isActive != active) { + this.isActive = active; + markDirty(); + World world = getWorld(); + if (world != null && !world.isRemote) { + writeCustomData(GregtechDataCodes.WORKABLE_ACTIVE, buf -> buf.writeBoolean(active)); + } + } + } + + @Override + public boolean isWorkingEnabled() { + return this.isWorkingEnabled; + } + + @Override + public void setWorkingEnabled(boolean isWorkingAllowed) { + this.isWorkingEnabled = isWorkingAllowed; + markDirty(); + World world = getWorld(); + if (world != null && !world.isRemote) { + writeCustomData(GregtechDataCodes.WORKING_ENABLED, buf -> buf.writeBoolean(isWorkingEnabled)); + } + } + + @SideOnly(Side.CLIENT) + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { + if (sourcePart != null) { + // part rendering + if (sourcePart instanceof IDataAccessHatch) { + return Textures.COMPUTER_CASING; + } else { + return Textures.HIGH_POWER_CASING; + } + } else { + // controller rendering + if (isStructureFormed()) { + return Textures.HIGH_POWER_CASING; + } else { + return Textures.COMPUTER_CASING; + } + } + } + + @Override + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + super.renderMetaTileEntity(renderState, translation, pipeline); + getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), this.isActive(), + this.isWorkingEnabled()); + } + + @SideOnly(Side.CLIENT) + @NotNull + @Override + protected ICubeRenderer getFrontOverlay() { + return Textures.DATA_BANK_OVERLAY; + } + + @Override + public boolean shouldShowVoidingModeButton() { + return false; + } + + @SideOnly(Side.CLIENT) + @Override + public SoundEvent getSound() { + return GTSoundEvents.COMPUTATION; + } + + @Override + public void addInformation(ItemStack stack, @Nullable World world, @NotNull List tooltip, + boolean advanced) { + super.addInformation(stack, world, tooltip, advanced); + tooltip.add(TextFormatting.LIGHT_PURPLE + I18n.format("gcyl.machine.wireless_data_bank.tooltip.1")); + tooltip.add(TooltipHelper.BLINKING_RED + I18n.format("gcyl.machine.wireless_data_bank.tooltip.2")); + tooltip.add(TextFormatting.LIGHT_PURPLE + I18n.format("gcyl.machine.wireless_data_bank.tooltip.3")); + tooltip.add(TooltipHelper.BLINKING_RED + I18n.format("gcyl.machine.wireless_data_bank.tooltip.6")); + tooltip.add(I18n.format("gregtech.machine.data_bank.tooltip.1")); + tooltip.add(I18n.format("gcyl.machine.wireless_data_bank.tooltip.4")); + tooltip.add( + I18n.format("gcyl.machine.wireless_data_bank.tooltip.5", TextFormattingUtil.formatNumbers(EUT_PER_HATCH))); + tooltip.add( + I18n.format("gcyl.machine.wireless_data_bank.tooltip.7", TextFormattingUtil.formatNumbers(COOLANT_PER_HATCH))); + } + + @Override + protected void configureDisplayText(MultiblockUIBuilder builder) { + builder.setWorkingStatus(true, isActive() && isWorkingEnabled()) // transform into two-state system for display + .setWorkingStatusKeys( + "gregtech.multiblock.idling", + "gregtech.multiblock.idling", + "gregtech.multiblock.data_bank.providing") + .addEnergyUsageExactLine(getEnergyUsage()) + .addWorkingStatusLine() + .addCustom((keyManager, uiSyncer) -> { + if(uiSyncer.syncBoolean(this.initialize)) { + keyManager.add(KeyUtil.lang("gcyl.multiblock.wireless_pss.not_initialized")); + } else { + try { + keyManager.add(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.wireless_pss.private", Objects.requireNonNull(this.getWorld().getPlayerEntityByUUID(this.playerUUID)).getName())); + } catch (NullPointerException e) { + if (Objects.equals(this.playerUUID, new UUID(0, 0))) { + keyManager.add(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.wireless_pss.public")); + } else { + keyManager.add(KeyUtil.lang(TextFormatting.RED, "gcyl.multiblock.wireless_pss.player_offline")); + } + } + } + }); + } + + @Override + protected void configureWarningText(MultiblockUIBuilder builder) { + builder.addLowPowerLine(hasNotEnoughEnergy) + .addCustom((keyManager, uiSyncer) -> { + if(uiSyncer.syncBoolean(hasNotEnoughCoolant)) { + keyManager.add(KeyUtil.lang(TextFormatting.RED, "gcyl.multiblock.wireless_pss.not_enough_coolant")); + } + }) + .addMaintenanceProblemLines(getMaintenanceProblems(), true); + } + + private boolean checkCoolant() { + IFluidTank inputTank = this.getAbilities(IMPORT_FLUIDS).get(0); + if (inputTank.getFluid() != null) + return (inputTank.getFluid().amount >= getCoolantUsage()) && inputTank.getFluid().containsFluid(PCBCoolant.getFluid(1)); + else + return false; + } + + @Override + public void updateFormedValid() { + + if(isWorkingEnabled()) { + + int energyToConsume = this.getEnergyUsage(); + boolean hasMaintenance = ConfigHolder.machines.enableMaintenance && hasMaintenanceMechanics(); + if (hasMaintenance) { + // 10% more energy per maintenance problem + energyToConsume += getNumMaintenanceProblems() * energyToConsume / 10; + } + + if (this.hasNotEnoughEnergy && energyContainer.getInputPerSec() > 19L * energyToConsume) { + this.hasNotEnoughEnergy = false; + } + + if (this.hasNotEnoughCoolant && this.checkCoolant()) { + this.hasNotEnoughCoolant = false; + } + + if (this.energyContainer.getEnergyStored() >= energyToConsume) { + if (!this.hasNotEnoughEnergy && !this.hasNotEnoughCoolant) { + long consumed = this.energyContainer.removeEnergy(energyToConsume); + if (consumed == -energyToConsume) { + setActive(true); + } else { + this.hasNotEnoughEnergy = true; + if (this.researchContainerWireless != null) + this.researchContainerWireless.clearResearch(); + setActive(false); + } + } + } else { + this.hasNotEnoughEnergy = true; + if (this.researchContainerWireless != null) + this.researchContainerWireless.clearResearch(); + setActive(false); + } + + if (this.checkCoolant()) { + if (!this.hasNotEnoughCoolant && !this.hasNotEnoughEnergy) { + IFluidTank inputTank = this.getAbilities(IMPORT_FLUIDS).get(0); + if(inputTank.drain(this.getCoolantUsage(), false) != null) { + if (inputTank.drain(this.getCoolantUsage(), false).isFluidStackIdentical(PCBCoolant.getFluid(this.getCoolantUsage()))) { + inputTank.drain(this.getCoolantUsage(), true); + setActive(true); + } + }else { + this.hasNotEnoughCoolant = true; + if (this.researchContainerWireless != null) + this.researchContainerWireless.clearResearch(); + setActive(false); + } + } + } else { + this.hasNotEnoughCoolant = true; + if (this.researchContainerWireless != null) + this.researchContainerWireless.clearResearch(); + setActive(false); + } + + if (!this.initialize && !this.getWorld().isRemote && this.getOffsetTimer() % 1200 == 0 && isActive()) { + + List researchStrings = new ArrayList<>(); + for (int x = 0; x < this.getAbilities(IMPORT_ITEMS).size(); x++) { + for (int i = 0; i < this.getAbilities(IMPORT_ITEMS).get(x).getSlots(); i++) { + ItemStack stack = this.getAbilities(IMPORT_ITEMS).get(x).getStackInSlot(i); + String researchId = AssemblyLineManager.readResearchId(stack); + boolean isValid = AssemblyLineManager.isStackDataItem(stack, true); + if (researchId != null && isValid) { + researchStrings.add(researchId); + } + } + } + + this.researchContainerWireless.setResearchId(researchStrings); + } + } + } + + @Override + public boolean onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, EnumFacing facing, + CuboidRayTraceResult hitResult) { + if(!getWorld().isRemote) { + if (this.initialize) { + if(playerIn.isSneaking()) { + this.playerUUID = playerIn.getUniqueID(); + this.researchContainerWireless = VirtualResearchRegistry.getContainerCreate(makeResearchContainerName(), this.playerUUID); + this.initialize = false; + playerIn.sendStatusMessage(new TextComponentTranslation("gcyl.wireless_initialized_private"), false); + } + else { + this.playerUUID = new UUID(0,0); + this.researchContainerWireless = VirtualResearchRegistry.getContainerCreate(makeResearchContainerName(), this.playerUUID); + this.initialize = false; + playerIn.sendStatusMessage(new TextComponentTranslation("gcyl.wireless_initialized_public"), false); + } + } + } + return true; + } + + @Override + public void receiveCustomData(int dataId, @NotNull PacketBuffer buf) { + super.receiveCustomData(dataId, buf); + if (dataId == GregtechDataCodes.WORKABLE_ACTIVE) { + this.isActive = buf.readBoolean(); + scheduleRenderUpdate(); + } else if (dataId == GregtechDataCodes.WORKING_ENABLED) { + this.isWorkingEnabled = buf.readBoolean(); + scheduleRenderUpdate(); + } + } + + @Override + public T getCapability(Capability capability, EnumFacing side) { + if (capability == GregtechTileCapabilities.CAPABILITY_CONTROLLABLE) { + return GregtechTileCapabilities.CAPABILITY_CONTROLLABLE.cast(this); + } + return super.getCapability(capability, side); + } + + @Override + public void writeInitialSyncData(PacketBuffer packetBuffer) { + super.writeInitialSyncData(packetBuffer); + packetBuffer.writeBoolean(this.isActive); + packetBuffer.writeBoolean(this.isWorkingEnabled); + packetBuffer.writeBoolean(this.initialize); + packetBuffer.writeString(this.playerUUID == null ? "null" : this.playerUUID.toString()); + } + + @Override + public void receiveInitialSyncData(PacketBuffer packetBuffer) { + super.receiveInitialSyncData(packetBuffer); + setActive(packetBuffer.readBoolean()); + setWorkingEnabled(packetBuffer.readBoolean()); + this.initialize = packetBuffer.readBoolean(); + String uuidStr = packetBuffer.readString(36); + this.playerUUID = uuidStr.equals("null") ? null : UUID.fromString(uuidStr); + updateResearchLink(); + } + + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound data) { + super.writeToNBT(data); + data.setBoolean("isActive", this.isActive); + data.setBoolean("isWorkingEnabled", this.isWorkingEnabled); + data.setBoolean("Initialized", initialize); + data.setString("PlacedUUID", playerUUID == null ? "null" : playerUUID.toString()); + return data; + } + + @Override + public void readFromNBT(NBTTagCompound data) { + super.readFromNBT(data); + setActive(data.getBoolean("isActive")); + setWorkingEnabled(data.getBoolean("isWorkingEnabled")); + String uuidStr = data.getString("PlacedUUID"); + this.playerUUID = uuidStr.equals("null") ? null : UUID.fromString(uuidStr); + this.initialize = data.getBoolean("Initialized"); + updateResearchLink(); + } + + protected void updateResearchLink() { + this.researchContainerWireless = VirtualResearchRegistry.getContainerCreate(makeResearchContainerName(), this.playerUUID); + this.markDirty(); + } + + private String makeResearchContainerName() {return "RContainer#";} +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityWirelessPowerSubstation.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityWirelessPowerSubstation.java new file mode 100644 index 00000000..ffc8a16f --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityWirelessPowerSubstation.java @@ -0,0 +1,1013 @@ +package com.fulltrix.gcyl.machines.multi.advance; + +import codechicken.lib.raytracer.CuboidRayTraceResult; +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.value.DoubleValue; +import com.cleanroommc.modularui.value.sync.BigIntSyncValue; +import com.cleanroommc.modularui.value.sync.DoubleSyncValue; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.fulltrix.gcyl.api.util.VirtualEnergyRegistry; +import com.fulltrix.gcyl.client.ClientHandler; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.GCYLMultiblockCasing2; +import com.fulltrix.gcyl.machines.GCYLTileEntities; +import gregtech.api.GTValues; +import gregtech.api.GregTechAPI; +import gregtech.api.capability.*; +import gregtech.api.capability.impl.EnergyContainerList; +import gregtech.api.gui.GuiTextures; +import gregtech.api.gui.ModularUI; +import gregtech.api.gui.resources.TextureArea; +import gregtech.api.gui.widgets.*; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.*; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; +import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; +import gregtech.api.mui.GTGuiTextures; +import gregtech.api.pattern.*; +import gregtech.api.util.BlockInfo; +import gregtech.api.util.KeyUtil; +import gregtech.api.util.TextComponentUtil; +import gregtech.api.util.TextFormattingUtil; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.client.renderer.texture.Textures; +import gregtech.client.utils.TooltipHelper; +import gregtech.common.ConfigHolder; +import gregtech.common.blocks.BlockGlassCasing; +import gregtech.common.blocks.BlockMetalCasing; +import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.VisibleForTesting; + +import java.math.BigInteger; +import java.time.Duration; +import java.util.*; +import java.util.function.BooleanSupplier; +import java.util.function.Supplier; +import java.util.function.UnaryOperator; + +import static gregtech.api.util.RelativeDirection.*; + +public class MetaTileEntityWirelessPowerSubstation extends MultiblockWithDisplayBase + implements IControllable, ProgressBarMultiblock { + + private UUID playerUUID = null; + + private VirtualEnergyRegistry.VirtualEnergyContainer energyContainerWireless; + + private boolean initialize; + + // Structure Constants + public static final int MAX_BATTERY_LAYERS = 18; + private static final int MIN_CASINGS = 35; + + // Passive Drain Constants + // 1% capacity per 24 hours + public static final long PASSIVE_DRAIN_DIVISOR = 20 * 60 * 60 * 24 * 100; + // no more than 100kEU/t per storage block + public static final long PASSIVE_DRAIN_MAX_PER_STORAGE = 100_000L; + + // NBT Keys + private static final String NBT_ENERGY_BANK = "EnergyBank"; + + // Match Context Headers + private static final String PMC_BATTERY_HEADER = "PSSBattery_"; + + private static final BigInteger BIG_INTEGER_MAX_LONG = BigInteger.valueOf(Long.MAX_VALUE); + + private MetaTileEntityWirelessPowerSubstation.PowerStationEnergyBank energyBank; + private EnergyContainerList inputHatches; + private EnergyContainerList outputHatches; + private long passiveDrain; + private boolean isActive, isWorkingEnabled = true; + + // Stats tracked for UI display + private long netInLastSec; + private long averageInLastSec; + private long netOutLastSec; + private long averageOutLastSec; + + public MetaTileEntityWirelessPowerSubstation(ResourceLocation metaTileEntityId) { + super(metaTileEntityId); + this.initialize = true; + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { + return new MetaTileEntityWirelessPowerSubstation(metaTileEntityId); + } + + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + List inputs = new ArrayList<>(); + inputs.addAll(getAbilities(MultiblockAbility.INPUT_ENERGY)); + inputs.addAll(getAbilities(MultiblockAbility.SUBSTATION_INPUT_ENERGY)); + inputs.addAll(getAbilities(MultiblockAbility.INPUT_LASER)); + this.inputHatches = new EnergyContainerList(inputs); + + List outputs = new ArrayList<>(); + outputs.addAll(getAbilities(MultiblockAbility.OUTPUT_ENERGY)); + outputs.addAll(getAbilities(MultiblockAbility.SUBSTATION_OUTPUT_ENERGY)); + outputs.addAll(getAbilities(MultiblockAbility.OUTPUT_LASER)); + this.outputHatches = new EnergyContainerList(outputs); + + List parts = new ArrayList<>(); + for (Map.Entry battery : context.entrySet()) { + if (battery.getKey().startsWith(PMC_BATTERY_HEADER) && + battery.getValue() instanceof MetaTileEntityWirelessPowerSubstation.BatteryMatchWrapper wrapper) { + for (int i = 0; i < wrapper.amount; i++) { + parts.add(wrapper.partType); + } + } + } + if (parts.isEmpty()) { + // only empty batteries found in the structure + invalidateStructure(); + return; + } + if (this.energyBank == null) { + this.energyBank = new MetaTileEntityWirelessPowerSubstation.PowerStationEnergyBank(parts); + } else { + this.energyBank = energyBank.rebuild(parts); + } + this.passiveDrain = this.energyBank.getPassiveDrainPerTick(); + } + + @Override + public void invalidateStructure() { + // don't null out energyBank since it holds the stored energy, which + // we need to hold on to across rebuilds to not void all energy if a + // multiblock part or block other than the controller is broken. + inputHatches = null; + outputHatches = null; + passiveDrain = 0; + netInLastSec = 0; + averageInLastSec = 0; + netOutLastSec = 0; + averageOutLastSec = 0; + super.invalidateStructure(); + } + + @Override + protected void updateFormedValid() { + if (!getWorld().isRemote) { + if (getOffsetTimer() % 20 == 0) { + // active here is just used for rendering + setActive(energyBank.hasEnergy()); + averageInLastSec = netInLastSec / 20; + averageOutLastSec = netOutLastSec / 20; + netInLastSec = 0; + netOutLastSec = 0; + } + + if (isWorkingEnabled()) { + // Bank from Energy Input Hatches + long energyBanked = energyBank.fill(inputHatches.getEnergyStored()); + inputHatches.changeEnergy(-energyBanked); + netInLastSec += energyBanked; + + // Passive drain + long energyPassiveDrained = energyBank.drain(getPassiveDrain()); + netOutLastSec += energyPassiveDrained; + + // Debank to Dynamo Hatches + long energyDebanked = energyBank + .drain(outputHatches.getEnergyCapacity() - outputHatches.getEnergyStored()); + outputHatches.changeEnergy(energyDebanked); + netOutLastSec += energyDebanked; + + // Send to wireless network + if (!initialize) { + if(this.getOffsetTimer() % 1200 == 0) { + long tempEnergyBank; + + try { + tempEnergyBank = energyBank.getStored().longValueExact(); + } + catch (ArithmeticException e) { + tempEnergyBank = Long.MAX_VALUE; + } + + if (this.energyContainerWireless.getEnergyStored() < tempEnergyBank) { + this.energyContainerWireless.addEnergy(energyBank.drain((tempEnergyBank - this.energyContainerWireless.getEnergyStored()) / 2)); + } + else { + this.energyContainerWireless.remove((this.energyContainerWireless.getEnergyStored() - tempEnergyBank) / 2); + energyBank.fill((this.energyContainerWireless.getEnergyStored() - tempEnergyBank) / 2); + } + } + } + } + } + } + + public long getPassiveDrain() { + if (ConfigHolder.machines.enableMaintenance) { + int multiplier = 1 + getNumMaintenanceProblems(); + double modifier = getMaintenanceDurationMultiplier(); + return (long) (passiveDrain * multiplier * modifier); + } + return passiveDrain; + } + + @Override + public boolean isActive() { + return super.isActive() && this.isActive; + } + + public void setActive(boolean active) { + if (this.isActive != active) { + this.isActive = active; + markDirty(); + World world = getWorld(); + if (world != null && !world.isRemote) { + writeCustomData(GregtechDataCodes.WORKABLE_ACTIVE, buf -> buf.writeBoolean(active)); + } + } + } + + @Override + public boolean isWorkingEnabled() { + return this.isWorkingEnabled; + } + + @Override + public void setWorkingEnabled(boolean isWorkingAllowed) { + this.isWorkingEnabled = isWorkingAllowed; + markDirty(); + World world = getWorld(); + if (world != null && !world.isRemote) { + writeCustomData(GregtechDataCodes.WORKING_ENABLED, buf -> buf.writeBoolean(isWorkingEnabled)); + } + } + + @Override + public boolean shouldShowVoidingModeButton() { + return false; + } + + @NotNull + @Override + protected BlockPattern createStructurePattern() { + return FactoryBlockPattern.start(RIGHT, FRONT, UP) + .aisle("XXSXX", "XXXXX", "XXXXX", "XXXXX", "XXXXX") + .aisle("XXXXX", "XCCCX", "XCCCX", "XCCCX", "XXXXX") + .aisle("GGGGG", "GBBBG", "GBBBG", "GBBBG", "GGGGG").setRepeatable(1, MAX_BATTERY_LAYERS) + .aisle("GGGGG", "GGGGG", "GGGGG", "GGGGG", "GGGGG") + .where('S', selfPredicate()) + .where('C', states(getCasingState())) + .where('X', states(getCasingState()).setMinGlobalLimited(MIN_CASINGS) + .or(maintenancePredicate()) + .or(abilities(MultiblockAbility.INPUT_ENERGY, MultiblockAbility.SUBSTATION_INPUT_ENERGY, + MultiblockAbility.INPUT_LASER).setMinGlobalLimited(1)) + .or(abilities(MultiblockAbility.OUTPUT_ENERGY, MultiblockAbility.SUBSTATION_OUTPUT_ENERGY, + MultiblockAbility.OUTPUT_LASER).setMinGlobalLimited(1))) + .where('G', states(getGlassState())) + .where('B', BATTERY_PREDICATE.get()) + .build(); + } + + @Override + public List getMatchingShapes() { + List shapeInfo = new ArrayList<>(); + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder() + .aisle("CCCCC", "CCCCC", "GGGGG", "GGGGG", "GGGGG") + .aisle("CCCCC", "CCCCC", "GBBBG", "GBBBG", "GGGGG") + .aisle("CCCCC", "CCCCC", "GBBBG", "GBBBG", "GGGGG") + .aisle("CCCCC", "CCCCC", "GBBBG", "GBBBG", "GGGGG") + .aisle("ICSCO", "NCMCT", "GGGGG", "GGGGG", "GGGGG") + .where('S', GCYLTileEntities.WIRELESS_PSS, EnumFacing.SOUTH) + .where('C', getCasingState()) + .where('G', getGlassState()) + .where('I', MetaTileEntities.ENERGY_INPUT_HATCH[GTValues.HV], EnumFacing.SOUTH) + .where('N', MetaTileEntities.SUBSTATION_ENERGY_INPUT_HATCH[0], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ENERGY_OUTPUT_HATCH[GTValues.HV], EnumFacing.SOUTH) + .where('T', MetaTileEntities.SUBSTATION_ENERGY_OUTPUT_HATCH[0], EnumFacing.SOUTH) + .where('M', + () -> ConfigHolder.machines.enableMaintenance ? MetaTileEntities.MAINTENANCE_HATCH : + MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.PALLADIUM_SUBSTATION), + EnumFacing.SOUTH); + + GregTechAPI.PSS_BATTERIES.entrySet().stream() + // filter out empty batteries in example structures, though they are still + // allowed in the predicate (so you can see them on right-click) + .filter(entry -> entry.getValue().getCapacity() > 0) + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .forEach(entry -> shapeInfo.add(builder.where('B', entry.getKey()).build())); + + return shapeInfo; + } + + protected IBlockState getCasingState() { + return GCYLMetaBlocks.MULTIBLOCK_CASING2.getState(GCYLMultiblockCasing2.CasingType.SEABORGIUM_SUBSTATION); + } + + protected IBlockState getGlassState() { + return MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.FUSION_GLASS); + } + + protected static final Supplier BATTERY_PREDICATE = () -> new TraceabilityPredicate( + blockWorldState -> { + IBlockState state = blockWorldState.getBlockState(); + if (GregTechAPI.PSS_BATTERIES.containsKey(state)) { + IBatteryData battery = GregTechAPI.PSS_BATTERIES.get(state); + // Allow unfilled batteries in the structure, but do not add them to match context. + // This lets you use empty batteries as "filler slots" for convenience if desired. + if (battery.getTier() != -1 && battery.getCapacity() > 0) { + String key = PMC_BATTERY_HEADER + battery.getBatteryName(); + MetaTileEntityWirelessPowerSubstation.BatteryMatchWrapper wrapper = blockWorldState.getMatchContext().get(key); + if (wrapper == null) wrapper = new MetaTileEntityWirelessPowerSubstation.BatteryMatchWrapper(battery); + blockWorldState.getMatchContext().set(key, wrapper.increment()); + } + return true; + } + return false; + }, () -> GregTechAPI.PSS_BATTERIES.entrySet().stream() + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .map(entry -> new BlockInfo(entry.getKey(), null)) + .toArray(BlockInfo[]::new)) + .addTooltips("gregtech.multiblock.pattern.error.batteries"); + + @SideOnly(Side.CLIENT) + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { + return ClientHandler.SEABORGIUM_SUBSTATION_CASING; + } + + @SideOnly(Side.CLIENT) + @NotNull + @Override + protected ICubeRenderer getFrontOverlay() { + return Textures.POWER_SUBSTATION_OVERLAY; + } + + @Override + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + super.renderMetaTileEntity(renderState, translation, pipeline); + getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), this.isActive(), + this.isWorkingEnabled()); + } + + /* + @Override + protected ModularUI.Builder createUITemplate(EntityPlayer entityPlayer) { + ModularUI.Builder builder; + label38: { + builder = ModularUI.builder(GuiTextures.BACKGROUND, 198, 250); + if (this instanceof IProgressBarMultiblock) { + IProgressBarMultiblock progressMulti = (IProgressBarMultiblock)this; + if (progressMulti.showProgressBar()) { + builder.image(4, 4, 190, 151, GuiTextures.DISPLAY); + ProgressWidget progressBar; + if (progressMulti.getNumProgressBars() == 3) { + progressBar = (new ProgressWidget(() -> { + return progressMulti.getFillPercentage(0); + }, 4, 157, 62, 7, progressMulti.getProgressBarTexture(0), ProgressWidget.MoveType.HORIZONTAL)).setHoverTextConsumer((list) -> { + progressMulti.addBarHoverText(list, 0); + }); + builder.widget(progressBar); + progressBar = (new ProgressWidget(() -> { + return progressMulti.getFillPercentage(1); + }, 68, 157, 62, 7, progressMulti.getProgressBarTexture(1), ProgressWidget.MoveType.HORIZONTAL)).setHoverTextConsumer((list) -> { + progressMulti.addBarHoverText(list, 1); + }); + builder.widget(progressBar); + progressBar = (new ProgressWidget(() -> { + return progressMulti.getFillPercentage(2); + }, 132, 157, 62, 7, progressMulti.getProgressBarTexture(2), ProgressWidget.MoveType.HORIZONTAL)).setHoverTextConsumer((list) -> { + progressMulti.addBarHoverText(list, 2); + }); + builder.widget(progressBar); + } else if (progressMulti.getNumProgressBars() == 2) { + progressBar = (new ProgressWidget(() -> { + return progressMulti.getFillPercentage(0); + }, 4, 157, 94, 7, progressMulti.getProgressBarTexture(0), ProgressWidget.MoveType.HORIZONTAL)).setHoverTextConsumer((list) -> { + progressMulti.addBarHoverText(list, 0); + }); + builder.widget(progressBar); + progressBar = (new ProgressWidget(() -> { + return progressMulti.getFillPercentage(1); + }, 100, 157, 94, 7, progressMulti.getProgressBarTexture(1), ProgressWidget.MoveType.HORIZONTAL)).setHoverTextConsumer((list) -> { + progressMulti.addBarHoverText(list, 1); + }); + builder.widget(progressBar); + } else { + progressBar = (new ProgressWidget(() -> { + return progressMulti.getFillPercentage(0); + }, 4, 157, 190, 7, progressMulti.getProgressBarTexture(0), ProgressWidget.MoveType.HORIZONTAL)).setHoverTextConsumer((list) -> { + progressMulti.addBarHoverText(list, 0); + }); + builder.widget(progressBar); + } + + builder.widget((new IndicatorImageWidget(174, 135, 17, 17, this.getLogo())).setWarningStatus(this.getWarningLogo(), this::addWarningText).setErrorStatus(this.getErrorLogo(), this::addErrorText)); + break label38; + } + } + + builder.image(4, 4, 190, 159, GuiTextures.DISPLAY); + builder.widget((new IndicatorImageWidget(174, 101, 17, 17, this.getLogo())).setWarningStatus(this.getWarningLogo(), this::addWarningText).setErrorStatus(this.getErrorLogo(), this::addErrorText)); + } + + builder.label(9, 9, this.getMetaFullName(), 16777215); + builder.widget((new AdvancedTextWidget(9, 20, this::addDisplayText, 16777215)).setMaxWidthLimit(181).setClickHandler(this::handleDisplayClick)); + IControllable controllable = (IControllable)this.getCapability(GregtechTileCapabilities.CAPABILITY_CONTROLLABLE, (EnumFacing)null); + TextureArea var10007; + BooleanSupplier var10008; + if (controllable != null) { + var10007 = GuiTextures.BUTTON_POWER; + Objects.requireNonNull(controllable); + var10008 = controllable::isWorkingEnabled; + Objects.requireNonNull(controllable); + builder.widget(new ImageCycleButtonWidget(173, 225, 18, 18, var10007, var10008, controllable::setWorkingEnabled)); + builder.widget(new ImageWidget(173, 243, 18, 6, GuiTextures.BUTTON_POWER_DETAIL)); + } + + if (this.shouldShowVoidingModeButton()) { + builder.widget((new ImageCycleButtonWidget(173, 203, 18, 18, GuiTextures.BUTTON_VOID_MULTIBLOCK, 4, this::getVoidingMode, this::setVoidingMode)).setTooltipHoverString(MultiblockWithDisplayBase::getVoidingModeTooltip)); + } else { + builder.widget((new ImageWidget(173, 203, 18, 18, GuiTextures.BUTTON_VOID_NONE)).setTooltip("gregtech.gui.multiblock_voiding_not_supported")); + } + + label30: { + if (this instanceof IDistinctBusController) { + IDistinctBusController distinct = (IDistinctBusController)this; + if (distinct.canBeDistinct()) { + var10007 = GuiTextures.BUTTON_DISTINCT_BUSES; + Objects.requireNonNull(distinct); + var10008 = distinct::isDistinct; + Objects.requireNonNull(distinct); + builder.widget((new ImageCycleButtonWidget(173, 185, 18, 18, var10007, var10008, distinct::setDistinct)).setTooltipHoverString((i) -> { + return "gregtech.multiblock.universal.distinct_" + (i == 0 ? "disabled" : "enabled"); + })); + break label30; + } + } + + builder.widget((new ImageWidget(173, 185, 18, 18, GuiTextures.BUTTON_NO_DISTINCT_BUSES)).setTooltip("gregtech.multiblock.universal.distinct_not_supported")); + } + + builder.widget(this.getFlexButton(173, 167, 18, 18)); + builder.bindPlayerInventory(entityPlayer.inventory, 167); + return builder; + } + + */ + + @Override + protected void configureDisplayText(MultiblockUIBuilder builder) { + builder.setWorkingStatus(true, isActive() && isWorkingEnabled()) // transform into two-state system for display + .setWorkingStatusKeys( + "gregtech.multiblock.idling", + "gregtech.multiblock.idling", + "gregtech.machine.active_transformer.routing") + .addCustom((keyManager, uiSyncer) -> { + if (uiSyncer.syncBoolean(isStructureFormed())) { + BigInteger energyStored = uiSyncer.syncBigInt(energyBank != null ? energyBank.getStored() : BigInteger.valueOf(0)); + BigInteger energyCapacity = uiSyncer.syncBigInt(energyBank != null ? energyBank.getCapacity() : BigInteger.valueOf(0)); + long averageInLastSec = uiSyncer.syncLong(getAverageInLastSec()); + long averageOutLastSec = uiSyncer.syncLong(getAverageOutLastSec()); + long passiveDrainSync = uiSyncer.syncLong(getPassiveDrain()); + + // Stored EU line + IKey storedFormatted = KeyUtil.string( + TextFormatting.GOLD, + TextFormattingUtil.formatNumbers(energyStored) + " EU"); + keyManager.add(KeyUtil.lang( + TextFormatting.GRAY, + "gregtech.multiblock.power_substation.stored", + storedFormatted)); + + // EU Capacity line + IKey capacityFormatted = KeyUtil.string( + TextFormatting.GOLD, + TextFormattingUtil.formatNumbers(energyCapacity) + " EU"); + keyManager.add(KeyUtil.lang( + TextFormatting.GRAY, + "gregtech.multiblock.power_substation.capacity", + capacityFormatted)); + + // Passive Drain line + IKey passiveDrain = KeyUtil.string( + TextFormatting.DARK_RED, + TextFormattingUtil.formatNumbers(passiveDrainSync) + " EU/t"); + keyManager.add(KeyUtil.lang( + TextFormatting.GRAY, + "gregtech.multiblock.power_substation.passive_drain", + passiveDrain)); + + // Average EU IN line + IKey avgValue = KeyUtil.string( + TextFormatting.GREEN, + TextFormattingUtil.formatNumbers(averageInLastSec) + " EU/t"); + IKey base = KeyUtil.lang( + TextFormatting.GRAY, + "gregtech.multiblock.power_substation.average_in", + avgValue); + IKey hover = KeyUtil.lang( + TextFormatting.GRAY, + "gregtech.multiblock.power_substation.average_in_hover"); + keyManager.add(KeyUtil.setHover(base, hover)); + + // Average EU OUT line + avgValue = KeyUtil.string( + TextFormatting.RED, + TextFormattingUtil.formatNumbers(averageOutLastSec) + " EU/t"); + base = KeyUtil.lang( + TextFormatting.GRAY, + "gregtech.multiblock.power_substation.average_out", + avgValue); + hover = KeyUtil.lang( + TextFormatting.GRAY, + "gregtech.multiblock.power_substation.average_out_hover"); + keyManager.add(KeyUtil.setHover(base, hover)); + + // Time to fill/drain line + if (averageInLastSec > averageOutLastSec) { + IKey timeToFill = getTimeToFillDrainText(energyCapacity.subtract(energyStored) + .divide(BigInteger.valueOf((averageInLastSec - averageOutLastSec) * 20))); + timeToFill.style(TextFormatting.GREEN); + keyManager.add(KeyUtil.lang( + TextFormatting.GRAY, + "gregtech.multiblock.power_substation.time_to_fill", + timeToFill)); + } else if (averageInLastSec < averageOutLastSec) { + IKey timeToDrain = getTimeToFillDrainText( + energyStored.divide(BigInteger.valueOf( + (averageOutLastSec - averageInLastSec) * 20))); + timeToDrain.style(TextFormatting.RED); + keyManager.add(KeyUtil.lang( + TextFormatting.GRAY, + "gregtech.multiblock.power_substation.time_to_drain", + timeToDrain)); + } + } + + if(!uiSyncer.syncBoolean(initialize) && uiSyncer.syncBoolean(isStructureFormed())) { + long energyStoredContainer = uiSyncer.syncLong(this.energyContainerWireless.getEnergyStored()); + IKey wirelessFormatted = KeyUtil.string(TextFormatting.LIGHT_PURPLE, TextFormattingUtil.formatNumbers(energyStoredContainer) + " EU"); + try { + keyManager.add(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.wireless_pss.private", Objects.requireNonNull(this.getWorld().getPlayerEntityByUUID(this.playerUUID)).getName())); + keyManager.add(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.wireless_pss.wireless_eu", wirelessFormatted)); + } + catch (NullPointerException e) { + if (Objects.equals(this.playerUUID, new UUID(0, 0))) { + keyManager.add(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.wireless_pss.public")); + } + else { + keyManager.add(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.wireless_pss.player_offline")); + } + keyManager.add(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.wireless_pss.wireless_eu", wirelessFormatted)); + } + } + else + keyManager.add(KeyUtil.lang("gcyl.multiblock.wireless_pss.not_initialized")); + }) + .addWorkingStatusLine(); + + + + } + + @Override + protected void configureWarningText(MultiblockUIBuilder builder) { + builder.addCustom((keyManager, uiSyncer) -> { + long averageInLastSec = uiSyncer.syncLong(this.averageInLastSec); + long averageOutLastSec = uiSyncer.syncLong(this.averageOutLastSec); + BigInteger stored = uiSyncer.syncBigInt(energyBank != null ? energyBank.getStored() : BigInteger.valueOf(0)); + if (uiSyncer.syncBoolean(isStructureFormed())) { + if ( averageInLastSec < averageOutLastSec) { // decreasing + BigInteger timeToDrainSeconds = stored.divide(BigInteger.valueOf((averageOutLastSec - averageInLastSec) * 20)); + if (timeToDrainSeconds.compareTo(BigInteger.valueOf(60 * 60)) < 0) { // less than 1 hour left + keyManager.add(KeyUtil.lang( + TextFormatting.YELLOW, + "gregtech.multiblock.power_substation.under_one_hour_left")); + } + } + } + }); + } + + private static IKey getTimeToFillDrainText(BigInteger timeToFillSeconds) { + if (timeToFillSeconds.compareTo(BIG_INTEGER_MAX_LONG) > 0) { + // too large to represent in a java Duration + timeToFillSeconds = BIG_INTEGER_MAX_LONG; + } + + Duration duration = Duration.ofSeconds(timeToFillSeconds.longValue()); + String key; + long fillTime; + if (duration.getSeconds() <= 180) { + fillTime = duration.getSeconds(); + key = "gregtech.multiblock.power_substation.time_seconds"; + } else if (duration.toMinutes() <= 180) { + fillTime = duration.toMinutes(); + key = "gregtech.multiblock.power_substation.time_minutes"; + } else if (duration.toHours() <= 72) { + fillTime = duration.toHours(); + key = "gregtech.multiblock.power_substation.time_hours"; + } else if (duration.toDays() <= 730) { // 2 years + fillTime = duration.toDays(); + key = "gregtech.multiblock.power_substation.time_days"; + } else if (duration.toDays() / 365 < 1_000_000) { + fillTime = duration.toDays() / 365; + key = "gregtech.multiblock.power_substation.time_years"; + } else { + return KeyUtil.lang("gregtech.multiblock.power_substation.time_forever"); + } + + return KeyUtil.lang(key, TextFormattingUtil.formatNumbers(fillTime)); + } + + @Override + public boolean onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, EnumFacing facing, + CuboidRayTraceResult hitResult) { + if(!getWorld().isRemote) { + if (this.initialize) { + if(playerIn.isSneaking()) { + this.playerUUID = playerIn.getUniqueID(); + this.energyContainerWireless = VirtualEnergyRegistry.getContainerCreate(makeEnergyContainerName(), this.playerUUID); + this.initialize = false; + playerIn.sendStatusMessage(new TextComponentTranslation("gcyl.wireless_initialized_private"), false); + } + else { + this.playerUUID = new UUID(0,0); + this.energyContainerWireless = VirtualEnergyRegistry.getContainerCreate(makeEnergyContainerName(), this.playerUUID); + this.initialize = false; + playerIn.sendStatusMessage(new TextComponentTranslation("gcyl.wireless_initialized_public"), false); + } + } + } + return true; + } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound data) { + super.writeToNBT(data); + data.setBoolean("isActive", isActive); + data.setBoolean("isWorkingEnabled", isWorkingEnabled); + if (energyBank != null) { + data.setTag(NBT_ENERGY_BANK, energyBank.writeToNBT(new NBTTagCompound())); + } + data.setBoolean("Initialized", initialize); + data.setString("PlacedUUID", playerUUID == null ? "null" : playerUUID.toString()); + return data; + } + + @Override + public void readFromNBT(NBTTagCompound data) { + super.readFromNBT(data); + isActive = data.getBoolean("isActive"); + isWorkingEnabled = data.getBoolean("isWorkingEnabled"); + if (data.hasKey(NBT_ENERGY_BANK)) { + energyBank = new MetaTileEntityWirelessPowerSubstation.PowerStationEnergyBank(data.getCompoundTag(NBT_ENERGY_BANK)); + } + String uuidStr = data.getString("PlacedUUID"); + this.playerUUID = uuidStr.equals("null") ? null : UUID.fromString(uuidStr); + this.initialize = data.getBoolean("Initialized"); + updateEnergyLink(); + } + + @Override + public void writeInitialSyncData(PacketBuffer buf) { + super.writeInitialSyncData(buf); + buf.writeBoolean(isActive); + buf.writeBoolean(isWorkingEnabled); + buf.writeBoolean(this.initialize); + buf.writeString(this.playerUUID == null ? "null" : this.playerUUID.toString()); + } + + @Override + public void receiveInitialSyncData(PacketBuffer buf) { + super.receiveInitialSyncData(buf); + isActive = buf.readBoolean(); + isWorkingEnabled = buf.readBoolean(); + this.initialize = buf.readBoolean(); + String uuidStr = buf.readString(36); + this.playerUUID = uuidStr.equals("null") ? null : UUID.fromString(uuidStr); + updateEnergyLink(); + } + + @Override + public void receiveCustomData(int dataId, @NotNull PacketBuffer buf) { + super.receiveCustomData(dataId, buf); + if (dataId == GregtechDataCodes.WORKABLE_ACTIVE) { + isActive = buf.readBoolean(); + scheduleRenderUpdate(); + } else if (dataId == GregtechDataCodes.WORKING_ENABLED) { + isWorkingEnabled = buf.readBoolean(); + scheduleRenderUpdate(); + } + } + + @Override + public T getCapability(Capability capability, EnumFacing side) { + if (capability == GregtechTileCapabilities.CAPABILITY_CONTROLLABLE) { + return GregtechTileCapabilities.CAPABILITY_CONTROLLABLE.cast(this); + } + return super.getCapability(capability, side); + } + + @Override + public void addInformation(ItemStack stack, @Nullable World world, @NotNull List tooltip, + boolean advanced) { + tooltip.add(TextFormatting.LIGHT_PURPLE + I18n.format("gcyl.machine.wireless_power_substation.tooltip1")); + tooltip.add(TooltipHelper.BLINKING_RED + I18n.format("gcyl.machine.wireless_power_substation.tooltip4")); + tooltip.add(TextFormatting.LIGHT_PURPLE + I18n.format("gcyl.machine.wireless_power_substation.tooltip2")); + tooltip.add(TextFormatting.RED + I18n.format("gcyl.machine.wireless_power_substation.tooltip3")); + tooltip.add(I18n.format("gregtech.machine.power_substation.tooltip1")); + tooltip.add(I18n.format("gregtech.machine.power_substation.tooltip2")); + tooltip.add(I18n.format("gregtech.machine.power_substation.tooltip3", MAX_BATTERY_LAYERS)); + tooltip.add(I18n.format("gregtech.machine.power_substation.tooltip4")); + tooltip.add(I18n.format("gregtech.machine.power_substation.tooltip5", PASSIVE_DRAIN_MAX_PER_STORAGE)); + tooltip.add(I18n.format("gregtech.machine.power_substation.tooltip6") + TooltipHelper.RAINBOW_SLOW + + I18n.format("gregtech.machine.power_substation.tooltip6.5")); + } + + protected void updateEnergyLink() { + this.energyContainerWireless = VirtualEnergyRegistry.getContainerCreate(makeEnergyContainerName(), this.playerUUID); + this.markDirty(); + } + + private String makeEnergyContainerName() {return "EContainer#";} + + public String getStored() { + if (energyBank == null) { + return "0"; + } + return TextFormattingUtil.formatNumbers(energyBank.getStored()); + } + + public long getStoredLong() { + if (energyBank == null) { + return 0; + } + return energyBank.getStored().longValue() & ~(1L << 63); + } + + public long getCapacityLong() { + if (energyBank == null) { + return 0; + } + return energyBank.getCapacity().longValue() & ~(1L << 63); + } + + public String getCapacity() { + if (energyBank == null) { + return "0"; + } + return TextFormattingUtil.formatNumbers(energyBank.getCapacity()); + } + + public long getAverageInLastSec() { + return averageInLastSec; + } + + public long getAverageOutLastSec() { + return averageOutLastSec; + } + + + @Override + public int getProgressBarCount() { + return 1; + } + + @Override + public void registerBars(List> bars, PanelSyncManager syncManager) { + BigIntSyncValue energyStoredValue = new BigIntSyncValue( + () -> energyBank == null ? BigInteger.ZERO : energyBank.getStored(), null); + BigIntSyncValue energyCapacityValue = new BigIntSyncValue( + () -> energyBank == null ? BigInteger.ZERO : energyBank.getCapacity(), null); + syncManager.syncValue("energy_stored", energyStoredValue); + syncManager.syncValue("energy_capacity", energyCapacityValue); + + bars.add(b -> b + .progress( + () -> energyStoredValue.getValue().doubleValue() / energyCapacityValue.getValue().doubleValue()) + .texture(GTGuiTextures.PROGRESS_BAR_MULTI_ENERGY_YELLOW) + .tooltipBuilder(t -> { + if (isStructureFormed()) { + t.addLine(IKey.lang("gregtech.multiblock.energy_stored", energyStoredValue.getValue(), + energyCapacityValue.getValue())); + } else { + t.addLine(IKey.lang("gregtech.multiblock.invalid_structure")); + } + })); + } + + public static class PowerStationEnergyBank { + + private static final String NBT_SIZE = "Size"; + private static final String NBT_STORED = "Stored"; + private static final String NBT_MAX = "Max"; + + private final long[] storage; + private final long[] maximums; + private final BigInteger capacity; + private int index; + + public PowerStationEnergyBank(List batteries) { + storage = new long[batteries.size()]; + maximums = new long[batteries.size()]; + for (int i = 0; i < batteries.size(); i++) { + maximums[i] = batteries.get(i).getCapacity(); + } + capacity = summarize(maximums); + } + + public PowerStationEnergyBank(NBTTagCompound storageTag) { + int size = storageTag.getInteger(NBT_SIZE); + storage = new long[size]; + maximums = new long[size]; + for (int i = 0; i < size; i++) { + NBTTagCompound subtag = storageTag.getCompoundTag(String.valueOf(i)); + if (subtag.hasKey(NBT_STORED)) { + storage[i] = subtag.getLong(NBT_STORED); + } + maximums[i] = subtag.getLong(NBT_MAX); + } + capacity = summarize(maximums); + } + + private NBTTagCompound writeToNBT(NBTTagCompound compound) { + compound.setInteger(NBT_SIZE, storage.length); + for (int i = 0; i < storage.length; i++) { + NBTTagCompound subtag = new NBTTagCompound(); + if (storage[i] > 0) { + subtag.setLong(NBT_STORED, storage[i]); + } + subtag.setLong(NBT_MAX, maximums[i]); + compound.setTag(String.valueOf(i), subtag); + } + return compound; + } + + /** + * Rebuild the power storage with a new list of batteries. + * Will use existing stored power and try to map it onto new batteries. + * If there was more power before the rebuild operation, it will be lost. + */ + public PowerStationEnergyBank rebuild(@NotNull List batteries) { + if (batteries.isEmpty()) { + throw new IllegalArgumentException("Cannot rebuild Power Substation power bank with no batteries!"); + } + PowerStationEnergyBank newStorage = new MetaTileEntityWirelessPowerSubstation.PowerStationEnergyBank(batteries); + for (long stored : storage) { + newStorage.fill(stored); + } + return newStorage; + } + + /** @return Amount filled into storage */ + public long fill(long amount) { + if (amount < 0) throw new IllegalArgumentException("Amount cannot be negative!"); + + // ensure index + if (index != storage.length - 1 && storage[index] == maximums[index]) { + index++; + } + + long maxFill = Math.min(maximums[index] - storage[index], amount); + + // storage is completely full + if (maxFill == 0 && index == storage.length - 1) { + return 0; + } + + // fill this "battery" as much as possible + storage[index] += maxFill; + amount -= maxFill; + + // try to fill other "batteries" if necessary + if (amount > 0 && index != storage.length - 1) { + return maxFill + fill(amount); + } + + // other fill not necessary, either because the storage is now completely full, + // or we were able to consume all the energy in this "battery" + return maxFill; + } + + /** @return Amount drained from storage */ + public long drain(long amount) { + if (amount < 0) throw new IllegalArgumentException("Amount cannot be negative!"); + + // ensure index + if (index != 0 && storage[index] == 0) { + index--; + } + + long maxDrain = Math.min(storage[index], amount); + + // storage is completely empty + if (maxDrain == 0 && index == 0) { + return 0; + } + + // drain this "battery" as much as possible + storage[index] -= maxDrain; + amount -= maxDrain; + + // try to drain other "batteries" if necessary + if (amount > 0 && index != 0) { + index--; + return maxDrain + drain(amount); + } + + // other drain not necessary, either because the storage is now completely empty, + // or we were able to drain all the energy from this "battery" + return maxDrain; + } + + public BigInteger getCapacity() { + return capacity; + } + + public BigInteger getStored() { + return summarize(storage); + } + + public boolean hasEnergy() { + for (long l : storage) { + if (l > 0) return true; + } + return false; + } + + private static BigInteger summarize(long[] values) { + BigInteger retVal = BigInteger.ZERO; + long currentSum = 0; + for (long value : values) { + if (currentSum != 0 && value > Long.MAX_VALUE - currentSum) { + // will overflow if added + retVal = retVal.add(BigInteger.valueOf(currentSum)); + currentSum = 0; + } + currentSum += value; + } + if (currentSum != 0) { + retVal = retVal.add(BigInteger.valueOf(currentSum)); + } + return retVal; + } + + @VisibleForTesting + public long getPassiveDrainPerTick() { + long[] maximumsExcl = new long[maximums.length]; + int index = 0; + int numExcl = 0; + for (long maximum : maximums) { + if (maximum / PASSIVE_DRAIN_DIVISOR >= PASSIVE_DRAIN_MAX_PER_STORAGE) { + numExcl++; + } else { + maximumsExcl[index++] = maximum; + } + } + maximumsExcl = Arrays.copyOf(maximumsExcl, index); + BigInteger capacityExcl = summarize(maximumsExcl); + + return capacityExcl.divide(BigInteger.valueOf(PASSIVE_DRAIN_DIVISOR)) + .add(BigInteger.valueOf(PASSIVE_DRAIN_MAX_PER_STORAGE * numExcl)) + .longValue(); + } + } + + private static class BatteryMatchWrapper { + + private final IBatteryData partType; + private int amount; + + public BatteryMatchWrapper(IBatteryData partType) { + this.partType = partType; + } + + public MetaTileEntityWirelessPowerSubstation.BatteryMatchWrapper increment() { + amount++; + return this; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/MetaTileEntityModuleBase.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/MetaTileEntityModuleBase.java new file mode 100644 index 00000000..3a01880c --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/MetaTileEntityModuleBase.java @@ -0,0 +1,284 @@ +package com.fulltrix.gcyl.machines.multi.advance.elevator; + +import com.fulltrix.gcyl.api.multi.ISpaceElevatorProvider; +import com.fulltrix.gcyl.api.multi.ISpaceElevatorReceiver; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.elevator.ElevatorCasing; +import com.fulltrix.gcyl.client.ClientHandler; +import gregtech.api.GTValues; +import gregtech.api.capability.GregtechDataCodes; +import gregtech.api.capability.GregtechTileCapabilities; +import gregtech.api.capability.IEnergyContainer; +import gregtech.api.capability.IWorkable; +import gregtech.api.capability.impl.EnergyContainerHandler; +import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase; +import gregtech.api.pattern.BlockPattern; +import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.PatternMatchContext; +import gregtech.api.pattern.TraceabilityPredicate; +import gregtech.api.util.GTLog; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.client.renderer.texture.Textures; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public abstract class MetaTileEntityModuleBase extends MultiblockWithDisplayBase implements ISpaceElevatorReceiver, IWorkable { + + protected final int tier; + protected final int moduleTier; + protected final int minMotorTier; + protected final long energyConsumption; + protected ISpaceElevatorProvider spaceElevator; + protected IEnergyContainer energyContainer; + + protected boolean isActive; + protected int maxProgress; + protected int progressTime = 0; + protected boolean isWorkingEnabled = false; + + public MetaTileEntityModuleBase(ResourceLocation metaTileEntityId, int tier, int moduleTier, int minMotorTier) { + super(metaTileEntityId); + this.tier = tier; + this.moduleTier = moduleTier; + this.minMotorTier = minMotorTier; + this.energyConsumption = (long) (Math.pow(4, this.tier + 2) / 2.0); + this.energyContainer = new EnergyContainerHandler(this, (long) (160008000L * Math.pow(4, this.tier - 9)), this.energyConsumption, 1, 0, 0); + } + + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + initializeAbilities(); + } + + @Override + public void checkStructurePattern() { + if(getSpaceElevator() != null) { + if(getSpaceElevator().getMotorTier() >= minMotorTier) { + super.checkStructurePattern(); + } + } + } + + protected abstract void initializeAbilities(); + + @Override + public void updateFormedValid() { + if(this.getOffsetTimer() % 20 == 0 && getSpaceElevator() != null) { + if (this.energyContainer.getEnergyCapacity() != this.energyContainer.getEnergyStored() && getSpaceElevator().getEnergyContainerForModules().getEnergyStored() > this.energyConsumption * 20) { + long energyToDraw = this.energyContainer.getEnergyCapacity() - this.energyContainer.getEnergyStored(); + getSpaceElevator().getEnergyContainerForModules().removeEnergy(energyToDraw); + this.energyContainer.addEnergy(energyToDraw); + } + } else if (getSpaceElevator() == null) { + setWorkingEnabled(false); + } + } + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + setSpaceElevator(null); + } + + @Override + protected @NotNull BlockPattern createStructurePattern() { + return FactoryBlockPattern.start() + .aisle("C","C","C","C","C") + .aisle("C","C","C","S","C") + .where('S', selfPredicate()) + .where('C', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_BASE_CASING)).or(abilities().setPreviewCount(0))) + .build(); + } + + protected abstract TraceabilityPredicate abilities(); + + @Override + public boolean hasMaintenanceMechanics() { + return false; + } + + @SideOnly(Side.CLIENT) + @NotNull + @Override + protected ICubeRenderer getFrontOverlay() { + return Textures.DATA_BANK_OVERLAY; + } + + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { + return ClientHandler.ELEVATOR_CASING; + } + + @Override + public @Nullable ISpaceElevatorProvider getSpaceElevator() { + return this.spaceElevator; + } + + @Override + public void setSpaceElevator(ISpaceElevatorProvider provider) { + this.spaceElevator = provider; + } + + public IEnergyContainer getEnergyContainer() { + if(getSpaceElevator() == null || getSpaceElevator().getEnergyContainerForModules() == null) { + return new EnergyContainerHandler(this, 0, 0, 0, 0, 0); + } + else + return this.energyContainer; + } + + @Override + public void sentWorkingDisabled() { + setWorkingEnabled(false); + } + + @Override + public void sentWorkingEnabled() { + setWorkingEnabled(true); + } + + @Override + public T getCapability(Capability capability, EnumFacing side) { + if (capability == GregtechTileCapabilities.CAPABILITY_WORKABLE) + return GregtechTileCapabilities.CAPABILITY_WORKABLE.cast(this); + if (capability == GregtechTileCapabilities.CAPABILITY_CONTROLLABLE) + return GregtechTileCapabilities.CAPABILITY_CONTROLLABLE.cast(this); + return super.getCapability(capability, side); + } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound data) { + super.writeToNBT(data); + data.setInteger("progressTime", this.progressTime); + data.setInteger("maxProgress", this.maxProgress); + data.setBoolean("isActive", this.isActive); + data.setBoolean("isWorkingEnabled", this.isWorkingEnabled); + return data; + } + + @Override + public void readFromNBT(NBTTagCompound data) { + super.readFromNBT(data); + this.progressTime = data.getInteger("progressTime"); + this.maxProgress = data.getInteger("maxProgress"); + this.isActive = data.getBoolean("isActive"); + this.isWorkingEnabled = data.getBoolean("isWorkingEnabled"); + } + + @Override + public void writeInitialSyncData(PacketBuffer buf) { + super.writeInitialSyncData(buf); + buf.writeInt(this.progressTime); + buf.writeInt(this.maxProgress); + buf.writeBoolean(this.isActive); + buf.writeBoolean(this.isWorkingEnabled); + } + + @Override + public void receiveInitialSyncData(PacketBuffer buf) { + super.receiveInitialSyncData(buf); + this.progressTime = buf.readInt(); + this.maxProgress = buf.readInt(); + setActive(buf.readBoolean()); + setWorkingEnabled(buf.readBoolean()); + } + + @Override + public void receiveCustomData(int dataId, PacketBuffer buf) { + super.receiveCustomData(dataId, buf); + if (dataId == GregtechDataCodes.WORKABLE_ACTIVE) { + this.setActive(buf.readBoolean()); + scheduleRenderUpdate(); + } else if (dataId == GregtechDataCodes.WORKING_ENABLED) { + this.setWorkingEnabled(buf.readBoolean()); + scheduleRenderUpdate(); + } + + } + @Override + public boolean isActive() { + return this.isActive && isWorkingEnabled(); + } + + public void setActive(boolean active) { + if (this.isActive != active) { + this.isActive = active; + this.markDirty(); + World world = this.getWorld(); + if (world != null && !world.isRemote) { + this.writeCustomData(GregtechDataCodes.WORKABLE_ACTIVE, buf -> buf.writeBoolean(active)); + } + } + } + + @Override + public int getProgress() { + return this.progressTime; + } + + @Override + public int getMaxProgress() { + return this.maxProgress; + } + + @Override + public boolean isWorkingEnabled() { + return this.isWorkingEnabled; + } + + protected void setMaxProgress(int progress) { + this.maxProgress = progress; + } + + @Override + public void setWorkingEnabled(boolean workingEnabled) { + initializeAbilities(); + this.isWorkingEnabled = workingEnabled; + this.markDirty(); + World world = this.getWorld(); + if (world != null && !world.isRemote) { + this.writeCustomData(GregtechDataCodes.WORKING_ENABLED, + buf -> buf.writeBoolean(workingEnabled)); + } + } + + protected boolean drainEnergy(boolean simulate, long EU) { + long resultEnergy = energyContainer.getEnergyStored() - EU; + if (resultEnergy >= 0L && resultEnergy <= energyContainer.getEnergyCapacity()) { + if (!simulate) + energyContainer.changeEnergy(-EU); + return true; + } + return false; + } + + protected boolean drainEnergy(boolean simulate) { + long resultEnergy = energyContainer.getEnergyStored() - energyContainer.getInputVoltage(); + if (resultEnergy >= 0L && resultEnergy <= energyContainer.getEnergyCapacity()) { + if (!simulate) + energyContainer.changeEnergy(-energyContainer.getInputVoltage()); + return true; + } + return false; + } + + @Override + public String getNameForDisplayCount() { + return this.getMetaName() + ".display_count"; + } + + public int getProgressPercent() { + return (int) ((1.0F * getProgress() / getMaxProgress()) * 100); + } + +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/MetaTileEntityModuleRecipeBase.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/MetaTileEntityModuleRecipeBase.java new file mode 100644 index 00000000..7e7beaba --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/MetaTileEntityModuleRecipeBase.java @@ -0,0 +1,137 @@ +package com.fulltrix.gcyl.machines.multi.advance.elevator; + +import com.fulltrix.gcyl.api.multi.ISpaceElevatorProvider; +import com.fulltrix.gcyl.api.multi.ISpaceElevatorReceiver; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.elevator.ElevatorCasing; +import com.fulltrix.gcyl.client.ClientHandler; +import gregtech.api.capability.IEnergyContainer; +import gregtech.api.capability.impl.EnergyContainerHandler; +import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.pattern.BlockPattern; +import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.TraceabilityPredicate; +import gregtech.api.recipes.RecipeMap; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.client.renderer.texture.Textures; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + + +public abstract class MetaTileEntityModuleRecipeBase extends RecipeMapMultiblockController implements ISpaceElevatorReceiver { + + protected final int tier; + protected final int moduleTier; + protected final int minMotorTier; + protected final long energyConsumption; + protected ISpaceElevatorProvider spaceElevator; + + public MetaTileEntityModuleRecipeBase(ResourceLocation metaTileEntityId, RecipeMap recipeMap, int tier, int moduleTier, int minMotorTier) { + super(metaTileEntityId, recipeMap); + this.moduleTier = moduleTier; + this.minMotorTier = minMotorTier; + this.tier = tier; + this.energyConsumption = (long) (Math.pow(4, this.tier + 2) / 2.0); + this.energyContainer = new EnergyContainerHandler(this, (long) (160008000L * Math.pow(4, this.tier - 9)), this.energyConsumption, 1, 0, 0); + } + + @Override + public void checkStructurePattern() { + if(getSpaceElevator() != null) { + if(getSpaceElevator().getMotorTier() >= minMotorTier) { + super.checkStructurePattern(); + } + } + } + + @Override + public abstract void initializeAbilities(); + + @Override + public void updateFormedValid() { + super.updateFormedValid(); + if(this.getOffsetTimer() % 20 == 0 && getSpaceElevator() != null) { + if (this.energyContainer.getEnergyCapacity() != this.energyContainer.getEnergyStored() && getSpaceElevator().getEnergyContainerForModules().getEnergyStored() > this.energyConsumption * 20) { + long energyToDraw = this.energyContainer.getEnergyCapacity() - this.energyContainer.getEnergyStored(); + getSpaceElevator().getEnergyContainerForModules().removeEnergy(energyToDraw); + this.energyContainer.addEnergy(energyToDraw); + } + } else if (getSpaceElevator() == null) { + this.recipeMapWorkable.setWorkingEnabled(false); + } + } + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + setSpaceElevator(null); + } + + @Override + protected @NotNull BlockPattern createStructurePattern() { + return FactoryBlockPattern.start() + .aisle("C","C","C","C","C") + .aisle("C","C","C","S","C") + .where('S', selfPredicate()) + .where('C', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_BASE_CASING)).or(abilities().setPreviewCount(0))) + .build(); + } + + protected abstract TraceabilityPredicate abilities(); + + @Override + public boolean hasMaintenanceMechanics() { + return false; + } + + @SideOnly(Side.CLIENT) + @NotNull + @Override + protected ICubeRenderer getFrontOverlay() { + return Textures.DATA_BANK_OVERLAY; + } + + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { + return ClientHandler.ELEVATOR_CASING; + } + + @Override + public @Nullable ISpaceElevatorProvider getSpaceElevator() { + return this.spaceElevator; + } + + @Override + public void setSpaceElevator(ISpaceElevatorProvider provider) { + this.spaceElevator = provider; + } + + @Override + public IEnergyContainer getEnergyContainer() { + if(getSpaceElevator() == null || getSpaceElevator().getEnergyContainerForModules() == null) { + return new EnergyContainerHandler(this, 0, 0, 0, 0, 0); + } + else + return this.energyContainer; + } + + @Override + public void sentWorkingDisabled() { + this.recipeMapWorkable.setWorkingEnabled(false); + } + + @Override + public void sentWorkingEnabled() {this.recipeMapWorkable.setWorkingEnabled(true);} + + @Override + public String getNameForDisplayCount() { + return this.getMetaName() + ".display_count"; + } + +} + + diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/MetaTileEntitySpaceElevator.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/MetaTileEntitySpaceElevator.java new file mode 100644 index 00000000..2c248c56 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/MetaTileEntitySpaceElevator.java @@ -0,0 +1,555 @@ +package com.fulltrix.gcyl.machines.multi.advance.elevator; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.cleanroommc.modularui.factory.PosGuiData; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.utils.serialization.ByteBufAdapters; +import com.cleanroommc.modularui.value.sync.BooleanSyncValue; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.cleanroommc.modularui.widget.EmptyWidget; +import com.cleanroommc.modularui.widget.Widget; +import com.cleanroommc.modularui.widgets.ButtonWidget; +import com.cleanroommc.modularui.widgets.CycleButtonWidget; +import com.cleanroommc.modularui.widgets.ToggleButton; +import com.cleanroommc.modularui.widgets.layout.Flow; +import com.fulltrix.gcyl.api.block.IElevatorMotorTier; +import com.fulltrix.gcyl.api.multi.ISpaceElevatorProvider; +import com.fulltrix.gcyl.api.multi.ISpaceElevatorReceiver; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.elevator.ElevatorCasing; +import com.fulltrix.gcyl.client.ClientHandler; +import gregtech.api.capability.IEnergyContainer; +import gregtech.api.capability.IOpticalComputationHatch; +import gregtech.api.capability.IOpticalComputationProvider; +import gregtech.api.capability.impl.EnergyContainerList; +import gregtech.api.gui.GuiTextures; +import gregtech.api.gui.ModularUI; +import gregtech.api.gui.widgets.*; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIFactory; +import gregtech.api.pattern.BlockPattern; +import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.PatternMatchContext; +import gregtech.api.pattern.TraceabilityPredicate; +import gregtech.api.util.KeyUtil; +import gregtech.api.util.Mods; +import gregtech.api.util.TextComponentUtil; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.client.renderer.texture.Textures; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats; +import micdoodle8.mods.galacticraft.core.util.WorldUtil; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; + +import static com.fulltrix.gcyl.api.pattern.TraceabilityPredicates.elevatorMotors; +import static gregtech.api.unification.material.Materials.Neutronium; +import static gregtech.api.util.RelativeDirection.*; + +public class MetaTileEntitySpaceElevator extends MultiblockWithDisplayBase implements ISpaceElevatorProvider { + + protected IEnergyContainer energyContainer; + protected IOpticalComputationProvider computationProvider; + protected int motorTier = 0; + private boolean isExtended = false; + private final Collection spaceElevatorReceivers = ConcurrentHashMap.newKeySet(); //TODO fix by using iterator on modification + + public MetaTileEntitySpaceElevator(ResourceLocation metaTileEntityId) { + super(metaTileEntityId); + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEntity) { + return new MetaTileEntitySpaceElevator(metaTileEntityId); + } + + @Override + public void update() { + super.update(); + if(!isStructureFormed()) { + this.spaceElevatorReceivers.forEach(ISpaceElevatorReceiver::sentWorkingDisabled); + } + } + + @Override + protected void updateFormedValid() { + if(!this.spaceElevatorReceivers.isEmpty()) { + if(!checkModules()) { + invalidateStructure(); + } + } + if(this.getOffsetTimer() % 20 == 0) { + this.spaceElevatorReceivers.forEach(s -> { + if(s.getSpaceElevator() == null) + this.spaceElevatorReceivers.remove(s); + }); + } + } + + @Override + protected @NotNull BlockPattern createStructurePattern() { + if(!this.isExtended) { + return FactoryBlockPattern.start(RIGHT, DOWN, FRONT) + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " FF FF ", " AAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " D D ", " FFFFF FFFFF ", " AAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " DDDDE EDDDD ", " FFFFFFF FFFFFFF ", " AAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DD DE ED DD ", " FFFFFFD DFFFFFF ", " AAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " D D ", " FFF FFF ", " AAAAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " ", " ", " AAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " DE ED ", " ", " ", " ", " AAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " HDE EDH ", " DE ED ", " DE ED ", " DE ED ", " ", " ", " ", " ", " ", " AAAAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " DE ED ", " HH DE ED HH ", " ", " ", " ", " ", " V V V ", " V V V ", " V V V ", " V V V ", " AAAAAAAAAAAAV V VAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " ", " E E ", " EHH HHE ", " E E ", " E E ", " E E ", " E E ", " E V V V E ", " E I I I E ", " E V V V E ", " FF E V V V E FF ", " AAAAAAAAAAAAV V VAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " E E ", " E E ", " E E ", " E E ", " E E ", " HE EH ", " ", " ", " ", " ", " ", " ", " D D ", " FFF F F F FFF ", " AAAAAAAAAAAAA AAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " ", " ", " E E ", " E E ", " E E ", " E E ", " E E ", " ", " ", " H H ", " ", " ", " ", " ", " ", " ", " D D ", " FFF F F F FFF ", " AAAAAAAAAAAAA AAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " ", " ", " ", " ", " ", " HH HH ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " ", " ", " ", " ", " ", " H H ", " ", " ", " ", " ", " ", " ", " D D ", " FFF FFFFFFF FFF ", " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " FFF ", " ", " ", " ", " ", " ", " ", " ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " HE EH ", " E E ", " E E ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " H H ", " ", " ", " ", " ", " ", " ", " D D ", " FFF FFFFFFFFF FFF ", " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" FFF ", " E ", " E ", " E ", " E ", " E ", " F F ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " ", " ", " FFF ", " ", " ", " H H ", " ", " ", " ", " ", " ", " ", " FFF ", " ", " ", " ", " ", " H H ", " ", " ", " ", " ", " XXX ", " X~X ", " D XXX D ", " FFF FFFFFFFFFFF FFF ", " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" F D F ", " D ", " D ", " D ", " D ", " D ", " F D F ", " D ", " D D D ", " D D D ", " D D D ", " D D D ", " D D D ", " D D D ", " D D D ", " DD D DD ", " D D D ", " D D D ", " D F D F D ", " D C D ", " D C D ", " D C D ", " D C D ", " DD C DD ", " D C D ", " D C D ", " D C D ", " DD C DD ", " D FDCDF D ", " D DCD D ", " DD DCD DD ", " D DCD D ", " D DCD D ", " DD DDCDD DD ", " D D C D D ", " D D C D D ", " DD D C D DD ", " D D C D D ", " DD VV XDCDX VV DD ", " DD VI XDCDX IV DD ", " DDDD VV XDCDX VV DDDD ", "FFFD VVFFFFFDDDDDFFFFFVV DFFF", "AAAAAAAAVV AAAXXXXXAAA VVAAAAAAAA") + .aisle(" F F ", " ", " ", " ", " ", " ", " F F ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " EE EE ", " EE EE ", " E E ", " E E ", " E F F E ", " E E ", " E E ", " E E ", " EE EE ", " EE EE ", " E E ", " E E ", " EE EE ", " EE EE ", " E FD DF E ", " EE D D EE ", " EE D D EE ", " E D D E ", " EE D D EE ", " EE D D EE ", " E E ", " EE EE ", " EE EE ", " EE EE ", " EEE XD DX EEE ", " EEE XD DX EEE ", " EE XD DX EE ", "FFF FFFDDDDDFFF FFF", "AAAAAAAA AAAXXXXXAAA AAAAAAAA") + .aisle(" FD DF ", " ED DE ", " ED DE ", " ED DE ", " ED DE ", " ED DE ", " F D D F ", " D D ", " D D ", " D D ", " D D ", " D D ", " D D ", " D D ", " D D ", " D D ", " D D ", " D B D ", " FD - DF ", " C - C ", " C - C ", " C - C ", " C - C ", " C - C ", " C - C ", " C - C ", " C - C ", " C - C ", " FC - CF ", " C - C ", " C - C ", " C - C ", " C - C ", " C - C ", " C - C ", " C - C ", " C - C ", " C - C ", " VV XC - CX VV ", " VI XC - CX IV ", " VV XC - CX VV ", " VVFFFFFDDDDDFFFFFVV ", "AAAAAAAAVV AAAXXXXXAAA VVAAAAAAAA") + .aisle(" F F ", " ", " ", " ", " ", " ", " F F ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " EE EE ", " EE EE ", " E E ", " E E ", " E F F E ", " E E ", " E E ", " E E ", " EE EE ", " EE EE ", " E E ", " E E ", " EE EE ", " EE EE ", " E FD DF E ", " EE D D EE ", " EE D D EE ", " E D D E ", " EE D D EE ", " EE D D EE ", " E E ", " EE EE ", " EE EE ", " EE EE ", " EEE XD DX EEE ", " EEE XD DX EEE ", " EE XD DX EE ", "FFF FFFDDDDDFFF FFF", "AAAAAAAA AAAXXXXXAAA AAAAAAAA") + .aisle(" F D F ", " D ", " D ", " D ", " D ", " D ", " F D F ", " D ", " D D D ", " D D D ", " D D D ", " D D D ", " D D D ", " D D D ", " D D D ", " DD D DD ", " D D D ", " D D D ", " D F D F D ", " D C D ", " D C D ", " D C D ", " D C D ", " DD C DD ", " D C D ", " D C D ", " D C D ", " DD C DD ", " D FDCDF D ", " D DCD D ", " DD DCD DD ", " D DCD D ", " D DCD D ", " DD DDCDD DD ", " D D C D D ", " D D C D D ", " DD D C D DD ", " D D C D D ", " DD VV XDCDX VV DD ", " DD VI XDCDX IV DD ", " DDDD VV XDCDX VV DDDD ", "FFFD VVFFFFFDDDDDFFFFFVV DFFF", "AAAAAAAAVV AAAXXXXXAAA VVAAAAAAAA") + .aisle(" FFF ", " E ", " E ", " E ", " E ", " E ", " F F ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " ", " ", " FFF ", " ", " ", " H H ", " ", " ", " ", " ", " ", " ", " FFF ", " ", " ", " ", " ", " H H ", " ", " ", " ", " ", " XXX ", " XXX ", " D XXX D ", " FFF FFFFFFFFFFF FFF ", " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " FFF ", " ", " ", " ", " ", " ", " ", " ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " HE EH ", " E E ", " E E ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " H H ", " ", " ", " ", " ", " ", " ", " D D ", " FFF FFFFFFFFF FFF ", " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " ", " ", " ", " ", " ", " HH HH ", " E E ", " E E ", " E E ", " E E ", " E E ", " E E ", " ", " ", " ", " ", " ", " H H ", " ", " ", " ", " ", " ", " ", " D D ", " FFF FFFFFFF FFF ", " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " ", " ", " E E ", " E E ", " E E ", " E E ", " E E ", " ", " ", " H H ", " ", " ", " ", " ", " ", " ", " D D ", " FFF F F F FFF ", " AAAAAAAAAAAAA AAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " E E ", " E E ", " E E ", " E E ", " E E ", " HE EH ", " ", " ", " ", " ", " ", " ", " D D ", " FFF F F F FFF ", " AAAAAAAAAAAAA AAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " DE ED ", " DE ED ", " ", " E E ", " EHH HHE ", " E E ", " E E ", " E E ", " E E ", " E V V V E ", " E I I I E ", " E V V V E ", " FF E V V V E FF ", " AAAAAAAAAAAAV V VAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " DE ED ", " HH DE ED HH ", " ", " ", " ", " ", " V V V ", " V V V ", " V V V ", " V V V ", " AAAAAAAAAAAAV V VAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " HDE EDH ", " DE ED ", " DE ED ", " DE ED ", " ", " ", " ", " ", " ", " AAAAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " DE ED ", " ", " ", " ", " AAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " DE ED ", " ", " ", " AAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DE ED ", " D D ", " FFF FFF ", " AAAAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " E E ", " DD DE ED DD ", " FFFFFFD DFFFFFF ", " AAAAAAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " DDDDE EDDDD ", " FFFFFFF FFFFFFF ", " AAAAAAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " D D ", " FFFFF FFFFF ", " AAAAAAAAAAA ") + .aisle(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " FF FF ", " AAAAA ") + .where(' ', any()) + .where('-', air()) + .where('~', selfPredicate()) + .where('D', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_BASE_CASING))) + .where('F', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_INTERNAL_STRUCTURE))) + .where('E', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_SUPPORT_STRUCTURE))) + .where('A', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.HIGH_STRENGTH_CONCRETE))) + .where('B', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_CABLE))) + .where('H', frames(Neutronium)) + .where('X', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_BASE_CASING)).or(abilities(MultiblockAbility.INPUT_ENERGY, MultiblockAbility.INPUT_LASER).setExactLimit(1)).or(abilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION).setExactLimit(1))) //abilities? + .where('C', elevatorMotors()) + .where('I', modulePredicate()) + .where('V', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_BASE_CASING)).or(abilities(MultiblockAbility.IMPORT_ITEMS,MultiblockAbility.IMPORT_FLUIDS,MultiblockAbility.EXPORT_FLUIDS,MultiblockAbility.EXPORT_ITEMS, MultiblockAbility.COMPUTATION_DATA_RECEPTION).setPreviewCount(0))) + .build(); + } + else { + return FactoryBlockPattern.start(RIGHT, DOWN, FRONT) + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," FFFFFFF "," AAAAAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," V V V "," V V V "," V V V "," FFV V VFF "," AAAAV V VAAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," V V V "," I I I "," V V V "," FFV V VFF "," AAAAAAAV V VAAAAAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," FFF F FFF "," AAAAAAAAAA AAAAAAAAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," FFFF F FFFF "," AAAA AAAAA AAAAA AAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," FFFF F FFFF "," AAAA AAAAA AAAAA AAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," FFFFFFFFFFF "," AAA AAAAAAAAAAAAAAA AAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," D D "," FFFFF FFFFF "," AAA AAAAAAAAAAAAAAA AAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," DDDDE EDDDD "," FFFFFFF FFFFFFF "," AAA AAAAAAAAAAAAAAA AAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DD DE ED DD "," FFFFFFD DFFFFFF "," AA AAAAAAAAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," D D "," FFF FFF "," AA AAAAAAAAAAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," "," "," AA AAAAAAAAAAAAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," DE ED "," "," "," "," AA AAAAAAAAAAAAAAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," HDE EDH "," DE ED "," DE ED "," DE ED "," "," "," "," "," "," AA AAAAAAAAAAAAAAAAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," DE ED "," HH DE ED HH "," "," "," "," "," V V V "," V V V "," V V V "," V V V "," AA AAAAAAAAAAAAV V VAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," DE ED "," DE ED "," "," E E "," EHH HHE "," E E "," E E "," E E "," E E "," E V V V E "," E I I I E "," E V V V E "," FF E V V V E FF "," AA AAAAAAAAAAAAV V VAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," E E "," E E "," E E "," E E "," E E "," HE EH "," "," "," "," "," "," "," D D "," FFF F F F FFF "," AA AAAAAAAAAAAAAAA AAAAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," "," "," E E "," E E "," E E "," E E "," E E "," "," "," H H "," "," "," "," "," "," "," D D "," FFF F F F FFF "," AAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAA ") + .aisle(" "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," "," "," "," "," "," HH HH "," E E "," E E "," E E "," E E "," E E "," E E "," "," "," "," "," "," H H "," "," "," "," "," "," "," D D "," FFFFFF FFFFFFF FFFFFF "," AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" "," "," "," "," "," "," FFF "," "," "," "," "," "," "," "," E E "," E E "," E E "," E E "," E E "," E E "," E E "," HE EH "," E E "," E E "," "," "," "," "," "," "," "," "," "," H H "," "," "," "," "," "," "," D D "," FFFFFFFFF FFFFFFFFF FFFFFFFFF "," AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" FFF "," E "," E "," E "," E "," E "," F F "," E E "," E E "," E E "," E E "," E E "," E E "," E E "," E E "," E E "," "," "," FFF "," "," "," H H "," "," "," "," "," "," "," FFF "," "," "," "," "," H H "," "," "," "," "," XXX "," X~X "," D XXX D ","FFFFFFFFFF FFFFFFFFFFF FFFFFFFFFF","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") + .aisle(" F D F "," D "," D "," D "," D "," D "," F D F "," D "," D D D "," D D D "," D D D "," D D D "," D D D "," D D D "," D D D "," DD D DD "," D D D "," D D D "," D F D F D "," D C D "," D C D "," D C D "," D C D "," DD C DD "," D C D "," D C D "," D C D "," DD C DD "," D FDCDF D "," D DCD D "," DD DCD DD "," D DCD D "," D DCD D "," DD DDCDD DD "," D D C D D "," D D C D D "," DD D C D DD "," D D C D D "," VV DD VV XDCDX VV DD VV "," VI DD VI XDCDX IV DD IV "," VV DDDD VV XDCDX VV DDDD VV ","FVVFFFFFFD VVFFFFFDDDDDFFFFFVV DFFFFFFVVF","AVVAAAAAAAAAAAVV AAAXXXXXAAA VVAAAAAAAAAAAVVA") + .aisle(" F F "," "," "," "," "," "," F F "," E E "," E E "," E E "," E E "," E E "," E E "," E E "," EE EE "," EE EE "," E E "," E E "," E F F E "," E E "," E E "," E E "," EE EE "," EE EE "," E E "," E E "," EE EE "," EE EE "," E FD DF E "," EE D D EE "," EE D D EE "," E D D E "," EE D D EE "," EE D D EE "," E E "," EE EE "," EE EE "," EE EE "," EEE XD DX EEE "," EEE XD DX EEE "," EE XD DX EE ","F FFF FFFDDDDDFFF FFF F","A AAAAAAAA AAAXXXXXAAA AAAAAAAA A") + .aisle(" FD DF "," ED DE "," ED DE "," ED DE "," ED DE "," ED DE "," F D D F "," D D "," D D "," D D "," D D "," D D "," D D "," D D "," D D "," D D "," D D "," D B D "," FD - DF "," C - C "," C - C "," C - C "," C - C "," C - C "," C - C "," C - C "," C - C "," C - C "," FC - CF "," C - C "," C - C "," C - C "," C - C "," C - C "," C - C "," C - C "," C - C "," C - C "," VV VV XC - CX VV VV "," VI VI XC - CX IV IV "," VV VV XC - CX VV VV ","FVVFFFF VVFFFFFDDDDDFFFFFVV FFFFVVF","AVV AAAAAAAAVV AAAXXXXXAAA VVAAAAAAAA VVA") + .aisle(" F F "," "," "," "," "," "," F F "," E E "," E E "," E E "," E E "," E E "," E E "," E E "," EE EE "," EE EE "," E E "," E E "," E F F E "," E E "," E E "," E E "," EE EE "," EE EE "," E E "," E E "," EE EE "," EE EE "," E FD DF E "," EE D D EE "," EE D D EE "," E D D E "," EE D D EE "," EE D D EE "," E E "," EE EE "," EE EE "," EE EE "," EEE XD DX EEE "," EEE XD DX EEE "," EE XD DX EE ","F FFF FFFDDDDDFFF FFF F","A AAAAAAAA AAAXXXXXAAA AAAAAAAA A") + .aisle(" F D F "," D "," D "," D "," D "," D "," F D F "," D "," D D D "," D D D "," D D D "," D D D "," D D D "," D D D "," D D D "," DD D DD "," D D D "," D D D "," D F D F D "," D C D "," D C D "," D C D "," D C D "," DD C DD "," D C D "," D C D "," D C D "," DD C DD "," D FDCDF D "," D DCD D "," DD DCD DD "," D DCD D "," D DCD D "," DD DDCDD DD "," D D C D D "," D D C D D "," DD D C D DD "," D D C D D "," VV DD VV XDCDX VV DD VV "," VI DD VI XDCDX IV DD IV "," VV DDDD VV XDCDX VV DDDD VV ","FVVFFFFFFD VVFFFFFDDDDDFFFFFVV DFFFFFFVVF","AVVAAAAAAAAAAAVV AAAXXXXXAAA VVAAAAAAAAAAAVVA") + .aisle(" FFF "," E "," E "," E "," E "," E "," F F "," E E "," E E "," E E "," E E "," E E "," E E "," E E "," E E "," E E "," "," "," FFF "," "," "," H H "," "," "," "," "," "," "," FFF "," "," "," "," "," H H "," "," "," "," "," XXX "," XXX "," D XXX D ","FFFFFFFFFF FFFFFFFFFFF FFFFFFFFFF","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") + .aisle(" "," "," "," "," "," "," FFF "," "," "," "," "," "," "," "," E E "," E E "," E E "," E E "," E E "," E E "," E E "," HE EH "," E E "," E E "," "," "," "," "," "," "," "," "," "," H H "," "," "," "," "," "," "," D D "," FFFFFFFFF FFFFFFFFF FFFFFFFFF "," AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," "," "," "," "," "," HH HH "," E E "," E E "," E E "," E E "," E E "," E E "," "," "," "," "," "," H H "," "," "," "," "," "," "," D D "," FFFFFF FFFFFFF FFFFFF "," AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," "," "," E E "," E E "," E E "," E E "," E E "," "," "," H H "," "," "," "," "," "," "," D D "," FFF F F F FFF "," AAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," DE ED "," DE ED "," DE ED "," E E "," E E "," E E "," E E "," E E "," HE EH "," "," "," "," "," "," "," D D "," FFF F F F FFF "," AA AAAAAAAAAAAAAAA AAAAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," DE ED "," DE ED "," "," E E "," EHH HHE "," E E "," E E "," E E "," E E "," E V V V E "," E I I I E "," E V V V E "," FF E V V V E FF "," AA AAAAAAAAAAAAV V VAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," DE ED "," HH DE ED HH "," "," "," "," "," V V V "," V V V "," V V V "," V V V "," AA AAAAAAAAAAAAV V VAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," HDE EDH "," DE ED "," DE ED "," DE ED "," "," "," "," "," "," AA AAAAAAAAAAAAAAAAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," DE ED "," "," "," "," AA AAAAAAAAAAAAAAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," DE ED "," "," "," AA AAAAAAAAAAAAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DE ED "," D D "," FFF FFF "," AA AAAAAAAAAAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," E E "," DD DE ED DD "," FFFFFFD DFFFFFF "," AA AAAAAAAAAAAAAAAAAAA AA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," DDDDE EDDDD "," FFFFFFF FFFFFFF "," AAA AAAAAAAAAAAAAAA AAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," D D "," FFFFF FFFFF "," AAA AAAAAAAAAAAAAAA AAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," FFFFFFFFFFF "," AAA AAAAAAAAAAAAAAA AAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," FFFF F FFFF "," AAAA AAAAA AAAAA AAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," FFFF F FFFF "," AAAA AAAAA AAAAA AAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," FFF F FFF "," AAAAAAAAAA AAAAAAAAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," V V V "," I I I "," V V V "," FFV V VFF "," AAAAAAAV V VAAAAAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," V V V "," V V V "," V V V "," FFV V VFF "," AAAAV V VAAAA ") + .aisle(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," FFFFFFF "," AAAAAAA ") + .where(' ', any()) + .where('-', air()) + .where('~', selfPredicate()) + .where('D', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_BASE_CASING))) + .where('F', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_INTERNAL_STRUCTURE))) + .where('E', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_SUPPORT_STRUCTURE))) + .where('A', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.HIGH_STRENGTH_CONCRETE))) + .where('B', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_CABLE))) + .where('H', frames(Neutronium)) + .where('X', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_BASE_CASING)).or(abilities(MultiblockAbility.INPUT_ENERGY, MultiblockAbility.INPUT_LASER).setExactLimit(1)).or(abilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION).setExactLimit(1))) //abilities? + .where('C', elevatorMotors()) + .where('I', modulePredicate()) + .where('V', states(GCYLMetaBlocks.ELEVATOR_CASING.getState(ElevatorCasing.CasingType.ELEVATOR_BASE_CASING)).or(abilities(MultiblockAbility.IMPORT_ITEMS,MultiblockAbility.IMPORT_FLUIDS,MultiblockAbility.EXPORT_FLUIDS,MultiblockAbility.EXPORT_ITEMS).setPreviewCount(0))) + .build(); + } + } + + @Override + public boolean hasMaintenanceMechanics() { + return false; + } + + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { + return ClientHandler.ELEVATOR_CASING; + } + + @SideOnly(Side.CLIENT) + @NotNull + @Override + protected ICubeRenderer getFrontOverlay() { + return Textures.DATA_BANK_OVERLAY; + } + + @Override + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + super.renderMetaTileEntity(renderState, translation, pipeline); + getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), true, + true); + } + + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + initializeAbilities(); + Object type = context.get("ElevatorMotorTier"); + if (type instanceof IElevatorMotorTier) { + this.motorTier = ((IElevatorMotorTier) type).getTier() + 1; + } else + this.motorTier = 0; + } + + @Override + public void checkStructurePattern() { + if(this.getOffsetTimer() % 100 == 0 || this.isFirstTick()) { + if (!this.isStructureFormed()) { + reinitializeStructurePattern(); + } + super.checkStructurePattern(); + } + } + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + resetTileAbilities(); + this.spaceElevatorReceivers.forEach(ISpaceElevatorReceiver::sentWorkingDisabled); + this.spaceElevatorReceivers.forEach(s -> s.setSpaceElevator(null)); + } + + protected void initializeAbilities() { + List powerInput = new ArrayList<>(getAbilities(MultiblockAbility.INPUT_ENERGY)); + powerInput.addAll(getAbilities(MultiblockAbility.INPUT_LASER)); + this.energyContainer = new EnergyContainerList(powerInput); + List providers = getAbilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION); + if (providers != null && providers.size() >= 1) { + this.computationProvider = providers.get(0); + } + } + + private void resetTileAbilities() { + this.energyContainer = new EnergyContainerList(new ArrayList<>()); + } + + @NotNull + protected TraceabilityPredicate modulePredicate() { + return new TraceabilityPredicate(blockWorldState -> { + IBlockState blockState = blockWorldState.getBlockState(); + Block block = blockState.getBlock(); + if (block instanceof ElevatorCasing) { + ElevatorCasing.CasingType casingType = ((ElevatorCasing) blockState.getBlock()).getState(blockState); + if (casingType == ElevatorCasing.CasingType.ELEVATOR_BASE_CASING) return true; + } + + TileEntity tileEntity = blockWorldState.getTileEntity(); + if (!(tileEntity instanceof IGregTechTileEntity)) return false; + + MetaTileEntity metaTileEntity = ((IGregTechTileEntity) tileEntity).getMetaTileEntity(); + + if (metaTileEntity instanceof ISpaceElevatorProvider) + return false; + + if (!(metaTileEntity instanceof ISpaceElevatorReceiver)) return false; + + ISpaceElevatorReceiver spaceElevatorReceiver = (ISpaceElevatorReceiver) metaTileEntity; + if (spaceElevatorReceiver.getSpaceElevator() != this) { + spaceElevatorReceiver.setSpaceElevator(this); + this.spaceElevatorReceivers.add(spaceElevatorReceiver); + } + return true; + }); + } + + @Override + protected MultiblockUIFactory createUIFactory() { + return new MultiblockUIFactory(this) { + @Override + protected @NotNull Flow createButtons(@NotNull ModularPanel mainPanel, @NotNull PanelSyncManager panelSyncManager, PosGuiData guiData) { + BooleanSyncValue isExtendedSync = new BooleanSyncValue(MetaTileEntitySpaceElevator.this::isExtended, MetaTileEntitySpaceElevator.this::setExtended); + Flow flow = Flow.column().debugName("button_col").right(4).coverChildren(); + if (Mods.GalacticraftCore.isModLoaded()) { + flow.child(new ButtonWidget<>().overlay(ClientHandler.BUTTON_ELEVATOR_TELEPORT) + .size(18) + .addTooltipLine(KeyUtil.lang("gcyl.gui.multiblock.space_elevator_teleport")) + .onMousePressed(pressed -> { + if(panelSyncManager.getPlayer() instanceof EntityPlayerMP player && MetaTileEntitySpaceElevator.this.isStructureFormed()) { + + final GCPlayerStats stats = GCPlayerStats.get(player); + stats.setCoordsTeleportedFromX(player.posX); + stats.setCoordsTeleportedFromZ(player.posZ); + + try { + WorldUtil.toCelestialSelection(player, stats, MetaTileEntitySpaceElevator.this.motorTier >= 3 ? 9 : 8); + } catch (final Exception e) { + e.printStackTrace(); + } + } + return true; + })); + } else { + flow.paddingTop(18); + } + + flow.child(new ButtonWidget<>().overlay(ClientHandler.BUTTON_ENABLE_STATIC) + .size(18) + .addTooltipLine(KeyUtil.lang("gcyl.gui.multiblock.space_elevator.enable_all_modules")) + .onMousePressed(pressed -> { + enableAllModules(); + return true; + })); + flow.child(new ButtonWidget<>().overlay(ClientHandler.BUTTON_DISABLE_STATIC) + .size(18) + .addTooltipLine(KeyUtil.lang("gcyl.gui.multiblock.space_elevator.disable_all_modules")) + .onMousePressed(pressed -> { + disableAllModules(); + return true; + })); + flow.child(new ToggleButton() + .stateOverlay(ClientHandler.BUTTON_ELEVATOR_EXTENSION) + .size(18) + .value(isExtendedSync) + .marginTop(4) + .addTooltipLine(KeyUtil.lang("gcyl.gui.multiblock.space_elevator_extended"))); + return flow; + } + }.configureDisplayText(this::configureDisplayText) + .configureErrorText(this::configureErrorText) + .configureWarningText(this::configureWarningText); + } + + /* + protected gregtech.api.gui.ModularUI.Builder createUITemplate(EntityPlayer entityPlayer) { + gregtech.api.gui.ModularUI.Builder builder = gregtech.api.gui.ModularUI.builder(GuiTextures.BACKGROUND, 198, 238); + + // Display + builder.image(4, 4, 190, 139, GuiTextures.DISPLAY); + + + builder.label(9, 9, getMetaFullName(), 0xFFFFFF); + + builder.widget(new AdvancedTextWidget(9, 20, this::addDisplayText, 0xFFFFFF) + .setMaxWidthLimit(220) + .setClickHandler(this::handleDisplayClick)); + + + // Extend Button + builder.widget(new ImageCycleButtonWidget(173, 213, 18, 18, ClientHandler.BUTTON_ELEVATOR_EXTENSION, + this::isExtended, this::setExtended).setTooltipHoverString("gcyl.gui.multiblock.space_elevator_extended")); + builder.widget(new ImageWidget(173, 201, 18, 6, GuiTextures.BUTTON_POWER_DETAIL)); + + // Voiding Mode Button + builder.widget(new ClickButtonWidget(173, 173, 18, 18, "", data -> enableAllModules()) + .setButtonTexture(ClientHandler.BUTTON_ENABLE_STATIC) + .setTooltipText("gcyl.gui.multiblock.space_elevator.enable_all_modules")); + + builder.widget(new ClickButtonWidget(173, 191, 18, 18, "", data -> disableAllModules()) + .setButtonTexture(ClientHandler.BUTTON_DISABLE_STATIC) + .setTooltipText("gcyl.gui.multiblock.space_elevator.disable_all_modules")); + + // Teleport Button + if(Mods.GalacticraftCore.isModLoaded()) { + builder.widget(new ClickButtonWidget(173, 155, 18, 18, "", data -> { + if(entityPlayer instanceof EntityPlayerMP && this.isStructureFormed()) { + EntityPlayerMP player = (EntityPlayerMP) entityPlayer; + + final GCPlayerStats stats = GCPlayerStats.get(player); + stats.setCoordsTeleportedFromX(player.posX); + stats.setCoordsTeleportedFromZ(player.posZ); + + try { + WorldUtil.toCelestialSelection(player, stats, this.motorTier >= 3 ? 9 : 8); + } catch (final Exception e) { + e.printStackTrace(); + } + } + }).setButtonTexture(ClientHandler.BUTTON_ELEVATOR_TELEPORT).setTooltipText("gcyl.gui.multiblock.space_elevator_teleport")); + } + + builder.bindPlayerInventory(entityPlayer.inventory, 155); + return builder; + } + */ + + public List getModuleNames() { + List moduleNames = new ArrayList<>(); + for (ISpaceElevatorReceiver spaceElevatorReceiver : spaceElevatorReceivers) { + moduleNames.add(spaceElevatorReceiver.getNameForDisplayCount()); + } + return moduleNames; + } + + @Override + protected void configureDisplayText(MultiblockUIBuilder builder) { + builder.structureFormed(this.isStructureFormed()) + .addCustom((keyManager, uiSyncer) -> { + int motorTier = uiSyncer.syncInt(getMotorTier()); + int maxModules = uiSyncer.syncInt(getMaxModules()); + int moduleCount = uiSyncer.syncInt(getModuleCount()); + List moduleNames = uiSyncer.syncCollection(getModuleNames(), ByteBufAdapters.STRING); + + keyManager.add(KeyUtil.lang(TextFormatting.BLUE, "gcyl.machine.space_elevator.motor_tier", motorTier)); + keyManager.add(KeyUtil.lang(TextFormatting.YELLOW, "gcyl.machine.space_elevator.max_modules", maxModules)); + + if (moduleNames.isEmpty()) { + keyManager.add(KeyUtil.lang(TextFormatting.RED, "gcyl.machine.space_elevator.modules.none")); + } else { + keyManager.add(KeyUtil.lang(moduleCount < maxModules ? TextFormatting.AQUA : TextFormatting.YELLOW, "gcyl.machine.space_elevator.total_modules", moduleCount)); + + keyManager.add(KeyUtil.lang(TextFormatting.GREEN, "gcyl.machine.space_elevator.modules")); + + Set uniqueNames = new HashSet<>(moduleNames); + uniqueNames.forEach(s -> keyManager.add(KeyUtil.lang(TextFormatting.WHITE, s, Collections.frequency(moduleNames, s)))); + } + }); + } + + private boolean isExtended() { + return this.isExtended; + } + + private void setExtended(boolean bool) { + this.isExtended = bool; + invalidateStructure(); + reinitializeStructurePattern(); + } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound data) { + data.setBoolean("extended", this.isExtended); + return super.writeToNBT(data); + } + + @Override + public void readFromNBT(NBTTagCompound data) { + super.readFromNBT(data); + this.isExtended = data.getBoolean("extended"); + } + + @Override + public void writeInitialSyncData(PacketBuffer buf) { + super.writeInitialSyncData(buf); + buf.writeBoolean(this.isExtended); + } + + @Override + public void receiveInitialSyncData(PacketBuffer buf) { + super.receiveInitialSyncData(buf); + this.isExtended = buf.readBoolean(); + } + + @Override + public int getMotorTier() { + return this.motorTier; + } + + @Override + public IEnergyContainer getEnergyContainerForModules() { + return this.energyContainer; + } + + @Override + public boolean amIInTheList(ISpaceElevatorReceiver receiver) { + return this.spaceElevatorReceivers.contains(receiver); + } + + private int getMaxModules() { + if(this.motorTier == 1) + return 6; + if(this.motorTier == 2) + return 12; + if(this.motorTier == 3 && this.isExtended) + return 15; + if(this.motorTier == 4 && this.isExtended) + return 18; + if(this.motorTier == 5 && this.isExtended) + return 24; + + return 12; + } + + private boolean checkModules() { + return getModuleCount() <= getMaxModules(); + } + + private int getModuleCount() { + return this.spaceElevatorReceivers.size(); + } + + private void disableAllModules() { + this.spaceElevatorReceivers.forEach(ISpaceElevatorReceiver::sentWorkingDisabled); + } + + private void enableAllModules() { + this.spaceElevatorReceivers.forEach(ISpaceElevatorReceiver::sentWorkingEnabled); + } + + @Override + public IOpticalComputationProvider getComputationProvider() { + return this.computationProvider; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/elevatormodules/MetaTileEntityAssemblerModule.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/elevatormodules/MetaTileEntityAssemblerModule.java new file mode 100644 index 00000000..cf0f7698 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/elevatormodules/MetaTileEntityAssemblerModule.java @@ -0,0 +1,54 @@ +package com.fulltrix.gcyl.machines.multi.advance.elevator.elevatormodules; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.fulltrix.gcyl.client.ClientHandler; +import com.fulltrix.gcyl.machines.multi.advance.elevator.MetaTileEntityModuleRecipeBase; +import gregtech.api.capability.impl.FluidTankList; +import gregtech.api.capability.impl.ItemHandlerList; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.pattern.TraceabilityPredicate; +import gregtech.api.recipes.RecipeMap; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +public class MetaTileEntityAssemblerModule extends MetaTileEntityModuleRecipeBase { + public MetaTileEntityAssemblerModule(ResourceLocation metaTileEntityId, RecipeMap recipeMap, int tier, int moduleTier, int minMotorTier) { + super(metaTileEntityId, recipeMap, tier, moduleTier, minMotorTier); + } + + @Override + public void initializeAbilities() { + this.inputFluidInventory = new FluidTankList(false, getAbilities(MultiblockAbility.IMPORT_FLUIDS)); + this.inputInventory = new ItemHandlerList(getAbilities(MultiblockAbility.IMPORT_ITEMS)); + this.outputInventory = new ItemHandlerList(getAbilities(MultiblockAbility.EXPORT_ITEMS)); + } + + @Override + protected TraceabilityPredicate abilities() { + return abilities(MultiblockAbility.IMPORT_ITEMS,MultiblockAbility.IMPORT_FLUIDS,MultiblockAbility.EXPORT_ITEMS); + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEntity) { + return new MetaTileEntityAssemblerModule(this.metaTileEntityId, this.recipeMap, this.tier, this.moduleTier, this.minMotorTier); + } + + @Override + @SideOnly(Side.CLIENT) + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + super.renderMetaTileEntity(renderState, translation, pipeline); + for (EnumFacing renderSide : EnumFacing.HORIZONTALS) { + if (renderSide == getFrontFacing()) { + getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), this.isActive(), + true); + } else + ClientHandler.ASSEMBLER_MODULE_OVERLAY.renderSided(renderSide, renderState, translation, pipeline); + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/elevatormodules/MetaTileEntityMiningModule.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/elevatormodules/MetaTileEntityMiningModule.java new file mode 100644 index 00000000..903e9b13 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/elevatormodules/MetaTileEntityMiningModule.java @@ -0,0 +1,770 @@ +package com.fulltrix.gcyl.machines.multi.advance.elevator.elevatormodules; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.cleanroommc.modularui.api.widget.IWidget; +import com.cleanroommc.modularui.factory.PosGuiData; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.value.sync.BooleanSyncValue; +import com.cleanroommc.modularui.value.sync.IntSyncValue; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.cleanroommc.modularui.value.sync.StringSyncValue; +import com.cleanroommc.modularui.widget.Widget; +import com.cleanroommc.modularui.widgets.ButtonWidget; +import com.cleanroommc.modularui.widgets.ScrollingTextWidget; +import com.cleanroommc.modularui.widgets.TextWidget; +import com.cleanroommc.modularui.widgets.ToggleButton; +import com.cleanroommc.modularui.widgets.layout.Flow; +import com.cleanroommc.modularui.widgets.textfield.TextFieldWidget; +import com.fulltrix.gcyl.client.ClientHandler; +import com.fulltrix.gcyl.machines.multi.advance.elevator.MetaTileEntityModuleBase; +import com.fulltrix.gcyl.recipes.categories.elevator.SpaceMiningRecipes; +import gregtech.api.capability.*; +import gregtech.api.capability.impl.FluidTankList; +import gregtech.api.capability.impl.ItemHandlerList; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIFactory; +import gregtech.api.mui.GTGuiTextures; +import gregtech.api.pattern.TraceabilityPredicate; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.ore.OrePrefix; +import gregtech.api.util.GTTransferUtils; +import gregtech.api.util.KeyUtil; +import gregtech.api.util.TextComponentUtil; +import gregtech.common.ConfigHolder; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.common.util.Constants; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.IItemHandlerModifiable; +import org.eclipse.xtext.xbase.lib.Pair; +import org.jetbrains.annotations.NotNull; +import org.lwjgl.input.Keyboard; + +import java.util.*; + +import static com.fulltrix.gcyl.item.GCYLCoreItems.*; +import static com.fulltrix.gcyl.recipes.categories.elevator.SpaceMiningRecipes.*; +import static gregtech.api.unification.material.Materials.*; + +public class MetaTileEntityMiningModule extends MetaTileEntityModuleBase implements IOpticalComputationReceiver { + + private IItemHandlerModifiable inputInventory; + private IItemHandlerModifiable outputInventory; + private IMultipleTankHandler inputFluidInventory; + private IOpticalComputationProvider computationProvider; + private int minDistance = 0; + private int maxDistance = 0; + private int distance = 0; + private int range = 0; + private final int MAX_PARALLEL; + private final int MAX_DISTANCE = 300; + private final int MAX_RANGE = 150; + private boolean cycleMode = false; + private int step = 0; + private int parallel; + + private SpaceMiningRecipes.SpaceMiningRecipePartTwo randomRecipe; + private List randomOutput = new ArrayList<>(); + + private List whitelist = new ArrayList<>(); + private boolean isWhitelist = true; + + private long totalEUt = 0; + private int totalComputation = 0; + + public MetaTileEntityMiningModule(ResourceLocation metaTileEntityId, int tier, int moduleTier, int minMotorTier, int maxParallel) { + super(metaTileEntityId, tier, moduleTier, minMotorTier); + this.MAX_PARALLEL = maxParallel; + this.parallel = maxParallel; + } + + @Override + public void initializeAbilities() { + this.inputInventory = new ItemHandlerList(getAbilities(MultiblockAbility.IMPORT_ITEMS)); + this.outputInventory = new ItemHandlerList(getAbilities(MultiblockAbility.EXPORT_ITEMS)); + this.inputFluidInventory = new FluidTankList(false, getAbilities(MultiblockAbility.IMPORT_FLUIDS)); + + try { + this.computationProvider = getSpaceElevator().getComputationProvider(); + } catch (NullPointerException ignored) { + } + } + + @Override + protected TraceabilityPredicate abilities() { + return abilities(MultiblockAbility.IMPORT_ITEMS, MultiblockAbility.EXPORT_ITEMS, MultiblockAbility.IMPORT_FLUIDS); + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEntity) { + return new MetaTileEntityMiningModule(this.metaTileEntityId, this.tier, this.moduleTier, this.minMotorTier, this.MAX_PARALLEL); + } + + @Override + @SideOnly(Side.CLIENT) + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + super.renderMetaTileEntity(renderState, translation, pipeline); + for (EnumFacing renderSide : EnumFacing.HORIZONTALS) { + if (renderSide == getFrontFacing()) { + getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), this.isActive(), + true); + } else + ClientHandler.MINING_MODULE_OVERLAY.renderSided(renderSide, renderState, translation, pipeline); + } + } + + @Override + public void updateFormedValid() { + super.updateFormedValid(); + if (!this.isWorkingEnabled()) { + return; + } + + if (!drainEnergy(true, this.totalEUt) || this.computationProvider.requestCWUt(this.totalComputation, true) != this.totalComputation) { + if (this.progressTime >= 2) { + if (ConfigHolder.machines.recipeProgressLowEnergy) this.progressTime = 1; + else this.progressTime = Math.max(1, this.progressTime - 2); + } + return; + } + + if (progressTime == 0 && checkFluidInventory(true) == null) { + setActive(false); + return; + } + + if (progressTime == 0 && checkRecipes(true) == null) { + setActive(false); + if (this.cycleMode) { + setDistance(this.distance + this.step); + } + } else { + Random rand = this.getWorld().rand; + + setActive(true); + + if (progressTime == 0) { + + List recipes = checkRecipes(false); + Fluid fluid = checkFluidInventory(false); + + int averageProgress = 0; + + for (int x = 0; x < this.parallel; x++) { + int totalWeight = 0; + for (SpaceMiningRecipes.SpaceMiningRecipePartTwo i : recipes) { + totalWeight += i.getWeight(); + } + + int idx = 0; + for (int r = rand.nextInt(totalWeight); idx < recipes.size() - 1; ++idx) { + r -= recipes.get(idx).getWeight(); + if (r <= 0) break; + } + + this.randomRecipe = recipes.get(idx); + + averageProgress += this.randomRecipe.getDuration(); + this.totalEUt += this.randomRecipe.getEUt(); + this.totalComputation += this.randomRecipe.getComputation(); + + + int randomStackSize = rand.nextInt(this.randomRecipe.getMaxSize() - this.randomRecipe.getMinSize()) + this.randomRecipe.getMinSize(); + + int totalWeight2 = 0; + for (Pair i : this.randomRecipe.getOutputs()) { + totalWeight2 += i.getValue(); + } + + int idx2 = 0; + for (int r = rand.nextInt(totalWeight2); idx2 < this.randomRecipe.getOutputs().size() - 1; ++idx2) { + r -= this.randomRecipe.getOutputs().get(idx2).getValue(); + if (r <= 0) break; + } + + if (!this.whitelist.isEmpty()) { + for (int i = 0; i < this.whitelist.size(); i++) { + if (this.whitelist.get(i).equalsIgnoreCase(this.randomRecipe.getOutputs().get(idx2).getKey().getLocalizedName())) { + if (this.isWhitelist) { + this.randomOutput.add(OreDictUnifier.get(OrePrefix.ore, this.randomRecipe.getOutputs().get(idx2).getKey(), randomStackSize)); + break; + } else continue; + } + + if (i == this.whitelist.size() - 1 && !this.isWhitelist) { + this.randomOutput.add(OreDictUnifier.get(OrePrefix.ore, this.randomRecipe.getOutputs().get(idx2).getKey(), randomStackSize)); + } + } + } else { + this.randomOutput.add(OreDictUnifier.get(OrePrefix.ore, this.randomRecipe.getOutputs().get(idx2).getKey(), randomStackSize)); + } + + if (x == this.parallel - 1) { + if (fluid == Helium.getFluid()) { + setMaxProgress(averageProgress / this.parallel); + } else if (fluid == Bismuth.getFluid()) { + setMaxProgress(averageProgress / this.parallel / 2); + } else if (fluid == Radon.getFluid()) { + setMaxProgress(averageProgress / this.parallel / 4); + } + } + } + } + + if (this.randomRecipe == null || this.randomOutput == null || this.outputInventory == null || !GTTransferUtils.addItemsToItemHandler(this.outputInventory, true, this.randomOutput)) { + progressTime = 0; + return; + } + + this.computationProvider.requestCWUt(this.totalComputation, false); + drainEnergy(false, this.totalEUt); + + progressTime++; + if (progressTime % getMaxProgress() != 0) return; + progressTime = 0; + + if (this.cycleMode) { + setDistance(this.distance + this.step); + } + + GTTransferUtils.addItemsToItemHandler(this.outputInventory, false, this.randomOutput); + + this.randomOutput.clear(); + this.totalEUt = 0; + this.totalComputation = 0; + + } + } + + public List checkRecipes(boolean simulate) { + + ItemStack item = null; + + Material matStick = null; + Material matDrill = null; + + int stickCount = 0; + int drillCount = 0; + + final int neededSticks = STICK_INPUT_STACK_SIZE * this.parallel; + final int neededDrills = DRILL_HEAD_INPUT_STACK_SIZE * this.parallel; + + for (int i = 0; i < getInputInventory().getSlots(); i++) { + ItemStack slot = getInputInventory().getStackInSlot(i); + if (ItemStack.areItemStacksEqual(slot, MINING_DRONE_1.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_2.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_3.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_4.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_5.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_6.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_7.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_8.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_9.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_10.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_11.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_12.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_13.getStackForm()) + || ItemStack.areItemStacksEqual(slot, MINING_DRONE_14.getStackForm())) { + item = slot; + continue; + } + if (OreDictUnifier.getPrefix(slot) == OrePrefix.stick) { + if (matStick != null && matStick != Objects.requireNonNull(OreDictUnifier.getMaterial(slot)).material) { + return null; + } + matStick = Objects.requireNonNull(OreDictUnifier.getMaterial(slot)).material; + stickCount += slot.getCount(); + continue; + } + + if (OreDictUnifier.getPrefix(slot) == OrePrefix.toolHeadDrill) { + if (matDrill != null && matDrill != Objects.requireNonNull(OreDictUnifier.getMaterial(slot)).material) { + return null; + } + matDrill = Objects.requireNonNull(OreDictUnifier.getMaterial(slot)).material; + drillCount += slot.getCount(); + } + + if (item != null && stickCount >= neededSticks && drillCount >= neededDrills) + break; + } + + if (stickCount < neededSticks || drillCount < neededDrills) { + return null; + } else { + stickCount = neededSticks; + drillCount = neededDrills; + } + + if (matStick != matDrill || matStick == null) + return null; + + List recipesBeforeCheck = SPACE_MINING_RECIPES.get(new SpaceMiningRecipes.SpaceMiningRecipePartOne(item, matStick).hashCode()); + + if (recipesBeforeCheck == null) return null; + + List recipesAfterCheck = new ArrayList<>(); + + for (SpaceMiningRecipes.SpaceMiningRecipePartTwo recipe : recipesBeforeCheck) { + if (recipe != null) { + if (this.moduleTier < recipe.getMinModuleTier()) { + continue; + } + + if (!(this.minDistance <= recipe.getMaxDistance() && recipe.getMinDistance() <= this.maxDistance)) { + continue; + } + + if (!drainEnergy(true, recipe.getEUt() * this.parallel)) { + continue; + } + + if (this.computationProvider.requestCWUt(recipe.getComputation() * this.parallel, true) != recipe.getComputation() * this.parallel) { + continue; + } + + recipesAfterCheck.add(recipe); + + if (simulate) + return recipesAfterCheck; + } + } + if (recipesAfterCheck.isEmpty()) + return null; + else { + int currentStickCount = 0; + int currentDrillCount = 0; + for (int i = 0; i < getInputInventory().getSlots(); i++) { + ItemStack item2 = getInputInventory().getStackInSlot(i); + + try { + if (currentStickCount != stickCount && OreDictUnifier.getPrefix(item2) == OrePrefix.stick && OreDictUnifier.getMaterial(item2).material == matStick) { + currentStickCount += item2.getCount(); + getInputInventory().extractItem(i, Math.min(item2.getCount(), stickCount), false); + } + + if (currentDrillCount != drillCount && OreDictUnifier.getPrefix(item2) == OrePrefix.toolHeadDrill && OreDictUnifier.getMaterial(item2).material == matDrill) { + currentDrillCount += item2.getCount(); + getInputInventory().extractItem(i, Math.min(item2.getCount(), drillCount), false); + } + } catch (NullPointerException ignored) { + } + + if (currentStickCount >= stickCount && currentDrillCount >= drillCount) + break; + } + return recipesAfterCheck; + } + } + + private Fluid checkFluidInventory(boolean simulate) { + + FluidStack canDrainHelium = getInputFluidInventory().drain(Helium.getPlasma(1000 * this.parallel), false); + FluidStack canDrainBismuth = getInputFluidInventory().drain(Bismuth.getPlasma(500 * this.parallel), false); + FluidStack canDrainRadon = getInputFluidInventory().drain(Radon.getPlasma(300 * this.parallel), false); + + if (canDrainHelium != null || canDrainBismuth != null || canDrainRadon != null) { + + if (canDrainHelium != null && canDrainHelium.isFluidStackIdentical(Helium.getPlasma(1000 * this.parallel))) { + if (!simulate) { + getInputFluidInventory().drain(Helium.getPlasma(1000 * this.parallel), true); + } + return Helium.getFluid(); + } + + if (canDrainBismuth != null && canDrainBismuth.isFluidStackIdentical(Bismuth.getPlasma(500 * this.parallel))) { + if (!simulate) { + getInputFluidInventory().drain(Bismuth.getPlasma(500 * this.parallel), true); + } + + return Bismuth.getFluid(); + } + + if (canDrainRadon != null && canDrainRadon.isFluidStackIdentical(Radon.getPlasma(300 * this.parallel))) { + if (!simulate) { + getInputFluidInventory().drain(Radon.getPlasma(300 * this.parallel), true); + } + return Radon.getFluid(); + } + + } + return null; + } + + private IMultipleTankHandler getInputFluidInventory() { + return this.inputFluidInventory; + } + + private IItemHandlerModifiable getInputInventory() { + return this.inputInventory; + } + + @Override + public IOpticalComputationProvider getComputationProvider() { + return this.computationProvider; + } + + @Override + protected MultiblockUIFactory createUIFactory() { + return new MultiblockUIFactory(this) { + @Override + protected @NotNull Flow createButtons(@NotNull ModularPanel mainPanel, @NotNull PanelSyncManager panelSyncManager, PosGuiData guiData) { + BooleanSyncValue cycleModeSync = new BooleanSyncValue(MetaTileEntityMiningModule.this::getCycleMode, MetaTileEntityMiningModule.this::setCycleMode); + BooleanSyncValue whitelistModeSync = new BooleanSyncValue(MetaTileEntityMiningModule.this::getWhitelistMode, MetaTileEntityMiningModule.this::setWhitelistMode); + + Widget powerButton = this.createPowerButton(mainPanel, panelSyncManager); + return Flow.column().name("button_col").right(4).coverChildren() + .child(new ToggleButton() + .stateOverlay(ClientHandler.BUTTON_CYCLE) + .addTooltipLine(KeyUtil.lang("gcyl.gui.mining_module.cycle")) + .value(cycleModeSync) + .size(18)) + .child(new ToggleButton() + .stateOverlay(ClientHandler.BUTTON_WHITE_BLACK_LIST) + .addTooltipLine(KeyUtil.lang("gcyl.gui.mining_module.change_whitelist_mode")) + .value(whitelistModeSync) + .size(18)) + .child(new ButtonWidget<>() + .overlay(GTGuiTextures.BUTTON_CLEAR_GRID) + .addTooltipLine(KeyUtil.lang("gcyl.gui.mining_module.print_whitelist_or_clear")) + .onMousePressed(mousePressed -> MetaTileEntityMiningModule.this.printWhitelistOrClear(panelSyncManager.getPlayer())) + .size(18) + ) + .childIf(powerButton != null, powerButton); + } + }.addScreenChildren((parentWidget, syncManager) -> { + IntSyncValue distanceSync = new IntSyncValue(this::getDistance, this::setDistance); + IntSyncValue rangeSync = new IntSyncValue(this::getRange, this::setRange); + IntSyncValue stepSync = new IntSyncValue(this::getStep, this::setStep); + IntSyncValue parallelSync = new IntSyncValue(this::getParallel, this::setParallel); + StringSyncValue addToWhitelistSync = new StringSyncValue(this::getBlankName, this::addToWhiteList); + StringSyncValue RemoveFromWhitelistSync = new StringSyncValue(this::getBlankRemoveName, this::removeFromWhitelist); + + int padding = 18; + + parentWidget + .child(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.gui.mining_module.distance").asWidget() + .pos(120, 5 + padding)) + .child(new TextFieldWidget() + .pos(163, 3 + padding) + .size(25,10) + .value(distanceSync) + .setNumbers(0, this.MAX_DISTANCE)) + .child(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.gui.mining_module.range").asWidget() + .pos(120, 5 + 2 * padding)) + .child(new TextFieldWidget() + .pos(163, 3 + 2 * padding) + .size(25,10) + .value(rangeSync) + .setNumbers(0, this.MAX_RANGE)) + .child(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.gui.mining_module.step").asWidget() + .pos(120, 5 + 3 * padding)) + .child(new TextFieldWidget() + .pos(163, 3 + 3 * padding) + .size(25,10) + .value(stepSync)) + .child(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.gui.mining_module.parallel").asWidget() + .pos(120, 5 + 4 * padding)) + .child(new TextFieldWidget() + .pos(163, 3 + 4 * padding) + .size(25,10) + .value(parallelSync) + .setNumbers(0, this.MAX_PARALLEL)) + .child(new TextFieldWidget() + .pos(47, 56) + .width(70) + .height(10) + .value(addToWhitelistSync)) + .child(new TextFieldWidget() + .pos(47, 70) + .width(70) + .height(10) + .value(RemoveFromWhitelistSync)); + }).configureWarningText(this::configureWarningText) + .configureDisplayText(this::configureDisplayText) + .configureErrorText(this::configureErrorText); + } + + /* + @Override + protected ModularUI.Builder createUITemplate(EntityPlayer entityPlayer) { + ModularUI.Builder builder = ModularUI.builder(GuiTextures.BACKGROUND, 198, 238); + ; + builder.image(4, 4, 190, 147, GuiTextures.DISPLAY); + builder.widget((new IndicatorImageWidget(174, 131, 17, 17, this.getLogo())).setWarningStatus(this.getWarningLogo(), this::addWarningText).setErrorStatus(this.getErrorLogo(), this::addErrorText)); + + builder.label(9, 9, this.getMetaFullName(), 16777215); + + int size = 18; + int padding = 3; + + + builder.widget(new LabelWidget(120, 9 + (size + padding), "gcyl.gui.mining_module.distance", 0xFF55FF)); + builder.widget(new TextFieldWidget2(170, 9 + (size + padding), size * size, size, this::getDistance, this::setDistance).setMaxLength(3).setAllowedChars(TextFieldWidget2.NATURAL_NUMS)); + + builder.widget(new LabelWidget(120, 9 + 2 * (size + padding), "gcyl.gui.mining_module.range", 0xFF55FF)); + builder.widget(new TextFieldWidget2(170, 9 + 2 * (size + padding), size * size, size, this::getRange, this::setRange).setMaxLength(3).setAllowedChars(TextFieldWidget2.NATURAL_NUMS)); + + builder.widget(new LabelWidget(120, 9 + 3 * (size + padding), "gcyl.gui.mining_module.step", 0xFF55FF)); + builder.widget(new TextFieldWidget2(170, 9 + 3 * (size + padding), size * size, size, this::getStep, this::setStep).setMaxLength(3).setAllowedChars(TextFieldWidget2.NATURAL_NUMS)); + + builder.widget(new LabelWidget(120, 9 + 4 * (size + padding), "gcyl.gui.mining_module.parallel", 0xFF55FF)); + builder.widget(new TextFieldWidget2(170, 9 + 4 * (size + padding), size * size, size, this::getParallel, this::setParallel).setMaxLength(1).setAllowedChars(TextFieldWidget2.NATURAL_NUMS)); + + + + builder.widget(new TextFieldWidget2(9, (size + padding) + 11 * 5, size * size, size, this::getBlankName, this::addToWhiteList).setMaxLength(21).setAllowedChars(TextFieldWidget2.LETTERS)); + + builder.widget(new TextFieldWidget2(9, (size + padding) + 11 * 7, size * size, size, this::getBlankRemoveName, this::removeFromWhitelist).setMaxLength(21).setAllowedChars(TextFieldWidget2.LETTERS)); + + + + builder.widget((new AdvancedTextWidget(9, (size + padding), this::addDisplayText, 16777215)).setMaxWidthLimit(181).setClickHandler(this::handleDisplayClick)); + IControllable controllable = (IControllable) this.getCapability(GregtechTileCapabilities.CAPABILITY_CONTROLLABLE, (EnumFacing) null); + TextureArea var10007; + BooleanSupplier var10008; + if (controllable != null) { + var10007 = GuiTextures.BUTTON_POWER; + Objects.requireNonNull(controllable); + var10008 = controllable::isWorkingEnabled; + Objects.requireNonNull(controllable); + builder.widget(new ImageCycleButtonWidget(173, 213, 18, 18, var10007, var10008, controllable::setWorkingEnabled)); + builder.widget(new ImageWidget(173, 231, 18, 6, GuiTextures.BUTTON_POWER_DETAIL)); + } + + //clear or retrieve list //TODO change the texture of this + builder.widget(new ClickButtonWidget(173, 155, 18, 18, "", data -> printWhitelistOrClear(data, entityPlayer)).setButtonTexture(GuiTextures.BUTTON_CLEAR_GRID).setTooltipText("gcyl.gui.mining_module.print_whitelist_or_clear")); + + //whitelist or blacklist + builder.widget(new ImageCycleButtonWidget(173, 173, 18, 18, ClientHandler.BUTTON_WHITE_BLACK_LIST, this::getWhitelistMode, this::setWhitelistMode).setTooltipHoverString("gcyl.gui.mining_module.change_whitelist_mode")); + + //Cycle mode + builder.widget(new ImageCycleButtonWidget(173, 191, 18, 18, ClientHandler.BUTTON_CYCLE, this::getCycleMode, this::setCycleMode).setTooltipHoverString("gcyl.gui.mining_module.cycle")); + + + builder.bindPlayerInventory(entityPlayer.inventory, 155); + return builder; + } + */ + + @Override + protected void configureDisplayText(MultiblockUIBuilder builder) { + builder.setWorkingStatus(isWorkingEnabled(), isActive()) + .addWorkingStatusLine() + .addParallelsLine(this.MAX_PARALLEL) + .addCustom((keyManager, uiSyncer) -> { + keyManager.add(KeyUtil.lang(TextFormatting.YELLOW, "gcyl.gui.mining_module.min_distance", uiSyncer.syncInt(this.minDistance))); + keyManager.add(KeyUtil.lang(TextFormatting.RED, "gcyl.gui.mining_module.max_distance", uiSyncer.syncInt(this.maxDistance))); + }) + .addCustom((keyManager, uiSyncer) -> keyManager.add(KeyUtil.lang(uiSyncer.syncBoolean(this.isWhitelist) ? TextFormatting.DARK_GREEN : TextFormatting.DARK_RED, uiSyncer.syncBoolean(this.isWhitelist) ? "gcyl.gui.mining_module.whitelist" : "gcyl.gui.mining_module.blacklist"))) + .addEmptyLine() + .addCustom((keyManager, uiSyncer) -> keyManager.add(KeyUtil.lang(TextFormatting.RED, "gcyl.gui.mining_module.remove"))) + .addEmptyLine() + .addProgressLine(getProgress(), getMaxProgress()) + .addEnergyUsageExactLine(this.totalEUt) + .addComputationUsageExactLine(this.totalComputation); + } + + + private boolean printWhitelistOrClear(EntityPlayer player) { + if(this.whitelist.isEmpty()) { + player.sendStatusMessage(TextComponentUtil.translationWithColor(TextFormatting.WHITE, "gcyl.gui.mining_module." + (this.isWhitelist ? "whitelist_empty" : "blacklist_empty")), false); + return true; + } + + if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { + this.whitelist.clear(); + player.sendStatusMessage(TextComponentUtil.translationWithColor(TextFormatting.WHITE, "gcyl.gui.mining_module." + (this.isWhitelist ? "whitelist_cleared" : "blacklist_cleared")), false); + } + else { + + StringBuilder sb = new StringBuilder(I18n.format("gcyl.gui.mining_module." + (this.isWhitelist ? "whitelist" : "blacklist")) + "\n"); + + for(int i = 0; i < this.whitelist.size(); i++) { + sb.append(this.whitelist.get(i)); + if(i != this.whitelist.size() - 1) { + sb.append("\n"); + } + } + + player.sendStatusMessage(TextComponentUtil.stringWithColor(TextFormatting.WHITE, sb.toString()), false); + } + return true; + } + + + private void addToWhiteList(String name) { + if (!this.whitelist.contains(name) && !Objects.equals(name, I18n.format("gcyl.gui.mining_module.blank_name"))) { + this.whitelist.add(name); + } + } + + private void removeFromWhitelist(String name) { + this.whitelist.remove(name); + } + + private String getBlankName() { + return I18n.format("gcyl.gui.mining_module.blank_name"); + } + + private String getBlankRemoveName() { + return I18n.format("gcyl.gui.mining_module.blank_name_remove"); + } + + private void setWhitelistMode(boolean bool) { + this.isWhitelist = bool; + } + + private boolean getWhitelistMode() { + return this.isWhitelist; + } + + private void setCycleMode(boolean bool) { + this.cycleMode = bool; + } + + private boolean getCycleMode() { + return this.cycleMode; + } + + private void setDistance(int distance) { + if (distance > this.MAX_DISTANCE) { + while (distance > this.MAX_DISTANCE) { + distance -= this.MAX_DISTANCE; + } + } + this.distance = distance; + this.minDistance = Math.max(this.distance - this.range / 2, 0); + this.maxDistance = Math.min(this.distance + this.range / 2, this.MAX_DISTANCE); + } + + private int getDistance() { + return this.distance; + } + + private void setRange(int range) { + if (range > this.MAX_RANGE) { + this.range = 0; + this.minDistance = this.distance; + this.maxDistance = this.distance; + } else { + this.range = range; + this.minDistance = Math.max(this.distance - this.range / 2, 0); + this.maxDistance = Math.min(this.distance + this.range / 2, this.MAX_DISTANCE); + } + } + + private int getRange() { + return this.range; + } + + private void setStep(int step) { + this.step = step; + } + + private int getStep() { + return this.step; + } + + private void setParallel(int parallel) { + if (parallel < 1) + this.parallel = 1; + else this.parallel = Math.min(parallel, this.MAX_PARALLEL); + } + + private int getParallel() { + return this.parallel; + } + + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound data) { + super.writeToNBT(data); + data.setInteger("distance", this.distance); + data.setInteger("minDistance", this.minDistance); + data.setInteger("maxDistance", this.maxDistance); + data.setInteger("range", this.range); + data.setInteger("step", this.step); + data.setInteger("parallel", this.parallel); + data.setBoolean("cycle", this.cycleMode); + data.setBoolean("isWhitelist", this.isWhitelist); + + + NBTTagList nbtTagList = new NBTTagList(); + + for(String s : this.whitelist) { + NBTTagCompound tag = new NBTTagCompound(); + + tag.setString("material", s); + nbtTagList.appendTag(tag); + } + + data.setInteger("whitelistSize", this.whitelist.size()); + data.setTag("whitelist", nbtTagList); + + return super.writeToNBT(data); + } + + @Override + public void readFromNBT(NBTTagCompound data) { + super.readFromNBT(data); + this.distance = data.getInteger("distance"); + this.minDistance = data.getInteger("minDistance"); + this.maxDistance = data.getInteger("maxDistance"); + this.range = data.getInteger("range"); + this.step = data.getInteger("step"); + this.parallel = data.getInteger("parallel"); + this.cycleMode = data.getBoolean("cycle"); + this.isWhitelist = data.getBoolean("isWhitelist"); + + if (data.getInteger("whitelistSize") > 0) { + NBTTagList nbtTagList = data.getTagList("whitelist", Constants.NBT.TAG_COMPOUND); + for (int i = 0; i < data.getInteger("whitelistSize"); i++) { + NBTTagCompound tag = nbtTagList.getCompoundTagAt(i); + this.whitelist.add(tag.getString("material")); + } + } + } + + @Override + public void writeInitialSyncData(PacketBuffer buf) { + super.writeInitialSyncData(buf); + buf.writeInt(this.distance); + buf.writeInt(this.minDistance); + buf.writeInt(this.maxDistance); + buf.writeInt(this.range); + buf.writeInt(this.step); + buf.writeInt(this.parallel); + buf.writeBoolean(this.cycleMode); + buf.writeBoolean(this.isWhitelist); + } + + @Override + public void receiveInitialSyncData(PacketBuffer buf) { + super.receiveInitialSyncData(buf); + this.distance = buf.readInt(); + this.minDistance = buf.readInt(); + this.maxDistance = buf.readInt(); + this.range = buf.readInt(); + this.step = buf.readInt(); + this.parallel = buf.readInt(); + this.cycleMode = buf.readBoolean(); + this.isWhitelist = buf.readBoolean(); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/elevatormodules/MetaTileEntityPumpingModule.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/elevatormodules/MetaTileEntityPumpingModule.java new file mode 100644 index 00000000..8aef4d00 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/elevator/elevatormodules/MetaTileEntityPumpingModule.java @@ -0,0 +1,373 @@ +package com.fulltrix.gcyl.machines.multi.advance.elevator.elevatormodules; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.cleanroommc.modularui.api.widget.IWidget; +import com.cleanroommc.modularui.value.sync.IntSyncValue; +import com.cleanroommc.modularui.widgets.TextWidget; +import com.cleanroommc.modularui.widgets.textfield.TextFieldWidget; +import com.fulltrix.gcyl.client.ClientHandler; +import com.fulltrix.gcyl.machines.multi.advance.elevator.MetaTileEntityModuleBase; +import gregtech.api.capability.IMultipleTankHandler; +import gregtech.api.capability.impl.FluidTankList; +import gregtech.api.gui.widgets.*; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIFactory; +import gregtech.api.pattern.TraceabilityPredicate; +import gregtech.api.util.GTTransferUtils; +import gregtech.api.util.KeyUtil; +import gregtech.common.ConfigHolder; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.common.util.Constants; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.function.BooleanSupplier; + +import static com.fulltrix.gcyl.recipes.categories.elevator.SpacePumpRecipes.GAS_SIPHON_RECIPES; + + +public class MetaTileEntityPumpingModule extends MetaTileEntityModuleBase { + + private IMultipleTankHandler outputFluidInventory; + @SuppressWarnings("FieldMayBeFinal") + private int[] planet = {0, 0, 0, 0}; + + @SuppressWarnings("FieldMayBeFinal") + private int[] fluidNumber = {0, 0, 0, 0}; + + public MetaTileEntityPumpingModule(ResourceLocation metaTileEntityId, int tier, int moduleTier, int minMotorTier) { + super(metaTileEntityId, tier, moduleTier, minMotorTier); + setMaxProgress(moduleTier == 3 ? 20 : 80); + } + @Override + protected void initializeAbilities() { + this.outputFluidInventory = new FluidTankList(false, getAbilities(MultiblockAbility.EXPORT_FLUIDS)); + } + + + + @Override + protected TraceabilityPredicate abilities() { + return abilities(MultiblockAbility.EXPORT_FLUIDS); + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEntity) { + return new MetaTileEntityPumpingModule(this.metaTileEntityId, this.tier, this.moduleTier, this.minMotorTier); + } + + @Override + @SideOnly(Side.CLIENT) + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + super.renderMetaTileEntity(renderState, translation, pipeline); + for (EnumFacing renderSide : EnumFacing.HORIZONTALS) { + if (renderSide == getFrontFacing()) { + getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), this.isActive(), + true); + } else + ClientHandler.PUMP_MODULE_OVERLAY.renderSided(renderSide, renderState, translation, pipeline); + } + } + + @Override + protected MultiblockUIFactory createUIFactory() { + return super.createUIFactory().addScreenChildren(((parentWidget, panelSyncManager) -> { + IntSyncValue firstPlanetValueSync = new IntSyncValue(this::getFirstPlanetValue, this::setFirstPlanetValue); + IntSyncValue secondPlanetValueSync = new IntSyncValue(this::getSecondPlanetValue, this::setSecondPlanetValue); + IntSyncValue thirdPlanetValueSync = new IntSyncValue(this::getThirdPlanetValue, this::setThirdPlanetValue); + IntSyncValue fourthPlanetValueSync = new IntSyncValue(this::getFourthPlanetValue, this::setFourthPlanetValue); + + IntSyncValue firstFluidValueSync = new IntSyncValue(this::getFirstFluidValue, this::setFirstFluidValue); + IntSyncValue secondFluidValueSync = new IntSyncValue(this::getSecondFluidValue, this::setSecondFluidValue); + IntSyncValue thirdFluidValueSync = new IntSyncValue(this::getThirdFluidValue, this::setThirdFluidValue); + IntSyncValue fourthFluidValueSync = new IntSyncValue(this::getFourthFluidValue, this::setFourthFluidValue); + + int padding = 18; + parentWidget.child(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.pump_module.planet").asWidget() + .pos(10, 9 + padding)) + .child(new TextFieldWidget() + .pos(43, 7 + padding) + .size(25, 10) + .value(firstPlanetValueSync)) + .child(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.pump_module.fluid").asWidget() + .pos(10, 9 + 2 * padding)) + .child(new TextFieldWidget() + .pos(43, 7 + 2 * padding) + .size(25, 10) + .value(firstFluidValueSync)); + if (moduleTier > 1) { + parentWidget.child(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.pump_module.planet").asWidget() + .pos(100, 9 + padding)) + .child(new TextFieldWidget() + .pos(133, 7 + padding) + .size(25, 10) + .value(secondPlanetValueSync)) + .child(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.pump_module.fluid").asWidget() + .pos(100, 9 + 2 * padding)) + .child(new TextFieldWidget() + .pos(133, 7 + 2 * padding) + .size(25, 10) + .value(secondFluidValueSync)) + + .child(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.pump_module.planet").asWidget() + .pos(10, 9 + 3 * padding)) + .child(new TextFieldWidget() + .pos(43, 7 + 3 * padding) + .size(25, 10) + .value(thirdPlanetValueSync)) + .child(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.pump_module.fluid").asWidget() + .pos(10, 9 + 4 * padding)) + .child(new TextFieldWidget() + .pos(43, 7 + 4 * padding) + .size(25, 10) + .value(thirdFluidValueSync)) + + .child(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.pump_module.planet").asWidget() + .pos(100, 9 + 3 * padding)) + .child(new TextFieldWidget() + .pos(133, 7 + 3 * padding) + .size(25, 10) + .value(fourthPlanetValueSync)) + .child(KeyUtil.lang(TextFormatting.LIGHT_PURPLE, "gcyl.multiblock.pump_module.fluid").asWidget() + .pos(100, 9 + 4 * padding)) + .child(new TextFieldWidget() + .pos(133, 7 + 4 * padding) + .size(25, 10) + .value(fourthFluidValueSync)); + } + })); + } + + + + /* + @Override + protected ModularUI.Builder createUITemplate(EntityPlayer entityPlayer) { + ModularUI.Builder builder = ModularUI.builder(GuiTextures.BACKGROUND, 198, 208);; + builder.image(4, 4, 190, 117, GuiTextures.DISPLAY); + builder.widget((new IndicatorImageWidget(174, 101, 17, 17, this.getLogo())).setWarningStatus(this.getWarningLogo(), this::addWarningText).setErrorStatus(this.getErrorLogo(), this::addErrorText)); + + builder.label(9, 9, this.getMetaFullName(), 16777215); + + int size = 18; + int padding = 3; + + + + builder.widget(new LabelWidget(10, 9 + (size + padding), "gcyl.multiblock.pump_module.planet", 0x55FF55)); + builder.widget(new TextFieldWidget2(50, 9 + (size + padding), size * size, size, () -> this.getPlanetValue(0), s -> this.setPlanetValue(s, 0)).setMaxLength(3).setAllowedChars(TextFieldWidget2.WHOLE_NUMS)); + builder.widget(new LabelWidget(10, 9 + 2 * (size + padding), "gcyl.multiblock.pump_module.fluid", 0xFF55FF)); + builder.widget(new TextFieldWidget2(50, 9 + 2 * (size + padding), size * size, size, () -> this.getFluidValue(0), s -> this.setFluidValue(s, 0)).setMaxLength(3).setAllowedChars(TextFieldWidget2.WHOLE_NUMS)); + + if (this.moduleTier > 1) { + builder.widget(new LabelWidget(100, 9 + (size + padding), "gcyl.multiblock.pump_module.planet", 0x55FF55)); + builder.widget(new TextFieldWidget2(140, 9 + (size + padding), size * size, size, () -> this.getPlanetValue(1), s -> this.setPlanetValue(s, 1)).setMaxLength(3).setAllowedChars(TextFieldWidget2.WHOLE_NUMS)); + builder.widget(new LabelWidget(100, 9 + 2 * (size + padding), "gcyl.multiblock.pump_module.fluid", 0xFF55FF)); + builder.widget(new TextFieldWidget2(140, 9 + 2 * (size + padding), size * size, size, () -> this.getFluidValue(1), s -> this.setFluidValue(s, 1)).setMaxLength(3).setAllowedChars(TextFieldWidget2.WHOLE_NUMS)); + + builder.widget(new LabelWidget(10, 9 + 3 * (size + padding), "gcyl.multiblock.pump_module.planet", 0x55FF55)); + builder.widget(new TextFieldWidget2(50, 9 + 3 * (size + padding), size * size, size, () -> this.getPlanetValue(2), s -> this.setPlanetValue(s, 2)).setMaxLength(3).setAllowedChars(TextFieldWidget2.WHOLE_NUMS)); + builder.widget(new LabelWidget(10, 9 + 4 * (size + padding), "gcyl.multiblock.pump_module.fluid", 0xFF55FF)); + builder.widget(new TextFieldWidget2(50, 9 + 4 * (size + padding), size * size, size, () -> this.getFluidValue(2), s -> this.setFluidValue(s, 2)).setMaxLength(3).setAllowedChars(TextFieldWidget2.WHOLE_NUMS)); + + builder.widget(new LabelWidget(100, 9 + 3 * (size + padding), "gcyl.multiblock.pump_module.planet", 0x55FF55)); + builder.widget(new TextFieldWidget2(140, 9 + 3 * (size + padding), size * size, size, () -> this.getPlanetValue(3), s -> this.setPlanetValue(s, 3)).setMaxLength(3).setAllowedChars(TextFieldWidget2.WHOLE_NUMS)); + builder.widget(new LabelWidget(100, 9 + 4 * (size + padding), "gcyl.multiblock.pump_module.fluid", 0xFF55FF)); + builder.widget(new TextFieldWidget2(140, 9 + 4 * (size + padding), size * size, size, () -> this.getFluidValue(3), s -> this.setFluidValue(s, 3)).setMaxLength(3).setAllowedChars(TextFieldWidget2.WHOLE_NUMS)); + } + + + builder.widget((new AdvancedTextWidget(9, 20, this::addDisplayText, 16777215)).setMaxWidthLimit(181).setClickHandler(this::handleDisplayClick)); + IControllable controllable = (IControllable)this.getCapability(GregtechTileCapabilities.CAPABILITY_CONTROLLABLE, (EnumFacing)null); + TextureArea var10007; + BooleanSupplier var10008; + if (controllable != null) { + var10007 = GuiTextures.BUTTON_POWER; + Objects.requireNonNull(controllable); + var10008 = controllable::isWorkingEnabled; + Objects.requireNonNull(controllable); + builder.widget(new ImageCycleButtonWidget(173, 183, 18, 18, var10007, var10008, controllable::setWorkingEnabled)); + builder.widget(new ImageWidget(173, 201, 18, 6, GuiTextures.BUTTON_POWER_DETAIL)); + } + + + builder.widget((new ImageWidget(173, 161, 18, 18, GuiTextures.BUTTON_VOID_NONE)).setTooltip("gregtech.gui.multiblock_voiding_not_supported")); + + + builder.widget(this.getFlexButton(173, 125, 18, 18)); + builder.bindPlayerInventory(entityPlayer.inventory, 125); + return builder; + } + */ + + private int getFirstPlanetValue() { + return this.planet[0]; + } + + private void setFirstPlanetValue(int val) { + this.planet[0] = val; + } + + private int getSecondPlanetValue() { + return this.planet[1]; + } + + private void setSecondPlanetValue(int val) { + this.planet[1] = val; + } + + private int getThirdPlanetValue() { + return this.planet[2]; + } + + private void setThirdPlanetValue(int val) { + this.planet[2] = val; + } + + private int getFourthPlanetValue() { + return this.planet[3]; + } + + private void setFourthPlanetValue(int val) { + this.planet[3] = val; + } + + private int getFirstFluidValue() { + return this.fluidNumber[0]; + } + + private void setFirstFluidValue(int val) { + this.fluidNumber[0] = val; + } + + private int getSecondFluidValue() { + return this.fluidNumber[1]; + } + + private void setSecondFluidValue(int val) { + this.fluidNumber[1] = val; + } + + private int getThirdFluidValue() { + return this.fluidNumber[2]; + } + + private void setThirdFluidValue(int val) { + this.fluidNumber[2] = val; + } + + private int getFourthFluidValue() { + return this.fluidNumber[3]; + } + + private void setFourthFluidValue(int val) { + this.fluidNumber[3] = val; + } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound data) { + super.writeToNBT(data); + NBTTagList nbtTagPlanetList = new NBTTagList(); + NBTTagList nbtTagFluidList = new NBTTagList(); + for(int i = 0; i < 4; i++) { + NBTTagCompound planetTag = new NBTTagCompound(); + NBTTagCompound fluidTag = new NBTTagCompound(); + + planetTag.setInteger("planet", this.planet[i]); + nbtTagPlanetList.appendTag(planetTag); + + fluidTag.setInteger("fluid", this.fluidNumber[i]); + nbtTagFluidList.appendTag(fluidTag); + } + data.setTag("planets", nbtTagPlanetList); + data.setTag("fluids", nbtTagFluidList); + return data; + } + + @Override + public void readFromNBT(NBTTagCompound data) { + super.readFromNBT(data); + NBTTagList nbtTagPlanetList = data.getTagList("planets", Constants.NBT.TAG_COMPOUND); + NBTTagList nbtTagFluidList = data.getTagList("fluids", Constants.NBT.TAG_COMPOUND); + for(int i = 0; i < 4; i++) { + NBTTagCompound planetTag = nbtTagPlanetList.getCompoundTagAt(i); + NBTTagCompound fluidTag = nbtTagFluidList.getCompoundTagAt(i); + + this.planet[i] = planetTag.getInteger("planet"); + this.fluidNumber[i] = fluidTag.getInteger("fluid"); + } + } + + @Override + public void updateFormedValid() { + super.updateFormedValid(); + if(!this.isWorkingEnabled()) { + return; + } + + List fluidStacks = new ArrayList<>(); + for (int i = 0; i < 4; i++) { + if(GAS_SIPHON_RECIPES.get(this.planet[i] + "," + this.fluidNumber[i]) != null) { + fluidStacks.add(GAS_SIPHON_RECIPES.get(this.planet[i] + "," + this.fluidNumber[i])); + } + } + + if (this.canVoidRecipeFluidOutputs() && (this.outputFluidInventory == null || !GTTransferUtils.addFluidsToFluidHandler(this.outputFluidInventory, true, fluidStacks))) + return; + + + if(!drainEnergy(true)) { + if (this.progressTime >= 2) { + if (ConfigHolder.machines.recipeProgressLowEnergy) this.progressTime = 1; + else this.progressTime = Math.max(1, this.progressTime - 2); + } + return; + } + + if(progressTime == 0 && !checkRecipes()) { + setActive(false); + } + else { + drainEnergy(false); + setActive(true); + + progressTime++; + if (progressTime % getMaxProgress() != 0) return; + progressTime = 0; + + for(FluidStack fluidStack : fluidStacks) { + this.outputFluidInventory.fill(fluidStack, true); + } + } + } + + protected boolean checkRecipes() { + + if(this.moduleTier > 1) { + for (int i = 0; i < 4; i++) { + FluidStack stack = GAS_SIPHON_RECIPES.get(this.planet[i] + "," + this.fluidNumber[i]); + if(stack != null) { + return true; + } + } + } + else { + FluidStack stack = GAS_SIPHON_RECIPES.get(this.planet[0]+ "," + this.fluidNumber[0]); + return stack != null; + } + return false; + } +} \ No newline at end of file diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityHyperReactor.java b/src/main/java/com/fulltrix/gcyl/machines/multi/generator/MetaTileEntityHyperReactor.java similarity index 78% rename from src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityHyperReactor.java rename to src/main/java/com/fulltrix/gcyl/machines/multi/generator/MetaTileEntityHyperReactor.java index e6b4ca74..a6df8d60 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityHyperReactor.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/generator/MetaTileEntityHyperReactor.java @@ -1,53 +1,67 @@ -package com.fulltrix.gcyl.machines.multi.advance; +package com.fulltrix.gcyl.machines.multi.generator; +import com.cleanroommc.modularui.value.sync.DoubleSyncValue; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; import com.fulltrix.gcyl.GCYLConfig; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; -import com.fulltrix.gcyl.item.GCYLReactorCasing; -import com.fulltrix.gcyl.item.GCYLTransparentCasing; -import com.fulltrix.gcyl.item.metal.MetalCasing2; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.GCYLReactorCasing; +import com.fulltrix.gcyl.blocks.metal.MetalCasing2; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregtech.api.GTValues; import gregtech.api.capability.IMultipleTankHandler; import gregtech.api.capability.impl.MultiblockFuelRecipeLogic; +import gregtech.api.fluids.store.FluidStorageKeys; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.*; +import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; +import gregtech.api.mui.GTGuiTextures; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.unification.material.Material; import gregtech.api.util.GTUtility; import gregtech.client.renderer.ICubeRenderer; import gregtech.common.blocks.BlockGlassCasing; import gregtech.common.blocks.MetaBlocks; +import gregtech.core.unification.material.internal.MaterialRegistryManager; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.Fluid; +import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; -import java.util.Objects; +import java.util.List; +import java.util.function.UnaryOperator; +import static com.fulltrix.gcyl.api.GCYLUtility.getFluidStorageKeyByName; import static com.fulltrix.gcyl.client.ClientHandler.*; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.METAL_CASING_2; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_2; import static gregtech.api.unification.material.Materials.Naquadria; -public class MetaTileEntityHyperReactor extends FuelMultiblockController implements IProgressBarMultiblock { +public class MetaTileEntityHyperReactor extends FuelMultiblockController implements ProgressBarMultiblock { //TODO finish implementing UI and cleanup - +//TODO add tooltips and information private final int tier; private static final int a = GTUtility.getTierByVoltage(GCYLConfig.multis.hyperReactors.euGeneration[1]); private static final int b = GTUtility.getTierByVoltage(GCYLConfig.multis.hyperReactors.euGeneration[2]); private static final int c = GTUtility.getTierByVoltage(GCYLConfig.multis.hyperReactors.euGeneration[0]); - private static final FluidStack boosterA = new FluidStack(FluidRegistry.getFluid(GCYLConfig.multis.hyperReactors.boosterFluid[1]), GCYLConfig.multis.hyperReactors.boosterFluidAmounts[1]); - private static final FluidStack boosterB = new FluidStack(FluidRegistry.getFluid("plasma."+ GCYLConfig.multis.hyperReactors.boosterFluid[2]), GCYLConfig.multis.hyperReactors.boosterFluidAmounts[2]); - private static final FluidStack boosterC = new FluidStack(FluidRegistry.getFluid(GCYLConfig.multis.hyperReactors.boosterFluid[0]), GCYLConfig.multis.hyperReactors.boosterFluidAmounts[0]); + private static final FluidStack boosterA = MaterialRegistryManager.getInstance().getMaterial(GCYLConfig.multis.hyperReactors.boosterFluid[1]).getFluid(getFluidStorageKeyByName(GCYLConfig.multis.hyperReactors.boosterFluidStates[1]), GCYLConfig.multis.hyperReactors.boosterFluidAmounts[1]); + private static final FluidStack boosterB = MaterialRegistryManager.getInstance().getMaterial(GCYLConfig.multis.hyperReactors.boosterFluid[2]).getFluid(getFluidStorageKeyByName(GCYLConfig.multis.hyperReactors.boosterFluidStates[2]), GCYLConfig.multis.hyperReactors.boosterFluidAmounts[2]); + private static final FluidStack boosterC = MaterialRegistryManager.getInstance().getMaterial(GCYLConfig.multis.hyperReactors.boosterFluid[0]).getFluid(getFluidStorageKeyByName(GCYLConfig.multis.hyperReactors.boosterFluidStates[0]), GCYLConfig.multis.hyperReactors.boosterFluidAmounts[0]); + + + private static final FluidStack[] boosters = {boosterC, boosterA, boosterB}; public MetaTileEntityHyperReactor(ResourceLocation metaTileEntityId, int tier) { super(metaTileEntityId, GCYLRecipeMaps.HYPER_REACTOR_FUELS, tier); @@ -71,21 +85,16 @@ else if(tier == b) } @Override - protected boolean shouldShowVoidingModeButton() { + public boolean shouldShowVoidingModeButton() { return false; } @NotNull private FluidStack getBooster(int tier) { - Fluid temp; - temp = FluidRegistry.getFluid(GCYLConfig.multis.hyperReactors.boosterFluid[getIndex(tier)]); - - return new FluidStack(Objects.requireNonNull(temp), GCYLConfig.multis.hyperReactors.boosterFluidAmounts[getIndex(tier)]); + return boosters[getIndex(tier)]; } - @Override - public double getFillPercentage(int index) { - if(index == 0) { + public double getFuelPercentage() { int[] fuelAmount = new int[2]; if (getInputFluidInventory() != null) { MultiblockFuelRecipeLogic recipeLogic = (MultiblockFuelRecipeLogic) recipeMapWorkable; @@ -96,14 +105,15 @@ public double getFillPercentage(int index) { } } return fuelAmount[1] != 0 ? 1.0 * fuelAmount[0] / fuelAmount[1] : 0; - } else { - int[] boosterAmount = new int[2]; - if (getInputFluidInventory() != null) { - boosterAmount = getTotalFluidAmount(getBooster(tier), - getInputFluidInventory()); - } - return boosterAmount[1] != 0 ? 1.0 * boosterAmount[0] / boosterAmount[1] : 0; + } + + private double getBoosterPercentage() { + int[] boosterAmount = new int[2]; + if (getInputFluidInventory() != null) { + boosterAmount = getTotalFluidAmount(getBooster(tier), + getInputFluidInventory()); } + return boosterAmount[1] != 0 ? 1.0 * boosterAmount[0] / boosterAmount[1] : 0; } @@ -165,12 +175,11 @@ protected BlockPattern createStructurePattern() { .aisle("CCCCC", "G###G", "G#H#G", "G###G", "CCCCC") .aisle("CCSCC", "CGGGC", "CGGGC", "CGGGC", "CCCCC") .where('S', selfPredicate()) - .where('C', states(getCasingState(c)).or(autoAbilities(false,true,true,true,true,true,false) + .where('C', states(getCasingState(c)).setMinGlobalLimited(55).or(autoAbilities(false,true,true,true,true,true,false) .or(abilities(MultiblockAbility.OUTPUT_ENERGY).setExactLimit(1)))) .where('G', states(MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.LAMINATED_GLASS))) .where('H', states(GCYLMetaBlocks.REACTOR_CASING.getState(GCYLReactorCasing.CasingType.HYPER_CORE))) .where('#', air()) - .where('c', states(getCasingState(c)).setMinGlobalLimited(25)) .build(); } } @@ -205,6 +214,28 @@ else if(tier == b) return METAL_CASING_2.getState(MetalCasing2.CasingType.NAQUADRIA); } + @Override + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gcyl.multiblock.hyper_reactor.tooltip.1", getBooster(this.tier).getLocalizedName())); + tooltip.add(I18n.format("gcyl.multiblock.hyper_reactor.tooltip.2", GTValues.VN[this.tier])); + } + + @Override + public int getProgressBarCount() { + return 2; + } + + @Override + public void registerBars(List> list, PanelSyncManager panelSyncManager) { + DoubleSyncValue fuelAmount = new DoubleSyncValue(this::getFuelPercentage); + DoubleSyncValue boosterAmount = new DoubleSyncValue(this::getBoosterPercentage); + list.add(bar -> bar.value(fuelAmount) + .texture(GTGuiTextures.PROGRESS_BAR_LCE_FUEL)); + list.add(bar -> bar.value(boosterAmount) + .texture(GTGuiTextures.PROGRESS_BAR_LCE_LUBRICANT)); + } + private static class HyperReactorWorkableHandler extends MultiblockFuelRecipeLogic { private final int tier; diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeNaquadahReactor.java b/src/main/java/com/fulltrix/gcyl/machines/multi/generator/MetaTileEntityLargeNaquadahReactor.java similarity index 60% rename from src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeNaquadahReactor.java rename to src/main/java/com/fulltrix/gcyl/machines/multi/generator/MetaTileEntityLargeNaquadahReactor.java index ec03f486..fee06a9a 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeNaquadahReactor.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/generator/MetaTileEntityLargeNaquadahReactor.java @@ -1,34 +1,49 @@ -package com.fulltrix.gcyl.machines.multi.advance; +package com.fulltrix.gcyl.machines.multi.generator; -import com.fulltrix.gcyl.item.metal.MetalCasing2; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.cleanroommc.modularui.value.sync.DoubleSyncValue; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.fulltrix.gcyl.blocks.metal.MetalCasing2; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregtech.api.GTValues; import gregtech.api.capability.IMultipleTankHandler; import gregtech.api.capability.impl.MultiblockFuelRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.*; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; +import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; +import gregtech.api.mui.GTGuiTextures; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.unification.material.Materials; +import gregtech.api.util.KeyUtil; +import gregtech.api.util.TextComponentUtil; import gregtech.client.renderer.ICubeRenderer; import gregtech.common.blocks.BlockBoilerCasing; import gregtech.common.blocks.BlockMultiblockCasing; import gregtech.common.blocks.BlockTurbineCasing; import gregtech.common.blocks.MetaBlocks; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.Nullable; + +import java.util.List; +import java.util.function.UnaryOperator; import static com.fulltrix.gcyl.client.ClientHandler.NAQUADRIA_CASING; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.METAL_CASING_2; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_2; import static gregtech.api.unification.material.Materials.Naquadria; //TODO finish implementing UI - -public class MetaTileEntityLargeNaquadahReactor extends FuelMultiblockController implements IProgressBarMultiblock { +public class MetaTileEntityLargeNaquadahReactor extends FuelMultiblockController implements ProgressBarMultiblock { private static final int tier = GTValues.UHV; @@ -51,11 +66,11 @@ protected BlockPattern createStructurePattern() { .aisle("CCCCC", "CPAPC", "CgAgC", "#PAP#", "#PAP#", "CgAgC", "CPAPC", "#CCC#") .aisle("#CCC#", "#CSC#", "#CCC#", "##C##", "##C##", "#CCC#", "#CGC#", "#CCC#") .where('S', selfPredicate()) - .where('C', states(getCasingState()).setMinGlobalLimited(80).or(autoAbilities(false,false,false,false,true,false,false).setMaxGlobalLimited(2)) + .where('C', states(getCasingState()).setMinGlobalLimited(78).or(autoAbilities(false,false,false,false,true,false,false).setMaxGlobalLimited(3)) .or(abilities(MultiblockAbility.OUTPUT_ENERGY).setExactLimit(1))) .where('G', states(MetaBlocks.MULTIBLOCK_CASING.getState(BlockMultiblockCasing.MultiblockCasingType.GRATE_CASING))) .where('g', states(MetaBlocks.TURBINE_CASING.getState(BlockTurbineCasing.TurbineCasingType.TUNGSTENSTEEL_GEARBOX))) - .where('F', states(MetaBlocks.FRAMES.get(Naquadria).getDefaultState())) + .where('F', frames(Naquadria)) .where('P', states(MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.TUNGSTENSTEEL_PIPE))) .where('m', abilities(MultiblockAbility.MAINTENANCE_HATCH).setExactLimit(1)) .where('A', air()) @@ -67,6 +82,24 @@ protected IBlockState getCasingState() { return METAL_CASING_2.getState(MetalCasing2.CasingType.NAQUADRIA); } + @Override + protected void configureDisplayText(MultiblockUIBuilder builder) { + NaquadahReactorWorkableHandler recipeLogic = (NaquadahReactorWorkableHandler) recipeMapWorkable; + builder.addCustom((keyManager, uiSyncer) -> { + if (uiSyncer.syncBoolean(recipeLogic.isOxygenBoosted)) { + keyManager.add(KeyUtil.lang(TextFormatting.AQUA, "gregtech.multiblock.large_naquadah_reactor.oxygen_boosted")); + } + }); + } + + @Override + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gcyl.multiblock.large_naquadah_reactor.tooltip.1")); + tooltip.add(I18n.format("gcyl.multiblock.large_naquadah_reactor.tooltip.2")); + tooltip.add(I18n.format("gcyl.multiblock.large_naquadah_reactor.tooltip.3")); + } + @SideOnly(Side.CLIENT) @Override public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { @@ -74,44 +107,58 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { } @Override - protected boolean shouldShowVoidingModeButton() { + public boolean shouldShowVoidingModeButton() { return false; } + private double getFuelPercentage() { + int[] fuelAmount = new int[2]; + if (getInputFluidInventory() != null) { + MultiblockFuelRecipeLogic recipeLogic = (MultiblockFuelRecipeLogic) recipeMapWorkable; + if (recipeLogic.getInputFluidStack() != null) { + FluidStack testStack = recipeLogic.getInputFluidStack().copy(); + testStack.amount = Integer.MAX_VALUE; + fuelAmount = getTotalFluidAmount(testStack, getInputFluidInventory()); + } + } + return fuelAmount[1] != 0 ? 1.0 * fuelAmount[0] / fuelAmount[1] : 0; + } + + private double getTritiumPercentage() { + int[] tritiumAmount = new int[2]; + if (getInputFluidInventory() != null) { + tritiumAmount = getTotalFluidAmount(Materials.Tritium.getFluid(Integer.MAX_VALUE), + getInputFluidInventory()); + } + return tritiumAmount[1] != 0 ? 1.0 * tritiumAmount[0] / tritiumAmount[1] : 0; + } + + private double getOxygenPercentage() { + int[] oxygenAmount = new int[2]; + if (getInputFluidInventory() != null) { + FluidStack oxygenStack = Materials.Oxygen.getPlasma(Integer.MAX_VALUE); + oxygenAmount = getTotalFluidAmount(oxygenStack, getInputFluidInventory()); + + } + return oxygenAmount[1] != 0 ? 1.0 * oxygenAmount[0] / oxygenAmount[1] : 0; + } + @Override - public int getNumProgressBars() { + public int getProgressBarCount() { return 3; } @Override - public double getFillPercentage(int index) { - if (index == 0) { - int[] fuelAmount = new int[2]; - if (getInputFluidInventory() != null) { - MultiblockFuelRecipeLogic recipeLogic = (MultiblockFuelRecipeLogic) recipeMapWorkable; - if (recipeLogic.getInputFluidStack() != null) { - FluidStack testStack = recipeLogic.getInputFluidStack().copy(); - testStack.amount = Integer.MAX_VALUE; - fuelAmount = getTotalFluidAmount(testStack, getInputFluidInventory()); - } - } - return fuelAmount[1] != 0 ? 1.0 * fuelAmount[0] / fuelAmount[1] : 0; - } else if (index == 1) { - int[] tritiumAmount = new int[2]; - if (getInputFluidInventory() != null) { - tritiumAmount = getTotalFluidAmount(Materials.Tritium.getFluid(Integer.MAX_VALUE), - getInputFluidInventory()); - } - return tritiumAmount[1] != 0 ? 1.0 * tritiumAmount[0] / tritiumAmount[1] : 0; - } else { - int[] oxygenAmount = new int[2]; - if (getInputFluidInventory() != null) { - FluidStack oxygenStack = Materials.Oxygen.getPlasma(Integer.MAX_VALUE); - oxygenAmount = getTotalFluidAmount(oxygenStack, getInputFluidInventory()); - - } - return oxygenAmount[1] != 0 ? 1.0 * oxygenAmount[0] / oxygenAmount[1] : 0; - } + public void registerBars(List> list, PanelSyncManager panelSyncManager) { + DoubleSyncValue fuelPercentageSync = new DoubleSyncValue(this::getFuelPercentage); + DoubleSyncValue tritiumPercentageSync = new DoubleSyncValue(this::getTritiumPercentage); + DoubleSyncValue oxygenPercentageSync = new DoubleSyncValue(this::getOxygenPercentage); + list.add(bar -> bar.value(fuelPercentageSync) + .texture(GTGuiTextures.PROGRESS_BAR_LCE_FUEL)); + list.add(bar -> bar.value(tritiumPercentageSync) + .texture(GTGuiTextures.PROGRESS_BAR_LCE_LUBRICANT)); + list.add(bar -> bar.value(oxygenPercentageSync) + .texture(GTGuiTextures.PROGRESS_BAR_LCE_OXYGEN)); } private static class NaquadahReactorWorkableHandler extends MultiblockFuelRecipeLogic { diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeRocketEngine.java b/src/main/java/com/fulltrix/gcyl/machines/multi/generator/MetaTileEntityLargeRocketEngine.java similarity index 90% rename from src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeRocketEngine.java rename to src/main/java/com/fulltrix/gcyl/machines/multi/generator/MetaTileEntityLargeRocketEngine.java index cfc3957f..125e4932 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityLargeRocketEngine.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/generator/MetaTileEntityLargeRocketEngine.java @@ -1,7 +1,8 @@ -package com.fulltrix.gcyl.machines.multi.advance; +package com.fulltrix.gcyl.machines.multi.generator; -import com.fulltrix.gcyl.item.metal.MetalCasing1; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.fulltrix.gcyl.blocks.metal.MetalCasing1; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregtech.api.GTValues; import gregtech.api.capability.IMultipleTankHandler; import gregtech.api.capability.impl.MultiblockFuelRecipeLogic; @@ -9,6 +10,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.*; +import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.unification.material.Materials; @@ -18,16 +20,18 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.FluidStack; -import org.jetbrains.annotations.NotNull; + +import java.util.List; +import java.util.function.UnaryOperator; import static com.fulltrix.gcyl.client.ClientHandler.NITINOL_60_CASING; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.METAL_CASING_1; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; import static gregtech.api.GTValues.LuV; import static gregtech.api.util.RelativeDirection.*; //TODO: implement ui, tooltip -public class MetaTileEntityLargeRocketEngine extends FuelMultiblockController implements IProgressBarMultiblock { +public class MetaTileEntityLargeRocketEngine extends FuelMultiblockController implements ProgressBarMultiblock { public MetaTileEntityLargeRocketEngine(ResourceLocation metaTileEntityId) { super(metaTileEntityId, GCYLRecipeMaps.ROCKET_FUEL_RECIPES, LuV); @@ -65,10 +69,15 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { } @Override - public double getFillPercentage(int i) { + public int getProgressBarCount() { return 0; } + @Override + public void registerBars(List> list, PanelSyncManager panelSyncManager) { + + } + public static class LREWorkableHandler extends MultiblockFuelRecipeLogic { diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java index b49140f9..a3b350d0 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java @@ -2,11 +2,9 @@ import codechicken.lib.raytracer.CuboidRayTraceResult; import com.fulltrix.gcyl.client.ClientHandler; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; -import com.fulltrix.gcyl.item.metal.MetalCasing1; import com.fulltrix.gcyl.materials.GCYLMaterials; -import com.fulltrix.gcyl.machines.multi.simple.GCYLRecipeMapMultiblockController; -import com.fulltrix.gcyl.recipes.recipeproperties.GCYLTemperatureProperty; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.api.recipes.properties.GCYLTemperatureProperty; import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; import gregtech.api.block.IHeatingCoilBlockStats; import gregtech.api.capability.IHeatingCoil; @@ -16,15 +14,18 @@ import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; import gregtech.api.pattern.TraceabilityPredicate; import gregtech.api.recipes.Recipe; import gregtech.api.recipes.RecipeMap; -import gregtech.api.recipes.recipeproperties.IRecipePropertyStorage; +import gregtech.api.recipes.logic.OCParams; +import gregtech.api.recipes.properties.RecipePropertyStorage; import gregtech.api.unification.material.Materials; import gregtech.api.util.GTUtility; +import gregtech.api.util.KeyUtil; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.Textures; import gregtech.common.blocks.BlockMetalCasing; @@ -55,6 +56,8 @@ public class MetaTileEntityDeepMiner extends GCYLRecipeMapMultiblockController implements IHeatingCoil { protected final MetaTileEntity metaTileEntity; + private final float TEMPERATURE_DURATION_MULTIPLIER = 1.11F; + private final float TEMPERATURE_DURATION_MULTIPLIER_INVERSE = 0.90F; private int currentTemperature; private int maxTemperature; @@ -97,23 +100,29 @@ public void addInformation(ItemStack stack, @Nullable World player, List tooltip.add(I18n.format("gcyl.multiblock.deep_miner.tooltip.4")); tooltip.add(I18n.format("gcyl.multiblock.deep_miner.tooltip.5")); tooltip.add(I18n.format("gcyl.multiblock.deep_miner.tooltip.6")); + tooltip.add(I18n.format("gcyl.multiblock.deep_miner.tooltip.11")); tooltip.add(I18n.format("gcyl.multiblock.deep_miner.tooltip.7")); - tooltip.add(I18n.format("gcyl.multiblock.deep_miner.tooltip.8")); + tooltip.add(I18n.format("gcyl.multiblock.deep_miner.tooltip.8", TEMPERATURE_DURATION_MULTIPLIER_INVERSE)); //tooltip.add(I18n.format("gcyl.multiblock.deep_miner.tooltip.9")); //tooltip.add(I18n.format("gcyl.multiblock.deep_miner.tooltip.10")); } @Override - protected void addDisplayText(List textList) { - super.addDisplayText(textList); - if (this.isStructureFormed() && !this.hasMaintenanceProblems()) { - textList.add(new TextComponentTranslation("gregtech.multiblock.universal.vom.temperature", getCurrentTemperature())); - textList.add(new TextComponentTranslation("gregtech.multiblock.deep_miner.max.temperature", getMaxTemperature())); - } + protected void configureDisplayText(MultiblockUIBuilder builder) { + builder.structureFormed(this.isStructureFormed()) + .addMaintenanceProblemLines(this.maintenance_problems, this.hasMaintenanceProblems()) + .addCustom((keyManager, uiSyncer) -> { + int currentTemp = uiSyncer.syncInt(getCurrentTemperature()); + int maxTemp = uiSyncer.syncInt(getMaxTemperature()); + keyManager.add(KeyUtil.lang("gregtech.multiblock.universal.vom.temperature", currentTemp)); + keyManager.add(KeyUtil.lang("gregtech.multiblock.deep_miner.max.temperature", maxTemp)); + keyManager.add(KeyUtil.lang("gregtech.multiblock.deep_miner.max.fluid consumption", uiSyncer.syncBoolean(this.recipeMapWorkable.isActive()) && currentTemp == maxTemp ? getHeatingFluidActiveMax(getFluidType()).amount : getHeatingFluid(getFluidType()).amount)); + }); if(this.getPos().getY() > 8 && !this.getWorld().isRemote) - textList.add(new TextComponentTranslation("gregtech.multiblock.deep_miner_error")); + builder.addCustom((keyManager, uiSyncer) -> keyManager.add(KeyUtil.lang("gregtech.multiblock.deep_miner_error"))); } + @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); @@ -131,10 +140,13 @@ protected void updateFormedValid() { if(this.recipeMapWorkable.isWorkingEnabled() && checkHeatingFluid() && getCurrentTemperature() <= getMaxTemperature()) { if(getOffsetTimer() % 20 == 0) { - if(getCurrentTemperature() != getMaxTemperature()) { + if(getCurrentTemperature() < getMaxTemperature()) { drainHeatingFluid(); increaseTemperature(); } + else if(getCurrentTemperature() == getMaxTemperature() && this.recipeMapWorkable.isActive()) { + drainHeatingFluidActiveMax(); + } else { if(!this.isActive()) decreaseTemperature(); @@ -160,6 +172,18 @@ protected FluidStack getHeatingFluid(int fluidType) { }; } + protected FluidStack getHeatingFluidActiveMax(int fluidType) { + return switch (fluidType) { + case 0 -> + Materials.Lava.getFluid(4 * (int) (Math.pow(2, 1.5 * GTUtility.getTierByVoltage(this.energyContainer.getInputVoltage())) / 10.0)); + case 1 -> + GCYLMaterials.Pyrotheum.getFluid((int) (Math.pow(2, 1.5 * GTUtility.getTierByVoltage(this.energyContainer.getInputVoltage())) / 10.0)); + case 2 -> + Materials.Helium.getFluid(FluidStorageKeys.PLASMA, (int) (4 * Math.pow(2, GTUtility.getTierByVoltage(this.energyContainer.getInputVoltage())) / 10.0)); + default -> GCYLMaterials.NeutronPlasma.getFluid(FluidStorageKeys.PLASMA,(int) (2 * Math.pow(2, GTUtility.getTierByVoltage(this.energyContainer.getInputVoltage())) / 10.0)); + }; + } + protected boolean checkHeatingFluid() { IMultipleTankHandler inputTank = this.getInputFluidInventory(); return getHeatingFluid(getFluidType()).isFluidStackIdentical(inputTank.drain(getHeatingFluid(getFluidType()), false)); @@ -169,6 +193,8 @@ protected void drainHeatingFluid() { this.getInputFluidInventory().drain(getHeatingFluid(getFluidType()), true); } + protected void drainHeatingFluidActiveMax() {this.getInputFluidInventory().drain(getHeatingFluidActiveMax(getFluidType()), true);} + protected void increaseTemperature() { if (getCurrentTemperature() < getMaxTemperature()) { int tTemperature = this.currentTemperature; @@ -343,15 +369,13 @@ public boolean checkRecipe(Recipe recipe) { } @Override - protected void modifyOverclockPre(int @NotNull [] values, @NotNull IRecipePropertyStorage storage) { - super.modifyOverclockPre(values, storage); + protected void modifyOverclockPre(@NotNull OCParams ocParams, @NotNull RecipePropertyStorage storage) { + super.modifyOverclockPre(ocParams, storage); - int recipeTemperature = storage.getRecipePropertyValue(GCYLTemperatureProperty.getInstance(),0); + int recipeTemperature = storage.get(GCYLTemperatureProperty.getInstance(),0); int temperatureDiff = deepMiner.getCurrentTemperature() - recipeTemperature; - double durationModifier = temperatureDiff / 1000 < 1 ? 1 : 1.25 * (temperatureDiff / 1000); - int recipeDuration = (int) (values[1] / durationModifier); - - values[1] = recipeDuration; + double durationModifier = temperatureDiff / 1000 < 1 ? 1 : TEMPERATURE_DURATION_MULTIPLIER * (temperatureDiff / 1000); + ocParams.setDuration((int) (ocParams.duration() / durationModifier)); } } } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityLaserMiner.java b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityLaserMiner.java new file mode 100644 index 00000000..39820ed8 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityLaserMiner.java @@ -0,0 +1,140 @@ +package com.fulltrix.gcyl.machines.multi.miner; + +import com.fulltrix.gcyl.api.multi.GCYLComputationRecipeLogic; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.client.ClientHandler; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils; +import com.fulltrix.gcyl.blocks.metal.MetalCasing1; +import com.fulltrix.gcyl.api.recipes.properties.AdvFusionCoilProperty; +import gregtech.api.capability.IOpticalComputationHatch; +import gregtech.api.capability.IOpticalComputationProvider; +import gregtech.api.capability.IOpticalComputationReceiver; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.pattern.*; +import gregtech.api.recipes.Recipe; +import gregtech.api.recipes.RecipeMap; +import gregtech.client.renderer.ICubeRenderer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.ResourceLocation; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +import static com.fulltrix.gcyl.api.pattern.TraceabilityPredicates.advFusionCoils; +import static com.fulltrix.gcyl.materials.GCYLMaterials.MetastableOganesson; + +public class MetaTileEntityLaserMiner extends GCYLRecipeMapMultiblockController implements IOpticalComputationReceiver { + + private IOpticalComputationProvider computationProvider; + private int coilTier; + + public MetaTileEntityLaserMiner(ResourceLocation metaTileEntityId, RecipeMap recipeMap, boolean isParallel) { + super(metaTileEntityId, recipeMap, isParallel); + this.recipeMapWorkable = new LaserMinerRecipeLogic(this); + } + + @Override + protected @NotNull BlockPattern createStructurePattern() { + return FactoryBlockPattern.start() + .aisle("####CCC#########CCC","####CCC#########CCC","####CCC#########CCC","####CCC#########CCC","####CCC#########CCC","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################") + .aisle("####CCC#########CCC","####CXC#########CXC","####CXC#########CXC","####CXC#########CXC","####CCC#########CCC","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################") + .aisle("####CCC#########CCC","####CCCC#######CCCC","####CCCC#######CCCC","####CCCC#######CCCC","####CCC#########CCC","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################") + .aisle("###################","######CC#######CC##","######CCC#####CCC##","######CC#######CC##","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################") + .aisle("###################","###################","#######CCC###CCC###","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################") + .aisle("###################","###################","########CCCCCCC####","###################","###################","###################","###################","###################","################B##","###############B###","##############B####","#############B#####","############B######","###########B#######","##########B########","#########B#########","########B##########","#######B###########","######B############","###################","###################","###################","###################","###################","###################") + .aisle("###################","###################","########CCCCCCC####","##########F#F######","##########F#F######","##########F#F######","##########F#F######","##########F#F###B##","##########F#F##B#B#","##########F#F#B#B##","##########F#FB#B###","##########F#B#B####","##########FB#B#####","##########B#B######","#########B#B#######","########B#B########","#######B#B#########","######B#B##########","#####B#B###########","#####BB############","####B##############","###B###############","##B################","###################","###################") + .aisle("###################","###################","########CCCCCCC####","###################","###################","###################","###################","###############BBB#","##############B###B","#############B###B#","############B###B##","###########B###B###","##########B###B####","#########B###B#####","########B###B######","#######B###B#######","######B###B########","######B##B#########","#####B##B##########","####BB#B###########","###BBBB############","##BBB##############","#BBB###############","BBB################","AB#################") + .aisle("###################","###################","########CCCCCCC####","##########F#F######","##########F#F######","##########F#F######","##########F#F######","##########F#F###B##","##########F#F##B#B#","##########F#F#B#B##","##########F#FB#B###","##########F#B#B####","##########FB#B#####","##########B#B######","#########B#B#######","########B#B########","#######B#B#########","######B#B##########","#####B#B###########","#####BB############","####B##############","###B###############","##B################","###################","###################") + .aisle("###################","###################","########CCCCCCC####","###################","###################","###################","###################","###################","################B##","###############B###","##############B####","#############B#####","############B######","###########B#######","##########B########","#########B#########","########B##########","#######B###########","######B############","###################","###################","###################","###################","###################","###################") + .aisle("###################","###################","#######CCC###CCC###","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################") + .aisle("###################","######CC#######CC##","######CCC#####CCC##","######CC#######CC##","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################") + .aisle("####CCC#########CCC","####CCCC#######CCCC","####CCCC#######CCCC","####CCCC#######CCCC","####CCC#########CCC","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################") + .aisle("####CCC#########CCC","####CXC#########CXC","####CXC#########CXC","####CXC#########CXC","####CCC#########CCC","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################") + .aisle("####CCC#########CCC","####CCC#########CCC","####CCC#########CCC","####CSC#########CCC","####CCC#########CCC","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################","###################") + .where('#', any()) + .where('C', states(getCasingState()).setMinGlobalLimited(240).or(autoAbilities()).or(abilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION).setExactLimit(1))) + .where('F', frames(MetastableOganesson)) + .where('X', tieredCasing()) + .where('B', advFusionCoils()) + .where('A', abilities(MultiblockAbility.OUTPUT_LASER)) + .where('S', selfPredicate()) + .build(); + } + + + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + Object type = context.get("AdvFusionCoilTier"); + if (type instanceof GCYLFusionCoils.CasingType) { + GCYLFusionCoils.CasingType casingType = (GCYLFusionCoils.CasingType) type; + + if (casingType.equals(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_1)) { + this.coilTier = 1; + } else if (casingType.equals(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_2)) { + this.coilTier = 2; + } else if (casingType.equals(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3)) { + this.coilTier = 3; + } else if (casingType.equals(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_4)) { + this.coilTier = 4; + } else if (casingType.equals(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_5)) { + this.coilTier = 5; + } + } + List providers = getAbilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION); + if (providers != null && providers.size() >= 1) { + computationProvider = providers.get(0); + } + + if (computationProvider == null) { + invalidateStructure(); + } + } + + private IBlockState getCasingState() { + return GCYLMetaBlocks.METAL_CASING_1.getState(MetalCasing1.CasingType.HASTELLOY_K243); + } + + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { + return ClientHandler.HASTELLOY_K243_CASING; + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEntity) { + return new MetaTileEntityLaserMiner(metaTileEntityId, this.recipeMap, this.isParallel()); + } + + @Override + public IOpticalComputationProvider getComputationProvider() { + return computationProvider; + } + + private class LaserMinerRecipeLogic extends GCYLComputationRecipeLogic { + + public LaserMinerRecipeLogic(RecipeMapMultiblockController metaTileEntity) { + super(metaTileEntity, ComputationType.STEADY); + } + + @NotNull + @Override + public MetaTileEntityLaserMiner getMetaTileEntity() { + return (MetaTileEntityLaserMiner) super.getMetaTileEntity(); + } + + @Override + public boolean checkRecipe(@NotNull Recipe recipe) { + if (!super.checkRecipe(recipe)) + return false; + + //do not run recipe if coil tier is too low + return recipe.getProperty(AdvFusionCoilProperty.getInstance(), 0) <= coilTier; + } + + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityVoidMiner.java b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityVoidMiner.java index 8c65b77d..22c4ae86 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityVoidMiner.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityVoidMiner.java @@ -3,9 +3,10 @@ import codechicken.lib.render.CCRenderState; import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Matrix4; -import com.fulltrix.gcyl.materials.GCYLMaterials; -import com.fulltrix.gcyl.item.metal.MetalCasing1; -import com.fulltrix.gcyl.item.metal.MetalCasing2; +import com.fulltrix.gcyl.api.multi.IVoidMinerProvider; +import com.fulltrix.gcyl.api.multi.VoidMinerLogic; +import com.fulltrix.gcyl.blocks.metal.MetalCasing1; +import com.fulltrix.gcyl.blocks.metal.MetalCasing2; import com.google.common.collect.Lists; import gregtech.api.GTValues; import gregtech.api.capability.*; @@ -17,11 +18,14 @@ import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase; +import gregtech.api.metatileentity.multiblock.ui.KeyManager; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; import gregtech.api.pattern.TraceabilityPredicate; -import gregtech.api.util.GTUtility; +import gregtech.api.util.KeyUtil; +import gregtech.api.util.TextComponentUtil; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.Textures; import gregtech.core.sound.GTSoundEvents; @@ -29,19 +33,14 @@ import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagInt; import net.minecraft.network.PacketBuffer; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.Style; -import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.items.IItemHandlerModifiable; @@ -49,17 +48,14 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; -import java.util.Collections; import java.util.List; import static com.fulltrix.gcyl.client.ClientHandler.*; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.METAL_CASING_1; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.METAL_CASING_2; -import static com.fulltrix.gcyl.recipes.categories.handlers.VoidMinerHandler.*; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_2; import static gregtech.api.unification.material.Materials.*; -import static gregtech.api.util.GTTransferUtils.addItemsToItemHandler; -public class MetaTileEntityVoidMiner extends MultiblockWithDisplayBase implements IControllable { //TODO: OpenComputers implementation +public class MetaTileEntityVoidMiner extends MultiblockWithDisplayBase implements IWorkable, IVoidMinerProvider { //TODO: OpenComputers implementation private static final int CONSUME_START = 100; private boolean isWorkingEnabled = false; @@ -76,27 +72,42 @@ public class MetaTileEntityVoidMiner extends MultiblockWithDisplayBase implement private int temperature = 0; private double currentDrillingFluid = CONSUME_START; + private final VoidMinerLogic voidMinerLogic; + public MetaTileEntityVoidMiner(ResourceLocation metaTileEntityId, int tier, int temp) { super(metaTileEntityId); this.tier = tier; this.energyDrain = GTValues.V[tier]; this.maxTemperature = temp; - this.reinitializeStructurePattern(); + this.voidMinerLogic = new VoidMinerLogic(this, tier, temp); + } + + @Override + public boolean shouldShowVoidingModeButton() { + return false; + } + + @Override + public void checkStructurePattern() { + if (!this.isStructureFormed()) { + reinitializeStructurePattern(); + } + super.checkStructurePattern(); } @Override public void invalidateStructure() { super.invalidateStructure(); resetTileAbilities(); - if (isActive) - setActive(false); + this.voidMinerLogic.invalidate(); } @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); initializeAbilities(); + this.voidMinerLogic.setMaxProgress(200); } private void initializeAbilities() { @@ -134,101 +145,31 @@ public boolean drainEnergy(boolean simulate) { } @Override - protected void updateFormedValid() { - if (!getWorld().isRemote && this.getNumMaintenanceProblems() < 6 && isWorkingEnabled()) { - if (overheat || !drainEnergy(false)) { - if (temperature > 0) { - temperature--; - } - if (temperature == 0) { - overheat = false; - } - if (currentDrillingFluid > CONSUME_START) { - currentDrillingFluid--; - } - if (currentDrillingFluid < CONSUME_START) { - currentDrillingFluid = CONSUME_START; - } - - if (isActive) - setActive(false); - return; - } + public IMultipleTankHandler getImportFluidHandler() { + return this.importFluidHandler; + } - if (getOffsetTimer() % 20 == 0) { - FluidStack pyrotheumFluid = GCYLMaterials.Pyrotheum.getFluid((int) currentDrillingFluid); - FluidStack cryotheumFluid = GCYLMaterials.Cryotheum.getFluid((int) currentDrillingFluid); - FluidStack drillingMudFluid = GCYLMaterials.DrillingMud.getFluid((int) currentDrillingFluid); - FluidStack usedDrillingMudFluid = GCYLMaterials.UsedDrillingMud.getFluid((int) currentDrillingFluid); - FluidStack canDrainPyrotheum = importFluidHandler.drain(pyrotheumFluid, false); - FluidStack canDrainCryotheum = importFluidHandler.drain(cryotheumFluid, false); - FluidStack canDrainDrillingMud = importFluidHandler.drain(drillingMudFluid, false); - int canFillUsedDrillingMud = exportFluidHandler.fill(usedDrillingMudFluid, false); - boolean hasConsume = false; - //consume fluid - if (canDrainDrillingMud != null && canDrainDrillingMud.amount == (int) currentDrillingFluid && - canFillUsedDrillingMud != 0 && canFillUsedDrillingMud == (int) currentDrillingFluid) { - importFluidHandler.drain(drillingMudFluid, true); - exportFluidHandler.fill(usedDrillingMudFluid, true); - } else { - setActive(false); - return; - } - - if (!isActive) - setActive(true); - - calculateMaintenance(); - - if (usingPyrotheum && canDrainPyrotheum != null && canDrainPyrotheum.amount == (int) currentDrillingFluid) { - importFluidHandler.drain(pyrotheumFluid, true); - temperature += (int) (currentDrillingFluid / 100.0); - currentDrillingFluid = currentDrillingFluid * 1.02; - hasConsume = true; - } else if (temperature > 0 && canDrainCryotheum != null && canDrainCryotheum.amount == (int) currentDrillingFluid) { - importFluidHandler.drain(cryotheumFluid, true); - currentDrillingFluid = currentDrillingFluid / 1.02; - temperature -= (int) (currentDrillingFluid / 100.0); - } - if (temperature < 0) { - temperature = 0; - } - if (currentDrillingFluid < CONSUME_START) { - currentDrillingFluid = CONSUME_START; - } - if (temperature > maxTemperature) { - overheat = true; - currentDrillingFluid = CONSUME_START; - return; - } - usingPyrotheum = !usingPyrotheum; - - currentDrillingFluid += this.getNumMaintenanceProblems(); - //mine - - int nbOres = temperature / 1000; - - if (nbOres == 0 || !hasConsume) { - return; - } - - List ores = getOres(); - Collections.shuffle(ores); - ores.stream().limit(10).peek(itemStack -> itemStack.setCount(getWorld().rand.nextInt(nbOres * nbOres) + 1)).forEach(itemStack -> addItemsToItemHandler(outputInventory, false, Collections.singletonList(itemStack))); + @Override + public IMultipleTankHandler getExportFluidHandler() { + return this.exportFluidHandler; + } + @Override + public IItemHandlerModifiable getOutputInventory() { + return this.outputInventory; + } + @Override + protected void updateFormedValid() { + if (!getWorld().isRemote) { + this.voidMinerLogic.updateLogic(); + if (this.voidMinerLogic.wasActiveAndNeedsUpdate()) { + this.voidMinerLogic.setWasActiveAndNeedsUpdate(false); + this.voidMinerLogic.setActive(false); } } } - List getOres() { - return switch (tier) { - case 8 -> ORES; - case 9 -> ORES_2; - default -> ORES_3; - }; - } - @Override protected @NotNull BlockPattern createStructurePattern() { return FactoryBlockPattern.start() @@ -283,29 +224,49 @@ public TraceabilityPredicate autoAbilities(boolean checkEnergyIn, public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { tooltip.add(I18n.format("gcyl.multiblock.void_miner.description.1")); tooltip.add(I18n.format("gcyl.multiblock.void_miner.description.2")); + tooltip.add(I18n.format("gcyl.multiblock.void_miner.description.11")); tooltip.add(I18n.format("gcyl.multiblock.void_miner.description.3")); + tooltip.add(I18n.format("gcyl.multiblock.void_miner.description.10", (int) ((this.voidMinerLogic.getMudMultiplier() - Math.floor(this.voidMinerLogic.getMudMultiplier())) * 100), this.voidMinerLogic.getMudMultiplier(),(int) (100 * (1.0 - 1.0 / this.voidMinerLogic.getMudMultiplier())))); tooltip.add(I18n.format("gcyl.multiblock.void_miner.description.4")); + tooltip.add(I18n.format("gcyl.multiblock.void_miner.description.7")); + tooltip.add(I18n.format("gcyl.multiblock.void_miner.description.8")); + tooltip.add(I18n.format("gcyl.multiblock.void_miner.description.9")); tooltip.add(I18n.format("gcyl.multiblock.void_miner.description.5")); tooltip.add(I18n.format("gcyl.multiblock.void_miner.description.6")); } @Override - protected void addDisplayText(List textList) { - if (this.isStructureFormed() && !this.hasMaintenanceProblems()) { - if (energyContainer != null && energyContainer.getEnergyCapacity() > 0) { - long maxVoltage = energyContainer.getInputVoltage(); - String voltageName = GTValues.VN[GTUtility.getTierByVoltage(maxVoltage)]; - textList.add(new TextComponentTranslation("gregtech.multiblock.max_energy_per_tick", maxVoltage, voltageName)); - } - textList.add(new TextComponentTranslation("gregtech.multiblock.universal.energy_used", energyDrain)); - textList.add(new TextComponentTranslation("gregtech.multiblock.universal.vom.temperature", temperature, maxTemperature)); - textList.add(new TextComponentTranslation("gregtech.multiblock.universal.drilling_fluid_amount", (int) currentDrillingFluid)); - if (overheat) { - textList.add(new TextComponentTranslation("gregtech.multiblock.universal.overheat").setStyle(new Style().setColor(TextFormatting.RED))); + protected void configureDisplayText(MultiblockUIBuilder builder) { + builder.setWorkingStatus(voidMinerLogic.isWorkingEnabled(), voidMinerLogic.isActive()) + .addCustom((keyManager, uiSyncer) -> { + if(isStructureFormed()) { + keyManager.add(KeyUtil.lang(TextFormatting.YELLOW,"gregtech.multiblock.universal.energy_used", energyDrain)); + keyManager.add(KeyUtil.lang(TextFormatting.GOLD,"gregtech.multiblock.universal.vom.temperature", this.voidMinerLogic.getTemperature())); + keyManager.add(KeyUtil.lang(TextFormatting.RED,"gregtech.multiblock.universal.vom.max_temperature", this.voidMinerLogic.getMaxTemperature())); + keyManager.add(KeyUtil.lang(TextFormatting.AQUA,"gregtech.multiblock.universal.drilling_fluid_amount", this.voidMinerLogic.getCurrentDrillingFluid())); } - } + }).addWorkingStatusLine() + .addProgressLine(getProgress(), getMaxProgress()); + } - super.addDisplayText(textList); + @Override + protected void configureWarningText(MultiblockUIBuilder builder) { + builder.addLowPowerLine(!drainEnergy(true)) + .addCustom((keyManager, uiSyncer) -> { + if(isStructureFormed()) { + if(this.voidMinerLogic.isFluidOutputFull()) { + keyManager.add(KeyUtil.lang( + TextFormatting.RED, + "gcyl.multiblock.vom.fluid_output_full")); + } + if(this.voidMinerLogic.isOverheat()) { + keyManager.add(KeyUtil.lang( + TextFormatting.RED, + "gregtech.multiblock.universal.overheat")); + } + } + }) + .addMaintenanceProblemLines(getMaintenanceProblems(), true); } public IBlockState getCasingState() { @@ -358,54 +319,45 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEnti @Override public void writeInitialSyncData(PacketBuffer buf) { super.writeInitialSyncData(buf); - buf.writeBoolean(isActive); - buf.writeBoolean(this.isWorkingEnabled); + this.voidMinerLogic.writeInitialSyncData(buf); } @Override public void receiveInitialSyncData(PacketBuffer buf) { super.receiveInitialSyncData(buf); - this.isActive = buf.readBoolean(); - this.isWorkingEnabled = buf.readBoolean(); + this.voidMinerLogic.receiveInitialSyncData(buf); } @Override public NBTTagCompound writeToNBT(NBTTagCompound data) { super.writeToNBT(data); - data.setTag("temperature", new NBTTagInt(temperature)); - data.setTag("currentDrillingFluid", new NBTTagDouble(currentDrillingFluid)); - data.setTag("overheat", new NBTTagInt(overheat ? 1 : 0)); - data.setBoolean("isActive", this.isActive); - data.setBoolean("isWorkingEnabled", this.isWorkingEnabled); - return data; + return this.voidMinerLogic.writeToNBT(data); } @Override public void readFromNBT(NBTTagCompound data) { super.readFromNBT(data); - temperature = data.getInteger("temperature"); - currentDrillingFluid = data.getDouble("currentDrillingFluid"); - overheat = data.getInteger("overheat") != 0; - this.isActive = data.getBoolean("isActive"); - this.isWorkingEnabled = data.getBoolean("isWorkingEnabled"); + reinitializeStructurePattern(); + this.voidMinerLogic.readFromNBT(data); } @Override public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { super.renderMetaTileEntity(renderState, translation, pipeline); - getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), this.isActive(), this.isWorkingEnabled); + getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), this.voidMinerLogic.isActive(), this.voidMinerLogic.isWorkingEnabled()); } @Override public void receiveCustomData(int dataId, PacketBuffer buf) { super.receiveCustomData(dataId, buf); if (dataId == GregtechDataCodes.WORKABLE_ACTIVE) { - this.isActive = buf.readBoolean(); + this.voidMinerLogic.setActive(buf.readBoolean()); scheduleRenderUpdate(); } else if (dataId == GregtechDataCodes.WORKING_ENABLED) { - this.isWorkingEnabled = buf.readBoolean(); + this.voidMinerLogic.setWorkingEnabled(buf.readBoolean()); scheduleRenderUpdate(); } + } @Override @@ -415,56 +367,37 @@ public SoundEvent getSound() { @Override public T getCapability(Capability capability, EnumFacing side) { - if (capability == GregtechTileCapabilities.CAPABILITY_CONTROLLABLE) { + if (capability == GregtechTileCapabilities.CAPABILITY_WORKABLE) + return GregtechTileCapabilities.CAPABILITY_WORKABLE.cast(this); + if (capability == GregtechTileCapabilities.CAPABILITY_CONTROLLABLE) return GregtechTileCapabilities.CAPABILITY_CONTROLLABLE.cast(this); - } return super.getCapability(capability, side); } @Override public boolean isWorkingEnabled() { - return isWorkingEnabled; + return this.voidMinerLogic.isWorkingEnabled(); } @Override public void setWorkingEnabled(boolean isWorkingAllowed) { - this.isWorkingEnabled = isWorkingAllowed; - markDirty(); - World world = getWorld(); - if (world != null && !world.isRemote) { - writeCustomData(GregtechDataCodes.WORKING_ENABLED, buf -> buf.writeBoolean(isWorkingEnabled)); - } + this.voidMinerLogic.setWorkingEnabled(isWorkingAllowed); } @Override - public boolean isActive() { - return super.isActive() && this.isWorkingEnabled; + public int getProgress() { + return voidMinerLogic.getProgressTime(); } - protected void setActive(boolean active) { - if (this.isActive != active) { - this.isActive = active; - markDirty(); - World world = getWorld(); - if (world != null && !world.isRemote) { - writeCustomData(GregtechDataCodes.WORKABLE_ACTIVE, buf -> buf.writeBoolean(active)); - } - } - } - - public int getMaxTemperature() { - return maxTemperature; - } - - public boolean isOverheat() { - return overheat; + @Override + public int getMaxProgress() { + return voidMinerLogic.getMaxProgress(); } - public int getTemperature() { - return temperature; - } + public int getProgressPercent() {return voidMinerLogic.getProgressPercent();} - public double getCurrentDrillingFluid() { - return currentDrillingFluid; + @Override + public boolean isActive() { + return super.isActive() && this.voidMinerLogic.isActive(); } } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/virtual/MetaTileEntityPrimitiveVirtual.java b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/virtual/MetaTileEntityPrimitiveVirtual.java new file mode 100644 index 00000000..17202278 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/virtual/MetaTileEntityPrimitiveVirtual.java @@ -0,0 +1,84 @@ +package com.fulltrix.gcyl.machines.multi.miner.virtual; + +import com.fulltrix.gcyl.api.multi.abilities.GCYLAbilities; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.pattern.BlockPattern; +import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.TraceabilityPredicate; +import gregtech.api.unification.material.Materials; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.client.renderer.texture.Textures; +import gregtech.common.blocks.BlockMetalCasing; +import gregtech.common.blocks.MetaBlocks; +import gregtech.core.sound.GTSoundEvents; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectList; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.NotNull; + +import java.util.Collections; + +//TODO finish implementing +public class MetaTileEntityPrimitiveVirtual extends MetaTileEntityVirtualMiner { + + private final ObjectList layers = new ObjectArrayList<>(Collections.singletonList(0)); + + public MetaTileEntityPrimitiveVirtual(ResourceLocation metaTileEntityId) { + super(metaTileEntityId, 0); + } + + @Override + protected @NotNull BlockPattern createStructurePattern() { + return FactoryBlockPattern.start() + .aisle("##F##","##F##","##F##","#####","#####") + .aisle("#####","##F##","#####","#####","#####") + .aisle("F#D#F","FFCFF","F#S#F","##X##","##X##") + .aisle("#####","##F##","#####","#####","#####") + .aisle("##F##","##F##","##F##","#####","#####") + .where('S', selfPredicate()) + .where('X', getFramePredicate() + .or(abilities(MultiblockAbility.EXPORT_ITEMS, MultiblockAbility.IMPORT_ITEMS).setMaxGlobalLimited(2))) + .where('D', abilities(GCYLAbilities.DRILL_HOLDER)) + .where('C', states(getCasingState())) + .where('F', getFramePredicate()) + .where('#', any()) + .build(); + } + + private IBlockState getCasingState() { + return MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.STEEL_SOLID); + } + + @NotNull + private TraceabilityPredicate getFramePredicate() { + return frames(Materials.Steel); + } + + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { + return Textures.SOLID_STEEL_CASING; + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEntity) { + return new MetaTileEntityPrimitiveVirtual(metaTileEntityId); + } + + @Override + public ObjectList getLayers() { + return this.layers; + } + + @SideOnly(Side.CLIENT) + @Override + public SoundEvent getSound() { + return GTSoundEvents.DRILL_TOOL; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/virtual/MetaTileEntityVirtualMiner.java b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/virtual/MetaTileEntityVirtualMiner.java new file mode 100644 index 00000000..9b7a6646 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/virtual/MetaTileEntityVirtualMiner.java @@ -0,0 +1,377 @@ +package com.fulltrix.gcyl.machines.multi.miner.virtual; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.fulltrix.gcyl.api.multi.VirtualMinerLogic; +import com.fulltrix.gcyl.api.multi.abilities.GCYLAbilities; +import com.fulltrix.gcyl.api.worldgen.VirtualOreVeinHandler; +import com.google.common.collect.Lists; +import gregtech.api.GTValues; +import gregtech.api.capability.GregtechTileCapabilities; +import gregtech.api.capability.IEnergyContainer; +import gregtech.api.capability.IMultipleTankHandler; +import gregtech.api.capability.IWorkable; +import gregtech.api.capability.impl.EnergyContainerList; +import gregtech.api.capability.impl.FluidTankList; +import gregtech.api.capability.impl.ItemHandlerList; +import gregtech.api.gui.GuiTextures; +import gregtech.api.gui.resources.TextureArea; +import gregtech.api.metatileentity.ITieredMetaTileEntity; +import gregtech.api.metatileentity.multiblock.IProgressBarMultiblock; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase; +import gregtech.api.pattern.PatternMatchContext; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.properties.PropertyKey; +import gregtech.api.unification.ore.OrePrefix; +import gregtech.api.util.GTUtility; +import gregtech.api.util.TextComponentUtil; +import gregtech.api.worldgen.bedrockFluids.BedrockFluidVeinHandler; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.client.renderer.texture.Textures; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectList; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.fluids.FluidUtil; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.IItemHandlerModifiable; +import net.minecraftforge.items.ItemStackHandler; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +import static gregtech.api.items.toolitem.ToolHelper.DURABILITY_KEY; +import static gregtech.api.items.toolitem.ToolHelper.MAX_DURABILITY_KEY; + + +//TODO finish implementing +public abstract class MetaTileEntityVirtualMiner extends MultiblockWithDisplayBase implements ITieredMetaTileEntity, IWorkable, IProgressBarMultiblock { + + protected final int tier; + protected ObjectList layers = new ObjectArrayList<>(); + protected final VirtualMinerLogic minerLogic; + protected IMultipleTankHandler inputFluidInventory; + protected IItemHandlerModifiable inputInventory; + protected IItemHandlerModifiable outputInventory; + protected IItemHandlerModifiable drillHolder; + + protected IEnergyContainer energyContainer; + protected int fuelBurnTimeLeft; + + public MetaTileEntityVirtualMiner(ResourceLocation metaTileEntityId, int tier) { + super(metaTileEntityId); + this.tier = tier; + this.minerLogic = new VirtualMinerLogic(this); + } + + protected void initializeAbilities() { + this.inputInventory = new ItemHandlerList(getAbilities(MultiblockAbility.IMPORT_ITEMS)); + this.outputInventory = new ItemHandlerList(getAbilities(MultiblockAbility.EXPORT_ITEMS)); + this.drillHolder = new ItemHandlerList(getAbilities(GCYLAbilities.DRILL_HOLDER)); + + if(this.tier > 0) { + this.inputFluidInventory = new FluidTankList(true, getAbilities(MultiblockAbility.IMPORT_FLUIDS)); + this.energyContainer = new EnergyContainerList(getAbilities(MultiblockAbility.INPUT_ENERGY)); + } + } + + @Override + protected void updateFormedValid() { + this.minerLogic.performDrilling(); + if (!getWorld().isRemote && this.minerLogic.wasActiveAndNeedsUpdate()) { + this.minerLogic.setWasActiveAndNeedsUpdate(false); + this.minerLogic.setActive(false); + } + } + + @Override + public boolean hasMaintenanceMechanics() { + return false; + } + + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + initializeAbilities(); + } + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + resetTileAbilities(); + if (this.minerLogic.isActive()) + this.minerLogic.setActive(false); + } + + private void resetTileAbilities() { + + this.inputInventory = new ItemStackHandler(0); + this.outputInventory = new ItemStackHandler(0); + this.drillHolder = new ItemStackHandler(0); + + if(this.tier > 0) { + this.inputFluidInventory = new FluidTankList(true); + this.energyContainer = new EnergyContainerList(Lists.newArrayList()); + } + } + + @Override + public IItemHandlerModifiable getExportItems() { + return this.outputInventory; + } + + public ObjectList getLayers() { + return this.layers; + } + + public boolean useDrill(boolean simulate) { + ItemStack drill = drillHolder.getStackInSlot(0); + + if(drill.isEmpty()) + return false; + + if(OreDictUnifier.getPrefix(drill) != OrePrefix.toolHeadDrill) { + return false; + } + else { + if(simulate) return true; + + Material material = OreDictUnifier.getMaterial(drill).material; + + if(drill.getTagCompound() == null){ + + NBTTagCompound tagCompound = new NBTTagCompound(); + + int durability = material.getProperty(PropertyKey.TOOL).getToolDurability(); + + tagCompound.setInteger(MAX_DURABILITY_KEY, durability); + tagCompound.setInteger(DURABILITY_KEY, durability); + + drill.setTagCompound(tagCompound); + + drill.setStackDisplayName(drill.getDisplayName() + " (" + durability + "/" + durability + ")"); + + return true; + } else { + NBTTagCompound tagCompound = drill.getTagCompound(); + + if(tagCompound.getInteger(DURABILITY_KEY) == 0) { + drill.shrink(1); + return false; + } + else { + tagCompound.setInteger(DURABILITY_KEY, tagCompound.getInteger(DURABILITY_KEY) - 1); + + drill.setStackDisplayName(drill.getDisplayName() + " (" + tagCompound.getInteger(DURABILITY_KEY) + "/" + tagCompound.getInteger(MAX_DURABILITY_KEY) + ")"); + + drill.setTagCompound(tagCompound); + + return true; + } + } + } + } + + public boolean drainEnergy(boolean simulate) { + long energyToDrain = GTValues.VA[getEnergyTier()]; + long resultEnergy = energyContainer.getEnergyStored() - energyToDrain; + if (resultEnergy >= 0L && resultEnergy <= energyContainer.getEnergyCapacity()) { + if (!simulate) + energyContainer.changeEnergy(-energyToDrain); + return true; + } + return false; + } + + public boolean consumeFuel(boolean simulate) { + if(inputInventory.getSlots() == 0) return false; + + ItemStack fuelInSlot = inputInventory.extractItem(0, 1, true); + if (fuelInSlot.isEmpty()) return false; + // Prevent consuming buckets with burn time + if (FluidUtil.getFluidHandler(fuelInSlot) != null) { + return false; + } + int burnTime = TileEntityFurnace.getItemBurnTime(fuelInSlot); + if (burnTime <= 0) return false; + + if(!simulate) { + inputInventory.extractItem(0, 1, false); + setFuelMaxBurnTime(burnTime); + } + + return true; + } + + public void setFuelMaxBurnTime(int fuelMaxBurnTime) { + this.fuelBurnTimeLeft = fuelMaxBurnTime; + if (!getWorld().isRemote) { + markDirty(); + } + } + + public int getFuelBurnTimeLeft() { + return this.fuelBurnTimeLeft; + } + + public void removeBurnTime() { + this.fuelBurnTimeLeft--; + } + + public long getEnergyInputPerSecond() { + return energyContainer.getInputPerSec(); + } + + public int getDepletionChance() { + return 1; + } + + public int getRigMultiplier() { + return 1; + } + + @Override + public int getTier() { + return this.tier; + } + + public int getEnergyTier() { + if (energyContainer == null) return this.tier; + return Math.min(this.tier + 1, + Math.max(this.tier, GTUtility.getFloorTierByVoltage(energyContainer.getInputVoltage()))); + } + + @Override + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + super.renderMetaTileEntity(renderState, translation, pipeline); + this.getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), + this.minerLogic.isActive(), this.minerLogic.isWorkingEnabled()); + } + + @Override + public boolean isActive() { + return minerLogic.isActive() && isWorkingEnabled(); + } + + @SideOnly(Side.CLIENT) + @NotNull + @Override + protected ICubeRenderer getFrontOverlay() { + return Textures.LARGE_MINER_OVERLAY_BASIC; + } + + @Override + public TextureArea getProgressBarTexture(int index) { + return GuiTextures.PROGRESS_BAR_FLUID_RIG_DEPLETION; + } + + @Override + public void addBarHoverText(List hoverList, int index) { + int numOperationsLeft = BedrockFluidVeinHandler.getOperationsRemaining(getWorld(), minerLogic.getChunkX(), + minerLogic.getChunkZ()); + int maxOperations = BedrockFluidVeinHandler.MAXIMUM_VEIN_OPERATIONS; + int percentage = (int) Math.round(1.0 * numOperationsLeft / maxOperations * 100); + TextFormatting color = percentage > 40 ? TextFormatting.GREEN : + percentage > 10 ? TextFormatting.YELLOW : TextFormatting.RED; + + if (numOperationsLeft == 0) { + hoverList.add(TextComponentUtil.translationWithColor(TextFormatting.RED, + "gregtech.multiblock.fluid_rig.vein_depleted")); + } else { + ITextComponent veinInfo = TextComponentUtil.stringWithColor(color, percentage + "%"); + hoverList.add(TextComponentUtil.translationWithColor( + TextFormatting.GRAY, + "gregtech.multiblock.fluid_rig.vein_depletion", + veinInfo)); + } + } + + @Override + public boolean isWorkingEnabled() { + return this.minerLogic.isWorkingEnabled(); + } + + @Override + public void setWorkingEnabled(boolean isActivationAllowed) { + this.minerLogic.setWorkingEnabled(isActivationAllowed); + } + + @Override + public boolean allowsExtendedFacing() { + return false; + } + + @Override + public boolean shouldShowVoidingModeButton() { + return false; + } + + @Override + public double getFillPercentage(int index) { + int numOperationsLeft = VirtualOreVeinHandler.getOperationsRemaining(getWorld(), minerLogic.getChunkX(), + minerLogic.getChunkZ()).get(index); + int maxOperations = VirtualOreVeinHandler.getYield(getWorld(), minerLogic.getChunkX(), + minerLogic.getChunkZ()).get(index); + return 1.0 * numOperationsLeft / maxOperations; + } + + @Override + public T getCapability(Capability capability, EnumFacing side) { + if (capability == GregtechTileCapabilities.CAPABILITY_WORKABLE) + return GregtechTileCapabilities.CAPABILITY_WORKABLE.cast(this); + if (capability == GregtechTileCapabilities.CAPABILITY_CONTROLLABLE) + return GregtechTileCapabilities.CAPABILITY_CONTROLLABLE.cast(this); + return super.getCapability(capability, side); + } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound data) { + super.writeToNBT(data); + return this.minerLogic.writeToNBT(data); + } + + @Override + public void readFromNBT(NBTTagCompound data) { + super.readFromNBT(data); + this.minerLogic.readFromNBT(data); + } + + @Override + public void writeInitialSyncData(PacketBuffer buf) { + super.writeInitialSyncData(buf); + this.minerLogic.writeInitialSyncData(buf); + } + + @Override + public void receiveInitialSyncData(PacketBuffer buf) { + super.receiveInitialSyncData(buf); + this.minerLogic.receiveInitialSyncData(buf); + } + + @Override + public void receiveCustomData(int dataId, PacketBuffer buf) { + super.receiveCustomData(dataId, buf); + this.minerLogic.receiveCustomData(dataId, buf); + } + + @Override + public int getProgress() { + return minerLogic.getProgressTime(); + } + + @Override + public int getMaxProgress() { + return VirtualMinerLogic.MAX_PROGRESS; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityDrillHolder.java b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityDrillHolder.java new file mode 100644 index 00000000..30cf301d --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityDrillHolder.java @@ -0,0 +1,298 @@ +package com.fulltrix.gcyl.machines.multi.multiblockpart; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.api.widget.IWidget; +import com.cleanroommc.modularui.factory.PosGuiData; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.screen.UISettings; +import com.cleanroommc.modularui.value.BoolValue; +import com.cleanroommc.modularui.value.sync.BooleanSyncValue; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.cleanroommc.modularui.value.sync.SyncHandlers; +import com.cleanroommc.modularui.widget.Widget; +import com.cleanroommc.modularui.widgets.SlotGroupWidget; +import com.cleanroommc.modularui.widgets.ToggleButton; +import com.cleanroommc.modularui.widgets.layout.Column; +import com.cleanroommc.modularui.widgets.layout.Grid; +import com.cleanroommc.modularui.widgets.slot.ItemSlot; +import com.fulltrix.gcyl.api.multi.abilities.GCYLAbilities; +import gregtech.api.capability.GregtechDataCodes; +import gregtech.api.capability.GregtechTileCapabilities; +import gregtech.api.capability.IControllable; +import gregtech.api.capability.impl.NotifiableItemStackHandler; +import gregtech.api.items.itemhandlers.GTItemStackHandler; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.AbilityInstances; +import gregtech.api.metatileentity.multiblock.IMultiblockAbilityPart; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.mui.GTGuiTextures; +import gregtech.api.mui.GTGuis; +import gregtech.api.util.GTHashMaps; +import gregtech.client.renderer.texture.Textures; +import gregtech.client.renderer.texture.cube.SimpleOverlayRenderer; +import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityMultiblockNotifiablePart; +import it.unimi.dsi.fastutil.objects.Object2IntMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.items.IItemHandlerModifiable; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; + +public class MetaTileEntityDrillHolder extends MetaTileEntityMultiblockNotifiablePart implements IMultiblockAbilityPart, IControllable { + private boolean workingEnabled; + public MetaTileEntityDrillHolder(ResourceLocation metaTileEntityId) { + super(metaTileEntityId, 0, false); + this.workingEnabled = true; + initializeInventory(); + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { + return new MetaTileEntityDrillHolder(metaTileEntityId); + } + + /* + @Override + public void addToMultiBlock(MultiblockControllerBase controllerBase) { + super.addToMultiBlock(controllerBase); + if (this.importItems instanceof ItemHandlerList) { + for (IItemHandler handler : ((ItemHandlerList) this.importItems).getBackingHandlers()) { + if (handler instanceof INotifiableHandler notifiable) { + notifiable.addNotifiableMetaTileEntity(controllerBase); + notifiable.addToNotifiedList(this, handler, false); + } + } + } + } + + */ + + @Override + public void setWorkingEnabled(boolean workingEnabled) { + this.workingEnabled = workingEnabled; + World world = getWorld(); + if (world != null && !world.isRemote) { + writeCustomData(GregtechDataCodes.WORKING_ENABLED, buf -> buf.writeBoolean(workingEnabled)); + } + } + + @Override + public boolean isWorkingEnabled() { + return workingEnabled; + } + + @Override + public MultiblockAbility getAbility() { + return GCYLAbilities.DRILL_HOLDER; + } + + @Override + public void registerAbilities(@NotNull AbilityInstances abilityInstances) { + abilityInstances.add(this.importItems); + } + + @Override + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + super.renderMetaTileEntity(renderState, translation, pipeline); + if (shouldRenderOverlay()) { + SimpleOverlayRenderer renderer = Textures.PIPE_IN_OVERLAY; + renderer.renderSided(getFrontFacing(), renderState, translation, pipeline); + SimpleOverlayRenderer overlay = Textures.ITEM_HATCH_INPUT_OVERLAY; + overlay.renderSided(getFrontFacing(), renderState, translation, pipeline); + } + } + + private int getInventorySize() { + return 1; + } + + @Override + protected IItemHandlerModifiable createExportItemHandler() { + return isExportHatch ? new NotifiableItemStackHandler(this, getInventorySize(), getController(), true) : + new GTItemStackHandler(this, 0); + } + + @Override + protected IItemHandlerModifiable createImportItemHandler() { + return isExportHatch ? new GTItemStackHandler(this, 0) : + new NotifiableItemStackHandler(this, getInventorySize(), getController(), false); + } + + @Override + public T getCapability(Capability capability, EnumFacing side) { + if (capability == GregtechTileCapabilities.CAPABILITY_CONTROLLABLE) { + return GregtechTileCapabilities.CAPABILITY_CONTROLLABLE.cast(this); + } + return super.getCapability(capability, side); + } + + @Override + public void writeInitialSyncData(PacketBuffer buf) { + super.writeInitialSyncData(buf); + buf.writeBoolean(workingEnabled); + } + + @Override + public void receiveInitialSyncData(PacketBuffer buf) { + super.receiveInitialSyncData(buf); + this.workingEnabled = buf.readBoolean(); + } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound data) { + super.writeToNBT(data); + data.setBoolean("workingEnabled", workingEnabled); + return data; + } + + @Override + public void readFromNBT(NBTTagCompound data) { + super.readFromNBT(data); + if (data.hasKey("workingEnabled")) { + this.workingEnabled = data.getBoolean("workingEnabled"); + } + } + + @Override + public void receiveCustomData(int dataId, PacketBuffer buf) { + super.receiveCustomData(dataId, buf); + if (dataId == GregtechDataCodes.WORKING_ENABLED) { + this.workingEnabled = buf.readBoolean(); + } + } + + @Override + public boolean usesMui2() { + return true; + } + + + @Override + public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager guiSyncManager, UISettings settings) { + int rowSize = (int) Math.sqrt(getInventorySize()); + guiSyncManager.registerSlotGroup("item_inv", rowSize); + + int backgroundWidth = Math.max( + 9 * 18 + 18 + 14 + 5, // Player Inv width + rowSize * 18 + 14); // Bus Inv width + int backgroundHeight = 18 + 18 * rowSize + 94; + + List> widgets = new ArrayList<>(); + for (int i = 0; i < rowSize; i++) { + widgets.add(new ArrayList<>()); + for (int j = 0; j < rowSize; j++) { + widgets.get(i) + .add(new ItemSlot() + .slot(SyncHandlers.itemSlot(isExportHatch ? exportItems : importItems, i * rowSize + j) + .slotGroup("item_inv") + .accessibility(!isExportHatch, true))); + } + } + + BooleanSyncValue workingStateValue = new BooleanSyncValue(() -> workingEnabled, val -> workingEnabled = val); + guiSyncManager.syncValue("working_state", workingStateValue); + + boolean hasGhostCircuit = false; + + return GTGuis.createPanel(this, backgroundWidth, backgroundHeight) + .child(IKey.lang(getMetaFullName()).asWidget().pos(5, 5)) + .child(SlotGroupWidget.playerInventory(true).left(7).bottom(7)) + .child(new Grid() + .top(18).height(rowSize * 18) + .minElementMargin(0, 0) + .minColWidth(18).minRowHeight(18) + .alignX(0.5f) + .matrix(widgets)) + .child(new Column() + .pos(backgroundWidth - 7 - 18, backgroundHeight - 18 * 4 - 7 - 5) + .width(18).height(18 * 4 + 5) + .child(GTGuiTextures.getLogo(getUITheme()).asWidget().size(17).top(18 * 3 + 5)) + .child(new ToggleButton() + .top(18 * 2) + .value(new BoolValue.Dynamic(workingStateValue::getBoolValue, + workingStateValue::setBoolValue)) + .overlay(GTGuiTextures.BUTTON_ITEM_OUTPUT) + .tooltipBuilder(t -> t.setAutoUpdate(true) + .addLine(isExportHatch ? + (workingStateValue.getBoolValue() ? + IKey.lang("gregtech.gui.item_auto_output.tooltip.enabled") : + IKey.lang("gregtech.gui.item_auto_output.tooltip.disabled")) : + (workingStateValue.getBoolValue() ? + IKey.lang("gregtech.gui.item_auto_input.tooltip.enabled") : + IKey.lang("gregtech.gui.item_auto_input.tooltip.disabled"))))) + .childIf(!hasGhostCircuit, new Widget<>() + .background(GTGuiTextures.SLOT, GTGuiTextures.BUTTON_X) + .tooltip(t -> t.addLine( + IKey.lang("gregtech.gui.configurator_slot.unavailable.tooltip"))))); + } + + private static void collapseInventorySlotContents(IItemHandlerModifiable inventory) { + // Gather a snapshot of the provided inventory + Object2IntMap inventoryContents = GTHashMaps.fromItemHandler(inventory, true); + + List inventoryItemContents = new ArrayList<>(); + + // Populate the list of item stacks in the inventory with apportioned item stacks, for easy replacement + for (Object2IntMap.Entry e : inventoryContents.object2IntEntrySet()) { + ItemStack stack = e.getKey(); + int count = e.getIntValue(); + int maxStackSize = stack.getMaxStackSize(); + while (count >= maxStackSize) { + ItemStack copy = stack.copy(); + copy.setCount(maxStackSize); + inventoryItemContents.add(copy); + count -= maxStackSize; + } + if (count > 0) { + ItemStack copy = stack.copy(); + copy.setCount(count); + inventoryItemContents.add(copy); + } + } + + for (int i = 0; i < inventory.getSlots(); i++) { + ItemStack stackToMove; + // Ensure that we are not exceeding the List size when attempting to populate items + if (i >= inventoryItemContents.size()) { + stackToMove = ItemStack.EMPTY; + } else { + stackToMove = inventoryItemContents.get(i); + } + + // Populate the slots + inventory.setStackInSlot(i, stackToMove); + } + } + + @Override + public void addInformation(ItemStack stack, @Nullable World player, @NotNull List tooltip, + boolean advanced) { + if (this.isExportHatch) + tooltip.add(I18n.format("gregtech.machine.item_bus.export.tooltip")); + else + tooltip.add(I18n.format("gregtech.machine.item_bus.import.tooltip")); + tooltip.add(I18n.format("gregtech.universal.tooltip.item_storage_capacity", getInventorySize())); + tooltip.add(I18n.format("gregtech.universal.enabled")); + } + + @Override + public void addToolUsages(ItemStack stack, @Nullable World world, List tooltip, boolean advanced) { + tooltip.add(I18n.format("gregtech.tool_action.screwdriver.access_covers")); + tooltip.add(I18n.format("gregtech.tool_action.screwdriver.auto_collapse")); + tooltip.add(I18n.format("gregtech.tool_action.wrench.set_facing")); + super.addToolUsages(stack, world, tooltip, advanced); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityHPCAComputationPlus.java b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityHPCAComputationPlus.java index d8ac391c..6b4fd844 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityHPCAComputationPlus.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityHPCAComputationPlus.java @@ -1,11 +1,13 @@ package com.fulltrix.gcyl.machines.multi.multiblockpart; +import com.cleanroommc.modularui.drawable.UITexture; import gregtech.api.GTValues; import gregtech.api.capability.IHPCAComputationProvider; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.resources.TextureArea; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.mui.GTGuiTextures; import gregtech.client.renderer.texture.Textures; import gregtech.client.renderer.texture.cube.SimpleOverlayRenderer; import gregtech.common.metatileentities.multi.multiblockpart.hpca.MetaTileEntityHPCAComponent; @@ -75,12 +77,12 @@ public boolean canBeDamaged() { } @Override - public TextureArea getComponentIcon() { + public UITexture getComponentIcon() { if (isDamaged()) { - return advanced ? GuiTextures.HPCA_ICON_DAMAGED_ADVANCED_COMPUTATION_COMPONENT : - GuiTextures.HPCA_ICON_DAMAGED_COMPUTATION_COMPONENT; + return advanced ? GTGuiTextures.HPCA_ICON_DAMAGED_ADVANCED_COMPUTATION_COMPONENT : + GTGuiTextures.HPCA_ICON_DAMAGED_COMPUTATION_COMPONENT; } - return advanced ? GuiTextures.HPCA_ICON_ADVANCED_COMPUTATION_COMPONENT : - GuiTextures.HPCA_ICON_COMPUTATION_COMPONENT; + return advanced ? GTGuiTextures.HPCA_ICON_ADVANCED_COMPUTATION_COMPONENT : + GTGuiTextures.HPCA_ICON_COMPUTATION_COMPONENT; } } \ No newline at end of file diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityHPCACoolingPlus.java b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityHPCACoolingPlus.java index 626bfc90..dad9afba 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityHPCACoolingPlus.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityHPCACoolingPlus.java @@ -1,11 +1,13 @@ package com.fulltrix.gcyl.machines.multi.multiblockpart; +import com.cleanroommc.modularui.drawable.UITexture; import gregtech.api.GTValues; import gregtech.api.capability.IHPCACoolantProvider; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.resources.TextureArea; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.mui.GTGuiTextures; import gregtech.client.renderer.texture.Textures; import gregtech.client.renderer.texture.cube.SimpleOverlayRenderer; import gregtech.common.metatileentities.multi.multiblockpart.hpca.MetaTileEntityHPCAComponent; @@ -56,8 +58,8 @@ public boolean canBeDamaged() { } @Override - public TextureArea getComponentIcon() { - return GuiTextures.HPCA_ICON_ACTIVE_COOLER_COMPONENT; + public UITexture getComponentIcon() { + return GTGuiTextures.HPCA_ICON_ACTIVE_COOLER_COMPONENT; } @Override diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityISO1CleaningMaintenanceHatch.java b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityISO1CleaningMaintenanceHatch.java new file mode 100644 index 00000000..b7b2bf41 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityISO1CleaningMaintenanceHatch.java @@ -0,0 +1,134 @@ +package com.fulltrix.gcyl.machines.multi.multiblockpart; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.ColourMultiplier; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; +import com.fulltrix.gcyl.client.ClientHandler; +import com.fulltrix.gcyl.machines.GCYLTileEntities; +import com.google.common.collect.ImmutableSet; +import gregtech.api.GTValues; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.*; +import gregtech.api.util.GTUtility; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.client.renderer.texture.Textures; +import gregtech.common.ConfigHolder; +import gregtech.common.metatileentities.MetaTileEntities; +import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityAutoMaintenanceHatch; +import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; +import net.minecraft.client.resources.I18n; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.NonNullList; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import org.apache.commons.lang3.ArrayUtils; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; +import java.util.Set; + +public class MetaTileEntityISO1CleaningMaintenanceHatch extends MetaTileEntityAutoMaintenanceHatch { + + protected static final Set CLEANED_TYPES = new ObjectOpenHashSet<>(); + + static { + CLEANED_TYPES.add(CleanroomType.CLEANROOM); + CLEANED_TYPES.add(CleanroomType.STERILE_CLEANROOM); + CLEANED_TYPES.add(GCYLCleanroomType.ISO3); + CLEANED_TYPES.add(GCYLCleanroomType.ISO2); + CLEANED_TYPES.add(GCYLCleanroomType.ISO1); + } + + // must come after the static block + private static final ICleanroomProvider DUMMY_CLEANROOM = DummyCleanroom.createForTypes(CLEANED_TYPES); + + public MetaTileEntityISO1CleaningMaintenanceHatch(ResourceLocation metaTileEntityId) { + super(metaTileEntityId); + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { + return new MetaTileEntityISO1CleaningMaintenanceHatch(metaTileEntityId); + } + + @Override + public void addToMultiBlock(MultiblockControllerBase controllerBase) { + super.addToMultiBlock(controllerBase); + if (controllerBase instanceof ICleanroomReceiver && + ((ICleanroomReceiver) controllerBase).getCleanroom() == null) { + ((ICleanroomReceiver) controllerBase).setCleanroom(DUMMY_CLEANROOM); + } + } + + @Override + public int getTier() { + return GTValues.UXV; + } + + @Override + public ICubeRenderer getBaseTexture() { + MultiblockControllerBase controller = getController(); + if (controller != null) { + return this.hatchTexture = controller.getBaseTexture(this); + } else if (this.hatchTexture != null) { + if (hatchTexture != Textures.getInactiveTexture(hatchTexture)) { + return this.hatchTexture = Textures.getInactiveTexture(hatchTexture); + } + return this.hatchTexture; + } else { + return Textures.VOLTAGE_CASINGS[getTier()]; + } + } + + @Override + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + getBaseTexture().render(renderState, translation, ArrayUtils.add(pipeline, + new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering())))); + if (shouldRenderOverlay()) + ClientHandler.MAINTENANCE_OVERLAY_ISO1_CLEANING.renderSided(getFrontFacing(), renderState, translation, pipeline); + } + + @Override + public void getSubItems(CreativeTabs creativeTab, NonNullList subItems) { + if (ConfigHolder.machines.enableMaintenance) { + super.getSubItems(creativeTab, subItems); + // keeps things in order despite IDs being out of order, due to the Cleaning Hatch being added later + subItems.add(GCYLTileEntities.ISO1_CLEANING_MAINTENANCE_HATCH.getStackForm()); + } + } + + @Override + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gregtech.machine.maintenance_hatch_cleanroom_auto.tooltip.1")); + tooltip.add(I18n.format("gregtech.machine.maintenance_hatch.cleanroom_auto.tooltip.2")); + for (CleanroomType type : CLEANED_TYPES) { + tooltip.add(String.format(" %s%s", TextFormatting.LIGHT_PURPLE, I18n.format(type.getTranslationKey()))); + } + } + + /** + * Add an {@link CleanroomType} that is provided to multiblocks with this hatch + * + * @param type the type to add + */ + @SuppressWarnings("unused") + public static void addCleanroomType(@NotNull CleanroomType type) { + CLEANED_TYPES.add(type); + } + + /** + * @return the {@link CleanroomType}s this hatch provides to multiblocks + */ + @SuppressWarnings("unused") + public static ImmutableSet getCleanroomTypes() { + return ImmutableSet.copyOf(CLEANED_TYPES); + } + +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityISO2CleaningMaintenanceHatch.java b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityISO2CleaningMaintenanceHatch.java new file mode 100644 index 00000000..b231a471 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityISO2CleaningMaintenanceHatch.java @@ -0,0 +1,133 @@ +package com.fulltrix.gcyl.machines.multi.multiblockpart; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.ColourMultiplier; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; +import com.fulltrix.gcyl.client.ClientHandler; +import com.fulltrix.gcyl.machines.GCYLTileEntities; +import com.google.common.collect.ImmutableSet; +import gregtech.api.GTValues; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.*; +import gregtech.api.util.GTUtility; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.client.renderer.texture.Textures; +import gregtech.common.ConfigHolder; +import gregtech.common.metatileentities.MetaTileEntities; +import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityAutoMaintenanceHatch; +import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; +import net.minecraft.client.resources.I18n; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.NonNullList; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import org.apache.commons.lang3.ArrayUtils; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; +import java.util.Set; + +public class MetaTileEntityISO2CleaningMaintenanceHatch extends MetaTileEntityAutoMaintenanceHatch { + + protected static final Set CLEANED_TYPES = new ObjectOpenHashSet<>(); + + static { + CLEANED_TYPES.add(CleanroomType.CLEANROOM); + CLEANED_TYPES.add(CleanroomType.STERILE_CLEANROOM); + CLEANED_TYPES.add(GCYLCleanroomType.ISO3); + CLEANED_TYPES.add(GCYLCleanroomType.ISO2); + } + + // must come after the static block + private static final ICleanroomProvider DUMMY_CLEANROOM = DummyCleanroom.createForTypes(CLEANED_TYPES); + + public MetaTileEntityISO2CleaningMaintenanceHatch(ResourceLocation metaTileEntityId) { + super(metaTileEntityId); + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { + return new MetaTileEntityISO2CleaningMaintenanceHatch(metaTileEntityId); + } + + @Override + public void addToMultiBlock(MultiblockControllerBase controllerBase) { + super.addToMultiBlock(controllerBase); + if (controllerBase instanceof ICleanroomReceiver && + ((ICleanroomReceiver) controllerBase).getCleanroom() == null) { + ((ICleanroomReceiver) controllerBase).setCleanroom(DUMMY_CLEANROOM); + } + } + + @Override + public int getTier() { + return GTValues.UIV; + } + + @Override + public ICubeRenderer getBaseTexture() { + MultiblockControllerBase controller = getController(); + if (controller != null) { + return this.hatchTexture = controller.getBaseTexture(this); + } else if (this.hatchTexture != null) { + if (hatchTexture != Textures.getInactiveTexture(hatchTexture)) { + return this.hatchTexture = Textures.getInactiveTexture(hatchTexture); + } + return this.hatchTexture; + } else { + return Textures.VOLTAGE_CASINGS[getTier()]; + } + } + + @Override + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + getBaseTexture().render(renderState, translation, ArrayUtils.add(pipeline, + new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering())))); + if (shouldRenderOverlay()) + ClientHandler.MAINTENANCE_OVERLAY_ISO2_CLEANING.renderSided(getFrontFacing(), renderState, translation, pipeline); + } + + @Override + public void getSubItems(CreativeTabs creativeTab, NonNullList subItems) { + if (ConfigHolder.machines.enableMaintenance) { + super.getSubItems(creativeTab, subItems); + // keeps things in order despite IDs being out of order, due to the Cleaning Hatch being added later + subItems.add(GCYLTileEntities.ISO2_CLEANING_MAINTENANCE_HATCH.getStackForm()); + } + } + + @Override + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gregtech.machine.maintenance_hatch_cleanroom_auto.tooltip.1")); + tooltip.add(I18n.format("gregtech.machine.maintenance_hatch.cleanroom_auto.tooltip.2")); + for (CleanroomType type : CLEANED_TYPES) { + tooltip.add(String.format(" %s%s", TextFormatting.LIGHT_PURPLE, I18n.format(type.getTranslationKey()))); + } + } + + /** + * Add an {@link CleanroomType} that is provided to multiblocks with this hatch + * + * @param type the type to add + */ + @SuppressWarnings("unused") + public static void addCleanroomType(@NotNull CleanroomType type) { + CLEANED_TYPES.add(type); + } + + /** + * @return the {@link CleanroomType}s this hatch provides to multiblocks + */ + @SuppressWarnings("unused") + public static ImmutableSet getCleanroomTypes() { + return ImmutableSet.copyOf(CLEANED_TYPES); + } + +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityISO3CleaningMaintenanceHatch.java b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityISO3CleaningMaintenanceHatch.java new file mode 100644 index 00000000..d6ef1c47 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityISO3CleaningMaintenanceHatch.java @@ -0,0 +1,132 @@ +package com.fulltrix.gcyl.machines.multi.multiblockpart; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.ColourMultiplier; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; +import com.fulltrix.gcyl.client.ClientHandler; +import com.fulltrix.gcyl.machines.GCYLTileEntities; +import com.google.common.collect.ImmutableSet; +import gregtech.api.GTValues; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.*; +import gregtech.api.util.GTUtility; +import gregtech.client.renderer.ICubeRenderer; +import gregtech.client.renderer.texture.Textures; +import gregtech.common.ConfigHolder; +import gregtech.common.metatileentities.MetaTileEntities; +import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityAutoMaintenanceHatch; +import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; +import net.minecraft.client.resources.I18n; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.NonNullList; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import org.apache.commons.lang3.ArrayUtils; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; +import java.util.Set; + +public class MetaTileEntityISO3CleaningMaintenanceHatch extends MetaTileEntityAutoMaintenanceHatch { + + protected static final Set CLEANED_TYPES = new ObjectOpenHashSet<>(); + + static { + CLEANED_TYPES.add(CleanroomType.CLEANROOM); + CLEANED_TYPES.add(CleanroomType.STERILE_CLEANROOM); + CLEANED_TYPES.add(GCYLCleanroomType.ISO3); + } + + // must come after the static block + private static final ICleanroomProvider DUMMY_CLEANROOM = DummyCleanroom.createForTypes(CLEANED_TYPES); + + public MetaTileEntityISO3CleaningMaintenanceHatch(ResourceLocation metaTileEntityId) { + super(metaTileEntityId); + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { + return new MetaTileEntityISO3CleaningMaintenanceHatch(metaTileEntityId); + } + + @Override + public void addToMultiBlock(MultiblockControllerBase controllerBase) { + super.addToMultiBlock(controllerBase); + if (controllerBase instanceof ICleanroomReceiver && + ((ICleanroomReceiver) controllerBase).getCleanroom() == null) { + ((ICleanroomReceiver) controllerBase).setCleanroom(DUMMY_CLEANROOM); + } + } + + @Override + public int getTier() { + return GTValues.UEV; + } + + @Override + public ICubeRenderer getBaseTexture() { + MultiblockControllerBase controller = getController(); + if (controller != null) { + return this.hatchTexture = controller.getBaseTexture(this); + } else if (this.hatchTexture != null) { + if (hatchTexture != Textures.getInactiveTexture(hatchTexture)) { + return this.hatchTexture = Textures.getInactiveTexture(hatchTexture); + } + return this.hatchTexture; + } else { + return Textures.VOLTAGE_CASINGS[getTier()]; + } + } + + @Override + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + getBaseTexture().render(renderState, translation, ArrayUtils.add(pipeline, + new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering())))); + if (shouldRenderOverlay()) + ClientHandler.MAINTENANCE_OVERLAY_ISO3_CLEANING.renderSided(getFrontFacing(), renderState, translation, pipeline); + } + + @Override + public void getSubItems(CreativeTabs creativeTab, NonNullList subItems) { + if (ConfigHolder.machines.enableMaintenance) { + super.getSubItems(creativeTab, subItems); + // keeps things in order despite IDs being out of order, due to the Cleaning Hatch being added later + subItems.add(GCYLTileEntities.ISO3_CLEANING_MAINTENANCE_HATCH.getStackForm()); + } + } + + @Override + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gregtech.machine.maintenance_hatch_cleanroom_auto.tooltip.1")); + tooltip.add(I18n.format("gregtech.machine.maintenance_hatch.cleanroom_auto.tooltip.2")); + for (CleanroomType type : CLEANED_TYPES) { + tooltip.add(String.format(" %s%s", TextFormatting.LIGHT_PURPLE, I18n.format(type.getTranslationKey()))); + } + } + + /** + * Add an {@link CleanroomType} that is provided to multiblocks with this hatch + * + * @param type the type to add + */ + @SuppressWarnings("unused") + public static void addCleanroomType(@NotNull CleanroomType type) { + CLEANED_TYPES.add(type); + } + + /** + * @return the {@link CleanroomType}s this hatch provides to multiblocks + */ + @SuppressWarnings("unused") + public static ImmutableSet getCleanroomTypes() { + return ImmutableSet.copyOf(CLEANED_TYPES); + } + +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntitySterileCleaningMaintenanceHatch.java b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntitySterileCleaningMaintenanceHatch.java index 39940df4..532878be 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntitySterileCleaningMaintenanceHatch.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntitySterileCleaningMaintenanceHatch.java @@ -37,6 +37,7 @@ public class MetaTileEntitySterileCleaningMaintenanceHatch extends MetaTileEntit protected static final Set CLEANED_TYPES = new ObjectOpenHashSet<>(); static { + CLEANED_TYPES.add(CleanroomType.CLEANROOM); CLEANED_TYPES.add(CleanroomType.STERILE_CLEANROOM); } @@ -63,7 +64,7 @@ public void addToMultiBlock(MultiblockControllerBase controllerBase) { @Override public int getTier() { - return GTValues.UIV; + return GTValues.UHV; } @Override diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityWirelessDataHatch.java b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityWirelessDataHatch.java new file mode 100644 index 00000000..038c88a1 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityWirelessDataHatch.java @@ -0,0 +1,195 @@ +package com.fulltrix.gcyl.machines.multi.multiblockpart; + +import codechicken.lib.raytracer.CuboidRayTraceResult; +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.fulltrix.gcyl.api.util.VirtualEnergyRegistry; +import com.fulltrix.gcyl.api.util.VirtualResearchRegistry; +import com.fulltrix.gcyl.client.ClientHandler; +import gregtech.api.capability.IDataAccessHatch; +import gregtech.api.gui.ModularUI; +import gregtech.api.metatileentity.IDataInfoProvider; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.AbilityInstances; +import gregtech.api.metatileentity.multiblock.IMultiblockAbilityPart; +import gregtech.api.metatileentity.multiblock.MultiblockControllerBase; +import gregtech.api.recipes.Recipe; +import gregtech.api.recipes.RecipeMaps; +import gregtech.api.recipes.machines.IResearchRecipeMap; +import gregtech.api.util.AssemblyLineManager; +import gregtech.client.utils.TooltipHelper; +import gregtech.common.metatileentities.multi.electric.MetaTileEntityDataBank; +import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityDataAccessHatch; +import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import org.apache.http.util.TextUtils; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.*; + +public class MetaTileEntityWirelessDataHatch extends MetaTileEntityDataAccessHatch implements IMultiblockAbilityPart, IDataAccessHatch, + IDataInfoProvider { + + private UUID playerUUID = null; + + private final Set recipes; + + private VirtualResearchRegistry.VirtualResearchContainer researchContainerWireless; + + private boolean initialize; + + + public MetaTileEntityWirelessDataHatch(ResourceLocation metaTileEntityId, int tier) { + super(metaTileEntityId, tier, false); + this.recipes = new ObjectOpenHashSet<>(); + this.initialize = true; + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { + return new MetaTileEntityWirelessDataHatch(metaTileEntityId, getTier()); + } + + @Override + public boolean isRecipeAvailable(@NotNull Recipe recipe, @NotNull Collection seen) { + seen.add(this); + return recipes.contains(recipe); + } + + @Override + protected ModularUI createUI(EntityPlayer entityPlayer) { + return null; + } + + @Override + public void update() { + super.update(); + + if(!this.initialize && !this.getWorld().isRemote && this.getOffsetTimer() % 1200 == 0) { + rebuildData(); + } + } + + + private void rebuildData() { + if (getWorld() == null || getWorld().isRemote || this.initialize) return; + recipes.clear(); + for (String researchId : this.researchContainerWireless.getResearchIds()) { + if (researchId != null) { + Collection collection = ((IResearchRecipeMap) RecipeMaps.ASSEMBLY_LINE_RECIPES) + .getDataStickEntry(researchId); + if (collection != null) { + recipes.addAll(collection); + } + } + } + } + + @Override + public boolean onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, EnumFacing facing, + CuboidRayTraceResult hitResult) { + if(!getWorld().isRemote) { + if (this.initialize) { + if(playerIn.isSneaking()) { + this.playerUUID = playerIn.getUniqueID(); + this.researchContainerWireless = VirtualResearchRegistry.getContainerCreate(makeResearchContainerName(), this.playerUUID); + this.initialize = false; + playerIn.sendStatusMessage(new TextComponentTranslation("gcyl.wireless_initialized_private"), false); + } + else { + this.playerUUID = new UUID(0,0); + this.researchContainerWireless = VirtualResearchRegistry.getContainerCreate(makeResearchContainerName(), this.playerUUID); + this.initialize = false; + playerIn.sendStatusMessage(new TextComponentTranslation("gcyl.wireless_initialized_public"), false); + } + } + } + return true; + } + + @Override + public void writeInitialSyncData(PacketBuffer packetBuffer) { + super.writeInitialSyncData(packetBuffer); + packetBuffer.writeBoolean(this.initialize); + packetBuffer.writeString(this.playerUUID == null ? "null" : this.playerUUID.toString()); + } + + @Override + public void receiveInitialSyncData(PacketBuffer packetBuffer) { + super.receiveInitialSyncData(packetBuffer); + this.initialize = packetBuffer.readBoolean(); + String uuidStr = packetBuffer.readString(36); + this.playerUUID = uuidStr.equals("null") ? null : UUID.fromString(uuidStr); + updateResearchLink(); + } + + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound data) { + super.writeToNBT(data); + data.setBoolean("Initialized", initialize); + data.setString("PlacedUUID", playerUUID == null ? "null" : playerUUID.toString()); + return data; + } + + @Override + public void readFromNBT(NBTTagCompound data) { + super.readFromNBT(data); + String uuidStr = data.getString("PlacedUUID"); + this.playerUUID = uuidStr.equals("null") ? null : UUID.fromString(uuidStr); + this.initialize = data.getBoolean("Initialized"); + updateResearchLink(); + } + + protected void updateResearchLink() { + this.researchContainerWireless = VirtualResearchRegistry.getContainerCreate(makeResearchContainerName(), this.playerUUID); + this.markDirty(); + } + + @Override + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + super.renderMetaTileEntity(renderState, translation, pipeline); + ClientHandler.WIRELESS_DATA_HATCH.renderSided(getFrontFacing(), renderState, translation, pipeline); + } + + + private String makeResearchContainerName() {return "RContainer#";} + + @Override + public void registerAbilities(@NotNull AbilityInstances abilityInstances) { + abilityInstances.add(this); + } + + @Override + public void addToMultiBlock(MultiblockControllerBase controllerBase) { + super.addToMultiBlock(controllerBase); + } + + + @Override + public void addInformation(ItemStack stack, @Nullable World world, @NotNull List tooltip, + boolean advanced) { + tooltip.add(TextFormatting.LIGHT_PURPLE + I18n.format("gcyl.machine.wireless_data_hatch.tooltip.1")); + tooltip.add(TextFormatting.LIGHT_PURPLE + I18n.format("gcyl.machine.wireless_data_hatch.tooltip.2")); + tooltip.add(TooltipHelper.BLINKING_RED + I18n.format("gcyl.machine.wireless_data_hatch.tooltip.3")); + tooltip.add(TextFormatting.LIGHT_PURPLE + I18n.format("gcyl.machine.wireless_data_hatch.tooltip.4")); + if (canPartShare()) { + tooltip.add(I18n.format("gregtech.universal.enabled")); + } else { + tooltip.add(I18n.format("gregtech.universal.disabled")); + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityWirelessEnergyHatch.java b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityWirelessEnergyHatch.java new file mode 100644 index 00000000..dad3f3be --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/multiblockpart/MetaTileEntityWirelessEnergyHatch.java @@ -0,0 +1,194 @@ +package com.fulltrix.gcyl.machines.multi.multiblockpart; + +import codechicken.lib.raytracer.CuboidRayTraceResult; +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Matrix4; +import com.fulltrix.gcyl.api.util.VirtualEnergyRegistry; +import com.fulltrix.gcyl.client.ClientHandler; +import com.fulltrix.gcyl.machines.GCYLTileEntities; +import gregtech.api.GTValues; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.util.TextFormattingUtil; +import gregtech.client.renderer.texture.cube.SimpleOverlayRenderer; +import gregtech.client.utils.PipelineUtil; +import gregtech.client.utils.TooltipHelper; +import gregtech.common.metatileentities.MetaTileEntities; +import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityEnergyHatch; +import net.minecraft.client.resources.I18n; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.NonNullList; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; +import java.util.UUID; + +//TODO: get it to render its active texture in jei, and have it have its inactive texture when placed, then have its active texture when activated +public class MetaTileEntityWirelessEnergyHatch extends MetaTileEntityEnergyHatch { + + private UUID playerUUID = null; + + private VirtualEnergyRegistry.VirtualEnergyContainer energyContainerWireless; + + private boolean initialize = true; + + public MetaTileEntityWirelessEnergyHatch(ResourceLocation metaTileEntityId, int tier, int amperage, boolean isExportHatch) { + super(metaTileEntityId, tier, amperage, isExportHatch); + this.initialize = true; + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { + return new MetaTileEntityWirelessEnergyHatch(metaTileEntityId, getTier(), amperage, isExportHatch); + } + + @Override + public void addInformation(ItemStack stack, @Nullable World world, List tooltip, boolean advanced) { + tooltip.add(TextFormatting.LIGHT_PURPLE + I18n.format("gcyl.wireless_hatch.tooltip1")); + tooltip.add(TooltipHelper.BLINKING_RED + I18n.format("gcyl.wireless_hatch.tooltip2")); + super.addInformation(stack, world, tooltip, advanced); + } + + @Override + public void update() { + super.update(); + + if(!this.initialize && !this.getWorld().isRemote) { + if (this.isExportHatch) { + long energy = this.energyContainer.getEnergyStored(); + this.energyContainer.removeEnergy(energy); + this.energyContainerWireless.addEnergy(energy); + } else { + if(this.energyContainer.getEnergyStored() != this.energyContainer.getEnergyCapacity()) { + long energy = getEnergy(); + //long energy = this.energyContainer.getEnergyCapacity() - this.energyContainer.getEnergyStored() > this.energyContainerWireless.getEnergyStored() ? this.energyContainerWireless.getEnergyStored() : this.energyContainer.getEnergyCapacity() - this.energyContainer.getEnergyStored(); + this.energyContainerWireless.remove(energy); + this.energyContainer.addEnergy(energy); + } + } + } + } + + private long getEnergy() { + long energy = this.energyContainer.getInputVoltage() * this.energyContainer.getInputAmperage() > this.energyContainerWireless.getEnergyStored() ? this.energyContainerWireless.getEnergyStored() : this.energyContainer.getInputVoltage() * this.energyContainer.getInputAmperage(); + + if(energy > this.energyContainer.getEnergyCapacity() - this.energyContainer.getEnergyStored()) + energy = this.energyContainer.getEnergyCapacity() - this.energyContainer.getEnergyStored(); + return energy; + } + + @Override + public boolean onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, EnumFacing facing, + CuboidRayTraceResult hitResult) { + if(!getWorld().isRemote) { + if (this.initialize) { + if(playerIn.isSneaking()) { + this.playerUUID = playerIn.getUniqueID(); + this.energyContainerWireless = VirtualEnergyRegistry.getContainerCreate(makeEnergyContainerName(), this.playerUUID); + this.initialize = false; + playerIn.sendStatusMessage(new TextComponentTranslation("gcyl.wireless_initialized_private"), false); + } + else { + this.playerUUID = new UUID(0,0); + this.energyContainerWireless = VirtualEnergyRegistry.getContainerCreate(makeEnergyContainerName(), this.playerUUID); + this.initialize = false; + playerIn.sendStatusMessage(new TextComponentTranslation("gcyl.wireless_initialized_public"), false); + } + } + } + return true; + } + + @Override + public void getSubItems(CreativeTabs creativeTab, NonNullList subItems) { + + for (MetaTileEntityWirelessEnergyHatch hatch : GCYLTileEntities.WIRELESS_ENERGY_HATCH_INPUT) { + if (hatch != null) subItems.add(hatch.getStackForm()); + } + for (MetaTileEntityWirelessEnergyHatch hatch : GCYLTileEntities.WIRELESS_ENERGY_HATCH_INPUT_4A) { + if (hatch != null) subItems.add(hatch.getStackForm()); + } + for (MetaTileEntityWirelessEnergyHatch hatch : GCYLTileEntities.WIRELESS_ENERGY_HATCH_INPUT_16A) { + if (hatch != null) subItems.add(hatch.getStackForm()); + } + for (MetaTileEntityWirelessEnergyHatch hatch : GCYLTileEntities.WIRELESS_ENERGY_HATCH_INPUT_64A) { + if (hatch != null) subItems.add(hatch.getStackForm()); + } + for (MetaTileEntityWirelessEnergyHatch hatch : GCYLTileEntities.WIRELESS_ENERGY_HATCH_OUTPUT) { + if (hatch != null) subItems.add(hatch.getStackForm()); + } + + } + + @Override + public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { + super.renderMetaTileEntity(renderState, translation, pipeline); + if (shouldRenderOverlay()) { + getOverlay().renderSided(getFrontFacing(), renderState, translation, + PipelineUtil.color(pipeline, GTValues.VC[getTier()])); + } + } + + @NotNull + private SimpleOverlayRenderer getOverlay() { + return switch (this.amperage) { + case 4 -> ClientHandler.WIRELESS_ENERGY_HATCH_4A; + case 16 -> ClientHandler.WIRELESS_ENERGY_HATCH_16A; + default -> ClientHandler.WIRELESS_ENERGY_HATCH; + }; + } + + @Override + public void writeInitialSyncData(PacketBuffer packetBuffer) { + super.writeInitialSyncData(packetBuffer); + packetBuffer.writeBoolean(this.initialize); + packetBuffer.writeString(this.playerUUID == null ? "null" : this.playerUUID.toString()); + } + + @Override + public void receiveInitialSyncData(PacketBuffer packetBuffer) { + super.receiveInitialSyncData(packetBuffer); + this.initialize = packetBuffer.readBoolean(); + String uuidStr = packetBuffer.readString(36); + this.playerUUID = uuidStr.equals("null") ? null : UUID.fromString(uuidStr); + updateEnergyLink(); + } + + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound data) { + super.writeToNBT(data); + data.setBoolean("Initialized", initialize); + data.setString("PlacedUUID", playerUUID == null ? "null" : playerUUID.toString()); + return data; + } + + @Override + public void readFromNBT(NBTTagCompound data) { + super.readFromNBT(data); + String uuidStr = data.getString("PlacedUUID"); + this.playerUUID = uuidStr.equals("null") ? null : UUID.fromString(uuidStr); + this.initialize = data.getBoolean("Initialized"); + updateEnergyLink(); + } + + protected void updateEnergyLink() { + this.energyContainerWireless = VirtualEnergyRegistry.getContainerCreate(makeEnergyContainerName(), this.playerUUID); + this.markDirty(); + } + + private String makeEnergyContainerName() {return "EContainer#";} + +} diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java index f29888af..e16a9ecb 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java @@ -1,14 +1,16 @@ package com.fulltrix.gcyl.machines.multi.simple; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; -import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; +import com.fulltrix.gcyl.api.multi.GCYLMultiblockRecipeLogic; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregtech.api.capability.IHeatingCoil; -import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.recipes.RecipeMap; +import gregtech.api.recipes.RecipeMaps; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.Textures; import gregtech.common.blocks.BlockBoilerCasing; @@ -21,14 +23,15 @@ import org.jetbrains.annotations.NotNull; //TODO implement coil bonus - +//TODO make a separate mega chemical reactor so this one isnt so broken +//TODO add tooltips and information public class MetaTileEntityChemicalPlant extends GCYLRecipeMapMultiblockController implements IHeatingCoil { private int temperature; public MetaTileEntityChemicalPlant(ResourceLocation metaTileEntityId, boolean isParallel) { - super(metaTileEntityId, GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES, isParallel); - this.recipeMapWorkable = new GCYMMultiblockRecipeLogic(this); + super(metaTileEntityId, new RecipeMap[] { GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES, RecipeMaps.LARGE_CHEMICAL_RECIPES }, isParallel); + this.recipeMapWorkable = new GCYLMultiblockRecipeLogic(this, true); } @Override diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java index 48728d06..aa0ad8c4 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java @@ -1,18 +1,17 @@ package com.fulltrix.gcyl.machines.multi.simple; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.client.ClientHandler; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; -import com.fulltrix.gcyl.item.GCYLReactorCasing; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.GCYLReactorCasing; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; -import gregtech.api.recipes.RecipeMap; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.Textures; import gregtech.common.blocks.BlockGlassCasing; -import gregtech.common.blocks.BlockMetalCasing; import gregtech.common.blocks.MetaBlocks; import net.minecraft.block.state.IBlockState; import net.minecraft.util.ResourceLocation; @@ -20,10 +19,11 @@ import net.minecraftforge.fml.relauncher.SideOnly; import org.jetbrains.annotations.NotNull; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.DECAY_CHAMBERS_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.DECAY_CHAMBERS_RECIPES; //TODO: add neutron mechanics +//TODO: add tooltips and information public class MetaTileEntityDecayChamber extends GCYLRecipeMapMultiblockController { public MetaTileEntityDecayChamber(ResourceLocation metaTileEntityId, boolean isParallel) { diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityGreenhouse.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityGreenhouse.java index 520a0e55..3b7da161 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityGreenhouse.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityGreenhouse.java @@ -6,7 +6,6 @@ import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; -import gregtech.api.recipes.RecipeMap; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.Textures; import gregtech.common.blocks.BlockGlassCasing; @@ -19,9 +18,10 @@ import net.minecraftforge.fml.relauncher.SideOnly; import org.jetbrains.annotations.NotNull; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.GREENHOUSE_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.GREENHOUSE_RECIPES; //TODO: GET A MATCHING TEXTURE FOR THE CASINGS AND BASE TEXTURE +//TODO: add tooltips and information public class MetaTileEntityGreenhouse extends GCYMRecipeMapMultiblockController { private final int tier; diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java index e98a5716..617f38a3 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java @@ -1,9 +1,9 @@ package com.fulltrix.gcyl.machines.multi.simple; -import com.fulltrix.gcyl.item.metal.MetalCasing1; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.blocks.metal.MetalCasing1; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; -import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; @@ -22,8 +22,8 @@ import javax.annotation.Nonnull; import static com.fulltrix.gcyl.client.ClientHandler.HASTELLOY_N_CASING; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.METAL_CASING_1; - +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; +//TODO add tooltips and information public class MetaTileEntityPlasmaCondenser extends GCYLRecipeMapMultiblockController { public MetaTileEntityPlasmaCondenser(ResourceLocation metaTileEntityId, boolean isParallel) { diff --git a/src/main/java/com/fulltrix/gcyl/materials/GCYLMaterialIconSets.java b/src/main/java/com/fulltrix/gcyl/materials/GCYLMaterialIconSets.java new file mode 100644 index 00000000..9f7b18bb --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/materials/GCYLMaterialIconSets.java @@ -0,0 +1,9 @@ +package com.fulltrix.gcyl.materials; + +import gregtech.api.unification.material.info.MaterialIconSet; + +public class GCYLMaterialIconSets { + + public static final MaterialIconSet INFINITY = new MaterialIconSet("infinity", MaterialIconSet.METALLIC); + +} \ No newline at end of file diff --git a/src/main/java/com/fulltrix/gcyl/materials/GCYLMaterialOverride.java b/src/main/java/com/fulltrix/gcyl/materials/GCYLMaterialOverride.java index 304c910b..45c36053 100644 --- a/src/main/java/com/fulltrix/gcyl/materials/GCYLMaterialOverride.java +++ b/src/main/java/com/fulltrix/gcyl/materials/GCYLMaterialOverride.java @@ -1,37 +1,93 @@ package com.fulltrix.gcyl.materials; +import com.fulltrix.gcyl.GCYLConfig; +import supercritical.SCValues; +import supercritical.api.unification.material.properties.CoolantProperty; +import supercritical.api.unification.material.properties.SCPropertyKey; import gregtech.api.GTValues; +import gregtech.api.GregTechAPI; import gregtech.api.fluids.FluidBuilder; import gregtech.api.fluids.store.FluidStorageKeys; +import gregtech.api.unification.OreDictUnifier; import gregtech.api.unification.material.Material; import gregtech.api.unification.material.info.MaterialFlag; -import gregtech.api.unification.material.properties.BlastProperty; -import gregtech.api.unification.material.properties.OreProperty; -import gregtech.api.unification.material.properties.PropertyKey; -import gregtech.api.unification.material.properties.WireProperties; +import gregtech.api.unification.material.properties.*; +import gregtech.api.unification.ore.OrePrefix; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.List; +import static com.fulltrix.gcyl.api.recipes.GCYLMaterialFlags.NO_MIXER_RECIPE; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.materials.GCYLNuclearMaterials.*; import static gregicality.multiblocks.api.unification.GCYMMaterialFlags.NO_ALLOY_BLAST_RECIPES; -import static gregicality.multiblocks.api.unification.GCYMMaterials.IncoloyMA956; -import static gregicality.multiblocks.api.unification.GCYMMaterials.Zeron100; +import static gregicality.multiblocks.api.unification.GCYMMaterials.*; +import static supercritical.api.unification.material.SCMaterials.Inconel; +import static supercritical.api.unification.material.SCMaterials.Zircaloy; import static gregtech.api.GTValues.OpV; import static gregtech.api.GTValues.UV; import static gregtech.api.unification.material.Materials.*; -import static gregtech.api.unification.material.Materials.Duranium; import static gregtech.api.unification.material.info.MaterialFlags.*; import static gregtech.api.unification.material.info.MaterialIconSet.ROUGH; import static gregtech.api.unification.ore.OrePrefix.plate; import static gregtech.integration.crafttweaker.material.MaterialPropertyExpansion.*; -import static gregtech.integration.crafttweaker.material.MaterialPropertyExpansion.addFluidPipes; -import static gregtech.integration.groovy.MaterialPropertyExpansion.addLiquid; +import static kono.ceu.materialreplication.api.unification.materials.flags.MRMaterialFlags.DISABLE_DECONSTRUCTION; +import static kono.ceu.materialreplication.api.unification.materials.flags.MRMaterialFlags.DISABLE_REPLICATION; public class GCYLMaterialOverride { - public static void materialChanges() { + + public static void init() { + materialChanges(); + coolants(); + tempMaterialModifications(); + } + + private static void coolants() { + + CarbonDioxide.setProperty(SCPropertyKey.COOLANT, + new CoolantProperty(CarbonDioxide, SupercriticalCO2, FluidStorageKeys.LIQUID,13.,28,195,380000,846)); + + Helium3.setProperty(SCPropertyKey.COOLANT, + new CoolantProperty(Helium3, HotHPHelium3,FluidStorageKeys.LIQUID, 0.,262,3,8600,5193)); + + Helium4.setProperty(SCPropertyKey.COOLANT, + new CoolantProperty(Helium4, HotHPHelium4,FluidStorageKeys.LIQUID, 0., 252, 4, 20700, 5193)); + + FLiBe.setProperty(SCPropertyKey.COOLANT, + new CoolantProperty(FLiBe, SupercriticalFLiBe,FluidStorageKeys.LIQUID,0.001,1830,1703,3330000,2386)); + + FLiNaK.setProperty(SCPropertyKey.COOLANT, + new CoolantProperty(FLiNaK, SupercriticalFLiNaK,FluidStorageKeys.LIQUID,0., 1290,1844,9520000,1854)); + + SodiumPotassiumAlloy.setProperty(SCPropertyKey.COOLANT, + new CoolantProperty(SodiumPotassiumAlloy, SupercriticalSodiumPotassiumAlloy,FluidStorageKeys.LIQUID,0.001,400,1059, 2500000, 1191)); + + + Sodium.setProperty(SCPropertyKey.COOLANT, + new CoolantProperty(Sodium, HotLiquidSodium,FluidStorageKeys.LIQUID, 0.05, 120100,1156,4250000,1230)); + + Mercury.setProperty(SCPropertyKey.COOLANT, + new CoolantProperty(Mercury, HotMercury,FluidStorageKeys.LIQUID, 0., 13800,630,295000,140)); + + Tin.setProperty(SCPropertyKey.COOLANT, + new CoolantProperty(Tin, HotLiquidTin, FluidStorageKeys.LIQUID,0.01, 54000, 2875, 2440000,217)); + + Lead.setProperty(SCPropertyKey.COOLANT, + new CoolantProperty(Lead, HotLiquidLead,FluidStorageKeys.LIQUID,0.06,55000, 2022,866000,139)); + + LeadBismuthEutectic.setProperty(SCPropertyKey.COOLANT, + new CoolantProperty(LeadBismuthEutectic, SupercriticalLeadBismuthEutectic,FluidStorageKeys.LIQUID, 0.01,10800,1944,852000,147)); + + BoricAcid.setProperty(SCPropertyKey.COOLANT, + new CoolantProperty(BoricAcid, HotLiquidBoronTrioxide,FluidStorageKeys.LIQUID,0.,370,573,8100000,1392) + .setAccumulatesHydrogen(true)); + + } + + private static void materialChanges() { addDust(Germanium, 1, 0); @@ -41,7 +97,8 @@ public static void materialChanges() { for (Material mat : nuclearMats) { addDust(mat, 1, 0); - addLiquid(mat); + mat.setProperty(PropertyKey.FLUID, new FluidProperty(FluidStorageKeys.LIQUID, new FluidBuilder())); + //addLiquid(mat); mat.addFlags(GENERATE_PLATE); } @@ -67,7 +124,7 @@ public static void materialChanges() { //CORE METAL ADDITIONS List cmmats = new ArrayList<>(); - Collections.addAll(cmmats, Bohrium, Dubnium, Duranium, Seaborgium, Rhenium, Rutherfordium, NaquadahEnriched, IncoloyMA956, CosmicNeutronium); + Collections.addAll(cmmats, Bohrium, Dubnium, Duranium, Seaborgium, Rhenium, Rutherfordium, NaquadahEnriched, IncoloyMA956, CosmicNeutronium, QCDMatter, Cerium, Barium, Calcium, Californium, Thallium, Tennessine, Plutonium); for (Material mat : cmmats) { for (MaterialFlag flag : CORE_METAL) { @@ -98,21 +155,21 @@ public static void materialChanges() { //FOIL ADDITIONS List foilmats = new ArrayList<>(); - Collections.addAll(foilmats, Barium, Calcium, Thallium); + Collections.addAll(foilmats, Barium, Calcium, Thallium, EnrichedNaquadahAlloy); for (Material mat : foilmats) { mat.addFlags(GENERATE_FOIL); } //FINE WIRE ADDITIONS List wirefinemats = new ArrayList<>(); - Collections.addAll(wirefinemats, AbyssalAlloy, Titanium, Iron); + Collections.addAll(wirefinemats, AbyssalAlloy, Titanium, Iron, Neutronium); for (Material mat : wirefinemats) { mat.addFlags(GENERATE_FINE_WIRE); } //LONG STICK ADDITIONS List longstickmats = new ArrayList<>(); - Collections.addAll(longstickmats, NeodymiumMagnetic); + Collections.addAll(longstickmats, NeodymiumMagnetic, Mendelevium, IronMagnetic, SteelMagnetic, Chrome); for (Material mat : longstickmats) { mat.addFlags(GENERATE_LONG_ROD); } @@ -128,7 +185,7 @@ public static void materialChanges() { List dmats = new ArrayList<>(); Collections.addAll(dmats, Dysprosium, Iodine, Gadolinium, Strontium, Holmium, Californium, Zirconium, Thallium, Rubidium, Technetium, Terbium, Promethium, Radium, Tellurium, Francium, Berkelium, Curium, Actinium, Protactinium, Scandium, Thulium, Hafnium, Astatine, - Selenium, Praseodymium, Copernicium, Erbium, Polonium); + Selenium, Praseodymium, Copernicium, Erbium, Polonium, Nihonium, Moscovium, Livermorium, Tennessine, Ytterbium); for (Material mat : dmats) { addDust(mat, 1, 0); } @@ -138,10 +195,26 @@ public static void materialChanges() { Collections.addAll(fmats, Sodium, Bromine, AmmoniumChloride, Rubidium, Caesium, Francium, Polonium, Praseodymium, Ytterbium, Neptunium, ProtoAdamantium, Scandium, Radium, MetastableHassium, MetastableFlerovium, MetastableOganesson, HeavyQuarkDegenerateMatter, Dubnium, Sulfur, Calcium, Curium, Bohrium, Seaborgium, Copernicium, Rutherfordium,Meitnerium, Tennessine, Livermorium, Moscovium, Nihonium, - Roentgenium, Astatine, Hafnium, RutheniumTetroxide); + Roentgenium, Astatine, Hafnium, RutheniumTetroxide, Lawrencium, Nobelium, Germanium, NeodymiumMagnetic, SamariumMagnetic, Lafium, + PlatinumGroupSludge, Plutonium); + + //TODO NUCLEAR + Collections.addAll(fmats, Uranium238); for (Material mat : fmats) { - addLiquid(mat); + mat.setProperty(PropertyKey.FLUID, new FluidProperty(FluidStorageKeys.LIQUID, new FluidBuilder())); + //addLiquid(mat); + } + + //GAS Additions + List gmats = new ArrayList<>(); + Collections.addAll(gmats, OsmiumTetroxide, RutheniumTetroxide); + for(Material mat : gmats) { + try { + mat.setProperty(PropertyKey.FLUID, new FluidProperty(FluidStorageKeys.GAS, new FluidBuilder())); + } catch (Exception e) { + mat.getProperty(PropertyKey.FLUID).enqueueRegistration(FluidStorageKeys.GAS, new FluidBuilder()); + } } //SPECIFIC FLUID ADDITIONS @@ -149,11 +222,10 @@ public static void materialChanges() { //LIQUIDS //TODO: get proper temperatures List lmats = new ArrayList<>(); - Collections.addAll(lmats, Fluorine, Xenon, Helium3, Hydrogen, Nitrogen); + Collections.addAll(lmats, Fluorine, Xenon, Helium3, Hydrogen, Nitrogen, DeepNetherGas, DeepOverworldGas, CarbonDioxide, Helium4); for (Material mat : lmats) { - addLiquid(mat, new FluidBuilder() - .temperature(40) - .color(mat.getMaterialRGB()) + mat.getProperty(PropertyKey.FLUID).enqueueRegistration(FluidStorageKeys.LIQUID, new FluidBuilder() + .temperature(1) .name("liquid_" + mat.getName()) .translation("gregtech.fluid.liquid_generic")); mat.getProperty(PropertyKey.FLUID).setPrimaryKey(FluidStorageKeys.GAS); @@ -161,7 +233,7 @@ public static void materialChanges() { //PLASMAS List pmats = new ArrayList<>(); - Collections.addAll(pmats, Carbon, Hydrogen, Helium3, Radon, Krypton, Neon, Magnesium, Silicon, Sulfur, Argon,Calcium, Titanium, Potassium); + Collections.addAll(pmats, Carbon, Hydrogen, Helium3, Radon, Krypton, Neon, Magnesium, Silicon, Sulfur,Calcium, Titanium, Potassium, Bismuth); for (Material mat : pmats) { /*addPlasma(mat, new FluidBuilder() @@ -172,22 +244,33 @@ public static void materialChanges() { mat.getProperty(PropertyKey.FLUID).setPrimaryKey(FluidStorageKeys.GAS); */ - addFluid(mat, "plasma", false); + mat.getProperty(PropertyKey.FLUID).enqueueRegistration(FluidStorageKeys.PLASMA, new FluidBuilder() + .name("plasma."+ mat.getName()) + .translation("gregtech.fluid.plasma")); + mat.getProperty(PropertyKey.FLUID).setPrimaryKey(FluidStorageKeys.GAS); + //addFluid(mat, "plasma", false); } //ORE ADDITIONS List omats = new ArrayList<>(); Collections.addAll(omats, Lignite, Witherite, Barytocalcite, PlatinumMetallicPowder, IridiumMetalResidue, PreciousMetal, - RarestMetalMixture, PalladiumMetallicPowder, Celestine, Caliche, Fluorite, Rhodocrosite, Columbite, Niter, Zircon, Bowieite, - Zinc, Enargite, Andradite, Dolomite, Wollastonite, Kaolinite, Tenorite, Tennantite, Cuprite, Tellurium, Zirkelite, - Arsenopyrite, Draconium, Iridium, Osmium, Rutile, Gallite, NetherStar, Plutonium, Uranium238, FluoroApatite); + RarestMetalMixture, PalladiumMetallicPowder, Celestine, Caliche, Fluorite, Rhodocrosite, Columbite, Niter, Zircon, + Bowieite, Zinc, Enargite, Andradite, Dolomite, Wollastonite, Kaolinite, Tenorite, Tennantite, Cuprite, Tellurium, + Zirkelite, Arsenopyrite, Draconium, Iridium, Osmium, Rutile, Gallite, NetherStar, Uranium238, FluoroApatite, + RhodiumSalt, SodiumRuthenate, Tritanium, Arsenic, Barium, Titanium, Tungsten, Tantalum, Duranium); for (Material mat : omats) { + + if(GCYLConfig.recipes.useNewPlatinumChain) { + if (mat == RhodiumSalt || mat == SodiumRuthenate || mat == IridiumMetalResidue || mat == RarestMetalMixture) + continue; + } + addOre(mat, 1, 1,false); } //EMISSIVE ORES List eomats = new ArrayList<>(); - Collections.addAll(eomats,Triniite, NaquadricCompound, EnrichedNaquadricCompound, NaquadriaticCompound, Uranium); + Collections.addAll(eomats,Triniite, NaquadricCompound, EnrichedNaquadricCompound, NaquadriaticCompound, Uranium, Plutonium, Dubnium); for (Material mat : eomats) { addOre(mat, 1,1,true); } @@ -210,17 +293,46 @@ public static void materialChanges() { oreProp = Arsenopyrite.getProperty(PropertyKey.ORE); oreProp.addOreByProducts(Iron, Cobaltite, Cobalt); - oreProp = PlatinumMetallicPowder.getProperty(PropertyKey.ORE); - oreProp.setOreMultiplier(2); - oreProp.setWashedIn(SodiumPersulfate); - oreProp.addOreByProducts(Nickel,IridiumMetalResidue,RarestMetalMixture,PlatinumMetallicPowder); + if(GCYLConfig.recipes.useNewPlatinumChain) { + + oreProp = PlatinumMetallicPowder.getProperty(PropertyKey.ORE); + oreProp.setOreMultiplier(2); + + oreProp = PalladiumMetallicPowder.getProperty(PropertyKey.ORE); + oreProp.setOreMultiplier(2); + + + } else { + oreProp = PlatinumMetallicPowder.getProperty(PropertyKey.ORE); + oreProp.setOreMultiplier(2); + oreProp.setWashedIn(SodiumPersulfate); + oreProp.addOreByProducts(Nickel, IridiumMetalResidue, RarestMetalMixture, PlatinumMetallicPowder); + + oreProp = PalladiumMetallicPowder.getProperty(PropertyKey.ORE); + oreProp.setOreMultiplier(2); + oreProp.setWashedIn(SodiumPersulfate); + + oreProp = IridiumMetalResidue.getProperty(PropertyKey.ORE); + oreProp.setWashedIn(SodiumPersulfate); + + oreProp = RarestMetalMixture.getProperty(PropertyKey.ORE); + oreProp.setWashedIn(SodiumPersulfate); + + oreProp = Iridium.getProperty(PropertyKey.ORE); + oreProp.setOreByProducts(PlatinumMetallicPowder, RarestMetalMixture); + + oreProp = Osmium.getProperty(PropertyKey.ORE); + oreProp.setOreByProducts(IridiumMetalResidue); + } + - oreProp = PalladiumMetallicPowder.getProperty(PropertyKey.ORE); - oreProp.setOreMultiplier(2); - oreProp.setWashedIn(SodiumPersulfate); oreProp = Bowieite.getProperty(PropertyKey.ORE); - oreProp.addOreByProducts(Nickel,PlatinumMetallicPowder,RarestMetalMixture,CrudeRhodiumMetal); + + if(GCYLConfig.recipes.useNewPlatinumChain) //TODO: add additional higher tier pgs materials to this + oreProp.addOreByProducts(Nickel, PlatinumGroupSludge); + else + oreProp.addOreByProducts(Nickel,PlatinumMetallicPowder,RarestMetalMixture,CrudeRhodiumMetal); oreProp = Tennantite.getProperty(PropertyKey.ORE); oreProp.setOreMultiplier(2); @@ -234,12 +346,6 @@ public static void materialChanges() { oreProp.setDirectSmeltResult(Copper); oreProp.addOreByProducts(Iron, Antimony, Malachite); - oreProp = IridiumMetalResidue.getProperty(PropertyKey.ORE); - oreProp.setWashedIn(SodiumPersulfate); - - oreProp = RarestMetalMixture.getProperty(PropertyKey.ORE); - oreProp.setWashedIn(SodiumPersulfate); - oreProp = Witherite.getProperty(PropertyKey.ORE); oreProp.setWashedIn(SodiumPersulfate); @@ -249,6 +355,9 @@ public static void materialChanges() { oreProp = Columbite.getProperty(PropertyKey.ORE); oreProp.addOreByProducts(Iron, Manganese, Niobium); //BYPRODUCT OVERRIDES + oreProp = Pollucite.getProperty(PropertyKey.ORE); + oreProp.setOreByProducts(Caesium, Aluminium, Rubidium); + oreProp = Nickel.getProperty(PropertyKey.ORE); oreProp.setOreByProducts(Cobalt, PlatinumMetallicPowder, Iron); @@ -267,21 +376,18 @@ public static void materialChanges() { oreProp = Pitchblende.getProperty(PropertyKey.ORE); oreProp.addOreByProducts(Thorium, Uranium, Lead); - oreProp = Iridium.getProperty(PropertyKey.ORE); - oreProp.setOreByProducts(PlatinumMetallicPowder, RarestMetalMixture); - - oreProp = Osmium.getProperty(PropertyKey.ORE); - oreProp.setOreByProducts(IridiumMetalResidue); - oreProp = Gallite.getProperty(PropertyKey.ORE); oreProp.setOreByProducts(Sulfur,Copper,Copper,Gallium); //SPECIFIC CASES NaquadahAlloy.addFlags(GENERATE_FINE_WIRE); - Copper.addFlags(GENERATE_DENSE); - StainlessSteel.addFlags(GENERATE_DENSE); - Titanium.addFlags(GENERATE_DENSE); + //DENSE PLATE + List densemats = new ArrayList<>(); + Collections.addAll(densemats,Copper, StainlessSteel, Titanium, WatertightSteel, Ruridit, HSSS, Iridium, Steel, Aluminium, Tritanium, NaquadriaticTaranium, HastelloyK243, EnrichedNaquadahAlloy, HSSE, Osmiridium, Rubber, SiliconeRubber, StyreneButadieneRubber); + for(Material mat : densemats) { + mat.addFlags(GENERATE_DENSE); + } BlastProperty blastProperty; @@ -290,7 +396,7 @@ public static void materialChanges() { //ADD FRAMES List framemats = new ArrayList<>(); - Collections.addAll(framemats, Bohrium, Naquadria,Osmiridium); + Collections.addAll(framemats, Bohrium, Naquadria,Osmiridium, Inconel625, RhodiumPlatedPalladium); for(Material mat : framemats) { mat.addFlags(GENERATE_FRAME); } @@ -299,6 +405,7 @@ public static void materialChanges() { //FLUID PIPES addFluidPipes(Zeron100, 15000, 1750, true); addFluidPipes(Enderium, 1500,650,true); + addFluidPipes(CosmicNeutronium, 1000000, 50000, true,true,true,true); //ORE PREFIX IGNORE FIXES plate.removeIgnored(BorosilicateGlass); @@ -319,6 +426,8 @@ public static void materialChanges() { */ + + //DISABLE ALLOY BLAST for old superconductors List wireMats = new ArrayList<>(); Collections.addAll(wireMats, ManganesePhosphide, MagnesiumDiboride, MercuryBariumCalciumCuprate, UraniumTriplatinum, SamariumIronArsenicOxide, @@ -326,6 +435,8 @@ public static void materialChanges() { for(Material mat : wireMats) { mat.addFlags(NO_ALLOY_BLAST_RECIPES); + mat.addFlags(NO_MIXER_RECIPE); + mat.addFlags(DISABLE_DECOMPOSITION); } //LENSES @@ -338,7 +449,13 @@ public static void materialChanges() { //WIRE PROPERTIES Neutronium.setProperty(PropertyKey.WIRE, new WireProperties((int) GTValues.V[OpV], 4, 64)); + if(!GCYLConfig.recipes.hardMode) { + Draconium.setProperty(PropertyKey.WIRE, new WireProperties((int) GTValues.V[GTValues.UHV], 10, 0, true)); + } + AwakenDraconium.setProperty(PropertyKey.WIRE, new WireProperties((int) GTValues.V[GTValues.UEV], 100 , 0, true)); + Chaos.setProperty(PropertyKey.WIRE, new WireProperties((int) GTValues.V[GTValues.UIV], 1000 , 0, true)); + ChaosAlloy.setProperty(PropertyKey.WIRE, new WireProperties((int) GTValues.V[OpV], 10000 , 0, true)); //REPLACE MATERIALS IridiumMetalResidue.setFormula("Ir2O4(SiO2)2Au3", true); @@ -350,9 +467,14 @@ public static void materialChanges() { RarestMetalMixture.setMaterialIconSet(ROUGH); NaquadahAlloy.setFormula("Nq(Ir3Os)",true); + + OreDictUnifier.registerOre(new ItemStack(Blocks.CLAY), OrePrefix.ore, Clay); + + //Liquid Temperatures + Sodium.getProperty(PropertyKey.FLUID).getQueuedBuilder(FluidStorageKeys.LIQUID).temperature(370); } - public static void tempMaterialModifications() { + private static void tempMaterialModifications() { /* List #mats = new ArrayList<>(); @@ -364,14 +486,14 @@ public static void tempMaterialModifications() { //Add rounds List rmats = new ArrayList<>(); - Collections.addAll(rmats, HDCS, HastelloyX78, HSSG, HSSE, Bohrium, Neutronium, CosmicNeutronium); + Collections.addAll(rmats, HDCS, HastelloyX78, HSSG, HSSE, Bohrium, Neutronium, CosmicNeutronium, QCDMatter); for (Material mat : rmats) { mat.addFlags(GENERATE_ROUND); } //add fine wire List wirefinemats = new ArrayList<>(); - Collections.addAll(wirefinemats, Trinium, TinAlloy, ReinforcedEpoxyResin, HSSS, Ruthenium, Plutonium, Cerium, + Collections.addAll(wirefinemats, Trinium, TinAlloy, ReinforcedEpoxyResin, HSSS, Ruthenium, Plutonium, Cerium, LanthanumFullereneNanotubes, HVSuperconductor, IVSuperconductor, LuVSuperconductor, ZPMSuperconductor, UVSuperconductor, UHVSuperconductor, UEVSuperconductor, UIVSuperconductor, UXVSuperconductor, OpVSuperconductor, MAXSuperconductor); for (Material mat : wirefinemats) { mat.addFlags(GENERATE_FINE_WIRE); @@ -379,17 +501,42 @@ public static void tempMaterialModifications() { //add gears List gearmats = new ArrayList<>(); - Collections.addAll(gearmats, RhodiumPlatedPalladium, EglinSteel, Magnalium, Inconel625, QCDMatter, AbyssalAlloy, BabbittAlloy, Nitinol60, HG1223); + Collections.addAll(gearmats, RhodiumPlatedPalladium, EglinSteel, Magnalium, Inconel625, AbyssalAlloy, BabbittAlloy, Nitinol60, HG1223); for (Material mat : gearmats) { mat.addFlags(GENERATE_GEAR); } + //no mixer recipe + List mixermats = new ArrayList<>(); + Collections.addAll(mixermats, HSSS, Osmiridium, WatertightSteel, MaragingSteel300, Stellite100, HastelloyC276, HastelloyX, Trinaquadalloy, Zeron100, TitaniumCarbide, TantalumCarbide, HSLASteel, BlackSteel, BlackBronze, + SterlingSilver, NaquadahAlloy, LVSuperconductorBase, MVSuperconductorBase, HVSuperconductorBase,EVSuperconductorBase,IVSuperconductorBase,LuVSuperconductorBase,ZPMSuperconductorBase,UVSuperconductorBase,UHVSuperconductorBase, + UEVSuperconductorBase,UIVSuperconductorBase,UXVSuperconductorBase,OpVSuperconductorBase, Zircaloy, Inconel); + for(Material mat: mixermats) { + mat.addFlags(NO_MIXER_RECIPE); + } + + //add springs + List springmats = new ArrayList<>(); + Collections.addAll(springmats, Pikyonium, NaquadriaticTaranium, TungstenTitaniumCarbide, Cinobite, Duranium); + for(Material mat: springmats) { + mat.addFlags(GENERATE_SPRING); + } + + //add screws + List screwMats = new ArrayList<>(); + Collections.addAll(screwMats, Zeron100); + for(Material mat: screwMats) { + mat.addFlags(GENERATE_BOLT_SCREW); + } + //Small Specific cases HSSG.addFlags(GENERATE_RING); Osmium.addFlags(GENERATE_RING); Neutronium.addFlags(GENERATE_RING); HSSE.addFlags(GENERATE_SMALL_GEAR); - Zeron100.addFlags(GENERATE_BOLT_SCREW); + Neutronium.addFlags(GENERATE_SMALL_GEAR); + + Trinium.addFlags(GENERATE_FRAME); Naquadria.addFlags(GENERATE_DENSE); Lead.addFlags(GENERATE_DENSE); @@ -398,12 +545,13 @@ public static void tempMaterialModifications() { YttriumBariumCuprate.addFlags(NO_ALLOY_BLAST_RECIPES); Glowstone.addFlags(DISABLE_DECOMPOSITION); Pyrochlore.addFlags(DISABLE_DECOMPOSITION); + Plutonium239.addFlags(GENERATE_ROD); //ADD ROTORS List rotmats = new ArrayList<>(); - Collections.addAll(rotmats, HSSG, Tritanium, HSSE); + Collections.addAll(rotmats, HSSG, Tritanium, HSSE, Neutronium, CosmicNeutronium, MaragingSteel250); for (Material mat : rotmats) { mat.addFlags(GENERATE_ROTOR); } @@ -419,6 +567,14 @@ public static void tempMaterialModifications() { wireProp.setAmperage(4); wireProp.setLossPerBlock(4); + /* + Collection SCMaterials = GregTechAPI.materialManager.getRegistry(SCValues.MODID).getAllMaterials(); + + SCMaterials.forEach(m -> { + m.addFlags(DISABLE_REPLICATION, DISABLE_DECONSTRUCTION); + }); + + */ } } diff --git a/src/main/java/com/fulltrix/gcyl/materials/GCYLMaterials.java b/src/main/java/com/fulltrix/gcyl/materials/GCYLMaterials.java index b3d41e1f..02660e01 100644 --- a/src/main/java/com/fulltrix/gcyl/materials/GCYLMaterials.java +++ b/src/main/java/com/fulltrix/gcyl/materials/GCYLMaterials.java @@ -3,12 +3,19 @@ //import com.fulltrix.tjfcore.materials.IsotopeMaterial; //import com.fulltrix.tjfcore.materials.RadioactiveMaterial; +import com.fulltrix.gcyl.materials.chains.MiscMaterials; +import com.fulltrix.gcyl.materials.chains.NewPlatinumGroupMaterials; +import com.fulltrix.gcyl.materials.chains.NewREEMaterials; +import gregicality.multiblocks.api.fluids.GCYMFluidStorageKeys; import gregtech.api.GTValues; import gregtech.api.fluids.FluidBuilder; -import gregtech.api.unification.Elements; import gregtech.api.unification.material.Material; import gregtech.api.unification.material.info.MaterialFlag; -import gregtech.api.unification.material.properties.*; +import gregtech.api.unification.material.info.MaterialIconSet; +import gregtech.api.unification.material.properties.BlastProperty; +import gregtech.api.unification.material.properties.MaterialToolProperty; +import gregtech.api.unification.material.properties.PropertyKey; +import gregtech.api.unification.material.properties.ToolProperty; import net.minecraft.server.MinecraftServer; import net.minecraft.util.text.TextFormatting; @@ -17,18 +24,18 @@ import java.util.List; import static com.fulltrix.gcyl.GCYLElements.*; -import static com.fulltrix.gcyl.GCYLUtility.gcylId; +import static com.fulltrix.gcyl.api.GCYLUtility.gcylId; import static com.fulltrix.gcyl.materials.GCYLNuclearMaterials.*; import static gregicality.multiblocks.api.unification.GCYMMaterialFlags.NO_ALLOY_BLAST_RECIPES; import static gregicality.multiblocks.api.unification.GCYMMaterials.*; +import static supercritical.api.unification.material.SCMaterials.BoronTrioxide; import static gregtech.api.GTValues.*; import static gregtech.api.fluids.attribute.FluidAttributes.ACID; import static gregtech.api.unification.Elements.*; import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.material.Materials.Plutonium; import static gregtech.api.unification.material.info.MaterialFlags.*; import static gregtech.api.unification.material.info.MaterialIconSet.*; -import static gregtech.api.util.GTUtility.gregtechId; -import static gregtech.integration.groovy.MaterialPropertyExpansion.addLiquid; import static kono.ceu.materialreplication.api.unification.materials.flags.MRMaterialFlags.DISABLE_DECONSTRUCTION; import static kono.ceu.materialreplication.api.unification.materials.flags.MRMaterialFlags.DISABLE_REPLICATION; import static net.minecraft.util.text.TextFormatting.*; @@ -206,6 +213,7 @@ public class GCYLMaterials { public static Material Oxydianiline; public static Material PolyamicAcid; public static Material Hexafluoropropylene; + public static Material Ferrosilite; public static Material FluorinatedEthylenePropylene; public static Material Taranium; public static Material NaquadriaticTaranium; @@ -1177,7 +1185,19 @@ public class GCYLMaterials { public static Material Tetrabromoindigo; public static Material CyanIndigoDye; public static Material Erythrosine; - + public static Material DeepOverworldGas; + public static Material DeepNetherGas; + public static Material RawBioGrowthMedium; + public static Material SterileBioGrowthMedium; + public static Material HotHPHelium3; + public static Material HotHPHelium4; + public static Material HotLiquidSodium; + public static Material HotMercury; + public static Material HotLiquidTin; + public static Material HotLiquidLead; + public static Material HotLiquidBoronTrioxide; + public static Material DuctileA356; + public static Material Placeholder; //COILS public static Material Pikyonium; @@ -1228,9 +1248,23 @@ public class GCYLMaterials { CORE_METAL.addAll(Arrays.asList(GENERATE_RING, GENERATE_FRAME, GENERATE_ROTOR, GENERATE_SMALL_GEAR, GENERATE_DENSE, GENERATE_FINE_WIRE, GENERATE_GEAR)); } + public static void init() { + registerRequiredNuclear(); + initDEMaterials(); + register(); + register2(); + registerSuperconductors(); + idSecondary = id+1000; + register3(); + + NewPlatinumGroupMaterials.init(); + NewREEMaterials.init(); + MiscMaterials.init(); + registerSecondaryNuclear(); + } - public static void register() { + private static void register() { ////////////////////// @@ -1277,7 +1311,7 @@ public static void register() { .iconSet(SHINY) .cableProperties(GTValues.V[GTValues.UEV], 4, 32) .components(Inconel792, 8, EglinSteel, 5, NaquadahEnriched, 4, Cerium, 3, Antimony, 2, Platinum, 2, Ytterbium, 1, TungstenSteel, 4) - .blast(11500) + .blast(10400) .flags(DISABLE_REPLICATION).build(); LithiumNiobate = new Material.Builder(++id, gcylId("lithium_niobate")) @@ -1407,7 +1441,7 @@ public static void register() { .flags(DISABLE_REPLICATION).build(); TungstenTitaniumCarbide = new Material.Builder(++id, gcylId("tungsten_titanium_carbide")) - .ingot(7) + .ingot(7).fluid().dust() .color(0x800d0d) .iconSet(SHINY) .flags(CORE_METAL, DISABLE_DECOMPOSITION) @@ -1450,7 +1484,7 @@ public static void register() { .flags(DISABLE_REPLICATION).build(); HDCS = new Material.Builder(++id, gcylId("hdcs")) - .ingot(5) + .ingot(5).fluid() .color(0x334433) .iconSet(SHINY) .flags(CORE_METAL, DISABLE_DECOMPOSITION) @@ -1463,6 +1497,7 @@ public static void register() { .gem(2) .color(13127760) .iconSet(EMERALD) + .ore() .flags(NO_SMELTING, HIGH_SIFTER_OUTPUT) .flags(DISABLE_REPLICATION).build(); @@ -1673,7 +1708,8 @@ public static void register() { BoricAcid = new Material.Builder(++id, gcylId("boric_acid")) - .liquid() + .liquid(new FluidBuilder().temperature(293)) + .dust() .color(0xD5D2D7) .iconSet(FLUID) .build() @@ -1702,26 +1738,28 @@ public static void register() { .setFormula("Co/AC-AB", true); SodiumNitrate = new Material.Builder(++id, gcylId("sodium_nitrate")) - .dust() - .color(0x846684) - .iconSet(ROUGH) + .color((Sodium.getMaterialRGB() + NitricAcid.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.DULL) .flags(DISABLE_DECOMPOSITION) - .components(Sodium, 1, Nitrogen, 1, Oxygen, 3) - .flags(DISABLE_REPLICATION).build(); + .dust() + .fluid() + .build() + .setFormula("NaNO3", true); SodiumNitrateSolution = new Material.Builder(++id, gcylId("sodium_nitrate_solution")) .liquid() .color(0xA09ED7) .iconSet(FLUID) .build() - .setFormula("H20NaNO3", true); + .setFormula("(H2O)NaNO3", true); SodiumNitrite = new Material.Builder(++id, gcylId("sodium_nitrite")) + .color(SodiumNitrate.getMaterialRGB() + 5) + .iconSet(MaterialIconSet.DULL) + .flags(DISABLE_DECOMPOSITION) .dust() - .color((Sodium.getMaterialRGB()+Nitrogen.getMaterialRGB())/2) - .iconSet(ROUGH) .build() - .setFormula("NaNO2",true); + .setFormula("NaNO2", true); Aniline = new Material.Builder(++id, gcylId("aniline")) .liquid() @@ -2013,8 +2051,8 @@ public static void register() { .setFormula("Nb(OH)5",true); OxalicAcid= new Material.Builder(++id, gcylId("oxalic_acid")) - .liquid(new FluidBuilder().attribute(ACID)) - .color(0x4aaae2) + .liquid(new FluidBuilder().attribute(ACID)).dust() + .color(0xf7f7f5) .iconSet(FLUID) .build() .setFormula("HOOCCOOH",true); @@ -2175,12 +2213,13 @@ public static void register() { .build() .setFormula("CCl4",true); - Butanol= new Material.Builder(++id, gcylId("butanol")) - .liquid() - .color((FermentedBiomass.getMaterialRGB()+20)) - .iconSet(FLUID) + Butanol = new Material.Builder(++id, gcylId("butanol")) + .color(0xf0ebe6) + .iconSet(MaterialIconSet.FLUID) + .flags(DISABLE_DECOMPOSITION) + .fluid() .build() - .setFormula("C4H9OH",true); + .setFormula("C4H9OH", true); ButanolGas = new Material.Builder(++id, gcylId("butanol_gas")) .gas() @@ -2265,6 +2304,7 @@ public static void register() { PotassiumHydroxide= new Material.Builder(++id, gcylId("potassium_hydroxide")) .liquid() + .dust() .color((Potassium.getMaterialRGB()+Hydrogen.getMaterialRGB()+Oxygen.getMaterialRGB())/3) .iconSet(FLUID) .build() @@ -2401,7 +2441,7 @@ public static void register() { .build(); NaquadriaticTaranium = new Material.Builder(++id, gcylId("naquadriatic_taranium")) - .ingot() + .ingot().fluid() .color((Naquadria.getMaterialRGB() + Taranium.getMaterialRGB()) / 2) .iconSet(SHINY) .flags(DISABLE_REPLICATION) @@ -2449,7 +2489,7 @@ public static void register() { .setFormula("H2O", true); SodiumPotassiumAlloy = new Material.Builder(++id, gcylId("sodium_potassium_alloy")) - .dust(2).liquid() + .dust(2).liquid(new FluidBuilder().temperature(293)) .color(0x252525) .iconSet(SHINY) .flags(DISABLE_REPLICATION) @@ -2457,7 +2497,7 @@ public static void register() { .build(); SupercriticalSodiumPotassiumAlloy = new Material.Builder(++id, gcylId("supercritical_sodium_potassium_alloy")) - .liquid() + .liquid(new FluidBuilder().temperature(873)) .color(SodiumPotassiumAlloy.getMaterialRGB()) .iconSet(FLUID) .flags(DISABLE_REPLICATION) @@ -2467,7 +2507,7 @@ public static void register() { .setFormula("Na7K3", true); FLiNaK = new Material.Builder(++id, gcylId("flinak")) - .dust(2).liquid() + .dust(2).liquid(new FluidBuilder().temperature(735)) .color(0x252525) .iconSet(DULL) .flags(DISABLE_REPLICATION) @@ -2475,7 +2515,7 @@ public static void register() { .build(); SupercriticalFLiNaK = new Material.Builder(++id, gcylId("supercritical_flinak")) - .liquid() + .liquid(new FluidBuilder().temperature(1023)) .color(FLiNaK.getMaterialRGB()) .iconSet(FLUID) .flags(DISABLE_REPLICATION) @@ -2484,7 +2524,7 @@ public static void register() { .build(); FLiBe = new Material.Builder(++id, gcylId("flibe")) - .dust(2).liquid() + .dust(2).liquid(new FluidBuilder().temperature(636)) .color(0x252525) .iconSet(DULL) .flags(DISABLE_REPLICATION) @@ -2492,7 +2532,7 @@ public static void register() { .build(); SupercriticalFLiBe = new Material.Builder(++id, gcylId("supercritical_flibe")) - .liquid() + .liquid(new FluidBuilder().temperature(973)) .color(FLiBe.getMaterialRGB()) .components(FLiBe, 1) .flags(DISABLE_REPLICATION) @@ -2501,7 +2541,7 @@ public static void register() { .build(); LeadBismuthEutectic = new Material.Builder(++id, gcylId("lead_bismuth_eutatic")) - .ingot().liquid() + .ingot().liquid(new FluidBuilder().temperature(397)) .color(0x757575) .iconSet(SHINY) .flags(DISABLE_REPLICATION) @@ -2509,7 +2549,7 @@ public static void register() { .build(); SupercriticalLeadBismuthEutectic = new Material.Builder(++id, gcylId("supercritical_lead_bismuth_eutatic")) - .liquid() + .liquid(new FluidBuilder().temperature(773)) .color(LeadBismuthEutectic.getMaterialRGB()) .iconSet(FLUID) .flags(DISABLE_REPLICATION) @@ -2609,7 +2649,7 @@ public static void register() { .build(); TantalumHafniumSeaborgiumCarbide = new Material.Builder(++id, gcylId("tantalum_hafnium_seaborgium_carbide")) - .ingot(6) + .ingot(6).fluid() .color(0x2c2c2c) .iconSet(SHINY) .flags(DISABLE_REPLICATION) @@ -2715,7 +2755,7 @@ public static void register() { .setFormula("(C60)2La2?", true); LanthanumFullereneNanotubes = new Material.Builder(++id, gcylId("lanthanum_fullerene_nanotubes")) - .dust() + .dust().ingot().fluid() .color(LanthanumFullereneMix.getMaterialRGB() * 3 / 5) .iconSet(SHINY) .flags(DISABLE_REPLICATION) @@ -2728,7 +2768,7 @@ public static void register() { .iconSet(SHINY) .flags(DISABLE_REPLICATION) .flags(GENERATE_PLATE, DISABLE_DECOMPOSITION) - .components(Rutherfordium, 1, Dubnium, 1, Seaborgium, 1, Bohrium, 1, MetastableHassium, 1, Meitnerium, 1, Roentgenium, 1) + .components(Rutherfordium, 1, Dubnium, 1, Seaborgium, 1, Bohrium, 1, MetastableHassium, 1, Meitnerium, 1, Darmstadtium, 1, Roentgenium, 1) .blast(10600) .build(); @@ -2808,10 +2848,10 @@ public static void register() { .setFormula("KNO2", true); NitrousAcid = new Material.Builder(++id, gcylId("nitrous_acid")) - .liquid(new FluidBuilder().attribute(ACID)) - .color(0x1e73b0) - .iconSet(FLUID) - .flags(DISABLE_REPLICATION) + .color(0xcaecfc) + .iconSet(MaterialIconSet.DULL) + .flags(DISABLE_DECOMPOSITION) + .fluid() .build() .setFormula("HNO2", true); @@ -2841,10 +2881,11 @@ public static void register() { .setFormula("KHSO3", true); HydroxylammoniumSulfate = new Material.Builder(++id, gcylId("hydroxylammonium_sulfate")) + .color(0xfcfcfc) + .iconSet(MaterialIconSet.DULL) + .flags(DISABLE_DECOMPOSITION) .dust() - .color(0xF0EAD6) - .iconSet(DULL) - .flags(DISABLE_REPLICATION) + .fluid() .build() .setFormula("(NH3OH)2SO4", true); @@ -3136,7 +3177,7 @@ public static void register() { .iconSet(METALLIC) .flags(DISABLE_REPLICATION) .build() - .setFormula("C4H4BrNO2", true); + .setFormula("C4H5NO2", true); Acetaldehyde = new Material.Builder(++id, gcylId("acetaldehyde")) .liquid() @@ -3222,6 +3263,7 @@ public static void register() { .dust().liquid(new FluidBuilder().temperature(5000)) .color(0xFF9A3C) .iconSet(SAND) + .ore() .flags(DISABLE_DECOMPOSITION, EXCLUDE_BLOCK_CRAFTING_RECIPES,DISABLE_REPLICATION) .components(Redstone, 1, Blaze, 2, Sulfur, 1) .build(); @@ -3235,9 +3277,10 @@ public static void register() { .build(); Cryotheum = new Material.Builder(++id, gcylId("cryotheum")) - .dust().liquid() + .dust().liquid(new FluidBuilder().temperature(250)) .color(0x01F3F6) .iconSet(DULL) + .ore() .flags(DISABLE_DECOMPOSITION, EXCLUDE_BLOCK_CRAFTING_RECIPES,DISABLE_REPLICATION) .components(Redstone, 1, Blizz, 2, Water, 1) .build(); @@ -3401,7 +3444,7 @@ public static void register() { Enderium = new Material.Builder(++id, gcylId("enderium")) .ingot(3).fluid() - .toolStats(ToolProperty.Builder.of(8.0F, 3.0F, 1280, 3).build()) + .toolStats(MaterialToolProperty.Builder.of(8.0F, 3.0F, 1280, 3).build()) .color(0x23524a) .iconSet(METALLIC) .flags(EXT2_METAL, DISABLE_DECOMPOSITION, DISABLE_REPLICATION) @@ -3439,7 +3482,7 @@ public static void register() { .iconSet(SHINY) .flags(DISABLE_REPLICATION) .build() - .setFormula("LiBeNaMgKCaScRbSrYCeBaFrRa", true); + .setFormula("LiBeNaMgKCaScRbSrYCsBaFrRa", true); PostTransitionMetals = new Material.Builder(++id, gcylId("post_transition_metals")) .dust() @@ -3455,14 +3498,14 @@ public static void register() { .iconSet(SHINY) .flags(DISABLE_REPLICATION) .build() - .setFormula("LaPrNdPmSmEuGdTbDyHoErTmYbLu", true); + .setFormula("CeLaPrNdPmSmEuGdTbDyHoErTmYbLu", true); Actinoids = new Material.Builder(++id, gcylId("actinoids")) .dust() - .color((Actinium.getMaterialRGB() + Thorium.getMaterialRGB() + Protactinium.getMaterialRGB() + Uranium.getMaterialRGB() + Neptunium.getMaterialRGB() + Plutonium.getMaterialRGB() + Americium.getMaterialRGB() + Curium.getMaterialRGB() + Berkelium.getMaterialRGB() + Californium.getMaterialRGB() + Einsteinium.getMaterialRGB() + Fermium.getMaterialRGB() + Mendelevium.getMaterialRGB()) / 13) + .color((Actinium.getMaterialRGB() + Thorium.getMaterialRGB() + Protactinium.getMaterialRGB() + Uranium.getMaterialRGB() + Neptunium.getMaterialRGB() + Plutonium.getMaterialRGB() + Americium.getMaterialRGB() + Curium.getMaterialRGB() + Berkelium.getMaterialRGB() + Californium.getMaterialRGB() + Einsteinium.getMaterialRGB() + Fermium.getMaterialRGB() + Mendelevium.getMaterialRGB() + Nobelium.getMaterialRGB() + Lawrencium.getMaterialRGB()) / 15) .iconSet(SHINY) .flags(DISABLE_REPLICATION) .build() - .setFormula("AcThPaNpPuAmCmBkCfEsFmMd", true); + .setFormula("AcThPaUNpPuAmCmBkCfEsFmMdNoLr", true); NonMetals = new Material.Builder(++id, gcylId("non_metals")) .liquid() @@ -4579,7 +4622,7 @@ public static void register() { .setFormula("(BaTiO3)C2H3BaO2Sr", true); BariumStrontiumTitanate = new Material.Builder(++id, gcylId("barium_strontium_titanate")) - .dust() + .dust().fluid() .color(0xFF0066) .flags(DISABLE_REPLICATION) .iconSet(SHINY) @@ -4627,7 +4670,7 @@ public static void register() { .setFormula("Pb(ScTa)O3", true); MagnetorestrictiveAlloy = new Material.Builder(++id, gcylId("magnetorestrictive_alloy")) - .dust() + .dust().fluid() .color(0xafefef) .flags(DISABLE_REPLICATION) .iconSet(ROUGH) @@ -4635,7 +4678,7 @@ public static void register() { .setFormula("Tb4Dy7Fe10Co5B2SiC", true); LeadSenenide = new Material.Builder(++id, gcylId("lead_selenide")) - .dust() + .dust().fluid() .color((Lead.getMaterialRGB() + Selenium.getMaterialRGB()) / 2) .flags(DISABLE_REPLICATION) .iconSet(ROUGH) @@ -4643,7 +4686,7 @@ public static void register() { .setFormula("PbSe", true); ZincSelenide = new Material.Builder(++id, gcylId("zinc_selenide")) - .dust() + .dust().fluid() .color(0xfcfc00) .flags(DISABLE_REPLICATION) .iconSet(FINE) @@ -4651,12 +4694,12 @@ public static void register() { .setFormula("ZnSe", true); FranciumCaesiumCadmiumBromide = new Material.Builder(++id, gcylId("francium_caesium_cadmium_bromide")) - .dust() + .dust().fluid() .color((Francium.getMaterialRGB() + Caesium.getMaterialRGB() + Cadmium.getMaterialRGB() + Bromine.getMaterialRGB()) / 4) .flags(DISABLE_REPLICATION) .iconSet(SHINY) .build() - .setFormula("FrCsCf2Br6", true); + .setFormula("FrCsCd2Br6", true); SodiumIodide = new Material.Builder(++id, gcylId("sodium_iodide")) .dust() @@ -4683,7 +4726,7 @@ public static void register() { .setFormula("C4H6O4Pd", true); Stilbene = new Material.Builder(++id, gcylId("stilbene")) - .dust() + .dust().fluid() .color(0x3c9c3c) .flags(DISABLE_REPLICATION) .iconSet(SHINY) @@ -4739,7 +4782,7 @@ public static void register() { .setFormula("(C8H20N)(ReH9)(TcH9)", true); RhodamineB = new Material.Builder(++id, gcylId("rhodamine_b")) - .dust() + .dust().fluid() .color(0xfc2020) .flags(DISABLE_REPLICATION) .iconSet(SHINY) @@ -5115,7 +5158,7 @@ public static void register() { .build(); SupercooledCryotheum = new Material.Builder(++id, gcylId("supercooled_cryotheum")) - .liquid() + .liquid(new FluidBuilder().temperature(10)) .color(Cryotheum.getMaterialRGB() - 10) .flags(DISABLE_REPLICATION) .iconSet(FLUID) @@ -6258,6 +6301,7 @@ public static void register() { .color(Titanium.getMaterialRGB()) .iconSet(SHINY) .flags(DISABLE_REPLICATION) + .element(Ti50) .blast(2000) .build() .setFormula("Ti_50"); @@ -6409,7 +6453,7 @@ public static void register() { CalciumTungstate = new Material.Builder(++id, gcylId("calcium_tungstate")) .dust() .color(0x6e6867) - .flags(DISABLE_REPLICATION) + .flags(DISABLE_REPLICATION, DISABLE_DECOMPOSITION) .iconSet(SHINY) .components(Tungsten, 1, Calcium, 1) .build(); @@ -6695,7 +6739,7 @@ public static void register() { .setFormula("C", true); SupercriticalCO2 = new Material.Builder(++id, gcylId("supercritcal_co_2")) - .liquid() + .liquid(new FluidBuilder().temperature(975)) .color(CarbonDioxide.getMaterialRGB()) .flags(DISABLE_REPLICATION) .iconSet(FLUID) @@ -7455,7 +7499,7 @@ public static void register() { .setFormula("C2F6S2", true); } - public static void register2() { + private static void register2() { BariumTriflateSolution = new Material.Builder(++id, gcylId("barium_triflate_solution")) .liquid() @@ -7762,7 +7806,7 @@ public static void register2() { .setFormula("HPF6", true); ChargedCaesiumCeriumCobaltIndium = new Material.Builder(++id, gcylId("charged_caesium_cerium_cobalt_indium")) - .dust() + .dust().fluid() .color(0x52ad25) .flags(DISABLE_REPLICATION) .iconSet(SHINY) @@ -8511,6 +8555,7 @@ public static void register2() { .color(6605055) .flags(DISABLE_REPLICATION, NO_SMASHING, NO_SMELTING) .iconSet(EMERALD) + .ore() .build() .setFormula("Vt¤",true); @@ -8519,6 +8564,7 @@ public static void register2() { .color(4194504) .flags(DISABLE_REPLICATION, NO_SMASHING, NO_SMELTING, HIGH_SIFTER_OUTPUT) .iconSet(GEM_VERTICAL) + .ore() .components(Calcium,2,Aluminium,3,Silicon,3,Hydrogen,1,Oxygen,13) .build(); @@ -9042,7 +9088,7 @@ public static void register2() { .setFormula("H2NqF4",true); Fluorescein = new Material.Builder(++id, gcylId("fluorescein")) - .dust() + .dust().fluid() .color(0x990000) .flags(DISABLE_REPLICATION) .iconSet(DULL) @@ -9050,12 +9096,12 @@ public static void register2() { .setFormula("C20H12O5",true); SodiumBorohydride = new Material.Builder(++id, gcylId("sodium_borohydride")) - .dust() - .color(0xc2c2fa) - .flags(DISABLE_REPLICATION) - .iconSet(ROUGH) + .color((Sodium.getMaterialRGB() + Boron.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.FLUID) + .flags(DISABLE_DECOMPOSITION) + .fluid().dust() .build() - .setFormula("NaBH4",true); + .setFormula("NaBH4", true); BoronTrifluorideEtherate = new Material.Builder(++id, gcylId("boron_trifluoride_etherate")) .liquid() @@ -9176,13 +9222,11 @@ public static void register2() { .build() .setFormula("C6F6",true); - Fluorocarborane = new Material.Builder(++id, gcylId("fluorocarborane")) - .dust() - .color(0x20EB7A) - .flags(DISABLE_REPLICATION) - .iconSet(SHINY) - .build() - .setFormula("HCHB11F11",true); + Ferrosilite = new Material.Builder(++id, gcylId("ferrosilite")) + .dust(1) + .color(0x97632A) + .components(Iron, 1, Silicon, 1, Oxygen, 3) + .build(); ActiniumRadiumHydroxideSolution = new Material.Builder(++id, gcylId("actinium_radium_hydroxide_solution")) .liquid() @@ -9433,8 +9477,8 @@ public static void register2() { .color(Helium.getMaterialRGB()-10) .flags(DISABLE_REPLICATION) .iconSet(FLUID) - .build() - .setFormula("He_4",true); + .element(He4) + .build(); //TUNGSTEN & PLATINUM PalladiumAmmonia = new Material.Builder(++id, gcylId("palladium_enriched_ammonia")) @@ -9598,12 +9642,11 @@ public static void register2() { .build(); RhodiumNitrate = new Material.Builder(++id, gcylId("rhodium_nitrate")) - .dust() - .color((SodiumNitrate.getMaterialRGB()+Rhodium.getMaterialRGB())/2) - .flags(DISABLE_REPLICATION, DISABLE_DECOMPOSITION) - .iconSet(QUARTZ) - .components(Rhodium,1,Ammonia,3) - .build(); + .color((Rhodium.getMaterialRGB() + NitricAcid.getMaterialRGB()) / 2) + .flags(DISABLE_DECOMPOSITION) + .fluid().dust() + .build() + .setFormula("Rh(NO3)3", true); RhodiumFilterCake = new Material.Builder(++id, gcylId("rhodium_filter_cake")) .dust() @@ -9632,7 +9675,7 @@ public static void register2() { MicaPulp = new Material.Builder(++id, gcylId("mica_based")) .dust() .color(0x917445) - .flags(DISABLE_REPLICATION, DISABLE_DECONSTRUCTION) + .flags(DISABLE_REPLICATION, DISABLE_DECONSTRUCTION, DISABLE_DECOMPOSITION) .iconSet(SAND) .components(Mica,1,RareEarth,1) .build(); @@ -10305,38 +10348,25 @@ public static void register2() { .build() .setFormula("C20H6I4Na2O5",true); - /* - = new Material.Builder(++id, gcylId("material")) - .ingot().liquid() - .color() - .iconSet() - .flags(DISABLE_REPLICATION) - .components() - .blast() - .build(); - - = new Material.Builder(++id, gcylId("material")) - .liquid() - .color() + DeepOverworldGas = new Material.Builder(++id, gcylId("deep_overworld_gas")) + .gas() + .color(Air.getMaterialRGB() - 10) .flags(DISABLE_REPLICATION) .iconSet(FLUID) .build() - .setFormula("",true); + .setFormula("?",true); - = new Material.Builder(++id, gcylId("material")) - .dust() - .color() + DeepNetherGas = new Material.Builder(++id, gcylId("deep_nether_gas")) + .gas() + .color(NetherAir.getMaterialRGB()-10) .flags(DISABLE_REPLICATION) - .iconSet() + .iconSet(FLUID) .build() - .setFormula("",true); - - - */ + .setFormula("?",true); } - public static void registerSuperconductors() { + private static void registerSuperconductors() { LVSuperconductorBase = new Material.Builder(++id, gcylId("lv_superconductor_base")) .ingot().liquid() @@ -10595,11 +10625,11 @@ public static void registerSuperconductors() { .build(); } - public static void initDEMaterials() { + private static void initDEMaterials() { Draconium = new Material.Builder(++id, gcylId("draconium")) .ingot().liquid() - .toolStats(new ToolProperty(10f, 30f,12800,6)) + .toolStats(MaterialToolProperty.Builder.of(10f, 30f,12800,6).build()) .color(0x573d85) .iconSet(DULL) .flags(DISABLE_REPLICATION, GENERATE_PLATE, GENERATE_DENSE, GENERATE_ROD, GENERATE_FRAME, GENERATE_BOLT_SCREW) @@ -10609,7 +10639,7 @@ public static void initDEMaterials() { AwakenDraconium = new Material.Builder(++id, gcylId("awaken_draconium")) .ingot().liquid().plasma() - .toolStats(new ToolProperty(10f,40f,6,128000)) + .toolStats(MaterialToolProperty.Builder.of(10f,40f,6,128000).build()) .color(0xff571a) .iconSet(SHINY) .flags(DISABLE_REPLICATION, DISABLE_DECONSTRUCTION, GENERATE_PLATE, GENERATE_DENSE, GENERATE_ROD, GENERATE_FRAME, GENERATE_BOLT_SCREW) @@ -10620,7 +10650,7 @@ public static void initDEMaterials() { Chaos = new Material.Builder(++id, gcylId("chaos")) .ingot().liquid().plasma() .color(0x696969) - .toolStats(new ToolProperty(10f,50f,6,1280000)) + .toolStats(MaterialToolProperty.Builder.of(10f,50f,1280000,7).build()) .iconSet(DULL) .flags(DISABLE_REPLICATION, DISABLE_DECONSTRUCTION, GENERATE_PLATE, GENERATE_DENSE, GENERATE_ROD, GENERATE_FRAME, GENERATE_FINE_WIRE, GENERATE_BOLT_SCREW) .blast(25000) @@ -10630,7 +10660,7 @@ public static void initDEMaterials() { ChaosAlloy = new Material.Builder(++id, gcylId("chaosalloy")) .ingot().liquid().plasma() .color(0x696969) - .toolStats(new ToolProperty(10f,60f,6,2560000)) + .toolStats(MaterialToolProperty.Builder.of(10f,60f,2560000,8).build()) .iconSet(SHINY) .flags(DISABLE_REPLICATION, DISABLE_DECONSTRUCTION, GENERATE_PLATE, GENERATE_DENSE, GENERATE_FINE_WIRE, GENERATE_BOLT_SCREW) .blast(50000) @@ -10638,6 +10668,139 @@ public static void initDEMaterials() { .setFormula(makeFancy(TextFormatting.OBFUSCATED+"?????????")); } + private static void register3() { + + RawBioGrowthMedium = new Material.Builder(++id, gcylId("raw_bio_growth_medium")) + .liquid() + .color(0x24B222) + .flags(DISABLE_REPLICATION) + .iconSet(FLUID) + .build() + .setFormula("?",true); + + SterileBioGrowthMedium = new Material.Builder(++id, gcylId("sterile_bio_growth_medium")) + .liquid() + .color(0x35FF31) + .flags(DISABLE_REPLICATION) + .iconSet(FLUID) + .build() + .setFormula("?",true); + + DuctileA356 = new Material.Builder(++id, gcylId("ductile_a_356")) + .ingot() + .liquid() + .iconSet(SHINY) + .color((Aluminium.getMaterialRGB() * 33 + Silicon.getMaterialRGB() * 2 + Magnesium.getMaterialRGB() + Iron.getMaterialRGB() + Europium.getMaterialRGB()) / 38) + .flags(DISABLE_REPLICATION , NO_SMELTING, GENERATE_FINE_WIRE) + .components(Aluminium, 33, Silicon, 2, Magnesium, 1, Iron, 1, Europium, 1) + .build(); + + DuctileA356.getProperty(PropertyKey.FLUID).enqueueRegistration(GCYMFluidStorageKeys.MOLTEN, new FluidBuilder() + .temperature(2300)); + + ++id; //TODO FREE MATERIAL ID + + HotHPHelium3 = new Material.Builder(++id, gcylId("hot_hp_he_3")) + .gas(new FluidBuilder().temperature(1225)) + .color(Helium3.getMaterialRGB() + 10) + .element(He3) + .flags(DISABLE_REPLICATION, DISABLE_DECOMPOSITION) + .iconSet(FLUID) + .build(); + + HotHPHelium4 = new Material.Builder(++id, gcylId("hot_hp_he_4")) + .gas(new FluidBuilder().temperature(1225)) + .color(Helium4.getMaterialRGB() + 10) + .element(He4) + .flags(DISABLE_REPLICATION, DISABLE_DECOMPOSITION) + .iconSet(FLUID) + .build(); + + HotLiquidSodium = new Material.Builder(++id, gcylId("hot_sodium")) + .liquid(new FluidBuilder().temperature(958)) + .color(Sodium.getMaterialRGB() + 10) + .flags(DISABLE_REPLICATION, DISABLE_DECOMPOSITION) + .iconSet(FLUID) + .element(Na) + .build(); + + HotMercury = new Material.Builder(++id, gcylId("hot_mercury")) + .liquid(new FluidBuilder().temperature(410)) + .color(Mercury.getMaterialRGB() + 10) + .flags(DISABLE_REPLICATION, DISABLE_DECOMPOSITION) + .iconSet(FLUID) + .element(Hg) + .build(); + + HotLiquidTin = new Material.Builder(++id, gcylId("hot_tin")) + .liquid(new FluidBuilder().temperature(1600)) + .color(Tin.getMaterialRGB() + 10) + .flags(DISABLE_REPLICATION, DISABLE_DECOMPOSITION) + .element(Sn) + .iconSet(FLUID) + .build(); + + HotLiquidLead = new Material.Builder(++id, gcylId("hot_lead")) + .liquid(new FluidBuilder().temperature(923)) + .color(Lead.getMaterialRGB() + 10) + .element(Pb) + .flags(DISABLE_REPLICATION, DISABLE_DECOMPOSITION) + .iconSet(FLUID) + .build(); + + HotLiquidBoronTrioxide = new Material.Builder(++id, gcylId("hot_boron_trioxide")) + .liquid(new FluidBuilder().temperature(573)) + .color(BoronTrioxide.getMaterialRGB() + 10) + .components(BoronTrioxide, 1) + .flags(DISABLE_REPLICATION, DISABLE_DECOMPOSITION) + .iconSet(FLUID) + .build(); + + Placeholder = new Material.Builder(32766, gcylId("placeholder")) + .liquid(new FluidBuilder().disableBucket()) + .color(0xFFFFFF) + .build(); + } + + /* + Infinity = new Material.Builder(++id, gcylId("infinity")) + .ingot().liquid() + .flags(DISABLE_REPLICATION) + .iconSet(INFINITY) + .build() + .setFormula("*If*",true); + */ + + + /* + = new Material.Builder(++id, gcylId("material")) + .ingot().liquid() + .color() + .iconSet() + .flags(DISABLE_REPLICATION) + .components() + .blast() + .build(); + + = new Material.Builder(++id, gcylId("material")) + .liquid() + .color() + .flags(DISABLE_REPLICATION) + .iconSet(FLUID) + .build() + .setFormula("",true); + + = new Material.Builder(++id, gcylId("material")) + .dust() + .color() + .flags(DISABLE_REPLICATION) + .iconSet() + .build() + .setFormula("",true); + + + */ + private static String makeFancy(String input) { return fancyTest(input, fanciness, 80.0, 1); } diff --git a/src/main/java/com/fulltrix/gcyl/materials/GCYLNuclearMaterials.java b/src/main/java/com/fulltrix/gcyl/materials/GCYLNuclearMaterials.java index e517b616..280f52ac 100644 --- a/src/main/java/com/fulltrix/gcyl/materials/GCYLNuclearMaterials.java +++ b/src/main/java/com/fulltrix/gcyl/materials/GCYLNuclearMaterials.java @@ -1,29 +1,33 @@ package com.fulltrix.gcyl.materials; +import supercritical.api.unification.material.properties.FissionFuelProperty; +import supercritical.api.unification.material.properties.SCPropertyKey; import gregtech.api.unification.Elements; import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.properties.BlastProperty; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; -import static com.fulltrix.gcyl.GCYLUtility.gcylId; +import static com.fulltrix.gcyl.GCYLElements.*; +import static com.fulltrix.gcyl.api.GCYLUtility.gcylId; +import static com.fulltrix.gcyl.api.recipes.GCYLMaterialFlags.NO_MIXER_RECIPE; +import static com.fulltrix.gcyl.materials.GCYLMaterials.Placeholder; +import static gregtech.api.unification.Elements.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.material.Materials.STD_METAL; import static gregtech.api.unification.material.info.MaterialFlags.DISABLE_DECOMPOSITION; import static com.fulltrix.gcyl.materials.GCYLMaterials.id; import static gregtech.api.unification.material.info.MaterialFlags.GENERATE_DENSE; import static gregtech.api.unification.material.info.MaterialIconSet.*; -import static gregtech.api.util.GTUtility.gregtechId; import static kono.ceu.materialreplication.api.unification.materials.flags.MRMaterialFlags.DISABLE_REPLICATION; public class GCYLNuclearMaterials { //NEEDED FOR RECIPES public static Material ReactorSteel; - public static Material Plutonium; public static Material Americium241; public static Material Americium243; public static Material Curium247; @@ -55,28 +59,24 @@ public class GCYLNuclearMaterials { public static Material DepletedNeptuniumDioxide; */ - public static void registerNuclear() { + public static void registerRequiredNuclear() { ReactorSteel = new Material.Builder(++id, gcylId("reactor_steel")) .ingot(2).liquid() .color(0xB4B3B0) .iconSet(SHINY) - .flags(GENERATE_DENSE, DISABLE_DECOMPOSITION, DISABLE_REPLICATION) + .flags(GENERATE_DENSE, DISABLE_DECOMPOSITION, DISABLE_REPLICATION, NO_MIXER_RECIPE) .components(Iron,15,Niobium,1,Vanadium,4,Carbon,2) + .blast(b->b.temp(3800, BlastProperty.GasTier.HIGH)) .build(); - Plutonium = new Material.Builder(++id, gcylId("plutonium_generic")) - .ingot(3).liquid() - .color(0xF03232) - .iconSet(METALLIC) - .flags(EXT_METAL) - .element(Elements.Pu) - .build(); + ++id; //TODO FREE MATERIAL Americium241 = new Material.Builder(++id, gcylId("americium_241")) .ingot().liquid() .color(Americium.getMaterialRGB()) .iconSet(METALLIC) + .element(Am241) .flags(STD_METAL) .build() .setFormula("Am-241", true); @@ -85,15 +85,17 @@ public static void registerNuclear() { .ingot().liquid() .color(0x984ACF) .iconSet(METALLIC) + .element(Fm258) .flags(STD_METAL) .build() - .setFormula("Fm-241", true); + .setFormula("Fm-258", true); Californium252 = new Material.Builder(++id, gcylId("californium_252")) .ingot().liquid() .color(0xA85A12) .iconSet(METALLIC) .flags(STD_METAL) + .element(Cf252) .build() .setFormula("Cf-252", true); @@ -102,6 +104,7 @@ public static void registerNuclear() { .color(Mendelevium.getMaterialRGB()) .iconSet(METALLIC) .flags(STD_METAL) + .element(Md261) .build() .setFormula("Md-261", true); @@ -110,6 +113,7 @@ public static void registerNuclear() { .color(Americium.getMaterialRGB()) .iconSet(METALLIC) .flags(STD_METAL) + .element(Am243) .build() .setFormula("Am-243", true); @@ -118,14 +122,16 @@ public static void registerNuclear() { .color(Curium.getMaterialRGB()) .iconSet(METALLIC) .flags(STD_METAL) + .element(Cm247) .build() - .setFormula("Cm-252", true); + .setFormula("Cm-247", true); Californium253 = new Material.Builder(++id, gcylId("californium_253")) .ingot().liquid() .color(Californium.getMaterialRGB()) .iconSet(METALLIC) .flags(STD_METAL) + .element(Cf253) .build() .setFormula("Cf-253", true); @@ -134,6 +140,7 @@ public static void registerNuclear() { .color(Fermium.getMaterialRGB()) .iconSet(METALLIC) .flags(STD_METAL) + .element(Fm259) .build() .setFormula("Fm-259", true); @@ -142,6 +149,7 @@ public static void registerNuclear() { .color(Curium.getMaterialRGB()) .iconSet(METALLIC) .flags(STD_METAL) + .element(Cm250) .build() .setFormula("Cm-250", true); @@ -150,6 +158,7 @@ public static void registerNuclear() { .color(Einsteinium.getMaterialRGB()) .iconSet(METALLIC) .flags(STD_METAL) + .element(Es253) .build() .setFormula("Es-253", true); @@ -158,7 +167,6 @@ public static void registerNuclear() { registerDecayMats(); //TODO: FINISH NUCLEAR AND REMOVE - temporaryNuclearMaterials(); /* HighEnrichedNeptuniumDioxide = new Material.Builder(++id, gcylId("high_enriched_neptunium_dioxide")) @@ -245,15 +253,32 @@ private static void registerDecayMats() { } - private static void temporaryNuclearMaterials() { + public static int idSecondary; + + public static Material Np237Breeder; + + public static void registerSecondaryNuclear() { - Bismuth210 = new Material.Builder(++id, gcylId("bismuth_210")) + + Bismuth210 = new Material.Builder(++idSecondary, gcylId("bismuth_210")) .dust() .color(Bismuth.getMaterialRGB()) .iconSet(Bismuth.getMaterialIconSet()) + .element(Bi210) .build() .setFormula("Bi-210", true); + Np237Breeder = new Material.Builder(++idSecondary, gcylId("np_237_breeder")) + .dust() + .components(Placeholder, 1, Aluminium, 1) //Neptunium237 + .color(Neptunium.getMaterialRGB()) + .iconSet(DULL) + .flags(DISABLE_REPLICATION, DISABLE_DECOMPOSITION) + //.fissionFuel(2000, 1000, 1000, 0, 100, 10, 3.5) + .build(); + Np237Breeder.setProperty(SCPropertyKey.FISSION_FUEL, new FissionFuelProperty( + 2000, 1000, 1000., 0., + 100., 10., 3.5, Np237Breeder.getRegistryName())); } } diff --git a/src/main/java/com/fulltrix/gcyl/materials/chains/MiscMaterials.java b/src/main/java/com/fulltrix/gcyl/materials/chains/MiscMaterials.java new file mode 100644 index 00000000..2997db67 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/materials/chains/MiscMaterials.java @@ -0,0 +1,60 @@ +package com.fulltrix.gcyl.materials.chains; + +import static com.fulltrix.gcyl.materials.GCYLMaterials.id; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.info.MaterialIconSet; +import gregtech.api.unification.material.properties.BlastProperty; + +import static com.fulltrix.gcyl.api.GCYLUtility.gcylId; +import static gregtech.api.GTValues.*; +import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.material.info.MaterialFlags.DISABLE_DECOMPOSITION; +import static gregtech.api.unification.material.info.MaterialFlags.GENERATE_FINE_WIRE; + +public class MiscMaterials { + + public static Material AmmoniumHydroxide; + public static Material PalmOil; + public static Material OctanicAcid; + public static Material Irirutan; + + public static void init() { + + AmmoniumHydroxide = new Material.Builder(++id, gcylId("ammonium_hydroxide")) + .color(Ammonia.getMaterialRGB() + 10) + .iconSet(MaterialIconSet.DULL) + .flags() + .components(Ammonia, 1, Water, 1) + .fluid() + .build(); + + PalmOil = new Material.Builder(++id, gcylId("palm_oil")) + .color(0xfafcd2) + .iconSet(MaterialIconSet.DULL) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("?", true); + + OctanicAcid = new Material.Builder(++id, gcylId("octanic_acid")) + .color(PalmOil.getMaterialRGB() + 10) + .iconSet(MaterialIconSet.DULL) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("?", true); + + Irirutan = new Material.Builder(++id, gcylId("irirutan")) + .color((Ruthenium.getMaterialRGB() + Iridium.getMaterialRGB() * 2 + Tantalum.getMaterialRGB() * 3) / 6) + .iconSet(MaterialIconSet.METALLIC) + .ingot() + .flags(GENERATE_FINE_WIRE) + .fluid() + .blast(b -> b + .temp(5500, BlastProperty.GasTier.HIGH) + .blastStats(VA[IV], 1600) + .vacuumStats(VA[EV], 300)) + .components(Ruthenium, 1, Iridium, 2, Tantalum, 3) + .build(); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/materials/chains/NewPlatinumGroupMaterials.java b/src/main/java/com/fulltrix/gcyl/materials/chains/NewPlatinumGroupMaterials.java new file mode 100644 index 00000000..422d681c --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/materials/chains/NewPlatinumGroupMaterials.java @@ -0,0 +1,356 @@ +package com.fulltrix.gcyl.materials.chains; + +import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.info.MaterialIconSet; + +import static com.fulltrix.gcyl.api.GCYLUtility.gcylId; +import static com.fulltrix.gcyl.materials.GCYLMaterials.PalladiumChloride; +import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.material.info.MaterialFlags.DISABLE_DECOMPOSITION; +import static com.fulltrix.gcyl.materials.GCYLMaterials.id; +import static gregtech.api.unification.material.info.MaterialFlags.GENERATE_PLATE; + +public class NewPlatinumGroupMaterials { + + public static Material AcidicOsmiumTetroxideSolution; + public static Material OsmiumChlorideSolution; + public static Material PGMSolution1; + public static Material PGMSolution1IR; + public static Material PGMSolution1Plat; + public static Material PGMSolution1Iri; + public static Material PGMSolution1IriOxide; + public static Material PGMSolution1Pall; + public static Material PGMSolution1Rho; + public static Material PGMSolution1Ruth; + public static Material PGMSolution1InertMetals; + public static Material PotassiumOsmate; + public static Material AmmoniumHexachloroplatinate; + public static Material AmmoniumHexachloroiridate; + public static Material PalladiumDimethylglyoxime; + public static Material AmmoniumHexachloropalladate; + public static Material TetraaminePalladiumChloride; + public static Material DiamineDichloropalladium; + public static Material PotassiumHexachlororuthenate; + public static Material PotassiumHexanitrorhodate; + public static Material PotassiumHexachlororhodateSolution; + public static Material AmmoniumHexachlororhodate; + public static Material ChlorinatedRutheniumTetroxideSolution; + public static Material BasicRutheniumTetroxideSolution; + public static Material PotassiumPersulfate; + public static Material PotassiumBisulfate; + public static Material PotassiumAcetate; + public static Material SodiumMethoxide; + public static Material TrimethylBorate; + public static Material MineralOil; + public static Material FerrousChloride; + public static Material Dimethylglyoxime; + public static Material Butanone; + public static Material EthylNitrite; + public static Material DiacetylMonoxime; + public static Material AmmoniumNitrite; + public static Material PotassiumNitrate; + public static Material LeadOxide; + public static Material ZincBronze; + public static Material PotassiumChlorideSolution; + public static Material GoldChloride; + + public static void init() { + + OsmiumChlorideSolution = new Material.Builder(++id, gcylId("osmium_chloride_solution")) + .color((Osmium.getMaterialRGB() + RareEarth.getMaterialRGB()) / 2) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("H2OsCl6", true); + + PGMSolution1 = new Material.Builder(++id, gcylId("pgm_solution_one")) + .color(PlatinumGroupSludge.getMaterialRGB() + 20) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(Pt?)(Pd?)(Ru?)", true); + + PGMSolution1IR = new Material.Builder(++id, gcylId("pgm_solution_one_ir")) + .color(PGMSolution1.getMaterialRGB() + 10) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(Pt?)(Pd?)(Ru?)", true); + + PGMSolution1Plat = new Material.Builder(++id, gcylId("pgm_solution_one_plat")) + .color(PGMSolution1.getMaterialRGB() + 20) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(Pt?)(Pd?)(Ru?)", true); + + PGMSolution1Iri = new Material.Builder(++id, gcylId("pgm_solution_one_iri")) + .color(PGMSolution1.getMaterialRGB() + 30) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(Ir?)(Pd?)(Ru?)", true); + + PGMSolution1IriOxide = new Material.Builder(++id, gcylId("pgm_solution_one_irioxide")) + .color(PGMSolution1.getMaterialRGB() + 0x000a00) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(Ir?)(Pd?)(Ru?)", true); + + PGMSolution1Pall = new Material.Builder(++id, gcylId("pgm_solution_one_pall")) + .color(PGMSolution1.getMaterialRGB() + 0x000a0a) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(Pd?)(Rh?)(Ru?)", true); + + PGMSolution1Rho = new Material.Builder(++id, gcylId("pgm_solution_one_rho")) + .color(PGMSolution1Pall.getMaterialRGB() + 0x000a14) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(Rh?)(Ru?)(Au?)", true); + + PGMSolution1Ruth = new Material.Builder(++id, gcylId("pgm_solution_one_ruth")) + .color(PGMSolution1Pall.getMaterialRGB() + 0x000a1e) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(Ru?)(Au?)(Ag?)", true); + + PGMSolution1InertMetals = new Material.Builder(++id, gcylId("pgm_solution_one_inert")) + .color(PGMSolution1Pall.getMaterialRGB() + 0x001400) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(Au?)(Ag?)", true); + + AcidicOsmiumTetroxideSolution = new Material.Builder(++id, gcylId("acidic_osmium_tetroxide_solution")) + .color((Osmium.getMaterialRGB() + Potassium.getMaterialRGB()) / 2) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(KHSO4)4(OsO4)(HCl)4", true); + + PotassiumOsmate = new Material.Builder(++id, gcylId("potassium_osmate")) + .color((Osmium.getMaterialRGB() + Potassium.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.SHINY) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("K2OsO2(OH)4", true); + AmmoniumHexachloroplatinate = new Material.Builder(++id, gcylId("ammonium_hexachloroplatinate")) + .color(0xfcf403) + .iconSet(MaterialIconSet.DULL) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("(NH4)2PtCl6", true); + AmmoniumHexachloroiridate = new Material.Builder(++id, gcylId("ammonium_hexachloroiridate")) + .color(0x100310) + .iconSet(MaterialIconSet.DULL) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("(NH4)2IrCl6", true); + PalladiumDimethylglyoxime = new Material.Builder(++id, gcylId("palladium_dimethylglyoxime")) + .color((Palladium.getMaterialRGB() + 0xfff8f7) / 2) + .iconSet(MaterialIconSet.DULL) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("(NH4)2IrCl6", true); + AmmoniumHexachloropalladate = new Material.Builder(++id, gcylId("ammonium_hexachloropalladate")) + .color((PalladiumChloride.getMaterialRGB() + Ammonia.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.DULL) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("(NH4)2PdCl6", true); + TetraaminePalladiumChloride = new Material.Builder(++id, gcylId("tetraamine_palladium_chloride")) + .color(AmmoniumHexachloropalladate.getMaterialRGB() + 10) + .iconSet(MaterialIconSet.SHINY) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("Pd(NH3)4Cl2", true); + DiamineDichloropalladium = new Material.Builder(++id, gcylId("diamine_dichloropalladium")) + .color(AmmoniumHexachloropalladate.getMaterialRGB() - 10) + .iconSet(MaterialIconSet.DULL) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("Pd(NH3)2Cl2", true); + PotassiumHexanitrorhodate = new Material.Builder(++id, gcylId("potassium_hexanitrorhodate")) + .color((Potassium.getMaterialRGB() + Rhodium.getMaterialRGB()) / 2) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("K3Rh(NO2)6", true); + PotassiumHexachlororhodateSolution = new Material.Builder(++id, + gcylId("potassium_hexachlororhodate_solution")) + .color((PotassiumHexanitrorhodate.getMaterialRGB() + Chlorine.getMaterialRGB()) / 2) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(K3RuCl6)(H2O)", true); + AmmoniumHexachlororhodate = new Material.Builder(++id, gcylId("ammonium_hexachlororhodate")) + .color((Ammonia.getMaterialRGB() + Rhodium.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.DULL) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("(NH4)3RhCl6", true); + PotassiumHexachlororuthenate = new Material.Builder(++id, gcylId("potassium_hexachlororuthenate")) + .color((Ruthenium.getMaterialRGB() + Potassium.getMaterialRGB()) / 2) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(K3RuCl6)(H2O)", true); + ChlorinatedRutheniumTetroxideSolution = new Material.Builder(++id, + gcylId("chlorinated_ruthenium_tetroxide_solution")) + .color((Ruthenium.getMaterialRGB() + Chlorine.getMaterialRGB()) / 2) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(RuO4)2(H2O)2(KCl)6(Cl2)3", true); + BasicRutheniumTetroxideSolution = new Material.Builder(++id, gcylId("basic_ruthenium_tetroxide_solution")) + .color((Ruthenium.getMaterialRGB() + Oxygen.getMaterialRGB()) / 2) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(NaHRuO5)(H2O)", true); + + PotassiumPersulfate = new Material.Builder(++id, gcylId("potassium_persulfate")) + .color((Potassium.getMaterialRGB() + SulfuricAcid.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.SAND) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("K2S2O8", true); + PotassiumBisulfate = new Material.Builder(++id, gcylId("potassium_bisulfate")) + .color(PotassiumPersulfate.getMaterialRGB() + 10) + .iconSet(MaterialIconSet.SHINY) + .flags(DISABLE_DECOMPOSITION) + .dust() + .fluid() + .build() + .setFormula("KHSO4", true); + PotassiumAcetate = new Material.Builder(++id, gcylId("potassium_acetate")) + .color((Potassium.getMaterialRGB() + Acetone.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.FLINT) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("KCH3CO2", true); + SodiumMethoxide = new Material.Builder(++id, gcylId("sodium_methoxide")) + .color((Sodium.getMaterialRGB() + Methanol.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.FLUID) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("NaCH3O", true); + TrimethylBorate = new Material.Builder(++id, gcylId("trimethyl_borate")) + .color((Boron.getMaterialRGB() + Methanol.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.FLUID) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(CH3)3BO3", true); + MineralOil = new Material.Builder(++id, gcylId("mineral_oil")) + .color(0xd9ca9a) + .iconSet(MaterialIconSet.DULL) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("???", true); + + FerrousChloride = new Material.Builder(++id, gcylId("ferrous_chloride")) + .color(Iron3Chloride.getMaterialRGB() + 20) + .iconSet(MaterialIconSet.SHINY) + .components(Iron, 1, Chlorine, 2) + .fluid() + .build(); + Dimethylglyoxime = new Material.Builder(++id, gcylId("dimethylglyoxime")) + .color(0xfff8f7) + .iconSet(MaterialIconSet.FLUID) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("C4H8N2O2", true); + Butanone = new Material.Builder(++id, gcylId("butanone")) + .color(0xf7f6f5) + .iconSet(MaterialIconSet.FLUID) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("C4H8O", true); + + EthylNitrite = new Material.Builder(++id, gcylId("ethyl_nitrite")) + .color((Ethanol.getMaterialRGB() + NitricAcid.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.FLUID) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("C2H5NO2", true); + DiacetylMonoxime = new Material.Builder(++id, gcylId("diacetyl_monoxime")) + .color((Butanone.getMaterialRGB() + EthylNitrite.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.FLUID) + .flags(DISABLE_DECOMPOSITION) + .dust() + .build() + .setFormula("C4H7NO2", true); + AmmoniumNitrite = new Material.Builder(++id, gcylId("ammonium_nitrite")) + .color((Ammonia.getMaterialRGB() + NitricAcid.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.FLUID) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("NH4NO2", true); + + + PotassiumNitrate = new Material.Builder(++id, gcylId("potassium_nitrate")) + .color((Potassium.getMaterialRGB() + NitricAcid.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.FLUID) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("KNO3", true); + + LeadOxide = new Material.Builder(++id, gcylId("lead_oxide")) + .color((Lead.getMaterialRGB() + Oxygen.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.SHINY) + //.flags(DISABLE_DECOMPOSITION) + .components(Lead, 1, Oxygen, 1) + .dust() + .build() + .setFormula("PbO", true); + ZincBronze = new Material.Builder(++id, gcylId("zinc_bronze")) + .color(Bronze.getMaterialRGB() + 10) + .iconSet(MaterialIconSet.SHINY) + .flags(GENERATE_PLATE) + .ingot() + .build() + .setFormula("(CuSn3)Zn", true); + PotassiumChlorideSolution = new Material.Builder(++id, gcylId("potassium_chloride_solution")) + .color((Potassium.getMaterialRGB() + Chlorine.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.FLUID) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("(KCl)(H2O)", true); + + GoldChloride = new Material.Builder(++id, gcylId("gold_chloride")) + .color((Gold.getMaterialRGB() + Chlorine.getMaterialRGB()) / 2) + .iconSet(MaterialIconSet.FLUID) + .flags(DISABLE_DECOMPOSITION) + .fluid() + .build() + .setFormula("AuCl3", true); + + + + + } +} diff --git a/src/main/java/com/fulltrix/gcyl/materials/chains/NewREEMaterials.java b/src/main/java/com/fulltrix/gcyl/materials/chains/NewREEMaterials.java new file mode 100644 index 00000000..b63eef9a --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/materials/chains/NewREEMaterials.java @@ -0,0 +1,185 @@ +package com.fulltrix.gcyl.materials.chains; + +import gregtech.api.unification.material.Material; + +import static com.fulltrix.gcyl.api.GCYLUtility.gcylId; +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; +import static gregtech.api.unification.material.Materials.*; + +public class NewREEMaterials { + + public static Material CeriumRichLREESulfateSolution; + public static Material CeriumRichLREEHydroxides; + public static Material MonaziteHydroxideSolution; + public static Material TrisodiumPhosphate; + public static Material ThoriumNitratePentahydrate; + public static Material ThoriumDioxide; + public static Material IrradiatedAir; + public static Material DEHPA; + public static Material AmmoniumThiocyanate; + public static Material CarbonDisulfide; + public static Material Xenotime; + public static Material XenotimeSulfateSolution; + public static Material XenotimeHydroxideSolution; + public static Material LREENitrateSolution; + public static Material LREEOxalates; + public static Material LREEOxides; + public static Material LREEPentachlorides; + public static Material LREEChlorides; + public static Material MREENitrateSolution; + public static Material MREEOxalates; + public static Material MREEOxides; + public static Material MREEPentachlorides; + public static Material MREEChlorides; + public static Material HREENitrateSolution; + public static Material HREEOxalates; + public static Material HREEOxides; + public static Material HREEPentachlorides; + public static Material HREEChlorides; + + public static void init() { + CeriumRichLREESulfateSolution = new Material.Builder(++id, gcylId("cerium_rich_lree_sulfate")) + .color((Bastnasite.getMaterialRGB() + Cerium.getMaterialRGB()) / 2) + .fluid() + .build() + .setFormula("Ce2(SO4)3", true); + CeriumRichLREEHydroxides = new Material.Builder(++id, gcylId("cerium_rich_lree_hydroxide")) + .color(CeriumRichLREESulfateSolution.getMaterialRGB() + 10) + .fluid() + .build() + .setFormula("Ce(OH)3", true); + MonaziteHydroxideSolution = new Material.Builder(++id, gcylId("monazite_hydroxide_solution")) + .color(Monazite.getMaterialRGB() + 10) + .fluid() + .build() + .setFormula("Ln(OH)3", true); + TrisodiumPhosphate = new Material.Builder(++id, gcylId("trisodium_phosphate")) + .color((Sodium.getMaterialRGB() + Phosphorus.getMaterialRGB()) / 2) + .dust() + .build() + .setFormula("Na3PO4", true); + ThoriumNitratePentahydrate = new Material.Builder(++id, gcylId("thorium_nitrate_pentahydrate")) + .color((Thorium.getMaterialRGB() + Nitrogen.getMaterialRGB()) / 2) + .dust() + .build() + .setFormula("(Th(NO3)4)(H2O)5", true); + ThoriumDioxide = new Material.Builder(++id, gcylId("thorium_dioxide")) + .color((Thorium.getMaterialRGB() + Oxygen.getMaterialRGB()) / 2) + .dust() + .build() + .setFormula("ThO2", true); + IrradiatedAir = new Material.Builder(++id, gcylId("irradiated_air")) + .color((Radium.getMaterialRGB() + Oxygen.getMaterialRGB()) / 2) + .fluid() + .build() + .setFormula("Ra???", true); + DEHPA = new Material.Builder(++id, gcylId("dehpa")) + .color((Ethylhexanol.getMaterialRGB() + SodiumHydroxide.getMaterialRGB()) / 2) + .fluid() + .build() + .setFormula("(C8H17O)2PO2H", true); + AmmoniumThiocyanate = new Material.Builder(++id, gcylId("ammonium_thiocyanate")) + .color(0xfcfc30) + .fluid() + .build() + .setFormula("(NH4)(SCN)", true); + CarbonDisulfide = new Material.Builder(++id, gcylId("carbon_disulfide")) + .color(Sulfur.getMaterialRGB() - 10) + .dust() + .build() + .setFormula("CS2", true); + Xenotime = new Material.Builder(++id, gcylId("xenotime")) + .color(0x606141) + .ore() + .dust() + .build() + .setFormula("YPO4", true); + XenotimeSulfateSolution = new Material.Builder(++id, gcylId("xenotime_sulfate_solution")) + .color(Xenotime.getMaterialRGB() - 10) + .fluid() + .build() + .setFormula("Y2(SO4)3", true); + XenotimeHydroxideSolution = new Material.Builder(++id, gcylId("xenotime_hydroxide_solution")) + .color(Xenotime.getMaterialRGB() + 10) + .fluid() + .build() + .setFormula("Y(OH)3", true); + + LREENitrateSolution = new Material.Builder(++id, gcylId("lree_nitrate_solution")) + .color((Cerium.getMaterialRGB() + NitricAcid.getMaterialRGB()) / 2) + .fluid() + .build() + .setFormula("Ce(NO3)3", true); + LREEOxalates = new Material.Builder(++id, gcylId("lree_oxalates")) + .color((Cerium.getMaterialRGB() + OxalicAcid.getMaterialRGB()) / 2) + .dust() + .build() + .setFormula("Ce2(C2O4)3", true); + LREEOxides = new Material.Builder(++id, gcylId("lree_oxides")) + .color((Cerium.getMaterialRGB() + Oxygen.getMaterialRGB()) / 2) + .dust() + .build() + .setFormula("Ce2O3", true); + LREEPentachlorides = new Material.Builder(++id, gcylId("lree_pentachlorides")) + .color((Cerium.getMaterialRGB() + Chlorine.getMaterialRGB() * 2) / 3) + .dust() + .build() + .setFormula("(NH4)2(CeCl5)", true); + LREEChlorides = new Material.Builder(++id, gcylId("lree_chlorides")) + .color((Cerium.getMaterialRGB() + Chlorine.getMaterialRGB()) / 2) + .dust() + .build() + .setFormula("CeCl3", true); + MREENitrateSolution = new Material.Builder(++id, gcylId("mree_nitrate_solution")) + .color((Samarium.getMaterialRGB() + NitricAcid.getMaterialRGB()) / 2) + .fluid() + .build() + .setFormula("Sm(NO3)3", true); + MREEOxalates = new Material.Builder(++id, gcylId("mree_oxalates")) + .color((Samarium.getMaterialRGB() + OxalicAcid.getMaterialRGB()) / 2) + .dust() + .build() + .setFormula("Sm2(C2O4)3", true); + MREEOxides = new Material.Builder(++id, gcylId("mree_oxides")) + .color((Samarium.getMaterialRGB() + Oxygen.getMaterialRGB()) / 2) + .dust() + .build() + .setFormula("Sm2O3", true); + MREEPentachlorides = new Material.Builder(++id, gcylId("mree_pentachlorides")) + .color((Samarium.getMaterialRGB() + Chlorine.getMaterialRGB() * 2) / 3) + .dust() + .build() + .setFormula("(NH4)2(SmCl5)", true); + MREEChlorides = new Material.Builder(++id, gcylId("mree_chlorides")) + .color((Samarium.getMaterialRGB() + Chlorine.getMaterialRGB()) / 2) + .dust() + .build() + .setFormula("SmCl3", true); + HREENitrateSolution = new Material.Builder(++id, gcylId("hree_nitrate_solution")) + .color((Yttrium.getMaterialRGB() + NitricAcid.getMaterialRGB()) / 2) + .fluid() + .build() + .setFormula("Y(NO3)3", true); + HREEOxalates = new Material.Builder(++id, gcylId("hree_oxalates")) + .color((Yttrium.getMaterialRGB() + OxalicAcid.getMaterialRGB()) / 2) + .dust() + .build() + .setFormula("Y2(C2O4)3", true); + HREEOxides = new Material.Builder(++id, gcylId("hree_oxides")) + .color((Yttrium.getMaterialRGB() + Oxygen.getMaterialRGB()) / 2) + .dust() + .build() + .setFormula("Y2O3", true); + HREEPentachlorides = new Material.Builder(++id, gcylId("hree_pentachlorides")) + .color((Yttrium.getMaterialRGB() + Chlorine.getMaterialRGB() * 2) / 3) + .dust() + .build() + .setFormula("(NH4)2(YCl5)", true); + HREEChlorides = new Material.Builder(++id, gcylId("hree_chlorides")) + .color((Yttrium.getMaterialRGB() + Chlorine.getMaterialRGB()) / 2) + .dust() + .build() + .setFormula("YCl3", true); + + } +} diff --git a/src/main/java/com/fulltrix/gcyl/mixin/GCYLLateMixinLoader.java b/src/main/java/com/fulltrix/gcyl/mixin/GCYLLateMixinLoader.java new file mode 100644 index 00000000..683d7220 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/mixin/GCYLLateMixinLoader.java @@ -0,0 +1,18 @@ +package com.fulltrix.gcyl.mixin; + +import zone.rong.mixinbooter.ILateMixinLoader; + +import java.util.ArrayList; +import java.util.List; + +public class GCYLLateMixinLoader implements ILateMixinLoader { + @Override + public List getMixinConfigs() { + + List configs = new ArrayList<>(); + + configs.add("mixins.gcyl.json"); + + return configs; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/mixin/MetaTileEntityHolderMixin.java b/src/main/java/com/fulltrix/gcyl/mixin/MetaTileEntityHolderMixin.java new file mode 100644 index 00000000..66f2e3dc --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/mixin/MetaTileEntityHolderMixin.java @@ -0,0 +1,91 @@ +package com.fulltrix.gcyl.mixin; + +import com.fulltrix.gcyl.GCYLConfig; +import gregtech.api.GregTechAPI; +import gregtech.api.block.machines.BlockMachine; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.MetaTileEntityHolder; +import gregtech.api.metatileentity.TickableTileEntityBase; +import gregtech.api.util.GTLog; +import gregtech.client.particle.GTNameTagParticle; +import gregtech.core.network.packets.PacketRecoverMTE; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.spongepowered.asm.mixin.*; + +import java.text.DecimalFormat; +import java.util.concurrent.CompletableFuture; + +import static com.fulltrix.gcyl.api.GCYLUtility.getGlobalThreadPoolExecutor; + +//TODO remove (THREADED TESTING MARK123) +@Mixin(value = MetaTileEntityHolder.class, remap = false) +public abstract class MetaTileEntityHolderMixin extends TickableTileEntityBase { + + @Shadow + MetaTileEntity metaTileEntity; + + @Shadow + private boolean needToUpdateLightning; + + @Shadow + @Final + private int[] timeStatistics; + + @Shadow + private int timeStatisticsIndex; + + @Shadow + private int lagWarningCount; + + @Shadow + public abstract MetaTileEntity getMetaTileEntity(); + + @Unique + private CompletableFuture updateFuture; + + /** + * @author + * @reason + */ + @Overwrite + public void update() { + long tickTime = System.nanoTime(); + if (this.metaTileEntity != null) { + if(GCYLConfig.experimental.threadedMTEUpdates) { + if (updateFuture == null || updateFuture.isDone()) { + updateFuture = CompletableFuture.runAsync(() -> metaTileEntity.update(), getGlobalThreadPoolExecutor()); + } + while(getGlobalThreadPoolExecutor().getActiveCount() == getGlobalThreadPoolExecutor().getMaximumPoolSize()) { + + } + } else { + metaTileEntity.update(); + } + } else if (this.world.isRemote) { + GregTechAPI.networkHandler.sendToServer(new PacketRecoverMTE(this.world.provider.getDimension(), this.getPos())); + } else if (this.world.getBlockState(this.pos).getBlock() instanceof BlockMachine) { + this.world.setBlockToAir(this.pos); + } + + if (this.needToUpdateLightning) { + this.getWorld().checkLight(this.getPos()); + this.needToUpdateLightning = false; + } + + if (!this.world.isRemote && this.metaTileEntity != null && this.getMetaTileEntity().isValid()) { + tickTime = System.nanoTime() - tickTime; + if (this.timeStatistics.length > 0) { + this.timeStatistics[this.timeStatisticsIndex] = (int)tickTime; + this.timeStatisticsIndex = (this.timeStatisticsIndex + 1) % this.timeStatistics.length; + } + + if (tickTime > 100000000L && this.getMetaTileEntity().doTickProfileMessage() && this.lagWarningCount++ < 10) { + GTLog.logger.warn("WARNING: Possible Lag Source at [" + this.getPos().getX() + ", " + this.getPos().getY() + ", " + this.getPos().getZ() + "] in Dimension " + this.world.provider.getDimension() + " with " + tickTime + "ns caused by an instance of " + this.getMetaTileEntity().getClass()); + } + } + + super.update(); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/mixin/MixinAssemblyLineManager.java b/src/main/java/com/fulltrix/gcyl/mixin/MixinAssemblyLineManager.java deleted file mode 100644 index 1530835c..00000000 --- a/src/main/java/com/fulltrix/gcyl/mixin/MixinAssemblyLineManager.java +++ /dev/null @@ -1,25 +0,0 @@ -//TODO none of the mixins i have tried have worked. this is one that i would hope i could get working - -/* -package com.fulltrix.gcyl.mixin; - -import com.fulltrix.gcyl.item.GCYLCoreItems; -import gregtech.api.util.AssemblyLineManager; -import net.minecraft.item.ItemStack; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -@Mixin(value = AssemblyLineManager.class, remap = false) -public final class MixinAssemblyLineManager { - - @Inject(method = "getDefaultResearchStationItem(I)Lnet/minecraft/item/ItemStack;", at = @At("HEAD"), cancellable = true) - private static void getDefaultResearchStationItem(int cwut, CallbackInfoReturnable cir) { - if(cwut > 128) { - cir.setReturnValue(GCYLCoreItems.TOOL_DATA_MODULE_CLUSTER.getStackForm()); - } - } -} - - */ diff --git a/src/main/java/com/fulltrix/gcyl/mixin/MixinProspectorScannerBehavior.java b/src/main/java/com/fulltrix/gcyl/mixin/MixinProspectorScannerBehavior.java new file mode 100644 index 00000000..4018916e --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/mixin/MixinProspectorScannerBehavior.java @@ -0,0 +1,185 @@ +package com.fulltrix.gcyl.mixin; + +import com.fulltrix.gcyl.mixinhelpers.MixinProspectorMode; +import com.fulltrix.gcyl.mixinhelpers.MixinWidgetOreList; +import com.fulltrix.gcyl.mixinhelpers.MixinWidgetProspectingMap; +import gregtech.api.GTValues; +import gregtech.api.capability.GregtechCapabilities; +import gregtech.api.capability.IElectricItem; +import gregtech.api.gui.GuiTextures; +import gregtech.api.gui.ModularUI; +import gregtech.api.gui.widgets.LabelWidget; +import gregtech.api.items.gui.PlayerInventoryHolder; +import gregtech.api.items.metaitem.stats.IItemBehaviour; +import gregtech.api.util.GTUtility; +import gregtech.common.gui.widget.prospector.ProspectorMode; +import gregtech.common.gui.widget.prospector.widget.WidgetOreList; +import gregtech.common.gui.widget.prospector.widget.WidgetProspectingMap; +import gregtech.common.items.behaviors.ProspectorScannerBehavior; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.world.World; +import net.minecraftforge.common.util.Constants; +import org.jetbrains.annotations.NotNull; +import org.spongepowered.asm.mixin.*; +import org.spongepowered.asm.mixin.gen.Invoker; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import scala.util.parsing.combinator.PackratParsers; + +import java.util.List; +import java.util.Locale; + +@Mixin(value = ProspectorScannerBehavior.class, remap = false) +public class MixinProspectorScannerBehavior implements IItemBehaviour { + + @Unique + private MixinWidgetOreList widgetOreList; + + @Unique + private WidgetOreList widgetOreListOG; + + @Final + @Shadow + private int radius; + + @Final + @Shadow + private int tier; + + @Shadow + @Final + private static int FLUID_PROSPECTION_THRESHOLD; + + @Shadow + @Final + private static long VOLTAGE_FACTOR; + + /** + * @author + * @reason + */ + @Overwrite + public ActionResult onItemRightClick(@NotNull World world, @NotNull EntityPlayer player, EnumHand hand) { + ItemStack heldItem = player.getHeldItem(hand); + if (!world.isRemote) { + if (player.isSneaking()) { + ItemStack stack = player.getHeldItem(hand); + MixinProspectorMode mode = getMode(stack); + MixinProspectorMode nextMode = mode.next(); + if (nextMode == MixinProspectorMode.FLUID) { + if (tier >= FLUID_PROSPECTION_THRESHOLD) { + setMode(stack, nextMode); + player.sendStatusMessage(new TextComponentTranslation("metaitem.prospector.mode.fluid"), true); + } + } else if (nextMode == MixinProspectorMode.VIRTUAL_ORE) { + setMode(stack, nextMode); + player.sendStatusMessage(new TextComponentTranslation("metaitem.prospector.mode.virtual_ores"), true); + } else { + setMode(stack, nextMode); + player.sendStatusMessage(new TextComponentTranslation("metaitem.prospector.mode.ores"), true); + } + } else if (checkCanUseScanner(heldItem, player, true)) { + new PlayerInventoryHolder(player, hand).openUI(); + } else { + player.sendMessage(new TextComponentTranslation("behavior.prospector.not_enough_energy")); + } + } + return ActionResult.newResult(EnumActionResult.SUCCESS, heldItem); + } + + @Unique + private boolean checkCanUseScanner(ItemStack stack, @NotNull EntityPlayer player, boolean simulate) { + return player.isCreative() || drainEnergy(stack, GTValues.V[tier] / VOLTAGE_FACTOR, simulate); + } + + @Unique + private static boolean drainEnergy(@NotNull ItemStack stack, long amount, boolean simulate) { + IElectricItem electricItem = stack.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null); + if (electricItem == null) return false; + + return electricItem.discharge(amount, Integer.MAX_VALUE, true, false, simulate) >= amount; + } + + @Unique + private static void setMode(ItemStack stack, @NotNull MixinProspectorMode mode) { + NBTTagCompound tagCompound = GTUtility.getOrCreateNbtCompound(stack); + tagCompound.setInteger("Mode", mode.ordinal()); + } + + + /** + * @author + * @reason + */ + @Overwrite + public ModularUI createUI(PlayerInventoryHolder holder, @NotNull EntityPlayer entityPlayer) { + MixinProspectorMode mode = getMode(entityPlayer.getHeldItem(EnumHand.MAIN_HAND)); + ModularUI.Builder builder = ModularUI.builder(GuiTextures.BACKGROUND, 332, 200); + + if(mode == MixinProspectorMode.VIRTUAL_ORE) { + this.widgetOreList = new MixinWidgetOreList(32 * radius - 6, 18, 332 - 32 * radius, 176); + builder.widget(this.widgetOreList); + builder.widget(new MixinWidgetProspectingMap(6, 18, radius, this.widgetOreList, mode, 1)); + } else { + ProspectorMode modeOG; + + if(mode == MixinProspectorMode.ORE) + modeOG = ProspectorMode.ORE; + else + modeOG = ProspectorMode.FLUID; + + this.widgetOreListOG = new WidgetOreList(32 * radius - 6, 18, 332 - 32 * radius, 176); + builder.widget(this.widgetOreListOG); + builder.widget(new WidgetProspectingMap(6, 18, radius, this.widgetOreListOG, modeOG, 1)); + } + // Cardinal directions + builder.widget(new LabelWidget(3 + (16 * (radius * 2 - 1)) / 2, 14, "N", 0xAAAAAA).setShadow(true)); + builder.widget(new LabelWidget(3 + (16 * (radius * 2 - 1)) / 2, 14 + 16 * (radius * 2 - 1), "S", 0xAAAAAA) + .setShadow(true)); + builder.widget(new LabelWidget(3, 15 + (16 * (radius * 2 - 1)) / 2, "W", 0xAAAAAA).setShadow(true)); + builder.widget(new LabelWidget(3 + 16 * (radius * 2 - 1), 15 + (16 * (radius * 2 - 1)) / 2, "E", 0xAAAAAA) + .setShadow(true)); + return builder.label(6, 6, getTranslationKey()).build(holder, entityPlayer); + } + + @Unique + private static MixinProspectorMode getMode(ItemStack stack) { + if (stack == ItemStack.EMPTY) { + return MixinProspectorMode.ORE; + } + NBTTagCompound tag = stack.getTagCompound(); + if (tag == null) { + return MixinProspectorMode.ORE; + } + if (tag.hasKey("Mode", Constants.NBT.TAG_INT)) { + return MixinProspectorMode.VALUES[tag.getInteger("Mode")]; + } + return MixinProspectorMode.ORE; + } + + @Inject(method = {"addInformation"}, at = {@At("HEAD")}, cancellable = true) + public void addInformation(ItemStack itemStack, List lines, CallbackInfo ci) { + IItemBehaviour.super.addInformation(itemStack, lines); + if (tier >= FLUID_PROSPECTION_THRESHOLD) { + lines.add(new TextComponentTranslation("metaitem.prospector.tooltip.fluids", radius).getFormattedText()); + lines.add(new TextComponentTranslation((getMode(itemStack).unlocalizedName)).getFormattedText()); + } else { + lines.add(new TextComponentTranslation("metaitem.prospector.tooltip.ores", radius).getFormattedText()); + } + + ci.cancel(); + } + + @Unique + private String getTranslationKey() { + return String.format("metaitem.prospector.%s.name", GTValues.VN[tier].toLowerCase(Locale.ROOT)); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/mixin/MixinTricorderBehavior.java b/src/main/java/com/fulltrix/gcyl/mixin/MixinTricorderBehavior.java new file mode 100644 index 00000000..0103af03 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/mixin/MixinTricorderBehavior.java @@ -0,0 +1,61 @@ +package com.fulltrix.gcyl.mixin; + +import com.fulltrix.gcyl.api.worldgen.VirtualOreVeinHandler; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.stack.MaterialStack; +import gregtech.common.items.behaviors.TricorderBehavior; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.util.List; + +@Mixin(value = TricorderBehavior.class, remap = false) +public class MixinTricorderBehavior { + + @Inject(method = {"getScannerInfo"}, at = {@At("TAIL")}, cancellable = true) + public void getScannerInfo(EntityPlayer player, World world, BlockPos pos, CallbackInfoReturnable> cir) { + + List list = cir.getReturnValue(); + + list.add(new TextComponentTranslation("behavior.tricorder.divider")); + + List materials = VirtualOreVeinHandler.getMaterialsInChunk(world, pos.getX() / 16, pos.getZ() / 16); + + if(materials != null) { + for (int i = 0; i < materials.size(); i++) { + Material material = materials.get(i); + if (material != null) { + int operationsRemaining = VirtualOreVeinHandler.getOperationsRemaining(world, pos.getX() / 16, pos.getZ() / 16).get(i); + int yield = VirtualOreVeinHandler.getYield(world, pos.getX() / 16, pos.getZ() / 16).get(i); + double materialPercent = operationsRemaining * 100.0 / yield; + + if (player.isCreative()) { + list.add(new TextComponentTranslation("behavior.tricorder.virtual_ore.amount", i + 1, + new TextComponentTranslation(material.getLocalizedName()) + .setStyle(new Style().setColor(TextFormatting.GOLD)), + new TextComponentTranslation(String.valueOf(operationsRemaining)) + .setStyle(new Style().setColor(TextFormatting.GOLD)), + new TextComponentTranslation(String.valueOf(materialPercent)) + .setStyle(new Style().setColor(TextFormatting.YELLOW)))); + } else { + list.add(new TextComponentTranslation("behavior.tricorder.virtual_ore.amount_unknown", i + 1, + new TextComponentTranslation(String.valueOf(materialPercent)) + .setStyle(new Style().setColor(TextFormatting.YELLOW)))); + } + } else { + list.add(new TextComponentTranslation("behavior.tricorder.virtual_ore.nothing")); + } + } + cir.setReturnValue(list); + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinPacketProspecting.java b/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinPacketProspecting.java new file mode 100644 index 00000000..6058bf27 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinPacketProspecting.java @@ -0,0 +1,137 @@ +package com.fulltrix.gcyl.mixinhelpers; + +import io.netty.buffer.Unpooled; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; + +public class MixinPacketProspecting { + public int chunkX; + public int chunkZ; + public int playerChunkX; + public int playerChunkZ; + public int posX; + public int posZ; + public MixinProspectorMode mode; + public HashMap[][] map; + public Set ores; + + @SuppressWarnings("unused") + public MixinPacketProspecting() {} + + public MixinPacketProspecting(int chunkX, int chunkZ, int playerChunkX, int playerChunkZ, int posX, int posZ, + MixinProspectorMode mode) { + this.chunkX = chunkX; + this.chunkZ = chunkZ; + this.playerChunkX = playerChunkX; + this.playerChunkZ = playerChunkZ; + this.posX = posX; + this.posZ = posZ; + this.mode = mode; + if (mode == MixinProspectorMode.FLUID || mode == MixinProspectorMode.VIRTUAL_ORE) { + // noinspection unchecked + map = new HashMap[1][1]; + } else { + // noinspection unchecked + map = new HashMap[16][16]; + } + + ores = new HashSet<>(); + } + + public static MixinPacketProspecting readPacketData(PacketBuffer buffer) { + MixinPacketProspecting packet = new MixinPacketProspecting(buffer.readInt(), buffer.readInt(), buffer.readInt(), + buffer.readInt(), buffer.readInt(), buffer.readInt(), MixinProspectorMode.VALUES[buffer.readInt()]); + int aSize = 0; + if (packet.mode == MixinProspectorMode.ORE) + aSize = 16; + else if (packet.mode == MixinProspectorMode.FLUID || packet.mode == MixinProspectorMode.VIRTUAL_ORE) + aSize = 1; + int checkOut = 0; + for (int i = 0; i < aSize; i++) + for (int j = 0; j < aSize; j++) { + byte kSize = buffer.readByte(); + if (kSize == 0) continue; + packet.map[i][j] = new HashMap<>(); + for (int k = 0; k < kSize; k++) { + byte y = buffer.readByte(); + String name = buffer.readString(1000); + packet.map[i][j].put(y, name); + if (packet.mode == MixinProspectorMode.ORE || y == 1) + packet.ores.add(name); + checkOut++; + } + } + int checkOut2 = buffer.readInt(); + if (checkOut != checkOut2) { + return null; + } + return packet; + } + + public static MixinPacketProspecting readPacketData(NBTTagCompound nbt) { + if (nbt.hasKey("buffer")) { + return MixinPacketProspecting + .readPacketData(new PacketBuffer(Unpooled.wrappedBuffer(nbt.getByteArray("buffer")))); + } + return null; + } + + public NBTTagCompound writePacketData() { + NBTTagCompound nbt = new NBTTagCompound(); + PacketBuffer buffer = new PacketBuffer(Unpooled.buffer()); + writePacketData(buffer); + byte[] bytes = buffer.array(); + nbt.setByteArray("buffer", bytes); + return nbt; + } + + public void writePacketData(PacketBuffer buffer) { + buffer.writeInt(chunkX); + buffer.writeInt(chunkZ); + buffer.writeInt(playerChunkX); + buffer.writeInt(playerChunkZ); + buffer.writeInt(posX); + buffer.writeInt(posZ); + buffer.writeInt(mode.ordinal()); + int aSize = 0; + if (this.mode == MixinProspectorMode.ORE) + aSize = 16; + else if (this.mode == MixinProspectorMode.FLUID || this.mode == MixinProspectorMode.VIRTUAL_ORE) + aSize = 1; + int checkOut = 0; + for (int i = 0; i < aSize; i++) + for (int j = 0; j < aSize; j++) { + if (map[i][j] == null) + buffer.writeByte(0); + else { + buffer.writeByte(map[i][j].keySet().size()); + for (byte key : map[i][j].keySet()) { + buffer.writeByte(key); + buffer.writeString(map[i][j].get(key)); + checkOut++; + } + } + } + buffer.writeInt(checkOut); + } + + public void addBlock(int x, int y, int z, String orePrefix) { + if (this.mode == MixinProspectorMode.ORE) { + if (map[x][z] == null) + map[x][z] = new HashMap<>(); + map[x][z].put((byte) y, orePrefix); + ores.add(orePrefix); + } else if (this.mode == MixinProspectorMode.FLUID || this.mode == MixinProspectorMode.VIRTUAL_ORE) { + if (map[x][z] == null) + map[x][z] = new HashMap<>(); + map[x][z].put((byte) y, orePrefix); + if (y == 1) { + ores.add(orePrefix); + } + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinProspectingTexture.java b/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinProspectingTexture.java new file mode 100644 index 00000000..6e863f33 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinProspectingTexture.java @@ -0,0 +1,223 @@ +package com.fulltrix.gcyl.mixinhelpers; + +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.stack.MaterialStack; +import gregtech.client.utils.RenderUtil; +import gregtech.core.unification.material.internal.MaterialRegistryManager; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.IResourceManager; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import org.jetbrains.annotations.Nullable; + +import java.awt.*; +import java.awt.image.BufferedImage; +import java.awt.image.WritableRaster; +import java.util.Arrays; +import java.util.HashMap; +import java.util.stream.Collectors; + +import static com.fulltrix.gcyl.mixinhelpers.MixinWidgetProspectingMap.ORE_PREFIX_CONSTANT_DISPLAY; + +public class MixinProspectingTexture extends AbstractTexture { + + public static final String SELECTED_ALL = "[all]"; + + private String selected = SELECTED_ALL; + private boolean darkMode; + private int imageWidth = -1; + private int imageHeight = -1; + public final HashMap[][] map; + public static HashMap emptyTag = new HashMap<>(); + private int playerXGui; + private int playerYGui; + private final MixinProspectorMode mode; + private final int radius; + + public MixinProspectingTexture(MixinProspectorMode mode, int radius, boolean darkMode) { + this.darkMode = darkMode; + this.radius = radius; + this.mode = mode; + if (this.mode == MixinProspectorMode.FLUID || this.mode == MixinProspectorMode.VIRTUAL_ORE) { + // noinspection unchecked + map = new HashMap[(radius * 2 - 1)][(radius * 2 - 1)]; + } else { + // noinspection unchecked + map = new HashMap[(radius * 2 - 1) * 16][(radius * 2 - 1) * 16]; + } + } + + public void updateTexture(MixinPacketProspecting packet) { + int playerChunkX = packet.playerChunkX; + int playerChunkZ = packet.playerChunkZ; + playerXGui = packet.posX - (playerChunkX - this.radius + 1) * 16 + (packet.posX > 0 ? 1 : 0); + playerYGui = packet.posZ - (playerChunkZ - this.radius + 1) * 16 + (packet.posX > 0 ? 1 : 0); + + int ox; + if ((packet.chunkX > 0 && playerChunkX > 0) || (packet.chunkX < 0 && playerChunkX < 0)) { + ox = Math.abs(Math.abs(packet.chunkX) - Math.abs(playerChunkX)); + } else { + ox = Math.abs(playerChunkX) + Math.abs(packet.chunkX); + } + if (playerChunkX > packet.chunkX) { + ox = -ox; + } + + int oy; + if ((packet.chunkZ > 0 && playerChunkZ > 0) || (packet.chunkZ < 0 && playerChunkZ < 0)) { + oy = Math.abs(Math.abs(packet.chunkZ) - Math.abs(playerChunkZ)); + } else { + oy = Math.abs(playerChunkZ) + Math.abs(packet.chunkZ); + } + if (playerChunkZ > packet.chunkZ) { + oy = -oy; + } + + int currentColumn = (this.radius - 1) + ox; + int currentRow = (this.radius - 1) + oy; + if (currentRow < 0) { + return; + } + + if (this.mode == MixinProspectorMode.FLUID || this.mode == MixinProspectorMode.VIRTUAL_ORE) { + map[currentColumn][currentRow] = packet.map[0][0] == null ? + emptyTag : packet.map[0][0]; + } else { + for (int x = 0; x < 16; x++) { + for (int z = 0; z < 16; z++) { + map[x + currentColumn * 16][z + currentRow * 16] = packet.map[x][z] == null ? + emptyTag : packet.map[x][z]; + } + } + } + loadTexture(null); + } + + private BufferedImage getImage() { + int wh = (this.radius * 2 - 1) * 16; + BufferedImage image = new BufferedImage(wh, wh, BufferedImage.TYPE_INT_ARGB); + WritableRaster raster = image.getRaster(); + + for (int i = 0; i < wh; i++) { + for (int j = 0; j < wh; j++) { + HashMap data = this.map[this.mode == MixinProspectorMode.ORE ? i : i / 16][this.mode == + MixinProspectorMode.ORE ? j : j / 16]; + // draw bg + image.setRGB(i, j, ((data == null) ^ darkMode) ? Color.darkGray.getRGB() : Color.WHITE.getRGB()); + // draw ore + if (this.mode == MixinProspectorMode.ORE && data != null) { + for (String orePrefix : data.values()) { + if (!selected.equals(SELECTED_ALL) && !selected.equals(orePrefix)) continue; + MaterialStack mterialStack = OreDictUnifier.getMaterial(OreDictUnifier.get(orePrefix)); + image.setRGB(i, j, mterialStack == null ? orePrefix.hashCode() : + mterialStack.material.getMaterialRGB() | 0XFF000000); + break; + } + } + // draw grid + if ((i) % 16 == 0 || (j) % 16 == 0) { + raster.setSample(i, j, 0, raster.getSample(i, j, 0) / 2); + raster.setSample(i, j, 1, raster.getSample(i, j, 1) / 2); + raster.setSample(i, j, 2, raster.getSample(i, j, 2) / 2); + } + } + } + return image; + } + + @Override + public void loadTexture(@Nullable IResourceManager resourceManager) { + this.deleteGlTexture(); + int tId = getGlTextureId(); + if (tId < 0) return; + TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), getImage(), false, false); + imageWidth = (radius * 2 - 1) * 16; + imageHeight = (radius * 2 - 1) * 16; + } + + public void loadTexture(@Nullable IResourceManager resourceManager, String selected) { + this.selected = selected; + loadTexture(resourceManager); + } + + public void loadTexture(@Nullable IResourceManager resourceManager, boolean darkMode) { + this.darkMode = darkMode; + loadTexture(resourceManager); + } + + public String getSelected() { + return selected; + } + + public void draw(int x, int y) { + if (this.glTextureId < 0) return; + GlStateManager.bindTexture(this.getGlTextureId()); + Gui.drawModalRectWithCustomSizedTexture(x, y, 0, 0, imageWidth, imageHeight, imageWidth, imageHeight); + if (this.mode == MixinProspectorMode.FLUID) { // draw fluids in grid + for (int cx = 0; cx < this.radius * 2 - 1; cx++) { + for (int cz = 0; cz < this.radius * 2 - 1; cz++) { + if (this.map[cx][cz] != null && !this.map[cx][cz].isEmpty()) { + Fluid fluid = FluidRegistry.getFluid(this.map[cx][cz].get((byte) 1)); + if (selected.equals(SELECTED_ALL) || selected.equals(fluid.getName())) { + RenderUtil.drawFluidForGui(new FluidStack(fluid, 1), 1, x + cx * 16 + 1, y + cz * 16 + 1, + 16, 16); + } + } + } + } + } + if(this.mode == MixinProspectorMode.VIRTUAL_ORE) { + for (int cx = 0; cx < this.radius * 2 - 1; cx++) { + for (int cz = 0; cz < this.radius * 2 - 1; cz++) { + if (this.map[cx][cz] != null && !this.map[cx][cz].isEmpty()) { + + String[] strings = this.map[cx][cz].get((byte) 1).split(","); + + String[] capitalized = Arrays.stream(this.map[cx][cz].get((byte) 1).split(",")).map(a -> ORE_PREFIX_CONSTANT_DISPLAY + Character.toTitleCase(a.charAt(0)) + a.substring(1)).collect(Collectors.joining(",")).split(","); + + + + for(int i = 0; i < strings.length ; i++) { + + + Fluid fluid = FluidRegistry.getFluid(strings[i]); + + if (selected.equals(SELECTED_ALL) || selected.equals(capitalized[i])) { + + if(fluid != null) { + RenderUtil.drawFluidForGui(new FluidStack(fluid, 1), 1, x + cx * 16 + 1 + (i < 2 ? i * 8 : (i - 2) * 8), y + cz * 16 + 1 + (i > 1 ? 8 : 0), + 8, 8); + } + else { + Material nullMaterial = MaterialRegistryManager.getInstance().getMaterial(strings[i]); + + Fluid coloredFluid = FluidRegistry.getFluid("placeholder").setColor(nullMaterial.getMaterialRGB()); + + RenderUtil.drawFluidForGui(new FluidStack(coloredFluid, 1), 1, x + cx * 16 + 1 + (i < 2 ? i * 8 : (i - 2) * 8), y + cz * 16 + 1 + (i > 1 ? 8 : 0), + 8, 8); + } + } + } + } + } + } + } + // draw red vertical line + if (playerXGui % 16 > 7 || playerXGui % 16 == 0) { + Gui.drawRect(x + playerXGui - 1, y, x + playerXGui, y + imageHeight, Color.RED.getRGB()); + } else { + Gui.drawRect(x + playerXGui, y, x + playerXGui + 1, y + imageHeight, Color.RED.getRGB()); + } + // draw red horizontal line + if (playerYGui % 16 > 7 || playerYGui % 16 == 0) { + Gui.drawRect(x, y + playerYGui - 1, x + imageWidth, y + playerYGui, Color.RED.getRGB()); + } else { + Gui.drawRect(x, y + playerYGui, x + imageWidth, y + playerYGui + 1, Color.RED.getRGB()); + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinProspectorMode.java b/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinProspectorMode.java new file mode 100644 index 00000000..26465996 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinProspectorMode.java @@ -0,0 +1,31 @@ +package com.fulltrix.gcyl.mixinhelpers; + + +import org.jetbrains.annotations.NotNull; + +public enum MixinProspectorMode { + + ORE("ore_prospector", "metaitem.prospector.mode.ores"), + FLUID("fluid_prospector", "metaitem.prospector.mode.fluid"), + VIRTUAL_ORE("virtual_ore_prospector", "metaitem.prospector.mode.virtual_ores"); + + public static final MixinProspectorMode[] VALUES = values(); + + public final String terminalName; + public final String unlocalizedName; + + MixinProspectorMode(@NotNull String terminalName, @NotNull String unlocalizedName) { + this.terminalName = terminalName; + this.unlocalizedName = unlocalizedName; + } + + @NotNull + public MixinProspectorMode next() { + int next = ordinal() + 1; + if (next >= VALUES.length) { + return MixinProspectorMode.VALUES[0]; + } + return VALUES[next]; + } + +} diff --git a/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinWidgetOreList.java b/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinWidgetOreList.java new file mode 100644 index 00000000..2864aebe --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinWidgetOreList.java @@ -0,0 +1,221 @@ +package com.fulltrix.gcyl.mixinhelpers; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import gregtech.api.gui.GuiTextures; +import gregtech.api.gui.IRenderContext; +import gregtech.api.gui.Widget; +import gregtech.api.gui.resources.ColorRectTexture; +import gregtech.api.gui.widgets.*; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.stack.MaterialStack; +import gregtech.api.util.Position; +import gregtech.common.gui.widget.terminal.gui.widgets.DraggableScrollableWidgetGroup; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.items.ItemStackHandler; + +import java.awt.*; +import java.util.*; +import java.util.List; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import static com.fulltrix.gcyl.mixinhelpers.MixinWidgetProspectingMap.ORE_PREFIX_CONSTANT_DISPLAY; + +public class MixinWidgetOreList extends DraggableScrollableWidgetGroup { + + protected WidgetGroup selected; + protected final BiMap widgetMap; + protected Consumer onSelected = null; + public Map ores; + private int tickCounter; + + public MixinWidgetOreList(int xPosition, int yPosition, int width, int slotSize) { + super(xPosition, yPosition, width, slotSize); + widgetMap = HashBiMap.create(); + ores = new HashMap<>(); + this.setYScrollBarWidth(5); + this.setYBarStyle(null, new ColorRectTexture(new Color(148, 226, 193))); + clear(); + } + + public void setSelected(String oreName) { + WidgetGroup widget = widgetMap.inverse().get(oreName); + if (widget != null) { + this.selected = widget; + if (this.onSelected != null) { + onSelected.accept(widgetMap.get(this.selected)); + } + } + } + + public void addOres(Set ores, MixinProspectorMode mode) { + switch (mode) { + case ORE: + ores.stream().sorted().forEach(this::addOre); + break; + case FLUID: + ores.stream().sorted().forEach(this::addOil); + break; + case VIRTUAL_ORE: + ores.stream().sorted().forEach(this::addVirtual); + default: + break; + } + } + + private void addOre(String orePrefix) { + if (ores.containsKey(orePrefix)) { + return; + } + ItemStack itemStack = OreDictUnifier.get(orePrefix); + if (itemStack == null || itemStack.isEmpty()) return; + ores.put(orePrefix, itemStack.getDisplayName()); + MaterialStack materialStack = OreDictUnifier.getMaterial(OreDictUnifier.get(orePrefix)); + ItemStackHandler itemStackHandler = new ItemStackHandler(1); + itemStackHandler.insertItem(0, itemStack, false); + WidgetGroup widgetGroup = new WidgetGroup(0, 0, getSize().width - 5, 18); + widgetGroup.addWidget(new SlotWidget(itemStackHandler, 0, 0, 0, false, false)); + widgetGroup.addWidget(new LabelWidget(20, 5, itemStack.getDisplayName(), + materialStack == null ? orePrefix.hashCode() : materialStack.material.getMaterialRGB() | 0XFF000000)); + addOrePrefix(orePrefix, widgetGroup); + } + + private void addOrePrefix(String orePrefix, WidgetGroup widgetGroup) { + widgetMap.put(widgetGroup, orePrefix); + this.addWidget(widgetGroup); + this.widgets.sort(Comparator.comparing(widgetMap::get)); + int y = 0; + for (Widget widget : this.widgets) { + widget.setSelfPosition(new Position(0, y - scrollYOffset)); + y += 18; + } + computeMax(); + } + + private void addOil(String orePrefix) { + if (ores.containsKey(orePrefix)) { + return; + } + FluidStack fluidStack = FluidRegistry.getFluidStack(orePrefix, 1); + if (fluidStack == null) return; + ores.put(orePrefix, fluidStack.getLocalizedName()); + FluidTank fluidTank = new FluidTank(1); + fluidTank.setCanFill(false); + fluidTank.fillInternal(fluidStack, true); + WidgetGroup widgetGroup = new WidgetGroup(0, 0, getSize().width - 5, 18); + widgetGroup.addWidget(new TankWidget(fluidTank, 0, 0, 18, 18) + .setAlwaysShowFull(true) + .setClient() + .setHideTooltip(true) + .setContainerClicking(false, false)); + widgetGroup + .addWidget(new LabelWidget(20, 5, fluidStack.getLocalizedName(), getFluidColor(fluidStack.getFluid()))); + addOrePrefix(orePrefix, widgetGroup); + } + + private void addVirtual(String orePrefix) { + String[] oreList = Arrays.stream(orePrefix.split(",")).map(a -> ORE_PREFIX_CONSTANT_DISPLAY + Character.toTitleCase(a.charAt(0)) + a.substring(1)).collect(Collectors.joining(",")).split(","); + + for(int i = 0; i < oreList.length; i++) { + if (ores.containsKey(oreList[i])) { + return; + } + ItemStack itemStack = OreDictUnifier.get(oreList[i]); + if (itemStack == null || itemStack.isEmpty()) return; + ores.put(oreList[i], itemStack.getDisplayName()); + MaterialStack materialStack = OreDictUnifier.getMaterial(OreDictUnifier.get(oreList[i])); + ItemStackHandler itemStackHandler = new ItemStackHandler(1); + itemStackHandler.insertItem(0, itemStack, false); + WidgetGroup widgetGroup = new WidgetGroup(0, 0, getSize().width - 5, 18); + widgetGroup.addWidget(new SlotWidget(itemStackHandler, 0, 0, 0, false, false)); + widgetGroup.addWidget(new LabelWidget(20, 5, itemStack.getDisplayName(), + materialStack == null ? oreList[i].hashCode() : materialStack.material.getMaterialRGB() | 0XFF000000)); + addOrePrefix(oreList[i], widgetGroup); + } + } + + public void clear() { + this.clearAllWidgets(); + widgetMap.clear(); + WidgetGroup widgetGroup = new WidgetGroup(0, 0, getSize().width - 5, 18); + widgetGroup.addWidget(new ImageWidget(0, 0, 18, 18, GuiTextures.LOCK)); + widgetGroup.addWidget(new LabelWidget(20, 9, "terminal.prospector.list", -1)); + selected = widgetGroup; + widgetMap.put(widgetGroup, "[all]"); + this.addWidget(widgetGroup); + } + + @Override + protected boolean hookDrawInBackground(int mouseX, int mouseY, float partialTicks, IRenderContext context) { + if (selected != null) { + drawSolidRect(selected.getPosition().x, selected.getPosition().y, selected.getSize().width, 18, 0x4BFFFFFF); + } + for (Widget widget : widgets) { + if (widget.isVisible()) { + widget.drawInBackground(mouseX, mouseY, partialTicks, context); + + GlStateManager.color(gui.getRColorForOverlay(), gui.getGColorForOverlay(), gui.getBColorForOverlay(), + 1.0F); + } + } + return true; + } + + @Override + protected boolean checkClickedDragged(int mouseX, int mouseY, int button) { + draggedWidget = null; + for (int i = widgets.size() - 1; i >= 0; i--) { + Widget widget = widgets.get(i); + if (widget.isVisible() && widget instanceof WidgetGroup) { + if (widget.isMouseOverElement(mouseX, mouseY)) { + if (isMouseOverElement(mouseX, mouseY) && this.selected != widget) { + this.setSelected(widgetMap.get(widget)); + } + return true; + } + } + } + return false; + } + + @Override + public void updateScreen() { + super.updateScreen(); + tickCounter++; + if (tickCounter % 20 == 0) { + widgets.forEach(widget -> { + if (widget instanceof WidgetGroup) { + Widget widget1 = ((WidgetGroup) widget).getContainedWidgets(true).get(0); + if (widget1 instanceof SlotWidget) { + SlotWidget slotWidget = (SlotWidget) widget1; + List list = OreDictUnifier.getAllWithOreDictionaryName(widgetMap.get(widget)); + if (list.size() > 0) { + slotWidget.getHandle().decrStackSize(64); + slotWidget.getHandle().putStack(list.get(Math.floorMod(tickCounter / 20, list.size()))); + } + } + } + + }); + } + } + + public static int getFluidColor(Fluid fluid) { + if (fluid == FluidRegistry.WATER) { + return 3183823; + } else { + return fluid == FluidRegistry.LAVA ? 16766720 : fluid.getColor(); + } + } + + @Override + protected void writeClientAction(int id, Consumer packetBufferWriter) {} +} + diff --git a/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinWidgetProspectingMap.java b/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinWidgetProspectingMap.java new file mode 100644 index 00000000..04be1498 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/mixinhelpers/MixinWidgetProspectingMap.java @@ -0,0 +1,607 @@ +package com.fulltrix.gcyl.mixinhelpers; + +import com.fulltrix.gcyl.api.worldgen.VirtualOreVeinHandler; +import gregtech.api.gui.IRenderContext; +import gregtech.api.gui.Widget; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.ore.OrePrefix; +import gregtech.api.unification.ore.StoneType; +import gregtech.api.unification.stack.MaterialStack; +import gregtech.api.util.*; +import gregtech.api.worldgen.bedrockFluids.BedrockFluidVeinHandler; +import gregtech.api.worldgen.config.OreDepositDefinition; +import gregtech.api.worldgen.config.WorldGenRegistry; +import gregtech.api.worldgen.filler.FillerEntry; +import gregtech.core.unification.material.internal.MaterialRegistryManager; +import gregtech.integration.xaero.ColorUtility; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.NotNull; + +import java.awt.*; +import java.io.IOException; +import java.util.*; +import java.util.List; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + + +public class MixinWidgetProspectingMap extends Widget { + + public static final String ORE_PREFIX_CONSTANT_DISPLAY = "ore"; + private final int chunkRadius; + private final MixinWidgetOreList oreList; + private final @NotNull MixinProspectorMode mode; + private final int scanTick; + private boolean darkMode = false; + private int chunkIndex = 0; + + @SideOnly(Side.CLIENT) + private MixinProspectingTexture texture; + @SideOnly(Side.CLIENT) + private Consumer onPacketReceived; + private final Queue packetQueue = new LinkedBlockingQueue<>(); + + private long lastClicked; + + private final List hoveredNames = new ArrayList<>(); + private int color; + + public MixinWidgetProspectingMap(int xPosition, int yPosition, int chunkRadius, MixinWidgetOreList widgetOreList, + @NotNull MixinProspectorMode mode, int scanTick) { + super(new Position(xPosition, yPosition), new Size(16 * (chunkRadius * 2 - 1), 16 * (chunkRadius * 2 - 1))); + this.chunkRadius = chunkRadius; + this.mode = mode; + this.scanTick = scanTick; + oreList = widgetOreList; + if (oreList != null) { + oreList.onSelected = name -> { + if (texture != null) { + texture.loadTexture(null, name); + } + }; + } + } + + + public void detectAndSendChanges() { + EntityPlayer player = gui.entityPlayer; + World world = player.world; + if (FMLCommonHandler.instance().getMinecraftServerInstance().getTickCounter() % scanTick == 0 && + chunkIndex < (chunkRadius * 2 - 1) * (chunkRadius * 2 - 1)) { + + int playerChunkX = player.chunkCoordX; + int playerChunkZ = player.chunkCoordZ; + + int row = chunkIndex / (chunkRadius * 2 - 1); + int column = chunkIndex % (chunkRadius * 2 - 1); + + int ox = column - chunkRadius + 1; + int oz = row - chunkRadius + 1; + + Chunk chunk = world.getChunk(playerChunkX + ox, playerChunkZ + oz); + MixinPacketProspecting packet = new MixinPacketProspecting(playerChunkX + ox, playerChunkZ + oz, playerChunkX, + playerChunkZ, (int) player.posX, (int) player.posZ, this.mode); + + switch (mode) { + case ORE: + BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(); + for (int x = 0; x < 16; x++) { + for (int z = 0; z < 16; z++) { + int ySize = chunk.getHeightValue(x, z); + for (int y = 1; y < ySize; y++) { + pos.setPos(x, y, z); + IBlockState state = chunk.getBlockState(pos); + ItemStack itemBlock = GTUtility.toItem(state); + if (GTUtility.isOre(itemBlock)) { + boolean added = false; + String oreDictString = OreDictUnifier.getOreDictionaryNames(itemBlock).stream() + .findFirst() + .orElse(""); + OrePrefix prefix = OreDictUnifier.getPrefix(itemBlock); + if (prefix != null) { + for (StoneType type : StoneType.STONE_TYPE_REGISTRY) { + if (type.processingPrefix == prefix && type.shouldBeDroppedAsItem) { + packet.addBlock(x, y, z, oreDictString); + added = true; + break; + } else if (type.processingPrefix == prefix) { + MaterialStack materialStack = OreDictUnifier.getMaterial(itemBlock); + if (materialStack != null) { + String oreDict = "ore" + + oreDictString.replaceFirst(prefix.name(), ""); + packet.addBlock(x, y, z, oreDict); + added = true; + break; + } + } + } + } + // Probably other mod's ores + if (!added) { + // Fallback + packet.addBlock(x, y, z, oreDictString); + } + } + } + } + } + break; + case FLUID: + BedrockFluidVeinHandler.FluidVeinWorldEntry fStack = BedrockFluidVeinHandler + .getFluidVeinWorldEntry(world, chunk.x, chunk.z); + if (fStack != null && fStack.getDefinition() != null) { + packet.addBlock(0, 3, 0, + TextFormattingUtil.formatNumbers(100.0 * + BedrockFluidVeinHandler.getOperationsRemaining(world, chunk.x, chunk.z) / + BedrockFluidVeinHandler.MAXIMUM_VEIN_OPERATIONS)); + packet.addBlock(0, 2, 0, + String.valueOf(BedrockFluidVeinHandler.getFluidYield(world, chunk.x, chunk.z))); + Fluid fluid = BedrockFluidVeinHandler.getFluidInChunk(world, chunk.x, chunk.z); + if (fluid != null) { + packet.addBlock(0, 1, 0, fluid.getName()); + } + } + break; + case VIRTUAL_ORE: + VirtualOreVeinHandler.VirtualOreVeinWorldEntry vStack = VirtualOreVeinHandler + .getVirtualOreVeinWorldEntry(world, chunk.x, chunk.z); + if (vStack != null && vStack.getDefinition() != null) { + + List materials = VirtualOreVeinHandler.getMaterialsInChunk(world, chunk.x, chunk.z); + + if (materials != null) { + + StringBuilder percent = new StringBuilder(); + StringBuilder yield = new StringBuilder(); + StringBuilder material = new StringBuilder(); + + for (int i = 0; i < materials.size(); i++) { + + percent.append(TextFormattingUtil.formatNumbers(100.0 * + VirtualOreVeinHandler.getOperationsRemaining(world, chunk.x, chunk.z).get(i) / + VirtualOreVeinHandler.getYield(world, chunk.x, chunk.z).get(i))); + + yield.append(VirtualOreVeinHandler.getOperationsRemaining(world, chunk.x, chunk.z).get(i)); + + material.append(materials.get(i).getName()); + + if(i != materials.size() - 1) { + percent.append(','); + yield.append(','); + material.append(','); + } + } + + packet.addBlock(0, 3, 0, percent.toString()); + packet.addBlock(0, 2, 0, yield.toString()); + packet.addBlock(0, 1, 0, material.toString()); + } + } + break; + default: + break; + } + writeUpdateInfo(2, packet::writePacketData); + chunkIndex++; + } + } + + @SideOnly(Side.CLIENT) + public void setOnPacketReceived(Consumer onPacketReceived) { + this.onPacketReceived = onPacketReceived; + } + + @SideOnly(Side.CLIENT) + public void setDarkMode(boolean mode) { + if (darkMode != mode) { + darkMode = mode; + if (texture != null) { + texture.loadTexture(null, darkMode); + } + } + } + + @SideOnly(Side.CLIENT) + public boolean getDarkMode() { + return darkMode; + } + + @SideOnly(Side.CLIENT) + @Override + public void drawInBackground(int mouseX, int mouseY, float partialTicks, IRenderContext context) { + if (texture != null) { + GlStateManager.color(1, 1, 1, 1); + texture.draw(this.getPosition().x, this.getPosition().y); + } + } + + @SideOnly(Side.CLIENT) + @Override + public void readUpdateInfo(int id, PacketBuffer buffer) { + super.readUpdateInfo(id, buffer); + if (id == 2) { + MixinPacketProspecting packet = MixinPacketProspecting.readPacketData(buffer); + if (packet != null) { + if (onPacketReceived != null) { + onPacketReceived.accept(packet); + } + addPacketToQueue(packet); + } + } + } + + @Override + public void updateScreen() { + if (packetQueue != null) { + int max = 10; + while (max-- > 0 && !packetQueue.isEmpty()) { + MixinPacketProspecting packet = packetQueue.poll(); + if (texture == null) { + texture = new MixinProspectingTexture(packet.mode, chunkRadius, darkMode); + } + texture.updateTexture(packet); + if (oreList != null) { + oreList.addOres(packet.ores, packet.mode); + } + } + } + } + + @SideOnly(Side.CLIENT) + public void addPacketToQueue(MixinPacketProspecting packet) { + packetQueue.add(packet); + } + + @SideOnly(Side.CLIENT) + @Override + public void drawInForeground(int mouseX, int mouseY) { + // draw tooltips + if (this.isMouseOverElement(mouseX, mouseY) && texture != null) { + this.hoveredNames.clear(); + List tooltips = new ArrayList<>(); + int cX = (mouseX - this.getPosition().x) / 16; + int cZ = (mouseY - this.getPosition().y) / 16; + if (cX >= chunkRadius * 2 - 1 || cZ >= chunkRadius * 2 - 1) + return; + // draw hover layer + Gui.drawRect(cX * 16 + this.getPosition().x, + cZ * 16 + this.getPosition().y, + (cX + 1) * 16 + this.getPosition().x, + (cZ + 1) * 16 + this.getPosition().y, + new Color(0x4B6C6C6C, true).getRGB()); + + // pick the color of the highest element for the waypoint color + final int[] maxAmount = { 0 }; + + if (this.mode == MixinProspectorMode.ORE) { // draw ore + tooltips.add(I18n.format("terminal.prospector.ore")); + HashMap oreInfo = new HashMap<>(); + for (int i = 0; i < 16; i++) { + for (int j = 0; j < 16; j++) { + if (texture.map[cX * 16 + i][cZ * 16 + j] != null) { + texture.map[cX * 16 + i][cZ * 16 + j].values().forEach(dict -> { + String name = OreDictUnifier.get(dict).getDisplayName(); + if (MixinProspectingTexture.SELECTED_ALL.equals(texture.getSelected()) || + texture.getSelected().equals(dict)) { + oreInfo.put(name, oreInfo.getOrDefault(name, 0) + 1); + if (oreInfo.get(name) > maxAmount[0]) { + maxAmount[0] = oreInfo.get(name); + MaterialStack m = OreDictUnifier.getMaterial(OreDictUnifier.get(dict)); + if (m != null) { + color = m.material.getMaterialRGB(); + } + } + } + }); + } + } + } + oreInfo.forEach((name, count) -> { + tooltips.add(name + " --- " + count); + hoveredNames.add(name); + }); + } else if (this.mode == MixinProspectorMode.FLUID) { + tooltips.add(I18n.format("terminal.prospector.fluid")); + if (texture.map[cX][cZ] != null && !texture.map[cX][cZ].isEmpty()) { + if (MixinProspectingTexture.SELECTED_ALL.equals(texture.getSelected()) || + texture.getSelected().equals(texture.map[cX][cZ].get((byte) 1))) { + FluidStack fluidStack = FluidRegistry.getFluidStack(texture.map[cX][cZ].get((byte) 1), 1); + if (fluidStack != null) { + tooltips.add(I18n.format("terminal.prospector.fluid.info", + fluidStack.getLocalizedName(), + texture.map[cX][cZ].get((byte) 2), + texture.map[cX][cZ].get((byte) 3))); + hoveredNames.add(fluidStack.getLocalizedName()); + int amount = Integer.parseInt(texture.map[cX][cZ].get((byte) 2)); + if (amount > maxAmount[0]) { + maxAmount[0] = amount; + color = fluidStack.getFluid().getColor(fluidStack); + } + } + } + } + } else if (this.mode == MixinProspectorMode.VIRTUAL_ORE) { + tooltips.add(I18n.format("terminal.prospector.virtual_ores")); + if (texture.map[cX][cZ] != null && !texture.map[cX][cZ].isEmpty()) { + + String[] materials = texture.map[cX][cZ].get((byte) 1).split(","); + String[] yields = texture.map[cX][cZ].get((byte) 2).split(","); + String[] percents = texture.map[cX][cZ].get((byte) 3).split(","); + + List materialsForSelect = Arrays.asList(Arrays.stream(materials).map(a -> ORE_PREFIX_CONSTANT_DISPLAY + Character.toTitleCase(a.charAt(0)) + a.substring(1)).collect(Collectors.joining(",")).split(",")); + + if (MixinProspectingTexture.SELECTED_ALL.equals(texture.getSelected())) { + + for(int i = 0; i < materials.length; i++) { + Material material = MaterialRegistryManager.getInstance().getMaterial(materials[i]); + String yield = yields[i]; + String percent = percents[i]; + + if(material != null) { + tooltips.add(I18n.format("terminal.prospector.virtual_ores.info", + i+1, + material.getLocalizedName(), + yield, + percent)); + + hoveredNames.add(material.getLocalizedName()); + int amount = Integer.parseInt(yield); + if (amount > maxAmount[0]) { + maxAmount[0] = amount; + color = material.getMaterialRGB(); + } + } + } + } else if (materialsForSelect.contains(texture.getSelected())) { + + int[] indices = IntStream.range(0, materialsForSelect.size()) + .filter(i -> materialsForSelect.get(i).equals(texture.getSelected())) + .toArray(); + + for (int index : indices) { + Material material = MaterialRegistryManager.getInstance().getMaterial(materials[index]); + String yield = yields[index]; + String percent = percents[index]; + + if (material != null) { + tooltips.add(I18n.format("terminal.prospector.virtual_ores.info", + index + 1, + material.getLocalizedName(), + yield, + percent)); + + hoveredNames.add(material.getLocalizedName()); + int amount = Integer.parseInt(yield); + if (amount > maxAmount[0]) { + maxAmount[0] = amount; + color = material.getMaterialRGB(); + } + } + } + } + } + } + + if (Mods.JourneyMap.isModLoaded() || Mods.VoxelMap.isModLoaded() || Mods.XaerosMinimap.isModLoaded()) { + tooltips.add(I18n.format("terminal.prospector.waypoint.add")); + } + this.drawHoveringText(ItemStack.EMPTY, tooltips, 300, mouseX, mouseY); + GlStateManager.color(1.0F, 1.0F, 1.0F); + } + } + + @Override + public boolean mouseClicked(int mouseX, int mouseY, int button) { + int cX = (mouseX - this.getPosition().x) / 16; + int cZ = (mouseY - this.getPosition().y) / 16; + + if (cX >= chunkRadius * 2 - 1 || cZ >= chunkRadius * 2 - 1) + return false; + + int xDiff = cX - (chunkRadius - 1); + int zDiff = cZ - (chunkRadius - 1); + + int xPos = ((Minecraft.getMinecraft().player.chunkCoordX + xDiff) << 4) + 8; + int zPos = ((Minecraft.getMinecraft().player.chunkCoordZ + zDiff) << 4) + 8; + + BlockPos b = new BlockPos(xPos, Minecraft.getMinecraft().world.getHeight(xPos, zPos), zPos); + if (System.currentTimeMillis() - lastClicked < 400 && !hoveredNames.isEmpty()) { + boolean added = false; + trimHoveredNames(); + + + if (Mods.JourneyMap.isModLoaded()) { + added = addJourneymapWaypoint(b); + } else if (Mods.VoxelMap.isModLoaded()) { + added = addVoxelMapWaypoint(b); + } else if (Mods.XaerosMinimap.isModLoaded()) { + added = addXaeroMapWaypoint(b); + } + if (added) { + Minecraft.getMinecraft().player + .sendStatusMessage(new TextComponentTranslation("behavior.prospector.added_waypoint"), true); + } + + + } + this.lastClicked = System.currentTimeMillis(); + return super.mouseClicked(mouseX, mouseY, button); + } + + private void trimHoveredNames() { + List oreVeins = WorldGenRegistry.getOreDeposits(); + for (OreDepositDefinition odd : oreVeins) { + for (FillerEntry fillerEntry : odd.getBlockFiller().getAllPossibleStates()) { + Collection matches = new ArrayList<>(); + Collection pr = fillerEntry.getPossibleResults(); + for (IBlockState bs : pr) { + Set ores = OreDictUnifier.getOreDictionaryNames(new ItemStack(bs.getBlock())); + for (String dict : ores) { + String name = OreDictUnifier.get(dict).getDisplayName(); + if (hoveredNames.contains(name)) { + matches.add(name); + } + } + } + if (matches.size() > pr.size() / 2) { + this.hoveredNames.removeAll(matches); + this.hoveredNames.add(FileUtility.trimFileName(odd.getDepositName())); + } + } + } + } + + @NotNull + private String createVeinName() { + // remove the [] surrounding the array + String s = hoveredNames.toString(); + return s.substring(1, s.length() - 1); + } + + + + @net.minecraftforge.fml.common.Optional.Method(modid = Mods.Names.JOURNEY_MAP) + private boolean addJourneymapWaypoint(BlockPos b) { + journeymap.client.model.Waypoint journeyMapWaypoint = new journeymap.client.model.Waypoint(createVeinName(), + b, + new Color(color), + journeymap.client.model.Waypoint.Type.Normal, + Minecraft.getMinecraft().world.provider.getDimension()); + if (!journeymap.client.waypoint.WaypointStore.INSTANCE.getAll().contains(journeyMapWaypoint)) { + journeymap.client.waypoint.WaypointStore.INSTANCE.save(journeyMapWaypoint); + return true; + } + return false; + } + + @net.minecraftforge.fml.common.Optional.Method(modid = Mods.Names.VOXEL_MAP) + private boolean addVoxelMapWaypoint(@NotNull BlockPos b) { + Color c = new Color(color); + TreeSet world = new TreeSet<>(); + world.add(Minecraft.getMinecraft().world.provider.getDimension()); + + com.mamiyaotaru.voxelmap.interfaces.IWaypointManager waypointManager = com.mamiyaotaru.voxelmap.interfaces.AbstractVoxelMap + .getInstance().getWaypointManager(); + com.mamiyaotaru.voxelmap.util.Waypoint voxelMapWaypoint = new com.mamiyaotaru.voxelmap.util.Waypoint( + createVeinName(), + b.getX(), + b.getZ(), + Minecraft.getMinecraft().world.getHeight(b.getX(), b.getZ()), + true, + c.getRed() / 255F, + c.getGreen() / 255F, + c.getBlue() / 255F, + Minecraft.getMinecraft().world.provider.getDimensionType().getSuffix(), + Minecraft.getMinecraft().world.provider.getDimensionType().getName(), + world); + + if (!waypointManager.getWaypoints().contains(voxelMapWaypoint)) { + waypointManager.addWaypoint(voxelMapWaypoint); + waypointManager.saveWaypoints(); + return true; + } + return false; + } + + @Optional.Method(modid = Mods.Names.XAEROS_MINIMAP) + private boolean addXaeroMapWaypoint(@NotNull BlockPos b) { + int red = clampColor(color >> 16 & 0xFF); + int green = clampColor(color >> 8 & 0xFF); + int blue = clampColor(color & 0xFF); + + Color wpc = new Color(red, green, blue); + double[] labWPC = ColorUtility.getLab(wpc); + int bestColorIndex = 0; + double closestDistance = Double.MAX_VALUE; + + for (int i = 0; i < xaerosColors.length; i++) { + double[] c = xaerosColors[i]; + double diffLInner = Math.abs(c[0] - labWPC[0]); + double diffAInner = Math.abs(c[1] - labWPC[1]); + double diffBInner = Math.abs(c[2] - labWPC[2]); + double distance = diffLInner * diffLInner + diffAInner * diffAInner + diffBInner * diffBInner; + if (distance < closestDistance) { + closestDistance = distance; + bestColorIndex = i; + } + + } + + xaero.common.XaeroMinimapSession minimapSession = xaero.common.XaeroMinimapSession.getCurrentSession(); + xaero.common.minimap.waypoints.WaypointSet wps = minimapSession.getWaypointsManager().getWaypoints(); + xaero.common.minimap.waypoints.WaypointWorld ww = minimapSession.getWaypointsManager().getCurrentWorld(); + xaero.common.minimap.waypoints.Waypoint xaeroWaypoint = new xaero.common.minimap.waypoints.Waypoint( + b.getX(), + Minecraft.getMinecraft().world.getHeight(b.getX(), b.getZ()), + b.getZ(), + createVeinName(), hoveredNames.get(0).substring(0, 1), bestColorIndex); + + for (xaero.common.minimap.waypoints.Waypoint xwp : wps.getList()) { + if (xwp.getX() == xaeroWaypoint.getX() && + xwp.getY() == xaeroWaypoint.getY() && + xwp.getZ() == xaeroWaypoint.getZ()) { + return false; + } + } + wps.getList().add(xaeroWaypoint); + try { + minimapSession.getModMain().getSettings().saveWaypoints(ww); + } catch (IOException e) { + return false; + } + return true; + } + + private static int clampColor(int color) { + if (color < 32) { + return 0; + } else if (color < 128) { + return 128; + } else if (color < 192) { + return 192; + } else { + return 255; + } + } + + private final double[][] xaerosColors = { + ColorUtility.getLab(new Color(0, 0, 0)), + ColorUtility.getLab(new Color(0, 0, 128)), + ColorUtility.getLab(new Color(0, 128, 0)), + ColorUtility.getLab(new Color(0, 128, 128)), + ColorUtility.getLab(new Color(128, 0, 0)), + ColorUtility.getLab(new Color(128, 0, 128)), + ColorUtility.getLab(new Color(128, 128, 0)), + ColorUtility.getLab(new Color(192, 192, 192)), + ColorUtility.getLab(new Color(128, 128, 128)), + ColorUtility.getLab(new Color(0, 0, 255)), + ColorUtility.getLab(new Color(0, 255, 0)), + ColorUtility.getLab(new Color(0, 255, 255)), + ColorUtility.getLab(new Color(255, 0, 0)), + ColorUtility.getLab(new Color(255, 0, 255)), + ColorUtility.getLab(new Color(255, 255, 0)), + ColorUtility.getLab(new Color(255, 255, 255)), + }; + +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/GCYLRecipeMaps.java b/src/main/java/com/fulltrix/gcyl/recipes/GCYLRecipeMaps.java deleted file mode 100644 index 9d78d6d3..00000000 --- a/src/main/java/com/fulltrix/gcyl/recipes/GCYLRecipeMaps.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.fulltrix.gcyl.recipes; - -//import com.fulltrix.tjfcore.recipes.impl.NuclearReactorBuilder; - -import com.fulltrix.gcyl.recipes.impl.AdvFusionRecipeBuilder; -import com.fulltrix.gcyl.recipes.impl.DeepMinerBuilder; -import gregtech.api.GTValues; -import gregtech.api.gui.GuiTextures; -import gregtech.api.gui.widgets.ProgressWidget; -import gregtech.api.gui.widgets.ProgressWidget.MoveType; -import gregtech.api.recipes.RecipeMap; -import gregtech.api.recipes.builders.AssemblyLineRecipeBuilder; -import gregtech.api.recipes.builders.BlastRecipeBuilder; -import gregtech.api.recipes.builders.FuelRecipeBuilder; -import gregtech.api.recipes.builders.SimpleRecipeBuilder; -import gregtech.api.recipes.machines.RecipeMapAssemblyLine; -import gregtech.api.recipes.ui.impl.AssemblyLineUI; -import gregtech.api.util.AssemblyLineManager; -import gregtech.core.sound.GTSoundEvents; -import net.minecraft.init.SoundEvents; - -import static com.fulltrix.gcyl.GCYLUtility.gcylId; -import static gregtech.api.recipes.RecipeMaps.*; -import static gregtech.api.util.GTUtility.gregtechId; - -public final class GCYLRecipeMaps { - - private GCYLRecipeMaps() { - } - - public static final RecipeMap BIO_REACTOR_RECIPES = new RecipeMap<>("bio_reactor", - 3, 3, 5, 2, new SimpleRecipeBuilder(), false) - .setSound(GTSoundEvents.ELECTROLYZER); - - public static final RecipeMap CHEMICAL_DEHYDRATOR_RECIPES = new RecipeMap<>("chemical_dehydrator", 2, 9, 2, 2, new SimpleRecipeBuilder(), false) - .setProgressBar(GuiTextures.PROGRESS_BAR_SIFT, MoveType.VERTICAL_INVERTED) - .setSound(SoundEvents.BLOCK_SAND_PLACE); - - - //public static final RecipeMap GAS_CENTRIFUGE_RECIPES = new RecipeMap<>("gas_centrifuge", 1, 0, 1, 3, new SimpleRecipeBuilder(), false) - // .setSlotOverlay(false, false, GuiTextures.CIRCUIT_OVERLAY) - // .setProgressBar(GuiTextures.PROGRESS_BAR_BATH, ProgressWidget.MoveType.VERTICAL_INVERTED); //NUCLEAR_MARK - - //public static final RecipeMap NUCLEAR_REACTOR_RECIPES = new RecipeMap<>("nuclear_reactor", 4, 4, 0, 0, new NuclearReactorBuilder().EUt(1920),false); //NUCLEAR_MARK - - //public static final RecipeMap NUCLEAR_BREEDER_RECIPES = new RecipeMap<>("nuclear_breeder", 4, 4, 0, 0, new NuclearReactorBuilder().EUt(1920),false); //NUCLEAR_MARK - - public static final RecipeMap DECAY_CHAMBERS_RECIPES = new RecipeMap<>("decay_chamber", 2, 4, 1, 1, new SimpleRecipeBuilder(), false) - .setProgressBar(GuiTextures.PROGRESS_BAR_HAMMER, ProgressWidget.MoveType.VERTICAL) - .setSound(GTSoundEvents.ARC); //NUCLEAR_MARK - - public static final RecipeMap ADV_FUSION_RECIPES = new RecipeMap<>("adv_fusion", 0, 0, 3, 3, new AdvFusionRecipeBuilder(), false) - .setSound(GTSoundEvents.ARC); - - public static final RecipeMap STELLAR_FORGE_RECIPES = new RecipeMap<>("stellar_forge", - 3, 2, 3, 2, (new SimpleRecipeBuilder()), false) - .setProgressBar(GuiTextures.PROGRESS_BAR_BATH, ProgressWidget.MoveType.HORIZONTAL) - .setSound(GTSoundEvents.COMBUSTION); - - public static final RecipeMap PLASMA_CONDENSER_RECIPES = new RecipeMap<>("plasma_condenser", - 2, 2, 2, 2, (new SimpleRecipeBuilder()), false) - .setProgressBar(GuiTextures.PROGRESS_BAR_BATH, ProgressWidget.MoveType.HORIZONTAL) - .setSound(GTSoundEvents.COOLING); - - public static final RecipeMap CHEMICAL_PLANT_RECIPES = new RecipeMap<>("chemical_plant", - 6, 4, 5, 4, (new SimpleRecipeBuilder()), false) - .setProgressBar(GuiTextures.PROGRESS_BAR_BATH, ProgressWidget.MoveType.HORIZONTAL) - .setSound(GTSoundEvents.CHEMICAL_REACTOR); - - public static final RecipeMap ELECTRIC_IMPLOSION_RECIPES = new RecipeMap<>("electric_implosion", - 2, 2, 0, 0, new SimpleRecipeBuilder().duration(1).EUt(GTValues.VA[10]), false - ); // UEV-tier, 1tick processing time - - //TODO: implement recipe overlap with mixer map - public static final RecipeMap ADVANCED_MIXER_RECIPES = new RecipeMap<>("large_mixer", - 9, 1, 6, 1, new SimpleRecipeBuilder(), false) - .setProgressBar(GuiTextures.PROGRESS_BAR_MIXER, MoveType.CIRCULAR) - .setSound(GTSoundEvents.MIXER); - - //TODO: implement recipe overlap with centrifuge map - public static final RecipeMap ADVANCED_CENTRIFUGE_RECIPES = new RecipeMap<>("large_centrifuge", - 2, 6, 2, 6, new SimpleRecipeBuilder(), false) - .setSlotOverlay(false, false, false, GuiTextures.EXTRACTOR_OVERLAY) - .setSlotOverlay(false, false, true, GuiTextures.CANISTER_OVERLAY) - .setSlotOverlay(false, true, true, GuiTextures.CENTRIFUGE_OVERLAY) - .setProgressBar(GuiTextures.PROGRESS_BAR_EXTRACT, MoveType.HORIZONTAL) - .setSound(GTSoundEvents.CENTRIFUGE); - - //TODO: ? - /* - public static final RecipeMap ADVANCED_ENGRAVER_RECIPES = new RecipeMap<>("advanced_engraver", - 2, 2, 1, 1, new SimpleRecipeBuilder(), false) - .setSlotOverlay(false, false, true, GuiTextures.LENS_OVERLAY) - .setSound(GTSoundEvents.ELECTROLYZER); - - */ - - public static final RecipeMap HYPER_REACTOR_FUELS = new RecipeMap<>("hyper_reactor", - 0,0,1,0, new FuelRecipeBuilder(),false) - .allowEmptyOutput() - .setSound(GTSoundEvents.COOLING); - - public static final RecipeMap NAQUADAH_REACTOR_FUELS = new RecipeMap<>("naquadah_reactor", - 0,0,1,0, new FuelRecipeBuilder(),false) - .allowEmptyOutput() - .setSound(GTSoundEvents.COOLING); - - public static final RecipeMap ROCKET_FUEL_RECIPES = new RecipeMap<>("rocket_fuel", - 0,0,1,0, new FuelRecipeBuilder(),false) - .allowEmptyOutput() - .setSound(GTSoundEvents.COMBUSTION); - - - public static final RecipeMap DEEP_MINER_RECIPES = new RecipeMap<>("deep_miner", - 6,12,3,3,new DeepMinerBuilder(),false) - .setSound(GTSoundEvents.MINER); - - public static final RecipeMap GREENHOUSE_RECIPES = new RecipeMap<>("greenhouse", - 2,2,1,0,new SimpleRecipeBuilder(), false); - - - - - public static void modifyMaps() { - LASER_ENGRAVER_RECIPES.setMaxFluidInputs(1); - LASER_ENGRAVER_RECIPES.setMaxFluidOutputs(1); - - BLAST_RECIPES.setMaxInputs(4); - - EXTRACTOR_RECIPES.setMaxInputs(2); - - GAS_CENTRIFUGE_RECIPES.setMaxFluidOutputs(3); - } - -} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/MetalCasingRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/MetalCasingRecipes.java index 575b1fef..1fc110d5 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/MetalCasingRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/MetalCasingRecipes.java @@ -1,17 +1,18 @@ package com.fulltrix.gcyl.recipes; -import com.fulltrix.gcyl.item.metal.MetalCasing1; -import com.fulltrix.gcyl.item.metal.MetalCasing2; +import com.fulltrix.gcyl.blocks.metal.MetalCasing1; +import com.fulltrix.gcyl.blocks.metal.MetalCasing2; import gregtech.api.block.VariantBlock; import gregtech.api.recipes.ModHandler; import gregtech.api.unification.OreDictUnifier; import gregtech.api.unification.material.Material; +import gregtech.common.ConfigHolder; import net.minecraft.util.IStringSerializable; import java.util.Arrays; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.METAL_CASING_1; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.METAL_CASING_2; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_2; import static gregtech.api.recipes.RecipeMaps.ASSEMBLER_RECIPES; import static gregtech.api.unification.ore.OrePrefix.frameGt; import static gregtech.api.unification.ore.OrePrefix.plate; @@ -27,7 +28,7 @@ public static void init() { private static & IStringSerializable> void registerMetalCasingRecipe(Material inputMaterial, VariantBlock outputCasingType, T outputCasing) { - ModHandler.addShapedRecipe(String.format("metal_casing_%s", inputMaterial), outputCasingType.getItemVariant(outputCasing, 2), + ModHandler.addShapedRecipe(String.format("metal_casing_%s", inputMaterial), outputCasingType.getItemVariant(outputCasing, ConfigHolder.recipes.casingsPerCraft), "PhP", "PFP", "PwP", 'P', OreDictUnifier.get(plate, inputMaterial), 'F', OreDictUnifier.get(frameGt, inputMaterial)); @@ -36,7 +37,7 @@ private static & IStringSerializable> void registerMetalCasin .input(plate, inputMaterial, 6) .input(frameGt, inputMaterial) .circuitMeta(6) - .outputs(outputCasingType.getItemVariant(outputCasing, 2)) + .outputs(outputCasingType.getItemVariant(outputCasing, ConfigHolder.recipes.casingsPerCraft)) .buildAndRegister(); } } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/PlasmaCondenserPlasmaRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/PlasmaCondenserPlasmaRecipes.java index fdd414ec..fb9f6dc1 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/PlasmaCondenserPlasmaRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/PlasmaCondenserPlasmaRecipes.java @@ -6,7 +6,7 @@ import gregtech.api.unification.material.Materials; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.PLASMA_CONDENSER_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.PLASMA_CONDENSER_RECIPES; import static gregtech.api.unification.material.Materials.*; public class PlasmaCondenserPlasmaRecipes { diff --git a/src/main/java/com/fulltrix/gcyl/recipes/RecipeHandler.java b/src/main/java/com/fulltrix/gcyl/recipes/RecipeHandler.java index ea7ed0ed..afc7dfcb 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/RecipeHandler.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/RecipeHandler.java @@ -1,11 +1,16 @@ package com.fulltrix.gcyl.recipes; +import com.fulltrix.gcyl.GCYLConfig; import com.fulltrix.gcyl.recipes.categories.*; import com.fulltrix.gcyl.recipes.categories.circuits.CircuitRecipes; -import com.fulltrix.gcyl.recipes.categories.DeepMinerRecipes; -import com.fulltrix.gcyl.recipes.categories.GreenhouseRecipes; +import com.fulltrix.gcyl.recipes.categories.elevator.SpaceMiningRecipes; +import com.fulltrix.gcyl.recipes.categories.elevator.SpacePumpRecipes; import com.fulltrix.gcyl.recipes.categories.machines.MachineCraftingRecipes; +import com.fulltrix.gcyl.recipes.categories.machines.MultiblockPartCraftingRecipes; import com.fulltrix.gcyl.recipes.chain.*; +import com.fulltrix.gcyl.recipes.chain.updated.MiscChemistry; +import com.fulltrix.gcyl.recipes.chain.updated.NewPlatinumGroupMetals; +import com.fulltrix.gcyl.recipes.chain.updated.NewREEChain; public class RecipeHandler { public static void initRecipes() { @@ -16,10 +21,11 @@ public static void initRecipes() { /* StagedRemovalRecipes.init(); */ - MetaItemRecipes.init(); ComponentRecipes.init(); + ComponentALRecipes.init(); MachineCraftingRecipes.init(); + MultiblockPartCraftingRecipes.init(); CircuitRecipes.init(); PlasmaCondenserPlasmaRecipes.init(); MiscRecipes.init(); @@ -28,13 +34,36 @@ public static void initRecipes() { CasingRecipes.init(); DeepMinerRecipes.init(); GreenhouseRecipes.init(); + CosmicRayDetectorRecipes.init(); + FisherRecipes.init(); + SpacePumpRecipes.init(); + SpaceMiningRecipes.init(); } public static void initChains() { NuclearChain.init(); Batteries.init(); - PlatinumSludgeGroupChain.init(); + + if(GCYLConfig.recipes.useNewPlatinumChain) + NewPlatinumGroupMetals.init(); + else + PlatinumSludgeGroupChain.init(); + + + if(GCYLConfig.recipes.useNewREEChain) + NewREEChain.init(); + else + REEChain.init(); + + REEOxides.init(); + + if(GCYLConfig.recipes.useNewPlatinumChain || GCYLConfig.recipes.useNewREEChain) { + MiscChemistry.init(); + } + + Bromine.init(); + TungstenChain.init(); UHVMaterials.init(); PolymerChain.init(); @@ -51,7 +80,7 @@ public static void initChains() { TaraniumChain.init(); SensorEmitter.init(); RheniumChain.init(); - REEChain.init(); + OrganometallicChains.init(); VariousChains.init(); AluminiumChain.init(); diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/CasingRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/CasingRecipes.java index 4fef3ee6..c7c33b59 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/CasingRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/CasingRecipes.java @@ -1,21 +1,22 @@ package com.fulltrix.gcyl.recipes.categories; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; -import com.fulltrix.gcyl.item.GCYLMultiblockCasing2; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.GCYLMultiblockCasing2; import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; import gregtech.api.GTValues; -import gregtech.api.unification.material.MarkerMaterials; import gregtech.api.unification.stack.MaterialStack; +import gregtech.common.ConfigHolder; import gregtech.common.blocks.MetaBlocks; import gregtech.common.metatileentities.MetaTileEntities; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.item.GCYLHeatingCoil.CoilType.*; -import static com.fulltrix.gcyl.item.GCYLMultiblockCasing2.CasingType.*; -import static com.fulltrix.gcyl.item.GCYLReactorCasing.CasingType.*; +import static com.fulltrix.gcyl.blocks.GCYLHeatingCoil.CoilType.*; +import static com.fulltrix.gcyl.blocks.GCYLMultiblockCasing2.CasingType.*; +import static com.fulltrix.gcyl.blocks.GCYLReactorCasing.CasingType.*; import static com.fulltrix.gcyl.materials.GCYLNuclearMaterials.ReactorSteel; import static gregicality.multiblocks.api.unification.GCYMMaterials.*; +import static supercritical.api.unification.material.SCMaterials.Plutonium244; import static gregtech.api.GTValues.L; import static gregtech.api.recipes.GTRecipeHandler.removeRecipesByInputs; import static gregtech.api.recipes.ModHandler.removeRecipeByName; @@ -28,7 +29,6 @@ import static gregtech.common.blocks.BlockWireCoil.CoilType.*; import static gregtech.common.items.MetaItems.*; import static gregtech.common.items.MetaItems.EMITTER_UV; -import static gregtech.common.metatileentities.MetaTileEntities.HULL; public class CasingRecipes { @@ -530,7 +530,7 @@ private static void multiblockCasings() { .input(plateDense, Lead, 9) .input(plateDense, ReactorSteel, 4) .input(plateDense, StainlessSteel, 2) - .outputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(CLADDED_REACTOR_CASING, 4)) + .outputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(CLADDED_REACTOR_CASING, ConfigHolder.recipes.casingsPerCraft)) .buildAndRegister(); @@ -569,7 +569,7 @@ private static void multiblockCasings() { .input(plate, HDCS, 6) .input(stick, EnrichedNaquadahAlloy, 4) .input(screw, Trinium, 8) - .outputs(GCYLMetaBlocks.MULTIBLOCK_CASING2.getItemVariant(STELLAR_CONTAINMENT, 4)) + .outputs(GCYLMetaBlocks.MULTIBLOCK_CASING2.getItemVariant(STELLAR_CONTAINMENT, ConfigHolder.recipes.casingsPerCraft)) .buildAndRegister(); // Hyper Reactor Casing @@ -578,7 +578,7 @@ private static void multiblockCasings() { .input(frameGt, Naquadria) .input(screw, EnrichedNaquadahAlloy, 16) .input(plate, Incoloy813, 8) - .outputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CASING, 4)) + .outputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CASING, ConfigHolder.recipes.casingsPerCraft)) .buildAndRegister(); // Hyper Reactor Casing 2 @@ -587,7 +587,7 @@ private static void multiblockCasings() { .inputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CASING)) .input(screw, Pikyonium, 16) .input(plate, TitanSteel, 8) - .outputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CASING_2, 4)) + .outputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CASING_2, ConfigHolder.recipes.casingsPerCraft)) .buildAndRegister(); // Hyper Core @@ -599,7 +599,7 @@ private static void multiblockCasings() { .input(screw, Dubnium, 16) .input(plate, Naquadria, 4) .input(circuit, UV) - .outputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CORE, 4)) + .outputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CORE, ConfigHolder.recipes.casingsPerCraft)) .buildAndRegister(); // Hyper Core 2 @@ -607,11 +607,11 @@ private static void multiblockCasings() { .inputs(FIELD_GENERATOR_UHV.getStackForm(2)) .inputs(SENSOR_UHV.getStackForm()) .inputs(EMITTER_UHV.getStackForm()) - .inputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CASING, 2)) + .inputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CASING, ConfigHolder.recipes.casingsPerCraft)) .input(screw, Rutherfordium, 16) .input(plate, TungstenTitaniumCarbide, 4) .input(circuit, UHV) - .outputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CORE_2, 4)) + .outputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CORE_2, ConfigHolder.recipes.casingsPerCraft)) .buildAndRegister(); // Hyper Core 3 @@ -619,11 +619,11 @@ private static void multiblockCasings() { .inputs(FIELD_GENERATOR_UEV.getStackForm(2)) .inputs(SENSOR_UEV.getStackForm()) .inputs(EMITTER_UEV.getStackForm()) - .inputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CASING_2, 2)) + .inputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CASING_2, ConfigHolder.recipes.casingsPerCraft)) .input(screw, TriniumTitanium, 16) .input(plate, TitanSteel, 4) .input(circuit, UEV) - .outputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CORE_3, 4)) + .outputs(GCYLMetaBlocks.REACTOR_CASING.getItemVariant(HYPER_CORE_3, ConfigHolder.recipes.casingsPerCraft)) .buildAndRegister(); // Bio Reactor Casing @@ -632,7 +632,17 @@ private static void multiblockCasings() { .input(plate, NaquadahAlloy, 4) .input(screw, Dubnium, 4) .fluidInputs(SolderingAlloy.getFluid(L)) - .outputs(GCYLMetaBlocks.MULTIBLOCK_CASING2.getItemVariant(GCYLMultiblockCasing2.CasingType.BIO_REACTOR, 2)) + .outputs(GCYLMetaBlocks.MULTIBLOCK_CASING2.getItemVariant(GCYLMultiblockCasing2.CasingType.BIO_REACTOR, ConfigHolder.recipes.casingsPerCraft)) + .buildAndRegister(); + + //WIRELESS PSS CASING + ASSEMBLER_RECIPES.recipeBuilder().duration(150).EUt(GTValues.VA[GTValues.UV]) + .input(plate, Enderium, 6) + .input(frameGt, Seaborgium) + .inputs(FIELD_GENERATOR_UV.getStackForm()) + .circuitMeta(6) + .fluidInputs(Indalloy140.getFluid(L * 2)) + .outputs(GCYLMetaBlocks.MULTIBLOCK_CASING2.getItemVariant(GCYLMultiblockCasing2.CasingType.SEABORGIUM_SUBSTATION, ConfigHolder.recipes.casingsPerCraft)) .buildAndRegister(); } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/ComponentALRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/ComponentALRecipes.java new file mode 100644 index 00000000..601a1fe5 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/ComponentALRecipes.java @@ -0,0 +1,394 @@ +package com.fulltrix.gcyl.recipes.categories; + +import com.fulltrix.gcyl.api.recipes.builders.ComponentALRecipeBuilder; +import gregtech.api.GTValues; +import gregtech.api.recipes.RecipeBuilder; +import gregtech.api.unification.material.MarkerMaterials; + +import static com.fulltrix.gcyl.api.GCYLUtility.*; +import static com.fulltrix.gcyl.api.GCYLUtility.getMainComponentMaterialByTier; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.COMPONENT_AL_RECIPES; +import static com.fulltrix.gcyl.item.GCYLCoreItems.*; +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; +import static com.fulltrix.gcyl.materials.chains.MiscMaterials.Irirutan; +import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.ore.OrePrefix.*; +import static gregtech.common.items.MetaItems.*; +import static gregtech.api.GTValues.L; + +public class ComponentALRecipes { + public static void init() { + + luv(); + components(); + max(); + + } + + private static void luv() { + + COMPONENT_AL_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.LuV - 1]).duration(28800) + .CWUt(getCWUt(GTValues.LuV)) + .outputs(ELECTRIC_MOTOR_LuV.getStackForm(64)) + .CasingTier(GTValues.LuV) + .circuitMeta(1) + .input(stickLong, NeodymiumMagnetic, 48) + .input(cableGtHex, YttriumBariumCuprate, 6) + .fluidInputs(SolderingAlloy.getFluid(L * 48)) + .fluidInputs(Lubricant.getFluid(12000)) + .fluidInputs(Irirutan.getFluid(L * 1536)) + .fluidInputs(HSSS.getFluid(20352)) + .buildAndRegister(); + + COMPONENT_AL_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.LuV - 1]).duration(28800) + .CWUt(getCWUt(GTValues.LuV)) + .outputs(ELECTRIC_PISTON_LUV.getStackForm(64)) + .CasingTier(GTValues.LuV) + .circuitMeta(2) + .input(plateDense, HSSS, 21) + .inputs(ELECTRIC_MOTOR_LuV.getStackForm(48)) + .input(cableGtHex, YttriumBariumCuprate, 6) + .fluidInputs(SolderingAlloy.getFluid(L * 48)) + .fluidInputs(Lubricant.getFluid(12000)) + .fluidInputs(HSSS.getFluid(74544)) + .buildAndRegister(); + + COMPONENT_AL_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.LuV - 1]).duration(28800) + .CWUt(getCWUt(GTValues.LuV)) + .outputs(ELECTRIC_PUMP_LuV.getStackForm(64)) + .CasingTier(GTValues.LuV) + .circuitMeta(3) + .input(cableGtHex, YttriumBariumCuprate, 6) + .input(plateDense, HSSS, 10) + .inputs(ELECTRIC_MOTOR_LuV.getStackForm(48)) + .fluidInputs(SolderingAlloy.getFluid(L * 48)) + .fluidInputs(Lubricant.getFluid(12000)) + .fluidInputs(NiobiumTitanium.getFluid(L * 96)) + .fluidInputs(HSSS.getFluid(47616)) + .fluidInputs(SiliconeRubber.getFluid(L * 48)) + .buildAndRegister(); + + COMPONENT_AL_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.LuV - 1]).duration(28800) + .CWUt(getCWUt(GTValues.LuV)) + .outputs(ROBOT_ARM_LuV.getStackForm(64)) + .CasingTier(GTValues.LuV) + .circuitMeta(4) + .input(circuit, MarkerMaterials.Tier.LuV, 48) + .input(circuit, MarkerMaterials.Tier.IV, 96) + .input(circuit, MarkerMaterials.Tier.EV, 192) + .input(cableGtHex, YttriumBariumCuprate, 18) + .inputs(ELECTRIC_PISTON_LUV.getStackForm(48)) + .inputs(ELECTRIC_MOTOR_LuV.getStackForm(96)) + .fluidInputs(SolderingAlloy.getFluid(192 * L)) + .fluidInputs(Lubricant.getFluid(12000)) + .fluidInputs(HSSS.getFluid(528 * L)) + .buildAndRegister(); + + + COMPONENT_AL_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.LuV - 1]).duration(28800) + .CWUt(getCWUt(GTValues.LuV)) + .outputs(CONVEYOR_MODULE_LuV.getStackForm(64)) + .CasingTier(GTValues.LuV) + .circuitMeta(5) + .input(plateDense, HSSS, 10) + .input(cableGtHex, YttriumBariumCuprate, 6) + .inputs(ELECTRIC_MOTOR_LuV.getStackForm(96)) + .fluidInputs(SolderingAlloy.getFluid(L * 48)) + .fluidInputs(Lubricant.getFluid(12000)) + .fluidInputs(StyreneButadieneRubber.getFluid(L * 8 * 48)) + .fluidInputs(HSSS.getFluid(23136)) + .buildAndRegister(); + + COMPONENT_AL_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.LuV - 1]).duration(28800) + .CWUt(getCWUt(GTValues.LuV)) + .outputs(EMITTER_LuV.getStackForm(64)) + .CasingTier(GTValues.LuV) + .circuitMeta(6) + .input(cableGtHex, YttriumBariumCuprate, 24) + .inputs(ELECTRIC_MOTOR_LuV.getStackForm(48)) + .input(gemExquisite, Ruby, 96) + .input(frameGt, HSSS, 48) + .input(circuit, MarkerMaterials.Tier.LuV, 96) + .inputs(QUANTUM_STAR.getStackForm(48)) + .fluidInputs(SolderingAlloy.getFluid(L * 96)) + .fluidInputs(Ruridit.getFluid(L * 96)) + .fluidInputs(Palladium.getFluid(1536 * L)) + .fluidInputs(ZincSelenide.getFluid(768 * L)) + .buildAndRegister(); + + + COMPONENT_AL_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.LuV - 1]).duration(28800) + .CWUt(getCWUt(GTValues.LuV)) + .outputs(SENSOR_LuV.getStackForm(64)) + .CasingTier(GTValues.LuV) + .circuitMeta(7) + .input(cableGtHex, YttriumBariumCuprate, 24) + .inputs(ELECTRIC_MOTOR_LuV.getStackForm(48)) + .input(gemExquisite, Ruby, 96) + .input(plateDense, Ruridit, 21) + .input(frameGt, HSSS, 48) + .input(circuit, MarkerMaterials.Tier.LuV, 96) + .inputs(QUANTUM_STAR.getStackForm(48)) + .fluidInputs(SolderingAlloy.getFluid(L * 96)) + .fluidInputs(Palladium.getFluid(1536 * L)) + .fluidInputs(Germanium.getFluid(768 * L)) + .buildAndRegister(); + + COMPONENT_AL_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.LuV - 1]).duration(28800) + .CWUt(getCWUt(GTValues.LuV)) + .outputs(FIELD_GENERATOR_LuV.getStackForm(64)) + .CasingTier(GTValues.LuV) + .circuitMeta(8) + .inputs(QUANTUM_STAR.getStackForm(48)) + .input(frameGt, HSSS, 48) + .input(plateDense, HSSS, 32) + .input(cableGtHex, YttriumBariumCuprate, 48) + .inputs(EMITTER_LuV.getStackForm(96)) + .input(circuit, MarkerMaterials.Tier.LuV, 384) + .fluidInputs(SolderingAlloy.getFluid(L * 192)) + .fluidInputs(LuVSuperconductor.getFluid(768 * L)) + .buildAndRegister(); + } + + private static void components() { + for(int i = GTValues.LV; i < GTValues.LuV; i++) { + getComponentALLowRecipe(i, 1).buildAndRegister(); + getComponentALLowRecipe(i, 2).buildAndRegister(); + if(i < GTValues.IV) { + getComponentALLowRecipe(i, 3).fluidInputs(Rubber.getFluid(3456)).buildAndRegister(); + getComponentALLowRecipe(i, 5).input(plateDense, Rubber, 32).buildAndRegister(); + } + getComponentALLowRecipe(i, 3).fluidInputs(SiliconeRubber.getFluid(3456)).buildAndRegister(); + getComponentALLowRecipe(i, 3).fluidInputs(StyreneButadieneRubber.getFluid(3456)).buildAndRegister(); + getComponentALLowRecipe(i, 5).input(plateDense, SiliconeRubber, 32).buildAndRegister(); + getComponentALLowRecipe(i, 5).input(plateDense, StyreneButadieneRubber, 32).buildAndRegister(); + getComponentALLowRecipe(i,4).buildAndRegister(); + + if(i < GTValues.EV) { + getComponentALLowRecipe(i, 6).input(i == GTValues.MV ? gemFlawless : gem, getLowEmitterSensorStarMaterial(i), 48).buildAndRegister(); + getComponentALLowRecipe(i, 7).input(i == GTValues.MV ? gemFlawless : gem, getLowEmitterSensorStarMaterial(i), 48).buildAndRegister(); + } + else { + getComponentALLowRecipe(i, 6).input(getStarByTier(i), 48).buildAndRegister(); + getComponentALLowRecipe(i, 7).input(getStarByTier(i), 48).buildAndRegister(); + } + + switch (i) { + case(1) -> getComponentALLowRecipe(i, 8).input(gem, EnderPearl, 48).buildAndRegister(); + case(2) -> getComponentALLowRecipe(i, 8).input(gem, EnderEye, 48).buildAndRegister(); + case(3) -> getComponentALLowRecipe(i, 8).inputs(QUANTUM_EYE.getStackForm(48)).buildAndRegister(); + case(4) -> getComponentALLowRecipe(i, 8).input(gem, NetherStar, 48).buildAndRegister(); + case(5) -> getComponentALLowRecipe(i, 8).inputs(QUANTUM_STAR.getStackForm(48)).buildAndRegister(); + } + + + } + + for(int i = GTValues.ZPM ; i < GTValues.MAX; i++) { + getComponentALHighRecipe(i, 1).buildAndRegister(); + getComponentALHighRecipe(i, 2).buildAndRegister(); + getComponentALHighRecipe(i, 3).buildAndRegister(); + getComponentALHighRecipe(i, 4).buildAndRegister(); + getComponentALHighRecipe(i, 5).buildAndRegister(); + getComponentALHighRecipe(i, 6).buildAndRegister(); + getComponentALHighRecipe(i, 7).buildAndRegister(); + getComponentALHighRecipe(i, 8).buildAndRegister(); + } + } + + private static void max() { + + } + + private static RecipeBuilder getComponentALLowRecipe(int tier, int type) { + ComponentALRecipeBuilder builder = COMPONENT_AL_RECIPES.recipeBuilder().EUt(GTValues.VA[tier - 1]).duration(600) + .CasingTier(tier) + .CWUt(getCWUt(tier)) + .circuitMeta(type); + + return switch (type) { + case(2) -> builder + .outputs(getPistonByTier(tier).getStackForm(64)) + .input(gear, getMaterialByTier(tier), 12) + .input(stickLong, getMaterialByTier(tier), 48) + .inputs(getMotorByTier(tier).getStackForm(48)) + .input(cableGtHex, getCableByTier(tier),6) + .input(plateDense, getMaterialByTier(tier), 16); + + case(3) -> builder + .outputs(getPumpByTier(tier).getStackForm(64)) + .input(screw, getFluidPipeMaterialByTier(tier == 5 ? tier : tier - 1), 48) + .input(rotor, getFluidPipeMaterialByTier(tier == 5 ? tier : tier - 1), 48) + .input(pipeNormalFluid, getFluidPipeMaterialByTier(tier), 48) + .input(cableGtHex, getCableByTier(tier), 3) + .inputs(getMotorByTier(tier).getStackForm(48)); + + case(4) -> builder + .outputs(getRobotArmByTier(tier).getStackForm(64)) + .input(circuit, getMarkerMaterialByTier(tier), 48) + .input(stickLong, getMaterialByTier(tier), 48) + .input(cableGtHex, getCableByTier(tier), 9) + .inputs(getPistonByTier(tier).getStackForm(48)) + .inputs(getMotorByTier(tier).getStackForm(96)); + + case(5) -> builder + .outputs(getConveyorByTier(tier).getStackForm(64)) + .inputs(getMotorByTier(tier).getStackForm(96)) + .input(cableGtHex, getCableByTier(tier), 3); + + case(6) -> builder + .outputs(getEmitterByTier(tier).getStackForm(64)) + .input(circuit, getMarkerMaterialByTier(tier), 96) + .input(cableGtHex, getCableByTier(tier),6) + .fluidInputs(getLowEmitterSensorRodMaterial(tier).getFluid(13824)); + + case(7) -> builder + .outputs(getSensorByTier(tier).getStackForm(64)) + .input(plateDense, getMaterialByTier(tier), 21) + .input(stickLong, getLowEmitterSensorRodMaterial(tier), 24) + .input(circuit, getMarkerMaterialByTier(tier), 48); + + case(8) -> builder + .outputs(getFieldGeneratorByTier(tier).getStackForm(64)) + .input(circuit, getMarkerMaterialByTier(tier), 96) + .input(plateDense, getMaterialByTier(tier), tier > 3 ? 21 : 11) + .fluidInputs(getSuperconductorByTier(tier).getFluid(384 * L)); + + + + default -> builder + .outputs(getMotorByTier(tier).getStackForm(64)) + .input(stickLong, tier == 1 ? Iron : getMaterialByTier(tier), 48) + .input(cableGtHex, getCableByTier(tier), tier > 2 ? 12 : 6) + .input(wireGtHex, getFineWireByTier(tier), tier > 1 ? 24 * (tier == 5 ? 2 : 1) : 12) + .input(stickLong, getMagneticMaterialFluidByTier(tier), 24); + }; + } + + private static RecipeBuilder getComponentALHighRecipe(int tier, int type) { + ComponentALRecipeBuilder builder = COMPONENT_AL_RECIPES.recipeBuilder().EUt(GTValues.VA[tier - 1]).duration(28800) + .CasingTier(tier) + .CWUt(getCWUt(tier)) + .circuitMeta(type); + + if(type == 6) { + if(tier > 10) { + builder.inputs(getEmitterCrystalByTier(tier).getStackForm(192)); + } + if(tier == 13) { + builder.inputs(ULTRASHORT_PULSE_LASER.getStackForm(48)); + } + } + + if(type == 7 && tier > 8) { + builder.inputs(BOSE_EINSTEIN_COOLING_CONTAINER.getStackForm((int) Math.pow(2, tier - 9) * 48)); + } + + if(type == 8 && tier == 13) { + builder + .inputs(BATTERY_LARGE_FLUORIDE.getStackForm(48)) + .inputs(CONTAINED_REISSNER_NORDSTROM_SINGULARITY.getStackForm(48)) + .inputs(CRYOGENIC_INTERFACE.getStackForm(48)); + } + + return switch (type) { + case(2) -> builder + .outputs(getPistonByTier(tier).getStackForm(64)) + .input(plateDense, getMainComponentMaterialByTier(tier), 21) + .inputs(getMotorByTier(tier).getStackForm(48)) + .input(cableGtHex, getCableByTier(tier), 6) + .fluidInputs(getSolderingAlloyByTier(tier).getFluid((int) (48 * L * Math.pow(2, tier - 6)))) + .fluidInputs(Lubricant.getFluid((int) (48 * 250 * Math.pow(2, tier - 6)))) + .fluidInputs(tier < 8 ? null : getFluidMaterialByTier(tier).getFluid((int) (48 * L * 4 * Math.pow(2, tier - 9)))); + + case(3) -> builder + .outputs(getPumpByTier(tier).getStackForm(64)) + .input(cableGtHex, getCableByTier(tier), 6) + .input(plateDense, getMainComponentMaterialByTier(tier), 10) + .inputs(getMotorByTier(tier).getStackForm(48)) + .fluidInputs(getSolderingAlloyByTier(tier).getFluid((int) (48 * L * Math.pow(2, tier - 6)))) + .fluidInputs(Lubricant.getFluid((int) (48 * 250 * Math.pow(2, tier - 6)))) + .fluidInputs(getFluidPipeMaterialByTier(tier).getFluid(tier < 9 ? (int) (L * 288 * Math.pow(2, tier - 7)) : L * 4608)) + .fluidInputs(getMainComponentMaterialByTier(tier).getFluid(47616)) + .fluidInputs(tier < 8 ? null : getFluidMaterialByTier(tier).getFluid((int) (48 * L * 4 * Math.pow(2, tier - 9)))) + .fluidInputs(SiliconeRubber.getFluid(tier < 8 ? (int) (L * 48 * Math.pow(2, tier - 6)) : L * 48 * 4)); + + case(4) -> builder + .outputs(getRobotArmByTier(tier).getStackForm(64)) + .input(circuit, getMarkerMaterialByTier(tier), 48) + .input(circuit, getMarkerMaterialByTier(tier - 1), 96) + .input(circuit, getMarkerMaterialByTier(tier - 2), 192) + .input(cableGtHex, getCableByTier(tier), 18) + .inputs(getPistonByTier(tier).getStackForm(48)) + .inputs(getMotorByTier(tier).getStackForm(96)) + .fluidInputs(getSolderingAlloyByTier(tier).getFluid((int) (192 * L * Math.pow(2, tier - 6)))) + .fluidInputs(Lubricant.getFluid((int) (48 * 250 * Math.pow(2, tier - 6)))) + .fluidInputs(getMainComponentMaterialByTier(tier).getFluid(528 * L)) + .fluidInputs(tier < 8 ? null : getFluidMaterialByTier(tier).getFluid((int) (48 * L * 8 * Math.pow(2, tier - 9)))); + + case(5) -> builder + .outputs(getConveyorByTier(tier).getStackForm(64)) + .input(plateDense, getMainComponentMaterialByTier(tier), 10) + .input(cableGtHex, getCableByTier(tier), 6) + .inputs(getMotorByTier(tier).getStackForm(96)) + .fluidInputs(getSolderingAlloyByTier(tier).getFluid((int) (L * 48 * Math.pow(2, tier - 6)))) + .fluidInputs(Lubricant.getFluid((int) (48 * 250 * Math.pow(2, tier - 6)))) + .fluidInputs(tier < 9 ? StyreneButadieneRubber.getFluid((int) (L * 8 * 48 * Math.pow(2, tier - 6))) : getPolymerByTier(tier).getFluid((int) (L * 8 * 48 * Math.pow(2, tier - 6)))) + .fluidInputs(getMainComponentMaterialByTier(tier).getFluid(23136)) + .fluidInputs(tier < 8 ? null : getFluidMaterialByTier(tier).getFluid((int) (48 * L * 4 * Math.pow(2, tier - 9)))); + + case(6) -> builder + .outputs(getEmitterByTier(tier).getStackForm(64)) + .input(cableGtHex, getCableByTier(tier), 24) + .inputs(getMotorByTier(tier).getStackForm(48)) + .input(gemExquisite, getGemByTier(tier), 96) + .input(frameGt, getMainComponentMaterialByTier(tier), 48) + .input(circuit, getMarkerMaterialByTier(tier), 96) + .inputs(getStarByTier(tier).getStackForm(tier % 2 != 0 ? 96 * (tier > 9 ? 2 : 1) : 48 * (tier > 9 ? 2 : 1))) + .fluidInputs(getSolderingAlloyByTier(tier).getFluid((int) (L * 96 * Math.pow(2, tier - 6)))) + .fluidInputs(tier < 8 ? null : getFluidMaterialByTier(tier).getFluid((int) (48 * L * 8 * Math.pow(2, tier - 9)))) + .fluidInputs(tier == 7 ? Osmiridium.getFluid(L * 96) : getMainComponentMaterialByTier(tier).getFluid(L * 96)) + .fluidInputs(tier == 13 ? Bohrium.getFluid(1536 * L) : getSensorEmitterFoil(tier).getFluid(1536 * L)) + .fluidInputs(getEmitterDustByTier(tier) == null ? null : getEmitterDustByTier(tier).getFluid(768 * L)); + + case(7) -> builder + .outputs(getSensorByTier(tier).getStackForm(64)) + .input(cableGtHex, getCableByTier(tier), 24) + .inputs(getMotorByTier(tier).getStackForm(48)) + .input(gemExquisite, getGemByTier(tier), 96) + .input(plateDense, tier == 7 ? Osmiridium : getMainComponentMaterialByTier(tier), 21) + .input(frameGt, getMainComponentMaterialByTier(tier), 48) + .input(circuit, getMarkerMaterialByTier(tier), 96) + .inputs(getStarByTier(tier).getStackForm(tier % 2 != 0 ? 96 : 48)) + .fluidInputs(getSolderingAlloyByTier(tier).getFluid((int) (L * 96 * Math.pow(2, tier - 6)))) + .fluidInputs(tier < 8 ? null : getFluidMaterialByTier(tier).getFluid((int) (48 * L * 8 * Math.pow(2, tier - 9)))) + .fluidInputs(tier == 7 ? Osmiridium.getFluid(L * 96) : getMainComponentMaterialByTier(tier).getFluid(L * 96)) + .fluidInputs(tier == 13 ? MetastableOganesson.getFluid(768 * L) : getSensorEmitterFoil(tier).getFluid(1536 * L)) + .fluidInputs(tier == 13 ? FullerenePolymerMatrix.getFluid(768 * L) : null) + .fluidInputs(getSensorDustByTier(tier) == null ? null : getSensorDustByTier(tier).getFluid(768 * L)); + + + case(8) -> builder + .outputs(getFieldGeneratorByTier(tier).getStackForm(64)) + .inputs(getStarByTier(tier).getStackForm(tier % 2 != 0 ? 96 * (tier > 8 ? 2 : 1) : 48 * (tier >= 8 ? 2 : 1))) + .input(frameGt, getMainComponentMaterialByTier(tier), 48) + .input(plateDense, getMainComponentMaterialByTier(tier), 32) + .input(cableGtHex, getCableByTier(tier), 48) + .inputs(getEmitterByTier(tier).getStackForm(96)) + .input(circuit, getMarkerMaterialByTier(tier), 384) + .fluidInputs(getSolderingAlloyByTier(tier).getFluid(tier == 7 ? L * 192 * 2 : (int) (L * 192 * 3 * Math.pow(2, tier - 8)))) + .fluidInputs(getSuperconductorByTier(tier).getFluid(768 * L)) + .fluidInputs(tier < 8 ? null : getFluidMaterialByTier(tier).getFluid((int) (48 * L * 8 * Math.pow(2, tier - 9)))); + + default -> builder + .outputs(getMotorByTier(tier).getStackForm(64)) + .input(cableGtHex, getCableByTier(tier), 6) + .fluidInputs(getSolderingAlloyByTier(tier).getFluid((int) (48 * L * Math.pow(2, tier - 6)))) + .fluidInputs(Lubricant.getFluid((int) (48 * 250 * Math.pow(2, tier - 6)))) + .fluidInputs(getMagneticMaterialFluidByTier(tier).getFluid((int) (tier < 10 ? 48 * L * Math.pow(2, tier - 6) : 48 * L * 8 * Math.pow(2, tier - 10)))) + .fluidInputs(getMainComponentMaterialByTier(tier).getFluid(tier == 6 ? 20352 : 20352 * 2)) + .fluidInputs(getFineWireByTier(tier).getFluid(L * 1536)) + .fluidInputs(tier < 8 ? null : getFluidMaterialByTier(tier).getFluid((int) (48 * L * 4 * Math.pow(2, tier - 9)))); + }; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/ComponentRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/ComponentRecipes.java index 5bbe18ea..ddbc11e0 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/ComponentRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/ComponentRecipes.java @@ -3,12 +3,13 @@ import gregtech.api.GTValues; import gregtech.api.recipes.ModHandler; import gregtech.api.unification.material.MarkerMaterials; -import gregtech.api.unification.stack.MaterialStack; import gregtech.api.unification.stack.UnificationEntry; +import static com.fulltrix.gcyl.api.GCYLUtility.*; +import static com.fulltrix.gcyl.api.GCYLUtility.getMainComponentMaterialByTier; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static gregicality.multiblocks.api.unification.GCYMMaterials.Zeron100; +import static com.fulltrix.gcyl.materials.chains.MiscMaterials.Irirutan; import static gregtech.api.GTValues.*; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; @@ -17,12 +18,6 @@ import static gregtech.common.items.MetaItems.*; public class ComponentRecipes { - private static final MaterialStack[] cableFluids = { - new MaterialStack(Rubber, 144), - new MaterialStack(StyreneButadieneRubber, 108), - new MaterialStack(SiliconeRubber, 72) - - }; public static void init() { pumpInit(); @@ -33,13 +28,12 @@ public static void init() { fieldGenInit(); sensorInit(); emitterInit(); - opvComponents(); - maxComponents(); } //TODO: add research to recipes and change to be more in line with CEu //TODO: add higher tiers of soldering alloy //TODO: add higher tier data storage and require it +//TODO: nerf consumable macrowormhole generators private static void emitterInit() { @@ -67,8 +61,8 @@ private static void emitterInit() { .inputs(QUANTUM_STAR.getStackForm()) .input(dust,ZincSelenide,16) .input(foil, Palladium, 64) - .input(foil, Palladium, 32) - .input(wireGtDouble, YttriumBariumCuprate, 8) + .input(foil, Palladium, 64) + .input(cableGtDouble, YttriumBariumCuprate, 8) .fluidInputs(SolderingAlloy.getFluid(L*2)) .outputs(EMITTER_LuV.getStackForm()) .scannerResearch(b -> b @@ -99,8 +93,8 @@ private static void emitterInit() { .input(QUANTUM_STAR, 2) .input(circuit, MarkerMaterials.Tier.ZPM, 2) .input(foil, Platinum, 64) - .input(foil, Platinum, 32) - .input(wireGtDouble, Naquadah, 8) + .input(foil, Platinum, 64) + .input(cableGtDouble, Naquadah, 8) .fluidInputs(SolderingAlloy.getFluid(L * 4)) .output(EMITTER_ZPM) .stationResearch(b -> b @@ -131,8 +125,8 @@ private static void emitterInit() { .input(GRAVI_STAR) .input(circuit, MarkerMaterials.Tier.UV, 2) .input(foil, Osmiridium, 64) - .input(foil, Osmiridium, 32) - .input(wireGtDouble, Duranium, 8) + .input(foil, Osmiridium, 64) + .input(cableGtDouble, Duranium, 8) .fluidInputs(SolderingAlloy.getFluid(L * 8)) .fluidInputs(Naquadria.getFluid(L * 4)) .output(EMITTER_UV) @@ -144,7 +138,120 @@ private static void emitterInit() { + for(int i = 9; i < 15; i++) { + if (i == 14) { + getAssLineResearchBuilder(i, 600, getEmitterByTier(i - 1).getStackForm(), false, false, V[MAX]) + .outputs(getEmitterByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .inputs(getMotorByTier(i).getStackForm()) + .input(dust, RheniumHassiumThalliumIsophtaloylbisdiethylthioureaHexafluorophosphate, 64) + .input(stickLong, Mendelevium, 64) + .inputs(getStarByTier(i).getStackForm(8)) + .input(circuit, getMarkerMaterialByTier(i), 2) + .inputs(RECURSIVELY_FOLDED_NEGATIVE_SPACE.getStackForm(2)) + .inputs(MANIFOLD_OSCILLATORY_POWER_CELL.getStackForm()) + .inputs(STABILIZED_WORMHOLE_GENERATOR.getStackForm()) //TODO: microwormhole + .input(foil, Bohrium, 64) + .input(foil, Bohrium, 64) + .input(cableGtDouble, getCableByTier(i), 8) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .fluidInputs(HighEnergyQGP.getFluid(2000)) + .buildAndRegister(); + + } else if (i == 9) { + getAssLineResearchBuilder(i, 600, getEmitterByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(2, i - 9))) + .outputs(getEmitterByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .inputs(getMotorByTier(i).getStackForm()) + .input(dust,FranciumCaesiumCadmiumBromide,16) + .input(gemExquisite, Diamond, 2) + .input(stickLong, getMainComponentMaterialByTier(i), 4) + .inputs(getStarByTier(i).getStackForm(2)) + .input(circuit, getMarkerMaterialByTier(i), 2) + .input(foil, getSensorEmitterFoil(i), 64) + .input(foil, getSensorEmitterFoil(i), 64) + .input(cableGtDouble, getCableByTier(i), 8) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } else if (i == 10) { + getAssLineResearchBuilder(i, 600, getEmitterByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(4, i - 9))) + .outputs(getEmitterByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .inputs(getMotorByTier(i).getStackForm()) + .input(dust,RhodamineB,16) + .input(gemExquisite, Diamond, 2) + .input(stickLong, getMainComponentMaterialByTier(i), 4) + .inputs(getStarByTier(i).getStackForm(2)) + .input(circuit, getMarkerMaterialByTier(i), 2) + .input(foil, getSensorEmitterFoil(i), 64) + .input(foil, getSensorEmitterFoil(i), 64) + .input(cableGtDouble, getCableByTier(i), 8) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } else if (i == 11) { + getAssLineResearchBuilder(i, 600, getEmitterByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(4, i - 9))) + .outputs(getEmitterByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .inputs(getMotorByTier(i).getStackForm()) + .inputs(LEPTON_TRAP_CRYSTAL.getStackForm(4)) + .input(gemExquisite, Diamond, 2) + .input(stickLong, getMainComponentMaterialByTier(i), 4) + .inputs(getStarByTier(i).getStackForm(4)) + .input(circuit, getMarkerMaterialByTier(i), 2) + .input(foil, TriniumTitanium, 64) + .input(foil, TriniumTitanium, 64) + .input(cableGtDouble, getCableByTier(i), 8) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } else if (i == 12) { + getAssLineResearchBuilder(i, 600, getEmitterByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(4, i - 9))) + .outputs(getEmitterByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .inputs(getMotorByTier(i).getStackForm()) + .inputs(CHARGED_LEPTON_TRAP_CRYSTAL.getStackForm(4)) + .input(gemExquisite, Diamond, 2) + .input(stickLong, getMainComponentMaterialByTier(i), 4) + .inputs(getStarByTier(i).getStackForm(2)) + .input(circuit, getMarkerMaterialByTier(i), 2) + .input(foil, ProtoAdamantium, 64) + .input(foil, ProtoAdamantium, 64) + .input(cableGtDouble, getCableByTier(i), 8) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } else { + getAssLineResearchBuilder(i, 600, getEmitterByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(4, i - 9))) + .outputs(getEmitterByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .inputs(getMotorByTier(i).getStackForm()) + .input(dust, ChargedCaesiumCeriumCobaltIndium, 64) + .inputs(SCINTILLATOR_CRYSTAL.getStackForm(4)) + .inputs(ULTRASHORT_PULSE_LASER.getStackForm()) + .input(gemExquisite, Jasper, 2) + .input(stickLong, getMainComponentMaterialByTier(i), 4) + .inputs(getStarByTier(i).getStackForm(4)) + .input(circuit, getMarkerMaterialByTier(i), 2) + .input(foil, Bohrium, 64) + .input(foil, Bohrium, 64) + .input(cableGtDouble, getCableByTier(i), 8) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .fluidInputs(QuarkGluonPlasma.getFluid(2000)) + .buildAndRegister(); + } + } + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(983040) .input(frameGt, HDCS, 1) .input(dust,FranciumCaesiumCadmiumBromide,16) @@ -189,6 +296,8 @@ private static void emitterInit() { .fluidInputs(SolderingAlloy.getFluid(L * 8)) .outputs(EMITTER_UXV.getStackForm()) .buildAndRegister(); + + */ } private static void sensorInit() { @@ -214,8 +323,8 @@ private static void sensorInit() { .input(QUANTUM_STAR) .input(circuit, MarkerMaterials.Tier.LuV, 2) .input(foil, Palladium, 64) - .input(foil, Palladium, 32) - .input(wireGtDouble, YttriumBariumCuprate, 8) + .input(foil, Palladium, 64) + .input(cableGtDouble, YttriumBariumCuprate, 8) .fluidInputs(SolderingAlloy.getFluid(L * 2)) .output(SENSOR_LuV) .scannerResearch(b -> b @@ -246,8 +355,8 @@ private static void sensorInit() { .input(QUANTUM_STAR, 2) .input(circuit, MarkerMaterials.Tier.ZPM, 2) .input(foil, Platinum, 64) - .input(foil, Platinum, 32) - .input(wireGtDouble, Naquadah, 8) + .input(foil, Platinum, 64) + .input(cableGtDouble, Naquadah, 8) .fluidInputs(SolderingAlloy.getFluid(L * 4)) .output(SENSOR_ZPM) .stationResearch(b -> b @@ -277,8 +386,8 @@ private static void sensorInit() { .input(GRAVI_STAR) .input(circuit, MarkerMaterials.Tier.UV, 2) .input(foil, Osmiridium, 64) - .input(foil, Osmiridium, 32) - .input(wireGtDouble, Duranium, 8) + .input(foil, Osmiridium, 64) + .input(cableGtDouble, Duranium, 8) .fluidInputs(SolderingAlloy.getFluid(L * 8)) .fluidInputs(Naquadria.getFluid(L * 4)) .output(SENSOR_UV) @@ -289,8 +398,125 @@ private static void sensorInit() { .duration(600).EUt(100000).buildAndRegister(); + for(int i = 9; i < 15; i++) { + if (i == 14) { + getAssLineResearchBuilder(i, 600, getSensorByTier(i - 1).getStackForm(), false, false, V[MAX]) + .outputs(getSensorByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .inputs(getMotorByTier(i).getStackForm()) + .inputs(STABILIZED_WORMHOLE_GENERATOR.getStackForm()) //TODO: microwormhole generator + .input(plate, getMainComponentMaterialByTier(i), 4) + .inputs(getStarByTier(i).getStackForm(4)) + .input(circuit,getMarkerMaterialByTier(i), 2) + .input(foil, getMainComponentMaterialByTier(i), 64) + .input(foil, FullerenePolymerMatrix, 64) + .inputs(COSMIC_FABRIC.getStackForm(64)) + .inputs(BOSE_EINSTEIN_COOLING_CONTAINER.getStackForm(32)) + .input(cableGtDouble, getCableByTier(i), 8) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .fluidInputs(HighEnergyQGP.getFluid(2000)) + .buildAndRegister(); + } + else if (i == 9){ + getAssLineResearchBuilder(i, 600, getSensorByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(4, i - 9))) + .outputs(getSensorByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .inputs(getMotorByTier(i).getStackForm()) + .input(dust,BariumStrontiumTitanate,16) + .input(gemExquisite, Diamond, 2) + .input(plate, getMainComponentMaterialByTier(i), 4) + .inputs(getStarByTier(i).getStackForm(2)) + .input(circuit,getMarkerMaterialByTier(i), 2) + .input(foil, getSensorEmitterFoil(i), 64) + .input(foil, getSensorEmitterFoil(i), 64) + .inputs(BOSE_EINSTEIN_COOLING_CONTAINER.getStackForm()) + .input(cableGtDouble, getCableByTier(i), 8) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } + else if (i == 10) { + getAssLineResearchBuilder(i, 600, getSensorByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(4, i - 9))) + .outputs(getSensorByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .inputs(getMotorByTier(i).getStackForm()) + .input(dust,MagnetorestrictiveAlloy,16) + .input(gemExquisite, Diamond, 2) + .input(plate, getMainComponentMaterialByTier(i), 4) + .inputs(getStarByTier(i).getStackForm(1)) + .input(circuit,getMarkerMaterialByTier(i), 2) + .input(foil, getSensorEmitterFoil(i), 64) + .input(foil, getSensorEmitterFoil(i), 64) + .inputs(BOSE_EINSTEIN_COOLING_CONTAINER.getStackForm(2)) + .input(cableGtDouble, getCableByTier(i), 8) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } + else if (i == 11) { + getAssLineResearchBuilder(i, 600, getSensorByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(4, i - 9))) + .outputs(getSensorByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .inputs(getMotorByTier(i).getStackForm()) + .input(gemExquisite, Diamond, 2) + .input(plate, getMainComponentMaterialByTier(i), 4) + .inputs(getStarByTier(i).getStackForm(2)) + .input(circuit,getMarkerMaterialByTier(i), 2) + .input(foil, TriniumTitanium, 64) + .input(foil, TriniumTitanium, 64) + .inputs(BOSE_EINSTEIN_COOLING_CONTAINER.getStackForm(4)) + .input(cableGtDouble, getCableByTier(i), 8) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .fluidInputs(LiquidCrystalDetector.getFluid(2500)) + .buildAndRegister(); + } + else if (i == 12) { + getAssLineResearchBuilder(i, 600, getSensorByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(4, i - 9))) + .outputs(getSensorByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .inputs(getMotorByTier(i).getStackForm()) + .input(gemExquisite, Diamond, 2) + .input(plate, getMainComponentMaterialByTier(i), 4) + .inputs(getStarByTier(i).getStackForm(1)) + .input(circuit,getMarkerMaterialByTier(i), 2) + .input(foil, ProtoAdamantium, 64) + .input(foil, ProtoAdamantium, 64) + .inputs(BOSE_EINSTEIN_COOLING_CONTAINER.getStackForm(8)) + .input(cableGtDouble, getCableByTier(i), 8) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .fluidInputs(FreeElectronGas.getFluid(2500)) + .buildAndRegister(); + } + else { + getAssLineResearchBuilder(i, 600, getSensorByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(4, i - 9))) + .outputs(getSensorByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .inputs(getMotorByTier(i).getStackForm()) + .input(gemExquisite, Jasper, 2) + .input(plate, getMainComponentMaterialByTier(i), 4) + .inputs(getStarByTier(i).getStackForm(2)) + .input(circuit,getMarkerMaterialByTier(i), 2) + .input(foil, MetastableOganesson, 64) + .input(foil, FullerenePolymerMatrix, 64) + .inputs(BOSE_EINSTEIN_COOLING_CONTAINER.getStackForm(16)) + .input(cableGtDouble, getCableByTier(i), 8) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .fluidInputs(QuarkGluonPlasma.getFluid(2000)) + .buildAndRegister(); + } + } - + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(983040) .input(frameGt, HDCS) @@ -340,33 +566,35 @@ private static void sensorInit() { .fluidInputs(FreeElectronGas.getFluid(2500)) .outputs(SENSOR_UXV.getStackForm()) .buildAndRegister(); + + */ } private static void fieldGenInit() { ModHandler.addShapedRecipe(true, "field_generator_lv", FIELD_GENERATOR_LV.getStackForm(), "WPW", "XGX", "WPW", 'W', new UnificationEntry(wireGtQuadruple, LVSuperconductor), 'P', new UnificationEntry(plate, Steel), - 'G', new UnificationEntry(gem, EnderPearl), 'X', new UnificationEntry(circuit, MarkerMaterials.Tier.MV)); + 'G', new UnificationEntry(gem, EnderPearl), 'X', new UnificationEntry(circuit, MarkerMaterials.Tier.LV)); ModHandler.addShapedRecipe(true, "field_generator_mv", FIELD_GENERATOR_MV.getStackForm(), "WPW", "XGX", "WPW", 'W', new UnificationEntry(wireGtQuadruple, MVSuperconductor), 'P', new UnificationEntry(plate, Aluminium), 'G', new UnificationEntry(gem, EnderEye), 'X', - new UnificationEntry(circuit, MarkerMaterials.Tier.HV)); + new UnificationEntry(circuit, MarkerMaterials.Tier.MV)); ModHandler.addShapedRecipe(true, "field_generator_hv", FIELD_GENERATOR_HV.getStackForm(), "WPW", "XGX", "WPW", 'W', new UnificationEntry(wireGtQuadruple, HVSuperconductor), 'P', new UnificationEntry(plate, StainlessSteel), 'G', QUANTUM_EYE.getStackForm(), 'X', - new UnificationEntry(circuit, MarkerMaterials.Tier.EV)); + new UnificationEntry(circuit, MarkerMaterials.Tier.HV)); ModHandler.addShapedRecipe(true, "field_generator_ev", FIELD_GENERATOR_EV.getStackForm(), "WPW", "XGX", "WPW", 'W', new UnificationEntry(wireGtQuadruple, EVSuperconductor), 'P', new UnificationEntry(plateDouble, Titanium), 'G', new UnificationEntry(gem, NetherStar), 'X', - new UnificationEntry(circuit, MarkerMaterials.Tier.IV)); + new UnificationEntry(circuit, MarkerMaterials.Tier.EV)); ModHandler.addShapedRecipe(true, "field_generator_iv", FIELD_GENERATOR_IV.getStackForm(), "WPW", "XGX", "WPW", 'W', new UnificationEntry(wireGtQuadruple, IVSuperconductor), 'P', new UnificationEntry(plateDouble, TungstenSteel), 'G', QUANTUM_STAR.getStackForm(), 'X', - new UnificationEntry(circuit, MarkerMaterials.Tier.LuV)); + new UnificationEntry(circuit, MarkerMaterials.Tier.IV)); ASSEMBLER_RECIPES.recipeBuilder() .input(gem, EnderPearl) .input(plate, Steel, 2) - .input(circuit, MarkerMaterials.Tier.MV, 2) + .input(circuit, MarkerMaterials.Tier.LV, 2) .input(wireGtQuadruple, LVSuperconductor, 4) .outputs(FIELD_GENERATOR_LV.getStackForm()) .duration(100).EUt(VA[GTValues.LV]).buildAndRegister(); @@ -374,7 +602,7 @@ private static void fieldGenInit() { ASSEMBLER_RECIPES.recipeBuilder() .input(gem, EnderEye) .input(plate, Aluminium, 2) - .input(circuit, MarkerMaterials.Tier.HV, 2) + .input(circuit, MarkerMaterials.Tier.MV, 2) .input(wireGtQuadruple, MVSuperconductor, 4) .outputs(FIELD_GENERATOR_MV.getStackForm()) .duration(100).EUt(VA[GTValues.LV]).buildAndRegister(); @@ -382,7 +610,7 @@ private static void fieldGenInit() { ASSEMBLER_RECIPES.recipeBuilder() .input(QUANTUM_EYE) .input(plate, StainlessSteel, 2) - .input(circuit, MarkerMaterials.Tier.EV, 2) + .input(circuit, MarkerMaterials.Tier.HV, 2) .input(wireGtQuadruple, HVSuperconductor, 4) .outputs(FIELD_GENERATOR_HV.getStackForm()) .duration(100).EUt(VA[GTValues.LV]).buildAndRegister(); @@ -390,7 +618,7 @@ private static void fieldGenInit() { ASSEMBLER_RECIPES.recipeBuilder() .input(gem, NetherStar) .input(plateDouble, Titanium, 2) - .input(circuit, MarkerMaterials.Tier.IV, 2) + .input(circuit, MarkerMaterials.Tier.EV, 2) .input(wireGtQuadruple, EVSuperconductor, 4) .outputs(FIELD_GENERATOR_EV.getStackForm()) .duration(100).EUt(VA[GTValues.LV]).buildAndRegister(); @@ -398,7 +626,7 @@ private static void fieldGenInit() { ASSEMBLER_RECIPES.recipeBuilder() .input(QUANTUM_STAR) .input(plateDouble, TungstenSteel, 2) - .input(circuit, MarkerMaterials.Tier.LuV, 2) + .input(circuit, MarkerMaterials.Tier.IV, 2) .input(wireGtQuadruple, IVSuperconductor, 4) .outputs(FIELD_GENERATOR_IV.getStackForm()) .duration(100).EUt(VA[GTValues.LV]).buildAndRegister(); @@ -421,10 +649,10 @@ private static void fieldGenInit() { .input(plate, HSSS, 6) .input(QUANTUM_STAR) .input(EMITTER_LuV, 2) - .input(circuit, MarkerMaterials.Tier.ZPM, 2) + .input(circuit, MarkerMaterials.Tier.LuV, 8) .input(wireFine, LuVSuperconductor, 64) .input(wireFine, LuVSuperconductor, 64) - .input(cableGtOctal, YttriumBariumCuprate, 4) + .input(cableGtQuadruple, YttriumBariumCuprate, 4) .fluidInputs(SolderingAlloy.getFluid(L * 4)) .output(FIELD_GENERATOR_LuV) .scannerResearch(b -> b @@ -445,14 +673,14 @@ private static void fieldGenInit() { .buildAndRegister(); */ ASSEMBLY_LINE_RECIPES.recipeBuilder() - .input(frameGt, NaquadahAlloy) - .input(plate, NaquadahAlloy, 6) - .input(QUANTUM_STAR) + .input(frameGt, HSSE) + .input(plate, HSSE, 6) + .inputs(QUANTUM_STAR.getStackForm(2)) .input(EMITTER_ZPM, 2) - .input(circuit, MarkerMaterials.Tier.UV, 2) + .input(circuit, MarkerMaterials.Tier.ZPM, 8) .input(wireFine, ZPMSuperconductor, 64) .input(wireFine, ZPMSuperconductor, 64) - .input(cableGtOctal, Naquadah, 4) + .input(cableGtQuadruple, Naquadah, 4) .fluidInputs(SolderingAlloy.getFluid(L * 8)) .output(FIELD_GENERATOR_ZPM) .stationResearch(b -> b @@ -476,12 +704,12 @@ private static void fieldGenInit() { ASSEMBLY_LINE_RECIPES.recipeBuilder() .input(frameGt, Tritanium) .input(plate, Tritanium, 6) - .input(GRAVI_STAR) + .input(GRAVI_STAR, 2) .input(EMITTER_UV, 2) - .input(circuit, MarkerMaterials.Tier.UHV, 2) + .input(circuit, MarkerMaterials.Tier.UV, 8) .input(wireFine, UVSuperconductor, 64) .input(wireFine, UVSuperconductor, 64) - .input(cableGtOctal, Duranium, 4) + .input(cableGtQuadruple, Duranium, 4) .fluidInputs(SolderingAlloy.getFluid(L * 12)) .fluidInputs(Naquadria.getFluid(L * 4)) .output(FIELD_GENERATOR_UV) @@ -492,6 +720,66 @@ private static void fieldGenInit() { .duration(600).EUt(491520).buildAndRegister(); + for(int i = 9; i < 15; i++) { + if (i == 14) { + //TODO change to use chaos later + getAssLineResearchBuilder(i, 600, getFieldGeneratorByTier(i - 1).getStackForm(), false, false, V[MAX]) + .outputs(getFieldGeneratorByTier(i).getStackForm()) + .input(frameGt, CosmicNeutronium) + .inputs(COSMIC_MESH.getStackForm(6)) + .inputs(QCD_PROTECTIVE_PLATING.getStackForm(6)) + .inputs(getStarByTier(i).getStackForm(8)) + .inputs(getEmitterByTier(i).getStackForm(2)) + .input(circuit, getMarkerMaterialByTier(i), 8) + .input(wireFine, getSuperconductorByTier(i), 64) + .input(wireFine, getSuperconductorByTier(i), 64) + .input(cableGtQuadruple, getCableByTier(i), 4) + .inputs(CONTAINED_EXOTIC_MATTER.getStackForm()) + .inputs(STABILIZED_WORMHOLE_GENERATOR.getStackForm()) + .fluidInputs(Indalloy140.getFluid((int) (L * 12 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .fluidInputs(HighEnergyQGP.getFluid(2000)) + .buildAndRegister(); + } else if(i == 13) { + getAssLineResearchBuilder(i, 600, getFieldGeneratorByTier(i - 1).getStackForm(), false, false, (int) VA[i]) + .outputs(getFieldGeneratorByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .input(plate, getMainComponentMaterialByTier(i), 6) + .inputs(getStarByTier(i).getStackForm(i % 2 == 0 ? 2 : 4)) + .inputs(getEmitterByTier(i).getStackForm(2)) + .input(circuit, getMarkerMaterialByTier(i), 8) + .input(wireFine, getSuperconductorByTier(i), 64) + .input(wireFine, getSuperconductorByTier(i), 64) + .input(cableGtQuadruple, getCableByTier(i), 4) + .inputs(BATTERY_LARGE_FLUORIDE.getStackForm()) + .inputs(CONTAINED_REISSNER_NORDSTROM_SINGULARITY.getStackForm()) + .inputs(CRYOGENIC_INTERFACE.getStackForm()) + .fluidInputs(Indalloy140.getFluid((int) (L * 12 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .fluidInputs(QuarkGluonPlasma.getFluid(2000)) + .buildAndRegister(); + + } else { + getAssLineResearchBuilder(i, 600, getFieldGeneratorByTier(i - 1).getStackForm(), false, false, (int) VA[i]) + .outputs(getFieldGeneratorByTier(i).getStackForm()) + .input(frameGt, getMainComponentMaterialByTier(i)) + .input(plate, getMainComponentMaterialByTier(i), 6) + .inputs(getStarByTier(i).getStackForm(i % 2 == 0 ? 2 : 4)) + .inputs(getEmitterByTier(i).getStackForm(2)) + .input(circuit, getMarkerMaterialByTier(i), 8) + .input(wireFine, getSuperconductorByTier(i), 64) + .input(wireFine, getSuperconductorByTier(i), 64) + .input(cableGtQuadruple, getCableByTier(i), 4) + .fluidInputs(Indalloy140.getFluid((int) (L * 12 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } + } + +/* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(1966080) .input(frameGt, Seaborgium) @@ -527,7 +815,7 @@ private static void fieldGenInit() { ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(15728640) .input(frameGt, Adamantium) - .inputs(UNSTABLE_STAR.getStackForm()) + .inputs(NUCLEAR_STAR.getStackForm()) .input(wireFine, Adamantium, 64) .input(wireGtQuadruple, UXVSuperconductor, 8) .input(cableGtSingle, NaquadriaticTaranium, 4) @@ -535,6 +823,8 @@ private static void fieldGenInit() { .fluidInputs(SolderingAlloy.getFluid(L * 6)) .outputs(FIELD_GENERATOR_UXV.getStackForm()) .buildAndRegister(); + + */ } private static void robotArmInit() { @@ -564,7 +854,7 @@ private static void robotArmInit() { .input(circuit, MarkerMaterials.Tier.LuV) .input(circuit, MarkerMaterials.Tier.IV, 2) .input(circuit, MarkerMaterials.Tier.EV, 4) - .input(cableGtDouble, YttriumBariumCuprate, 16) + .input(cableGtDouble, YttriumBariumCuprate, 6) .fluidInputs(SolderingAlloy.getFluid(L * 4)) .fluidInputs(Lubricant.getFluid(250)) .output(ROBOT_ARM_LuV) @@ -597,7 +887,7 @@ private static void robotArmInit() { .input(circuit, MarkerMaterials.Tier.ZPM) .input(circuit, MarkerMaterials.Tier.LuV, 2) .input(circuit, MarkerMaterials.Tier.IV, 4) - .input(cableGtDouble, Naquadah, 16) + .input(cableGtDouble, Naquadah, 6) .fluidInputs(SolderingAlloy.getFluid(L * 8)) .fluidInputs(Lubricant.getFluid(500)) .output(ROBOT_ARM_ZPM) @@ -632,7 +922,7 @@ private static void robotArmInit() { .input(circuit, MarkerMaterials.Tier.UV) .input(circuit, MarkerMaterials.Tier.ZPM, 2) .input(circuit, MarkerMaterials.Tier.LuV, 4) - .input(cableGtDouble, Duranium, 16) + .input(cableGtSingle, Duranium, 6) .fluidInputs(SolderingAlloy.getFluid(L * 12)) .fluidInputs(Lubricant.getFluid(1000)) .fluidInputs(Naquadria.getFluid(L * 4)) @@ -644,8 +934,47 @@ private static void robotArmInit() { .duration(600).EUt(327680).buildAndRegister(); + for(int i = 9; i < 15; i++) { + if (i == 14) { + getAssLineResearchBuilder(i, 600, getRobotArmByTier(i - 1).getStackForm(), false, false, V[MAX]) + .outputs(getRobotArmByTier(i).getStackForm()) + .input(stickLong, getMainComponentMaterialByTier(i), 4) + .input(gear, getMainComponentMaterialByTier(i+1)) + .input(gearSmall, getMainComponentMaterialByTier(i+1), 3) + .input(getMotorByTier(i), 2) + .input(getPistonByTier(i)) + .input(circuit, getMarkerMaterialByTier(i)) + .input(circuit, getMarkerMaterialByTier(i-1), 2) + .input(circuit, getMarkerMaterialByTier(i-2), 4) + .input(cableGtSingle, getCableByTier(i), 6) + .fluidInputs(Indalloy140.getFluid((int) (L * 12 * Math.pow(2, i - 8)))) + .fluidInputs(Lubricant.getFluid((int) (1000 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } else { + getAssLineResearchBuilder(i, 600, getRobotArmByTier(i - 1).getStackForm(), false, false, (int) (1310720 * Math.pow(4, i - 9))) + .outputs(getRobotArmByTier(i).getStackForm()) + .input(stickLong, getMainComponentMaterialByTier(i), 4) + .input(gear, getMainComponentMaterialByTier(i)) + .input(gearSmall, getMainComponentMaterialByTier(i), 3) + .input(getMotorByTier(i), 2) + .input(getPistonByTier(i)) + .input(circuit, getMarkerMaterialByTier(i)) + .input(circuit, getMarkerMaterialByTier(i-1), 2) + .input(circuit, getMarkerMaterialByTier(i-2), 4) + .input(cableGtSingle, getCableByTier(i), 6) + .fluidInputs(Indalloy140.getFluid((int) (L * 12 * Math.pow(2, i - 8)))) + .fluidInputs(Lubricant.getFluid((int) (1000 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 4 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } + } + /* + ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(1310720) .input(cableGtDouble, TungstenTitaniumCarbide, 16) .input(screw, HDCS, 16) @@ -697,6 +1026,8 @@ private static void robotArmInit() { .fluidInputs(Lubricant.getFluid(2000)) .outputs(ROBOT_ARM_UXV.getStackForm()) .buildAndRegister(); + + */ } private static void conveyorInit() { @@ -791,9 +1122,44 @@ private static void conveyorInit() { .duration(600).EUt(245760).buildAndRegister(); + for(int i = 9; i < 15; i++) { + if(i == 14) { + getAssLineResearchBuilder(i, 600, getConveyorByTier(i - 1).getStackForm(), false, false, V[MAX]) + .output(getConveyorByTier(i)) + .inputs(getMotorByTier(i).getStackForm(2)) + .input(plate, getMainComponentMaterialByTier(i), 2) + .input(ring, getMainComponentMaterialByTier(i), 4) + .input(round, getMainComponentMaterialByTier(i+1), 16) + .input(screw, getMainComponentMaterialByTier(i+1), 4) + .input(cableGtSingle, getCableByTier(i), 2) + .inputs(MACROWORMHOLE_GENERATOR.getStackForm()) + .fluidInputs(Indalloy140.getFluid((int) (L * 4 * Math.pow(2, i - 8)))) + .fluidInputs(Lubricant.getFluid((int) (1000 * Math.pow(2, i - 8)))) + .fluidInputs(getPolymerByTier(i).getFluid(L * 24 * (i - 7))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 2 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } + else { + getAssLineResearchBuilder(i, 600, getConveyorByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(4, i - 9))) + .output(getConveyorByTier(i)) + .inputs(getMotorByTier(i).getStackForm(2)) + .input(plate, getMainComponentMaterialByTier(i), 2) + .input(ring, getMainComponentMaterialByTier(i), 4) + .input(round, getMainComponentMaterialByTier(i), 16) + .input(screw, getMainComponentMaterialByTier(i), 4) + .input(cableGtSingle, getCableByTier(i), 2) + .fluidInputs(Indalloy140.getFluid((int) (L * 4 * Math.pow(2, i - 8)))) + .fluidInputs(Lubricant.getFluid((int) (1000 * Math.pow(2, i - 8)))) + .fluidInputs(getPolymerByTier(i).getFluid(L * 24 * (i - 7))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 2 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } + } - + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(983040) .inputs(ELECTRIC_MOTOR_UHV.getStackForm(2)) .input(plate, HDCS, 8) @@ -841,6 +1207,8 @@ private static void conveyorInit() { .fluidInputs(Lubricant.getFluid(2000)) .outputs(CONVEYOR_MODULE_UXV.getStackForm()) .buildAndRegister(); + + */ } private static void pistonInit() { @@ -943,8 +1311,43 @@ private static void pistonInit() { .duration(600).EUt(245760).buildAndRegister(); + for(int i = 9; i < 15; i++) { + if (i == 14) { + getAssLineResearchBuilder(i, 600, getPistonByTier(i - 1).getStackForm(), false, false, V[MAX]) + .outputs(getPistonByTier(i).getStackForm()) + .inputs(getMotorByTier(i).getStackForm()) + .input(plate, getMainComponentMaterialByTier(i), 4) + .input(ring, getMainComponentMaterialByTier(i), 4) + .input(round, getMainComponentMaterialByTier(i), 16) + .input(stick, getMainComponentMaterialByTier(i), 4) + .input(gear, getMainComponentMaterialByTier(i+1)) + .input(gearSmall, getMainComponentMaterialByTier(i+1), 2) + .input(cableGtSingle, getCableByTier(i), 2) + .fluidInputs(Indalloy140.getFluid((int) (L * 4 * Math.pow(2, i - 8)))) + .fluidInputs(Lubricant.getFluid((int) (1000 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 2 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } else { + getAssLineResearchBuilder(i, 600, getPistonByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(4, i - 9))) + .outputs(getPistonByTier(i).getStackForm()) + .inputs(getMotorByTier(i).getStackForm()) + .input(plate, getMainComponentMaterialByTier(i), 4) + .input(ring, getMainComponentMaterialByTier(i), 4) + .input(round, getMainComponentMaterialByTier(i), 16) + .input(stick, getMainComponentMaterialByTier(i), 4) + .input(gear, getMainComponentMaterialByTier(i)) + .input(gearSmall, getMainComponentMaterialByTier(i), 2) + .input(cableGtSingle, getCableByTier(i), 2) + .fluidInputs(Indalloy140.getFluid((int) (L * 4 * Math.pow(2, i - 8)))) + .fluidInputs(Lubricant.getFluid((int) (1000 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 2 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } + } - + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(983040) .inputs(ELECTRIC_MOTOR_UHV.getStackForm()) .input(plate, HDCS, 8) @@ -992,6 +1395,8 @@ private static void pistonInit() { .fluidInputs(Lubricant.getFluid(2000)) .outputs(ELECTRIC_PISTON_UXV.getStackForm()) .buildAndRegister(); + + */ } private static void motorInit() { @@ -1049,10 +1454,10 @@ private static void motorInit() { .input(stickLong, HSSS, 2) .input(ring, HSSS, 2) .input(round, HSSS, 4) - .input(wireFine, Ruridit, 64) - .input(wireFine, Ruridit, 64) - .input(wireFine, Ruridit, 64) - .input(wireFine, Ruridit, 64) + .input(wireFine, Irirutan, 64) + .input(wireFine, Irirutan, 64) + .input(wireFine, Irirutan, 64) + .input(wireFine, Irirutan, 64) .input(cableGtSingle, YttriumBariumCuprate, 2) .fluidInputs(SolderingAlloy.getFluid(L)) .fluidInputs(Lubricant.getFluid(250)) @@ -1061,15 +1466,15 @@ private static void motorInit() { .duration(600).EUt(10240).buildAndRegister(); ASSEMBLY_LINE_RECIPES.recipeBuilder() - .input(stickLong, NeodymiumMagnetic,16) + .input(stickLong, NeodymiumMagnetic,2) .input(stickLong, HSSE, 4) .input(ring, HSSE, 4) .input(round, HSSE, 8) - .input(wireFine, Europium, 64) - .input(wireFine, Europium, 64) - .input(wireFine, Europium, 64) - .input(wireFine, Europium, 64) - .input(cableGtQuadruple, Naquadah, 2) + .input(wireFine, DuctileA356, 64) + .input(wireFine, DuctileA356, 64) + .input(wireFine, DuctileA356, 64) + .input(wireFine, DuctileA356, 64) + .input(cableGtSingle, Naquadah, 2) .fluidInputs(SolderingAlloy.getFluid(L * 2)) .fluidInputs(Lubricant.getFluid(500)) .output(ELECTRIC_MOTOR_ZPM) @@ -1080,7 +1485,7 @@ private static void motorInit() { .duration(600).EUt(40960).buildAndRegister(); ASSEMBLY_LINE_RECIPES.recipeBuilder() - .input(stickLong, NeodymiumMagnetic,64) + .input(stickLong, NeodymiumMagnetic,4) .input(stickLong, Tritanium, 4) .input(ring, Tritanium, 4) .input(round, Tritanium, 8) @@ -1088,7 +1493,7 @@ private static void motorInit() { .input(wireFine, Duranium, 64) .input(wireFine, Duranium, 64) .input(wireFine, Duranium, 64) - .input(cableGtQuadruple, Duranium, 2) + .input(cableGtSingle, Duranium, 2) .fluidInputs(SolderingAlloy.getFluid(L * 4)) .fluidInputs(Lubricant.getFluid(1000)) .fluidInputs(Naquadria.getFluid(L * 4)) @@ -1104,8 +1509,7 @@ private static void motorInit() { ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(655360) .outputs(ELECTRIC_MOTOR_UHV.getStackForm()) - .input(stickLong, NeodymiumMagnetic, 64) - .input(stickLong, NeodymiumMagnetic, 64) + .input(stickLong, NeodymiumMagnetic, 8) .input(stickLong, HDCS, 4) .input(ring, HDCS, 4) .input(round, HDCS, 8) @@ -1113,10 +1517,11 @@ private static void motorInit() { .input(wireFine, TungstenTitaniumCarbide, 64) .input(wireFine, TungstenTitaniumCarbide, 64) .input(wireFine, TungstenTitaniumCarbide, 64) - .input(cableGtQuadruple, TungstenTitaniumCarbide, 2) + .input(cableGtSingle, TungstenTitaniumCarbide, 2) .fluidInputs(Indalloy140.getFluid(L * 8)) .fluidInputs(Lubricant.getFluid(2000)) - .fluidInputs(Naquadria.getFluid(L * 8)) + //.fluidInputs(Seaborgium.getFluid(L * 4 * 2)) + .fluidInputs(Seaborgium.getFluid(L * 4)) .stationResearch(b -> b .researchStack(ELECTRIC_MOTOR_UV.getStackForm()) .CWUt(128) @@ -1125,8 +1530,7 @@ private static void motorInit() { ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(2621440) .outputs(ELECTRIC_MOTOR_UEV.getStackForm()) - .input(stickLong, SamariumMagnetic, 64) - .input(stickLong, SamariumMagnetic, 64) + .input(stickLong, SamariumMagnetic, 8) .input(stickLong, EnrichedNaquadahAlloy, 4) .input(ring, EnrichedNaquadahAlloy, 4) .input(round, EnrichedNaquadahAlloy, 8) @@ -1134,10 +1538,12 @@ private static void motorInit() { .input(wireFine, Pikyonium, 64) .input(wireFine, Pikyonium, 64) .input(wireFine, Pikyonium, 64) - .input(cableGtQuadruple, Pikyonium, 2) + .input(cableGtSingle, Pikyonium, 2) .fluidInputs(Indalloy140.getFluid(L * 16)) .fluidInputs(Lubricant.getFluid(4000)) - .fluidInputs(Bohrium.getFluid(L * 16)) + // .fluidInputs(Bohrium.getFluid(L * 4 * 3)) + .fluidInputs(Bohrium.getFluid(L * 8)) + .stationResearch(b -> b .researchStack(ELECTRIC_MOTOR_UHV.getStackForm()) .CWUt(256) @@ -1147,8 +1553,7 @@ private static void motorInit() { ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(10485760) .outputs(ELECTRIC_MOTOR_UIV.getStackForm()) - .input(stickLong, SamariumMagnetic, 64) - .input(stickLong, SamariumMagnetic, 64) + .input(stickLong, SamariumMagnetic, 16) .input(stickLong, HastelloyX78, 4) .input(ring, HastelloyX78, 4) .input(round, HastelloyX78, 8) @@ -1156,10 +1561,11 @@ private static void motorInit() { .input(wireFine, CarbonNanotubes, 64) .input(wireFine, CarbonNanotubes, 64) .input(wireFine, CarbonNanotubes, 64) - .input(cableGtQuadruple, BlackTitanium, 2) + .input(cableGtSingle, BlackTitanium, 2) .fluidInputs(Indalloy140.getFluid(L * 32)) .fluidInputs(Lubricant.getFluid(8000)) - .fluidInputs(MetastableHassium.getFluid(L * 32)) + //.fluidInputs(MetastableHassium.getFluid(L * 4 * 4)) + .fluidInputs(MetastableHassium.getFluid(L * 16)) .stationResearch(b -> b .researchStack(ELECTRIC_MOTOR_UEV.getStackForm()) .CWUt(512) @@ -1167,22 +1573,21 @@ private static void motorInit() { .EUt(VA[GTValues.UIV])) .buildAndRegister(); - //Change this from carbon nanotubes ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(41943040) .outputs(ELECTRIC_MOTOR_UXV.getStackForm()) - .input(stickLong, SamariumMagnetic, 64) - .input(stickLong, SamariumMagnetic, 64) + .input(stickLong, SamariumMagnetic, 32) .input(stickLong, HastelloyK243, 4) .input(ring, HastelloyK243, 4) .input(round, HastelloyK243, 8) - .input(wireFine, CarbonNanotubes, 64) - .input(wireFine, CarbonNanotubes, 64) - .input(wireFine, CarbonNanotubes, 64) - .input(wireFine, CarbonNanotubes, 64) - .input(cableGtQuadruple, NaquadriaticTaranium, 2) + .input(wireFine, LanthanumFullereneNanotubes, 64) + .input(wireFine, LanthanumFullereneNanotubes, 64) + .input(wireFine, LanthanumFullereneNanotubes, 64) + .input(wireFine, LanthanumFullereneNanotubes, 64) + .input(cableGtSingle, NaquadriaticTaranium, 2) .fluidInputs(Indalloy140.getFluid(L * 64)) .fluidInputs(Lubricant.getFluid(16000)) - .fluidInputs(HeavyQuarkDegenerateMatter.getFluid(L * 64)) + // .fluidInputs(HeavyQuarkDegenerateMatter.getFluid(L * 4 * 5)) + .fluidInputs(HeavyQuarkDegenerateMatter.getFluid(L * 32)) .stationResearch(b -> b .researchStack(ELECTRIC_MOTOR_UIV.getStackForm()) .CWUt(1024) @@ -1193,7 +1598,6 @@ private static void motorInit() { ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(536870900) .outputs(ELECTRIC_MOTOR_OpV.getStackForm()) .input(stickLong, NaquadriaticTaranium, 64) - .input(stickLong, NaquadriaticTaranium, 32) .input(stickLong, Neutronium, 4) .input(ring, Neutronium, 4) .input(round, Neutronium, 8) @@ -1201,10 +1605,11 @@ private static void motorInit() { .input(wireFine, MetastableOganesson, 64) .input(wireFine, MetastableOganesson, 64) .input(wireFine, MetastableOganesson, 64) - .input(cableGtQuadruple, Neutronium, 2) + .input(cableGtSingle, Neutronium, 2) .fluidInputs(Indalloy140.getFluid(L * 128)) .fluidInputs(Lubricant.getFluid(32000)) - .fluidInputs(SuperheavyMix.getFluid(L * 128)) + //.fluidInputs(SuperheavyMix.getFluid(L * 4 * 6)) + .fluidInputs(SuperheavyMix.getFluid(L * 64)) .stationResearch(b -> b .researchStack(ELECTRIC_MOTOR_UXV.getStackForm()) .CWUt(2048) @@ -1212,11 +1617,10 @@ private static void motorInit() { .EUt(VA[GTValues.OpV])) .buildAndRegister(); - ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt((int) GTValues.V[GTValues.MAX]) + ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(GTValues.V[GTValues.MAX]) .outputs(ELECTRIC_MOTOR_MAX.getStackForm()) .input(stickLong, NaquadriaticTaranium, 64) .input(stickLong, NaquadriaticTaranium, 64) - .input(stickLong, NaquadriaticTaranium, 64) .input(wireFine, HeavyQuarkDegenerateMatter, 64) .input(wireFine, HeavyQuarkDegenerateMatter, 64) .input(wireFine, HeavyQuarkDegenerateMatter, 64) @@ -1225,16 +1629,17 @@ private static void motorInit() { .input(ring, CosmicNeutronium, 4) .input(round, CosmicNeutronium, 8) .input(COSMIC_FABRIC, 64) - .input(cableGtOctal, CosmicNeutronium, 2) + .input(cableGtSingle, CosmicNeutronium, 2) .inputs(MACROWORMHOLE_GENERATOR.getStackForm()) .fluidInputs(Indalloy140.getFluid(L * 256)) .fluidInputs(Lubricant.getFluid(64000)) - .fluidInputs(Neutronium.getFluid(L * 256)) + // .fluidInputs(Neutronium.getFluid(L * 4 * 7)) + .fluidInputs(Neutronium.getFluid(L * 128)) .stationResearch(b -> b .researchStack(ELECTRIC_MOTOR_OpV.getStackForm()) .CWUt(4096) .dataStack(TOOL_DATA_SUPRACAUSAL.getStackForm()) - .EUt((int) V[GTValues.MAX])) + .EUt(V[GTValues.MAX])) .buildAndRegister(); } @@ -1330,7 +1735,42 @@ private static void pumpInit() { .EUt(VA[GTValues.UV])) .duration(600).EUt(245760).buildAndRegister(); + for(int i = 9; i < 15; i++) { + if (i == 14) { + getAssLineResearchBuilder(i, 600, getPumpByTier(i - 1).getStackForm(), false, false, V[MAX]) + .outputs(getPumpByTier(i).getStackForm()) + .input(getMotorByTier(i)) + .input(pipeLargeFluid, getFluidPipeMaterialByTier(i), 32) + .input(plate, getMainComponentMaterialByTier(i), 2) + .input(screw, getMainComponentMaterialByTier(i), 8) + .input(ring, SiliconeRubber, 16) + .input(rotor, getMainComponentMaterialByTier(i)) + .input(cableGtSingle, getCableByTier(i), 2) + .inputs(MACROWORMHOLE_GENERATOR.getStackForm()) + .fluidInputs(Indalloy140.getFluid((int) (L * 4 * Math.pow(2, i - 8)))) + .fluidInputs(Lubricant.getFluid((int) (1000 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 2 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } else { + getAssLineResearchBuilder(i, 600, getPumpByTier(i - 1).getStackForm(), false, false, (int) (983040 * Math.pow(4, i - 9))) + .outputs(getPumpByTier(i).getStackForm()) + .input(getMotorByTier(i)) + .input(pipeLargeFluid, getFluidPipeMaterialByTier(i), 32) + .input(plate, getMainComponentMaterialByTier(i), 2) + .input(screw, getMainComponentMaterialByTier(i), 8) + .input(ring, SiliconeRubber, 16) + .input(rotor, getMainComponentMaterialByTier(i)) + .input(cableGtSingle, getCableByTier(i), 2) + .fluidInputs(Indalloy140.getFluid((int) (L * 4 * Math.pow(2, i - 8)))) + .fluidInputs(Lubricant.getFluid((int) (1000 * Math.pow(2, i - 8)))) + //.fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * (i - 7))) + .fluidInputs(getFluidMaterialByTier(i).getFluid((int) (L * 2 * (Math.pow(2, i - 8))))) + .buildAndRegister(); + } + } + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(983040) .outputs(ELECTRIC_PUMP_UHV.getStackForm()) @@ -1379,13 +1819,8 @@ private static void pumpInit() { .fluidInputs(SolderingAlloy.getFluid(L * 4)) .fluidInputs(Lubricant.getFluid(2000)) .buildAndRegister(); - } - - public static void opvComponents() { + */ } - public static void maxComponents() { - - } } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/CosmicRayDetectorRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/CosmicRayDetectorRecipes.java new file mode 100644 index 00000000..6bd579c1 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/CosmicRayDetectorRecipes.java @@ -0,0 +1,18 @@ +package com.fulltrix.gcyl.recipes.categories; + +import gregtech.api.GTValues; + +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.COSMIC_RAY_DETECTOR_RECIPES; +import static com.fulltrix.gcyl.materials.GCYLMaterials.HeavyLeptonMix; +import static gregtech.api.GTValues.UHV; + +public class CosmicRayDetectorRecipes { + public static void init() { + + COSMIC_RAY_DETECTOR_RECIPES.recipeBuilder().EUt((int) GTValues.V[UHV]).duration(984) + .circuitMeta(1) + .fluidOutputs(HeavyLeptonMix.getFluid(200)) + .CWUt(64) + .buildAndRegister(); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/DeepMinerRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/DeepMinerRecipes.java index 89974795..4072ae79 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/DeepMinerRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/DeepMinerRecipes.java @@ -1,32 +1,32 @@ package com.fulltrix.gcyl.recipes.categories; -import com.fulltrix.gcyl.recipes.recipeproperties.GCYLScanProperty; +import com.fulltrix.gcyl.GCYLConfig; +import com.fulltrix.gcyl.api.recipes.properties.GCYLScanProperty; import gregtech.api.GTValues; import gregtech.api.metatileentity.multiblock.CleanroomType; import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.RecipeMaps; -import gregtech.api.recipes.chance.output.ChancedOutputLogic; import gregtech.api.recipes.ingredients.nbtmatch.NBTCondition; import gregtech.api.recipes.ingredients.nbtmatch.NBTMatcher; import gregtech.api.unification.OreDictUnifier; import gregtech.api.unification.material.MarkerMaterials; import gregtech.api.util.GTUtility; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; -import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraftforge.common.util.Constants; import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import stanhebben.zenscript.annotations.Optional; import java.util.Map; +import static com.fulltrix.gcyl.item.GCYLCoreItems.ELECTRIC_PISTON_MAX; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.TOOL_DATA_DEEP_MINER; -import static com.fulltrix.gcyl.materials.GCYLNuclearMaterials.Plutonium; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.DEEP_MINER_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.DEEP_MINER_RECIPES; +import static supercritical.api.unification.material.SCMaterials.Plutonium244; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; @@ -34,6 +34,8 @@ public class DeepMinerRecipes { + //TODO add platinum, iridium, osmium, ruthenium, rhodium recipe? + public static final String RESEARCH_NBT_TAG = "minerDataResearch"; public static final String RESEARCH_ID_NBT_TAG = "researchId"; @@ -58,18 +60,25 @@ public static void init() { .duration(400).EUt(400).buildAndRegister(); - createResearchRecipe("deep_rutile", OreDictUnifier.get(block, Titanium), null,TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 512, 0); - createResearchRecipe("deep_pyrochlore", OreDictUnifier.get(block, Niobium),null, TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 512, 0); - createResearchRecipe("deep_diamond", OreDictUnifier.get(block, Diamond), null,TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 512, 0); - createResearchRecipe("deep_aluminium", OreDictUnifier.get(block, Aluminium),null,TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 512, 0); - createResearchRecipe("deep_platinum", OreDictUnifier.get(block, Platinum),null, TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 1920, 0); + createResearchRecipe("deep_rutile", OreDictUnifier.get(block, Titanium), null, TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 512, 0); + createResearchRecipe("deep_pyrochlore", OreDictUnifier.get(block, Niobium), null, TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 512, 0); + createResearchRecipe("deep_diamond", OreDictUnifier.get(block, Diamond), null, TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 512, 0); + createResearchRecipe("deep_aluminium", OreDictUnifier.get(block, Aluminium), null, TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 512, 0); + createResearchRecipe("deep_platinum", OreDictUnifier.get(block, Platinum), null, TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 1920, 0); + createResearchRecipe("deep_rare_earth", OreDictUnifier.get(block, Neodymium), null, TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 1920, 0); + + createResearchRecipe("deep_overworld_gas", null, LiquidAir.getFluid(32000), TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 1920, 0); + createResearchRecipe("deep_nether_gas", null, LiquidNetherAir.getFluid(32000), TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 7860, 0); - createResearchRecipe("deep_salts", OreDictUnifier.get(block, Salt),HydrofluoricAcid.getFluid(16000), TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 1920, 0); - createResearchRecipe( "deep_exotics", OreDictUnifier.get(block, Enderium), null, TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 1920, 0); + createResearchRecipe("deep_salts", OreDictUnifier.get(block, Salt), HydrofluoricAcid.getFluid(16000), TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 1920, 0); + + createResearchRecipe("deep_exotics", OreDictUnifier.get(block, Enderium), null, TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 1920, 0); createResearchRecipe("deep_radioactive", OreDictUnifier.get(block, Plutonium244), null, TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 7860, 0); + createResearchRecipe("deep_tantalum", OreDictUnifier.get(block, Tantalum), null, TOOL_DATA_DEEP_MINER.getStackForm(), true, 300, 7860, 0); + DEEP_MINER_RECIPES.recipeBuilder() .notConsumable(minerScanMap.get("deep_diamond")) @@ -80,10 +89,10 @@ public static void init() { .fluidInputs(DrillingFluid.getFluid(64000)) .output(ore, Coal, 64) .output(ore, Diamond, 16) - .chancedOutput(ore, Coal, 64,100,2000) - .chancedOutput(ore, Diamond, 16,100,2000) - .chancedOutput(ore, Coal, 64,100,500) - .chancedOutput(ore, Diamond, 16,100,500) + .chancedOutput(ore, Coal, 64, 100, 2000) + .chancedOutput(ore, Diamond, 16, 100, 2000) + .chancedOutput(ore, Coal, 64, 100, 500) + .chancedOutput(ore, Diamond, 16, 100, 500) .duration(4000) .EUt(480) .temperature(2500) @@ -100,10 +109,10 @@ public static void init() { .fluidInputs(DrillingFluid.getFluid(64000)) .output(ore, Pyrochlore, 64) .output(ore, Columbite, 64) - .chancedOutput(ore, Pyrochlore, 64,100,2000) - .chancedOutput(ore, Columbite, 64,100,2000) - .chancedOutput(ore, Pyrochlore, 64,100,500) - .chancedOutput(ore, Columbite, 64,100,500) + .chancedOutput(ore, Pyrochlore, 64, 100, 2000) + .chancedOutput(ore, Columbite, 64, 100, 2000) + .chancedOutput(ore, Pyrochlore, 64, 100, 500) + .chancedOutput(ore, Columbite, 64, 100, 500) .duration(4000) .EUt(480) .temperature(2500) @@ -120,12 +129,12 @@ public static void init() { .output(ore, Bauxite, 64) .output(ore, Aluminium, 32) .output(ore, Gallite, 32) - .chancedOutput(ore, Bauxite, 64,100,2000) - .chancedOutput(ore, Aluminium, 32,100,2000) - .chancedOutput(ore, Aluminium, 32,100,2000) - .chancedOutput(ore, Bauxite, 64,100,500) - .chancedOutput(ore, Rutile, 32,100,500) - .chancedOutput(ore, Gallite, 32,100,500) + .chancedOutput(ore, Bauxite, 64, 100, 2000) + .chancedOutput(ore, Aluminium, 32, 100, 2000) + .chancedOutput(ore, Aluminium, 32, 100, 2000) + .chancedOutput(ore, Bauxite, 64, 100, 500) + .chancedOutput(ore, Rutile, 32, 100, 500) + .chancedOutput(ore, Gallite, 32, 100, 500) .duration(4000) .EUt(480) .temperature(2500) @@ -141,10 +150,10 @@ public static void init() { .fluidInputs(DrillingFluid.getFluid(64000)) .output(ore, Bauxite, 64) .output(ore, Rutile, 32) - .chancedOutput(ore, Bauxite, 64,100,2000) - .chancedOutput(ore, Rutile, 32,100,2000) - .chancedOutput(ore, Bauxite, 64,100,500) - .chancedOutput(ore, Rutile, 32,100,500) + .chancedOutput(ore, Bauxite, 64, 100, 2000) + .chancedOutput(ore, Rutile, 32, 100, 2000) + .chancedOutput(ore, Bauxite, 64, 100, 500) + .chancedOutput(ore, Rutile, 32, 100, 500) .duration(4000) .EUt(480) .temperature(2500) @@ -160,16 +169,38 @@ public static void init() { .fluidInputs(DrillingFluid.getFluid(128000)) .output(ore, PlatinumMetallicPowder, 64) .output(ore, PalladiumMetallicPowder, 64) - .chancedOutput(ore, PlatinumMetallicPowder, 64,100,2000) - .chancedOutput(ore, PalladiumMetallicPowder, 64,100,2000) - .chancedOutput(ore, PlatinumMetallicPowder, 64,100,500) - .chancedOutput(ore, PalladiumMetallicPowder, 64,100,500) + .chancedOutput(ore, PlatinumMetallicPowder, 64, 100, 2000) + .chancedOutput(ore, PalladiumMetallicPowder, 64, 100, 2000) + .chancedOutput(ore, PlatinumMetallicPowder, 64, 100, 500) + .chancedOutput(ore, PalladiumMetallicPowder, 64, 100, 500) .duration(4000) .EUt(1920) .temperature(4500) .dimension(0) .buildAndRegister(); + DEEP_MINER_RECIPES.recipeBuilder() + .notConsumable(minerScanMap.get("deep_rare_earth")) + .circuitMeta(0) + .input(SENSOR_EV) + .input(ELECTRIC_PISTON_EV) + + .fluidInputs(DrillingFluid.getFluid(128000)) + .output(ore, Bastnasite, 64) + .output(ore, Monazite, 16) + .output(ore, Neodymium, 16) + .chancedOutput(ore, Bastnasite, 64, 100, 2000) + .chancedOutput(ore, Monazite, 16, 100, 2000) + .chancedOutput(ore, Neodymium, 16, 100, 2000) + .chancedOutput(ore, Bastnasite, 64, 100, 500) + .chancedOutput(ore, Monazite, 16, 100, 500) + .chancedOutput(ore, Neodymium, 16, 100, 500) + .duration(4000) + .EUt(1920) + .temperature(3500) + .dimension(0) + .buildAndRegister(); + DEEP_MINER_RECIPES.recipeBuilder() .notConsumable(minerScanMap.get("deep_exotics")) .circuitMeta(1) @@ -178,43 +209,41 @@ public static void init() { .fluidInputs(DrillingFluid.getFluid(128000)) .output(ore, NetherStar, 16) - .chancedOutput(ore, NetherStar, 16,100,2000) - .chancedOutput(ore, NetherStar, 16,100,500) + .chancedOutput(ore, NetherStar, 16, 100, 2000) + .chancedOutput(ore, NetherStar, 16, 100, 500) .duration(4000) .EUt(1920) .temperature(4500) .dimension(-1) .buildAndRegister(); - DEEP_MINER_RECIPES.recipeBuilder() - .notConsumable(minerScanMap.get("deep_salts")) - .circuitMeta(1) - .input(SENSOR_IV) - .input(ELECTRIC_PUMP_IV) + .notConsumable(minerScanMap.get("deep_overworld_gas")) + .circuitMeta(0) + .input(SENSOR_EV) + .input(ELECTRIC_PUMP_EV) - .fluidInputs(DrillingFluid.getFluid(256000)) - .fluidInputs(NitricAcid.getFluid(16000)) - .fluidOutputs(Chlorine.getFluid(64000)) - .chancedFluidOutput(Chlorine.getFluid(64000), 100, 2000) - .chancedFluidOutput(Chlorine.getFluid(64000), 100, 500) + .fluidInputs(DrillingFluid.getFluid(128000)) + .fluidOutputs(DeepOverworldGas.getFluid(64000)) + .chancedFluidOutput(DeepOverworldGas.getFluid(64000), 100, 2000) + .chancedFluidOutput(DeepOverworldGas.getFluid(64000), 100, 500) .duration(4000) - .EUt(7860) - .temperature(4500) - .dimension(-1) + .EUt(1920) + .temperature(3500) + .dimension(0) .buildAndRegister(); DEEP_MINER_RECIPES.recipeBuilder() - .notConsumable(minerScanMap.get("deep_salts")) - .circuitMeta(2) + .notConsumable(minerScanMap.get("deep_nether_gas")) + .circuitMeta(1) .input(SENSOR_IV) .input(ELECTRIC_PUMP_IV) .fluidInputs(DrillingFluid.getFluid(256000)) .fluidInputs(NitricAcid.getFluid(16000)) - .fluidOutputs(Fluorine.getFluid(64000)) - .chancedFluidOutput(Fluorine.getFluid(64000), 100, 2000) - .chancedFluidOutput(Fluorine.getFluid(64000), 100, 500) + .fluidOutputs(DeepNetherGas.getFluid(64000)) + .chancedFluidOutput(DeepNetherGas.getFluid(64000), 100, 2000) + .chancedFluidOutput(DeepNetherGas.getFluid(64000), 100, 500) .duration(4000) .EUt(7860) .temperature(4500) @@ -232,7 +261,7 @@ public static void init() { .output(ore, Salt, 32) .chancedOutput(ore, Salt, 32, 100, 2000) .chancedOutput(ore, Salt, 32, 100, 500) - .output(ore, Fluorite,32) + .output(ore, Fluorite, 32) .chancedOutput(ore, Fluorite, 32, 100, 2000) .chancedOutput(ore, Fluorite, 32, 100, 500) .output(ore, Lepidolite, 8) @@ -258,7 +287,7 @@ public static void init() { .output(ore, Salt, 32) .chancedOutput(ore, Salt, 32, 100, 2000) .chancedOutput(ore, Salt, 32, 100, 500) - .output(ore, Fluorite,32) + .output(ore, Fluorite, 32) .chancedOutput(ore, Fluorite, 32, 100, 2000) .chancedOutput(ore, Fluorite, 32, 100, 500) .output(ore, Lepidolite, 8) @@ -284,7 +313,7 @@ public static void init() { .output(ore, NaquadricCompound, 64) .chancedOutput(ore, NaquadricCompound, 64, 100, 2000) .chancedOutput(ore, NaquadricCompound, 64, 100, 500) - .output(ore, EnrichedNaquadricCompound,64) + .output(ore, EnrichedNaquadricCompound, 64) .chancedOutput(ore, EnrichedNaquadricCompound, 64, 100, 2000) .chancedOutput(ore, EnrichedNaquadricCompound, 64, 100, 500) .output(ore, NaquadriaticCompound, 32) @@ -296,12 +325,30 @@ public static void init() { .dimension(0) .buildAndRegister(); + DEEP_MINER_RECIPES.recipeBuilder() + .notConsumable(minerScanMap.get("deep_tantalum")) + .circuitMeta(1) + .input(SENSOR_IV) + .input(ELECTRIC_PISTON_IV) + .fluidInputs(DrillingFluid.getFluid(256000)) + .fluidInputs(NitricAcid.getFluid(32000)) + .output(ore, Tantalite, 64) + .chancedOutput(ore, Tantalite, 64, 100, 2000) + .chancedOutput(ore, Tantalite, 64, 100, 500) + .chancedOutput(ore, Tantalum, 16, 100, 2000) + .chancedOutput(ore, Tantalum, 16, 100, 500) + .duration(4000) + .EUt(7860) + .temperature(5400) + .dimension(0) + .buildAndRegister(); + + DEEP_MINER_RECIPES.recipeBuilder() .notConsumable(minerScanMap.get("deep_radioactive")) .circuitMeta(0) .input(SENSOR_LuV) .input(ELECTRIC_PISTON_LUV) - .fluidInputs(DrillingFluid.getFluid(512000)) .fluidInputs(NitricAcid.getFluid(64000)) .output(ore, Uranium238, 64) @@ -316,19 +363,49 @@ public static void init() { .dimension(0) .buildAndRegister(); + if (GCYLConfig.recipes.useNewPlatinumChain) { + //TODO Add this + } else { + DEEP_MINER_RECIPES.recipeBuilder() + .notConsumable(minerScanMap.get("deep_platinum")) + .circuitMeta(1) + .input(SENSOR_ZPM) + .input(ELECTRIC_PISTON_ZPM) + .fluidInputs(DrillingFluid.getFluid(1024000)) + .fluidInputs(NitricAcid.getFluid(128000)) + .output(ore, RarestMetalMixture, 64) + .output(ore, RarestMetalMixture, 64) + .output(ore, RhodiumSalt, 64) + .output(ore, RhodiumSalt, 64) + .output(ore, SodiumRuthenate, 64) + .output(ore, SodiumRuthenate, 64) + .chancedOutput(ore, RarestMetalMixture, 64, 100, 2000) + .chancedOutput(ore, RarestMetalMixture, 64, 100, 2000) + .chancedOutput(ore, RhodiumSalt, 64, 100, 2000) + .chancedOutput(ore, RhodiumSalt, 64, 100, 2000) + .chancedOutput(ore, SodiumRuthenate, 64, 100, 2000) + .chancedOutput(ore, SodiumRuthenate, 64, 100, 2000) + .duration(4000) + .EUt(GTValues.VA[GTValues.ZPM]) + .temperature(8300) + .dimension(0) + .buildAndRegister(); } - public static void createResearchRecipe(@NotNull String researchId, @NotNull ItemStack researchItem, FluidStack fluid, - @NotNull ItemStack dataItem, boolean ignoreNBT, int duration, - int EUt, int CWUt) { + } + + + public static void createResearchRecipe(@NotNull String researchId, ItemStack researchItem, FluidStack fluid, + @NotNull ItemStack dataItem, boolean ignoreNBT, int duration, + int EUt, int CWUt) { NBTTagCompound compound = GTUtility.getOrCreateNbtCompound(dataItem); writeResearchToNBT(compound, researchId); dataItem.setTagCompound(compound); - dataItem.setStackDisplayName(I18n.format("gcyl.research."+researchId)); + dataItem.setStackDisplayName((new TextComponentTranslation("gcyl.research." + researchId).getFormattedText())); if (CWUt > 0) { RecipeBuilder researchBuilder = RecipeMaps.RESEARCH_STATION_RECIPES.recipeBuilder() @@ -354,13 +431,17 @@ public static void createResearchRecipe(@NotNull String researchId, @NotNull Ite .EUt(EUt); if (ignoreNBT) { - builder.inputNBT(researchItem.getItem(), 1, researchItem.getMetadata(), NBTMatcher.ANY, - NBTCondition.ANY); + if (researchItem != null) { + builder.inputNBT(researchItem.getItem(), 1, researchItem.getMetadata(), NBTMatcher.ANY, + NBTCondition.ANY); + } if (fluid != null) { builder.fluidInputs(fluid); } } else { - builder.inputs(researchItem); + if (researchItem != null) { + builder.inputs(researchItem); + } if (fluid != null) { builder.fluidInputs(fluid); } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/FisherRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/FisherRecipes.java new file mode 100644 index 00000000..cf27a2fd --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/FisherRecipes.java @@ -0,0 +1,23 @@ +package com.fulltrix.gcyl.recipes.categories; + +import gregtech.api.recipes.chance.output.ChancedOutputLogic; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.ore.OrePrefix; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.FISHER_RECIPES; +import static gregtech.api.unification.material.Materials.Meat; + +public class FisherRecipes { + public static void init() { + FISHER_RECIPES.recipeBuilder().duration(1200).EUt(7680) + .inputs(new ItemStack(Items.STRING ,64)) + .input(OrePrefix.dust, Meat, 32) + .chancedOutputLogic(ChancedOutputLogic.XOR) + .chancedOutput(new ItemStack(Items.FISH, 64), 3333, 333) + .chancedOutput(new ItemStack(Items.FISH, 64, 2), 3333, 333) + .chancedOutput(new ItemStack(Items.FISH, 64, 3), 3333, 333) + .buildAndRegister(); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/GreenhouseRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/GreenhouseRecipes.java index b944aabe..1f4f6ee2 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/GreenhouseRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/GreenhouseRecipes.java @@ -1,45 +1,272 @@ package com.fulltrix.gcyl.recipes.categories; -import com.cleanroommc.groovyscript.api.IIngredient; import gregtech.common.blocks.MetaBlocks; -import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.GREENHOUSE_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.GREENHOUSE_RECIPES; +import static com.fulltrix.gcyl.materials.GCYLMaterials.OrganicFertilizer; import static gregtech.api.unification.material.Materials.CarbonDioxide; +import static gregtech.api.unification.material.Materials.Water; +import static gregtech.api.unification.ore.OrePrefix.dust; +import static gregtech.common.items.MetaItems.FERTILIZER; import static gregtech.common.items.MetaItems.STICKY_RESIN; public class GreenhouseRecipes { public static void init() { - GREENHOUSE_RECIPES.recipeBuilder().EUt(90).duration(600) + //oak tree apples + + GREENHOUSE_RECIPES.recipeBuilder().EUt(120).duration(600) .circuitMeta(1) - .notConsumable(new ItemStack(Blocks.SAPLING)) - .output(new ItemStack(Blocks.LOG).getItem(), 64) + .fluidInputs(Water.getFluid(64000)) + .inputs(new ItemStack(Blocks.SAPLING, 8)) + .output(new ItemStack(Blocks.LOG).getItem(), 32) + .outputs(new ItemStack(Blocks.SAPLING, 16)) + .chancedOutput(new ItemStack(Items.APPLE, 32), 2500,0) .buildAndRegister(); - GREENHOUSE_RECIPES.recipeBuilder().EUt(120).duration(300) + GREENHOUSE_RECIPES.recipeBuilder().EUt(480).duration(300) .circuitMeta(2) - .notConsumable(new ItemStack(Blocks.SAPLING)) + .fluidInputs(Water.getFluid(128000)) + .inputs(new ItemStack(Blocks.SAPLING, 8)) .fluidInputs(CarbonDioxide.getFluid(16000)) + .output(new ItemStack(Blocks.LOG).getItem(), 64) + .outputs(new ItemStack(Blocks.SAPLING, 32)) + .chancedOutput(new ItemStack(Items.APPLE, 32), 5000, 250) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(1920).duration(150) + .circuitMeta(3) + .fluidInputs(Water.getFluid(256000)) + .inputs(new ItemStack(Blocks.SAPLING, 8)) + .inputs(FERTILIZER.getStackForm(64)) + .fluidInputs(CarbonDioxide.getFluid(32000)) + .output(new ItemStack(Blocks.LOG).getItem(), 128) + .outputs(new ItemStack(Blocks.SAPLING, 64)) + .chancedOutput(new ItemStack(Items.APPLE, 64), 7500, 500) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(1920).duration(150) + .circuitMeta(3) + .fluidInputs(Water.getFluid(256000)) + .inputs(new ItemStack(Blocks.SAPLING, 8)) + .input(dust, OrganicFertilizer, 64) + .fluidInputs(CarbonDioxide.getFluid(32000)) .output(new ItemStack(Blocks.LOG).getItem(), 128) + .outputs(new ItemStack(Blocks.SAPLING, 64)) + .chancedOutput(new ItemStack(Items.APPLE, 64), 7500, 500) .buildAndRegister(); - GREENHOUSE_RECIPES.recipeBuilder().EUt(90).duration(600) + //LOGS + + for(int i = 1; i < 6; i++) { + GREENHOUSE_RECIPES.recipeBuilder().EUt(120).duration(600) + .circuitMeta(1) + .fluidInputs(Water.getFluid(64000)) + .inputs(new ItemStack(Blocks.SAPLING, 8, i)) + .outputs(i < 4 ? new ItemStack(Blocks.LOG, 32, i) : new ItemStack(Blocks.LOG2, 32, i - 4)) + .outputs(new ItemStack(Blocks.SAPLING, 16, i)) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(480).duration(300) + .circuitMeta(2) + .fluidInputs(Water.getFluid(128000)) + .inputs(new ItemStack(Blocks.SAPLING, 8)) + .fluidInputs(CarbonDioxide.getFluid(16000)) + .outputs(i < 4 ? new ItemStack(Blocks.LOG, 64, i) : new ItemStack(Blocks.LOG2, 64, i - 4)) + .outputs(new ItemStack(Blocks.SAPLING, 32)) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(1920).duration(150) + .circuitMeta(3) + .fluidInputs(Water.getFluid(256000)) + .inputs(new ItemStack(Blocks.SAPLING, 8)) + .inputs(FERTILIZER.getStackForm(64)) + .fluidInputs(CarbonDioxide.getFluid(32000)) + .outputs(i < 4 ? new ItemStack(Blocks.LOG, 128, i) : new ItemStack(Blocks.LOG2, 128, i - 4)) + .outputs(new ItemStack(Blocks.SAPLING, 64)) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(1920).duration(150) + .circuitMeta(3) + .fluidInputs(Water.getFluid(256000)) + .inputs(new ItemStack(Blocks.SAPLING, 8)) + .input(dust, OrganicFertilizer, 64) + .fluidInputs(CarbonDioxide.getFluid(32000)) + .outputs(i < 4 ? new ItemStack(Blocks.LOG, 128, i) : new ItemStack(Blocks.LOG2, 128, i - 4)) + .outputs(new ItemStack(Blocks.SAPLING, 64)) + .buildAndRegister(); + } + + //RUBBER TREE + + GREENHOUSE_RECIPES.recipeBuilder().EUt(120).duration(600) .circuitMeta(1) - .notConsumable(new ItemStack(MetaBlocks.RUBBER_SAPLING)) - .output(new ItemStack(MetaBlocks.RUBBER_LOG).getItem(), 64) - .chancedOutput(STICKY_RESIN, 64, 2500,0) + .fluidInputs(Water.getFluid(64000)) + .inputs(new ItemStack(MetaBlocks.RUBBER_SAPLING, 8)) + .output(new ItemStack(MetaBlocks.RUBBER_LOG).getItem(), 32) + .outputs(new ItemStack(MetaBlocks.RUBBER_SAPLING, 16)) + .chancedOutput(STICKY_RESIN, 32, 2500,0) .buildAndRegister(); - GREENHOUSE_RECIPES.recipeBuilder().EUt(120).duration(300) + GREENHOUSE_RECIPES.recipeBuilder().EUt(480).duration(300) .circuitMeta(2) - .notConsumable(new ItemStack(MetaBlocks.RUBBER_SAPLING)) + .fluidInputs(Water.getFluid(128000)) + .inputs(new ItemStack(MetaBlocks.RUBBER_SAPLING, 8)) .fluidInputs(CarbonDioxide.getFluid(16000)) + .output(new ItemStack(MetaBlocks.RUBBER_LOG).getItem(), 64) + .outputs(new ItemStack(MetaBlocks.RUBBER_SAPLING, 32)) + .chancedOutput(STICKY_RESIN, 32, 5000, 250) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(1920).duration(150) + .circuitMeta(3) + .fluidInputs(Water.getFluid(256000)) + .inputs(new ItemStack(MetaBlocks.RUBBER_SAPLING, 8)) + .inputs(FERTILIZER.getStackForm(64)) + .fluidInputs(CarbonDioxide.getFluid(32000)) .output(new ItemStack(MetaBlocks.RUBBER_LOG).getItem(), 128) - .chancedOutput(STICKY_RESIN, 128, 5000, 500) + .outputs(new ItemStack(MetaBlocks.RUBBER_SAPLING, 64)) + .chancedOutput(STICKY_RESIN, 64, 7500, 500) .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(1920).duration(150) + .circuitMeta(3) + .fluidInputs(Water.getFluid(256000)) + .inputs(new ItemStack(MetaBlocks.RUBBER_SAPLING, 8)) + .input(dust, OrganicFertilizer, 64) + .fluidInputs(CarbonDioxide.getFluid(32000)) + .output(new ItemStack(MetaBlocks.RUBBER_LOG).getItem(), 128) + .outputs(new ItemStack(MetaBlocks.RUBBER_SAPLING, 64)) + .chancedOutput(STICKY_RESIN, 64, 7500, 500) + .buildAndRegister(); + + + //NO SEED PLANTS + registerGreenhouseRecipes(Items.REEDS, 120, 600); + registerGreenhouseRecipes(Items.CARROT, 120, 600); + registerGreenhouseRecipes(Items.POTATO, 120, 600); + + //SEED PLANTS + registerGreenhouseRecipesSeed(Items.WHEAT_SEEDS, Items.WHEAT, 120, 600, 1, true); + registerGreenhouseRecipesSeed(Items.BEETROOT_SEEDS, Items.BEETROOT, 120, 600, 1, true); + registerGreenhouseRecipesSeed(Items.MELON_SEEDS, Item.getItemFromBlock(Blocks.MELON_BLOCK), 120, 600, 8, false); + registerGreenhouseRecipesSeed(Items.PUMPKIN_SEEDS, Item.getItemFromBlock(Blocks.PUMPKIN), 120, 600, 8, false); + + } + + private static void registerGreenhouseRecipes(Item input, int baseEUt, int baseDuration) { + + GREENHOUSE_RECIPES.recipeBuilder().EUt(baseEUt).duration(baseDuration) + .circuitMeta(1) + .fluidInputs(Water.getFluid(64000)) + .inputs(new ItemStack(input, 8)) + .outputs(new ItemStack(input, 32)) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(baseEUt * 4).duration(baseDuration / 2) + .circuitMeta(2) + .fluidInputs(Water.getFluid(128000)) + .fluidInputs(CarbonDioxide.getFluid(16000)) + .inputs(new ItemStack(input, 8)) + .outputs(new ItemStack(input, 64)) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(baseEUt * 16).duration(baseDuration / 4) + .circuitMeta(3) + .fluidInputs(Water.getFluid(256000)) + .fluidInputs(CarbonDioxide.getFluid(32000)) + .inputs(new ItemStack(input, 8)) + .inputs(FERTILIZER.getStackForm(64)) + .outputs(new ItemStack(input, 128)) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(baseEUt * 16).duration(baseDuration / 4) + .circuitMeta(3) + .fluidInputs(Water.getFluid(256000)) + .fluidInputs(CarbonDioxide.getFluid(32000)) + .inputs(new ItemStack(input, 8)) + .input(dust, OrganicFertilizer, 64) + .outputs(new ItemStack(input, 128)) + .buildAndRegister(); + } + + private static void registerGreenhouseRecipesSeed(Item input, Item output, int baseEUt, int baseDuration, int outputDivisor, boolean outputSeeds) { + + if(outputSeeds) { + GREENHOUSE_RECIPES.recipeBuilder().EUt(baseEUt).duration(baseDuration) + .circuitMeta(1) + .fluidInputs(Water.getFluid(64000)) + .inputs(new ItemStack(input, 8)) + .outputs(new ItemStack(output, 32 / outputDivisor)) + .outputs(new ItemStack(input, 16)) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(baseEUt * 4).duration(baseDuration / 2) + .circuitMeta(2) + .fluidInputs(Water.getFluid(128000)) + .fluidInputs(CarbonDioxide.getFluid(16000)) + .inputs(new ItemStack(input, 8)) + .outputs(new ItemStack(output, 64 / outputDivisor)) + .outputs(new ItemStack(input, 32)) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(baseEUt * 16).duration(baseDuration / 4) + .circuitMeta(3) + .fluidInputs(Water.getFluid(256000)) + .fluidInputs(CarbonDioxide.getFluid(32000)) + .inputs(new ItemStack(input, 8)) + .inputs(FERTILIZER.getStackForm(64)) + .outputs(new ItemStack(output, 128 / outputDivisor)) + .outputs(new ItemStack(input, 64)) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(baseEUt * 16).duration(baseDuration / 4) + .circuitMeta(3) + .fluidInputs(Water.getFluid(256000)) + .fluidInputs(CarbonDioxide.getFluid(32000)) + .inputs(new ItemStack(input, 8)) + .input(dust, OrganicFertilizer, 64) + .outputs(new ItemStack(output, 128 / outputDivisor)) + .outputs(new ItemStack(input, 64)) + .buildAndRegister(); + } + else { + GREENHOUSE_RECIPES.recipeBuilder().EUt(baseEUt).duration(baseDuration) + .circuitMeta(1) + .fluidInputs(Water.getFluid(64000)) + .inputs(new ItemStack(input, 8)) + .outputs(new ItemStack(output, 32 / outputDivisor)) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(baseEUt * 4).duration(baseDuration / 2) + .circuitMeta(2) + .fluidInputs(Water.getFluid(128000)) + .fluidInputs(CarbonDioxide.getFluid(16000)) + .inputs(new ItemStack(input, 8)) + .outputs(new ItemStack(output, 64 / outputDivisor)) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(baseEUt * 16).duration(baseDuration / 4) + .circuitMeta(3) + .fluidInputs(Water.getFluid(256000)) + .fluidInputs(CarbonDioxide.getFluid(32000)) + .inputs(new ItemStack(input, 8)) + .inputs(FERTILIZER.getStackForm(64)) + .outputs(new ItemStack(output, 128 / outputDivisor)) + .buildAndRegister(); + + GREENHOUSE_RECIPES.recipeBuilder().EUt(baseEUt * 16).duration(baseDuration / 4) + .circuitMeta(3) + .fluidInputs(Water.getFluid(256000)) + .fluidInputs(CarbonDioxide.getFluid(32000)) + .inputs(new ItemStack(input, 8)) + .input(dust, OrganicFertilizer, 64) + .outputs(new ItemStack(output, 128 / outputDivisor)) + .buildAndRegister(); + } } } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/LaserMinerRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/LaserMinerRecipes.java new file mode 100644 index 00000000..554e5167 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/LaserMinerRecipes.java @@ -0,0 +1,4 @@ +package com.fulltrix.gcyl.recipes.categories; + +public class LaserMinerRecipes { +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/MiscRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/MiscRecipes.java index c95d1e48..7501cb4f 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/MiscRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/MiscRecipes.java @@ -1,73 +1,45 @@ package com.fulltrix.gcyl.recipes.categories; +import gregicality.multiblocks.api.fluids.GCYMFluidStorageKeys; import gregtech.api.GTValues; +import gregtech.api.fluids.store.FluidStorageKeys; +import gregtech.api.metatileentity.multiblock.CleanroomType; import gregtech.api.recipes.ModHandler; import gregtech.api.recipes.chance.output.ChancedOutputLogic; +import gregtech.api.recipes.ingredients.IntCircuitIngredient; import gregtech.api.unification.material.MarkerMaterials; import gregtech.api.unification.stack.UnificationEntry; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import static com.fulltrix.gcyl.api.GCYLUtility.getAssLineResearchBuilder; +import static com.fulltrix.gcyl.api.GCYLUtility.getPolymerByTier; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.machines.GCYLTileEntities.DEEP_MINER; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.materials.GCYLNuclearMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.ADVANCED_MIXER_RECIPES; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.DECAY_CHAMBERS_RECIPES; -import static gregicality.multiblocks.api.unification.GCYMMaterials.Stellite100; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.DECAY_CHAMBERS_RECIPES; +import static gregicality.multiblocks.api.recipes.GCYMRecipeMaps.ALLOY_BLAST_RECIPES; +import static supercritical.api.unification.material.SCMaterials.Plutonium244; import static gregtech.api.GTValues.*; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.material.Materials.Bismuth; +import static gregtech.api.unification.material.Materials.Plutonium; import static gregtech.api.unification.ore.OrePrefix.*; import static gregtech.common.items.MetaItems.*; -import static gregtech.common.items.MetaItems.COVER_ENDER_FLUID_LINK; -import static gregtech.common.metatileentities.MetaTileEntities.HULL; +import static gregtech.common.metatileentities.MetaTileEntities.*; import static gregtech.loaders.recipe.MetaTileEntityLoader.registerMachineRecipe; import static kono.ceu.materialreplication.api.unification.materials.MRMaterials.NeutralMatter; public class MiscRecipes { public static void init() { initSolars(); - +highTierVoltageCoils(); //TODO: FINISH NUCLEAR AND REMOVE temporaryNuclearRecipes(); - // Quantum Dust - ADVANCED_MIXER_RECIPES.recipeBuilder().duration(10500).EUt(30) - .input(dust, Stellite100, 15) - .input(dust, Jasper, 5) - .input(dust, Gallium, 5) - .input(dust, Americium241, 5) - .input(dust, Palladium, 5) - .input(dust, Bismuth, 5) - .input(dust, Germanium, 5) - .input(dust,SiliconCarbide,5) - .output(dust, Quantum, 50) - .buildAndRegister(); - - //Bright steel - MIXER_RECIPES.recipeBuilder().duration(400).EUt(1920) - .input(dust, Steel, 4) - .input(dust, Bismuth, 2) - .input(dust, Caesium, 2) - .input(dust, Europium,1) - .output(dust, BrightSteel, 9) - .circuitMeta(9) - .buildAndRegister(); - - //Inconel 625 dust - MIXER_RECIPES.recipeBuilder().duration(860).EUt(480) - .input(dust, Nickel, 3) - .input(dust, Chrome, 7) - .input(dust, Molybdenum, 10) - .input(dust, Invar, 10) - .input(dust, Nichrome, 13) - .circuitMeta(5) - .output(dust, Inconel625, 43) - .buildAndRegister(); - //eglin steel dust and base dust MIXER_RECIPES.recipeBuilder().duration(20 * 10).EUt(120) .input(dust, Iron, 4) @@ -77,14 +49,6 @@ public static void init() { .output(dust, EglinSteelBase, 10) .buildAndRegister(); - MIXER_RECIPES.recipeBuilder().duration(13 * 20).EUt(120) - .input(dust, EglinSteelBase, 10) - .input(dust, Sulfur) - .input(dust, Silicon) - .input(dust, Carbon) - .output(dust, EglinSteel, 13) - .circuitMeta(5) - .buildAndRegister(); //Babbitt alloy MIXER_RECIPES.recipeBuilder().duration(50 * 20).EUt(GTValues.VA[ZPM]) @@ -105,6 +69,7 @@ public static void init() { .input(ELECTRIC_PISTON_HV) .fluidInputs(Polyethylene.getFluid(L * 2)) .output(COVER_ENDER_ITEM_LINK) + .circuitMeta(1) .EUt(VA[HV]).duration(320) .buildAndRegister(); @@ -112,18 +77,107 @@ public static void init() { ROCK_BREAKER_RECIPES.recipeBuilder() .notConsumable(new ItemStack(Blocks.NETHERRACK)) .duration(16) - .EUt(240) - .dimension(-1) + .EUt(960) .outputs(new ItemStack(Blocks.NETHERRACK)) .buildAndRegister(); ROCK_BREAKER_RECIPES.recipeBuilder() .notConsumable(new ItemStack(Blocks.END_STONE)) .duration(16) - .EUt(960) + .EUt(3840) .dimension(1) .outputs(new ItemStack(Blocks.END_STONE)) .buildAndRegister(); + + //liquid nitrogen + VACUUM_RECIPES.recipeBuilder().EUt(1920).duration(200) + .fluidInputs(Nitrogen.getFluid(1000)) + .fluidOutputs(Nitrogen.getFluid(FluidStorageKeys.LIQUID, 1000)) + .buildAndRegister(); + + //liquid helium-3 + VACUUM_RECIPES.recipeBuilder().EUt(30720).duration(200) + .fluidInputs(Helium3.getFluid(1000)) + .fluidOutputs(Helium3.getFluid(FluidStorageKeys.LIQUID, 1000)) + .buildAndRegister(); + + //carbon fibers from gcyl polymers + AUTOCLAVE_RECIPES.recipeBuilder().EUt(GTValues.VA[IV]).duration(37) + .fluidInputs(Polyetheretherketone.getFluid(9)) + .input(dust, Carbon, 8) + .outputs(CARBON_FIBERS.getStackForm(32)) + .buildAndRegister(); + + AUTOCLAVE_RECIPES.recipeBuilder().EUt(GTValues.VA[LuV]).duration(37) + .fluidInputs(Zylon.getFluid(9)) + .input(dust, Carbon, 8) + .outputs(CARBON_FIBERS.getStackForm(64)) + .buildAndRegister(); + + AUTOCLAVE_RECIPES.recipeBuilder().EUt(GTValues.VA[ZPM]).duration(37) + .fluidInputs(FullerenePolymerMatrix.getFluid(9)) + .input(dust, Carbon, 4) + .outputs(CARBON_FIBERS.getStackForm(64)) + .buildAndRegister(); + + //WIRELESS BATTERY + ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.UV]).duration(1200) + .outputs(WIRELESS_BATTERY_UV.getStackForm()) + .inputs(ENERGY_CLUSTER.getStackForm()) + .input(circuit, MarkerMaterials.Tier.UV, 16) + .inputs(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(64)) + .inputs(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(64)) + .inputs(SENSOR_UV.getStackForm(6)) + .inputs(FIELD_GENERATOR_UV.getStackForm(3)) + .input(wireGtDouble, UVSuperconductor, 64) + .input(wireGtDouble, UVSuperconductor, 64) + .fluidInputs(Indalloy140.getFluid( L * 32)) + .fluidInputs(getPolymerByTier(UV).getFluid(L * 32)) + .fluidInputs(Seaborgium.getFluid( L * 32)) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .buildAndRegister(); + + //magnetic fluids + POLARIZER_RECIPES.recipeBuilder().EUt(256).duration(144) + .fluidInputs(Neodymium.getFluid(144)) + .fluidOutputs(NeodymiumMagnetic.getFluid(144)) + .buildAndRegister(); + + POLARIZER_RECIPES.recipeBuilder().EUt(4096).duration(150) + .fluidInputs(Samarium.getFluid(144)) + .fluidOutputs(SamariumMagnetic.getFluid(144)) + .buildAndRegister(); + + // Ductile A356 + ALLOY_BLAST_RECIPES.recipeBuilder().EUt(VA[ZPM]).duration(300) + .fluidInputs(Argon.getFluid(1000)) + .circuitMeta(5) + .input(dust, Aluminium, 33) + .input(dust, Silicon, 2) + .input(dust, Magnesium) + .input(dust, Iron) + .input(dust, Europium) + .blastFurnaceTemp(2300) + .fluidOutputs(DuctileA356.getFluid(GCYMFluidStorageKeys.MOLTEN,L * 38)) + .buildAndRegister(); + + VACUUM_RECIPES.recipeBuilder().EUt(VA[LuV]).duration(150) + .fluidInputs(DuctileA356.getFluid(GCYMFluidStorageKeys.MOLTEN, 144)) + .fluidOutputs(DuctileA356.getFluid(144)) + .buildAndRegister(); + + //sodium hydroxide loop + /* + CHEMICAL_RECIPES.recipeBuilder().EUt(8).duration(100) + .circuitMeta(1) + .fluidInputs(Water.getFluid(1000)) + .input(dust, Sodium) + .output(dust, SodiumHydroxide,3) + .fluidOutputs(Hydrogen.getFluid(1000)) + .buildAndRegister(); + + */ + } public static void initSolars() { @@ -212,14 +266,14 @@ public static void temporaryNuclearRecipes() { //alpha decay //beta decay - DECAY_CHAMBERS_RECIPES.recipeBuilder().EUt(7680).duration(300) + DECAY_CHAMBERS_RECIPES.recipeBuilder().EUt(1920).duration(300) .input(dust, Bismuth210, 1) .chancedOutputLogic(ChancedOutputLogic.XOR) .chancedOutput(dust, Polonium, 5000, 0) .chancedOutput(dust, Bismuth, 10000, 0) .buildAndRegister(); - DECAY_CHAMBERS_RECIPES.recipeBuilder().EUt(7680).duration(300) + DECAY_CHAMBERS_RECIPES.recipeBuilder().EUt(1920).duration(300) .input(dust, Uranium238, 1) .fluidInputs(NeutralMatter.getFluid(200)) .chancedOutputLogic(ChancedOutputLogic.XOR) @@ -236,7 +290,7 @@ public static void temporaryNuclearRecipes() { .buildAndRegister(); //isotopes - DECAY_CHAMBERS_RECIPES.recipeBuilder().EUt(7680).duration(300) + DECAY_CHAMBERS_RECIPES.recipeBuilder().EUt(1920).duration(300) .input(dust, Bismuth, 1) .fluidInputs(NeutralMatter.getFluid(100)) .chancedOutputLogic(ChancedOutputLogic.XOR) @@ -264,6 +318,106 @@ public static void temporaryNuclearRecipes() { .chancedOutput(dust, Plutonium244, 2000, 300) .chancedOutput(dustTiny, Uranium238, 3000, 450) .buildAndRegister(); + + + //NUCLEAR STAR + AUTOCLAVE_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.UIV]).duration(600) + .inputs(UNSTABLE_STAR.getStackForm(16)) + .fluidInputs(HeavyQuarkDegenerateMatter.getFluid(L * 8)) + .outputs(NUCLEAR_STAR.getStackForm()) + .buildAndRegister(); + + //liquid deep overworld and nether gas + VACUUM_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.EV]).duration(400) + .fluidInputs(DeepOverworldGas.getFluid(4000)) + .fluidOutputs(DeepOverworldGas.getFluid(FluidStorageKeys.LIQUID, 4000)) + .buildAndRegister(); + + VACUUM_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.IV]).duration(400) + .fluidInputs(DeepNetherGas.getFluid(4000)) + .fluidOutputs(DeepNetherGas.getFluid(FluidStorageKeys.LIQUID, 4000)) + .buildAndRegister(); + + //distillation of deep gases + DISTILLATION_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.EV]).duration(2000) + .fluidInputs(DeepOverworldGas.getFluid(FluidStorageKeys.LIQUID, 128000)) + .fluidOutputs(SaltWater.getFluid(64000)) + .fluidOutputs(Chlorine.getFluid(32000)) + .fluidOutputs(Fluorine.getFluid(32000)) + .buildAndRegister(); + + DISTILLATION_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.IV]).duration(2000) + .fluidInputs(DeepNetherGas.getFluid(FluidStorageKeys.LIQUID, 256000)) + .fluidOutputs(Oil.getFluid(128000)) + .fluidOutputs(IodizedOil.getFluid(64000)) + .fluidOutputs(CharcoalByproducts.getFluid(32000)) + .fluidOutputs(Toluene.getFluid(16000)) + .fluidOutputs(Octane.getFluid(16000)) + .buildAndRegister(); + + // Silicon Carbide + BLAST_RECIPES.recipeBuilder().EUt(120).duration(3000).blastFurnaceTemp(2500) + .input(dust, Silicon) + .input(dust, Carbon) + .notConsumable(new IntCircuitIngredient(2)) + .notConsumable(Argon.getFluid(1)) + .output(dust, SiliconCarbide, 2) + .buildAndRegister(); + + // Snow Dust + MACERATOR_RECIPES.recipeBuilder().EUt(2).duration(60) + .inputs(new ItemStack(Blocks.SNOW)) + .output(dust, Snow, 4) + .buildAndRegister(); + + MACERATOR_RECIPES.recipeBuilder().EUt(2).duration(15) + .inputs(new ItemStack(Items.SNOWBALL)) + .output(dust, Snow) + .buildAndRegister(); } + private static void highTierVoltageCoils() { + ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(VA[UHV]) + .circuitMeta(1) + .input(stick, SamariumMagnetic) + .input(wireFine, Seaborgium, 16) + .outputs(VOLTAGE_COIL_UHV.getStackForm()) + .buildAndRegister(); + + ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(VA[UEV]) + .circuitMeta(1) + .input(stick, SamariumMagnetic) + .input(wireFine, Bohrium, 16) + .outputs(VOLTAGE_COIL_UEV.getStackForm()) + .buildAndRegister(); + + ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(VA[UIV]) + .circuitMeta(1) + .input(stick, SamariumMagnetic) + .input(wireFine, MetastableHassium, 16) + .outputs(VOLTAGE_COIL_UIV.getStackForm()) + .buildAndRegister(); + + ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(VA[UXV]) + .circuitMeta(1) + .input(stick, SamariumMagnetic) + .input(wireFine, HeavyQuarkDegenerateMatter, 16) + .outputs(VOLTAGE_COIL_UXV.getStackForm()) + .buildAndRegister(); + + ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(VA[OpV]) + .circuitMeta(1) + .input(stick, NaquadriaticTaranium) + .input(wireFine, Neutronium, 16) + .outputs(VOLTAGE_COIL_OpV.getStackForm()) + .buildAndRegister(); + + ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(VA[MAX]) + .circuitMeta(1) + .input(stick, NaquadriaticTaranium) + .input(wireFine, CosmicNeutronium, 16) + .outputs(VOLTAGE_COIL_MAX.getStackForm()) + .buildAndRegister(); + + } } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/RecipeOverride.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/RecipeOverride.java index d327d0bc..43f71cae 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/RecipeOverride.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/RecipeOverride.java @@ -1,18 +1,26 @@ package com.fulltrix.gcyl.recipes.categories; +import com.google.common.collect.ImmutableMap; import gregicality.multiblocks.common.block.GCYMMetaBlocks; import gregicality.multiblocks.common.block.blocks.BlockLargeMultiblockCasing; import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; import gregtech.api.GTValues; -import gregtech.api.fluids.store.FluidStorageKeys; import gregtech.api.items.armor.ArmorMetaItem; import gregtech.api.metatileentity.multiblock.CleanroomType; +import gregtech.api.recipes.GTRecipeHandler; import gregtech.api.recipes.ModHandler; import gregtech.api.recipes.ingredients.nbtmatch.NBTCondition; import gregtech.api.recipes.ingredients.nbtmatch.NBTMatcher; import gregtech.api.unification.OreDictUnifier; import gregtech.api.unification.material.MarkerMaterials; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.Materials; +import gregtech.api.unification.material.properties.PropertyKey; +import gregtech.api.unification.material.properties.WireProperties; +import gregtech.api.unification.ore.OrePrefix; +import gregtech.api.unification.stack.MaterialStack; import gregtech.api.unification.stack.UnificationEntry; +import gregtech.api.util.GTUtility; import gregtech.common.ConfigHolder; import gregtech.common.blocks.*; import gregtech.common.items.MetaItems; @@ -21,10 +29,17 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import static com.fulltrix.gcyl.materials.GCYLMaterials.*; +import java.util.Map; + +import static com.fulltrix.gcyl.api.GCYLUtility.getAssLineResearchBuilder; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; +import static com.fulltrix.gcyl.machines.GCYLTileEntities.CRYOGENIC_FREEZER; +import static com.fulltrix.gcyl.machines.GCYLTileEntities.VOLCANUS; +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static gregicality.multiblocks.api.recipes.GCYMRecipeMaps.ALLOY_BLAST_RECIPES; -import static gregicality.multiblocks.api.unification.GCYMMaterials.Stellite100; +import static gregicality.multiblocks.api.unification.GCYMMaterials.*; +import static gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities.MEGA_BLAST_FURNACE; +import static gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities.MEGA_VACUUM_FREEZER; import static gregtech.api.GTValues.*; import static gregtech.api.recipes.GTRecipeHandler.removeRecipesByInputs; import static gregtech.api.recipes.ModHandler.removeRecipeByName; @@ -38,15 +53,25 @@ import static gregtech.common.blocks.BlockFusionCasing.CasingType.SUPERCONDUCTOR_COIL; import static gregtech.common.blocks.BlockMetalCasing.MetalCasingType.ALUMINIUM_FROSTPROOF; import static gregtech.common.blocks.MetaBlocks.*; -import static gregtech.common.items.MetaItems.*; -import static gregtech.common.items.MetaItems.ENERGY_CLUSTER; -import static gregtech.common.items.MetaItems.ENERGY_MODULE; import static gregtech.common.items.MetaItems.GRAVITATION_ENGINE; +import static gregtech.common.items.MetaItems.*; import static gregtech.common.metatileentities.MetaTileEntities.*; import static gregtech.integration.crafttweaker.recipe.CTRecipeUtils.removeAll; -import static gregtech.loaders.recipe.CraftingComponent.CASING; public class RecipeOverride { + + private static final Map INSULATION_AMOUNT = ImmutableMap.of( + cableGtSingle, 1, + cableGtDouble, 1, + cableGtQuadruple, 2, + cableGtOctal, 3, + cableGtHex, 5); + + private static final MaterialStack[] cableFluids = { + new MaterialStack(StyreneButadieneRubber, 36), + new MaterialStack(SiliconeRubber, 72) + }; + public static void init() { /* @@ -59,19 +84,27 @@ public static void init() { recipeRemoval(); chemistryOverride(); gregtechOverride(); + waferRecipeFixes(); } private static void recipeRemoval() { + // Cables + wireGtSingle.addProcessingHandler(PropertyKey.WIRE, RecipeOverride::cablesInit); + wireGtDouble.addProcessingHandler(PropertyKey.WIRE, RecipeOverride::cablesInit); + wireGtHex.addProcessingHandler(PropertyKey.WIRE, RecipeOverride::cablesInit); + wireGtOctal.addProcessingHandler(PropertyKey.WIRE, RecipeOverride::cablesInit); + wireGtQuadruple.addProcessingHandler(PropertyKey.WIRE, RecipeOverride::cablesInit); + //removeRecipesByInputs(FLUID_SOLIDFICATION_RECIPES, new ItemStack[]{MetaItems.SHAPE_MOLD_CYLINDER.getStackForm()}, new FluidStack[]{Polytetrafluoroethylene.getFluid(36)}); //remove all circuit assembler recipes - removeAll(CIRCUIT_ASSEMBLER_RECIPES); + GTRecipeHandler.removeAllRecipes(CIRCUIT_ASSEMBLER_RECIPES); //remove all assembly line recipes - removeAll(ASSEMBLY_LINE_RECIPES); - removeAll(SCANNER_RECIPES); - removeAll(RESEARCH_STATION_RECIPES); + GTRecipeHandler.removeAllRecipes(ASSEMBLY_LINE_RECIPES); + GTRecipeHandler.removeAllRecipes(SCANNER_RECIPES); + GTRecipeHandler.removeAllRecipes(RESEARCH_STATION_RECIPES); //conflict removal removeRecipesByInputs(DISTILLERY_RECIPES, new ItemStack[]{getIntegratedCircuit(1)}, new FluidStack[]{CoalTar.getFluid(100)}); @@ -86,9 +119,6 @@ private static void recipeRemoval() { removeRecipesByInputs(CHEMICAL_RECIPES, new ItemStack[]{OreDictUnifier.get(dust, SodiumHydroxide, 3)}, new FluidStack[]{SulfuricAcid.getFluid(1000)}); removeRecipesByInputs(LARGE_CHEMICAL_RECIPES, new ItemStack[]{OreDictUnifier.get(dust, SodiumHydroxide, 3)}, new FluidStack[]{SulfuricAcid.getFluid(1000)}); - removeRecipesByInputs(CHEMICAL_RECIPES, DinitrogenTetroxide.getFluid(1000), Dimethylhydrazine.getFluid(1000)); - removeRecipesByInputs(LARGE_CHEMICAL_RECIPES, DinitrogenTetroxide.getFluid(1000), Dimethylhydrazine.getFluid(1000)); - removeRecipesByInputs(CENTRIFUGE_RECIPES, new ItemStack[]{OreDictUnifier.get(dust,PlatinumGroupSludge,6)}, new FluidStack[]{AquaRegia.getFluid(1200)}); removeRecipesByInputs(CHEMICAL_RECIPES, new ItemStack[]{OreDictUnifier.get(dust,PhosphorusPentoxide,14)}, new FluidStack[]{Water.getFluid(6000)}); @@ -143,7 +173,6 @@ private static void recipeRemoval() { //Plat line fixes TODO: remove and replace the recipes that turn ore into platinum group sludge removeRecipesByInputs(LARGE_CHEMICAL_RECIPES, new ItemStack[]{OreDictUnifier.get(dust, RarestMetalMixture, 7)}, new FluidStack[]{HydrochloricAcid.getFluid(4000)}); - removeRecipesByInputs(CENTRIFUGE_RECIPES, OreDictUnifier.get(dust,RarestMetalMixture,5)); removeRecipesByInputs(CENTRIFUGE_RECIPES, OreDictUnifier.get(dust,PlatinumSludgeResidue,5)); removeRecipesByInputs(DISTILLATION_RECIPES, AcidicOsmiumSolution.getFluid(2000)); removeRecipesByInputs(DISTILLERY_RECIPES, new ItemStack[]{getIntegratedCircuit(1)}, new FluidStack[]{AcidicOsmiumSolution.getFluid(400)}); @@ -163,7 +192,7 @@ private static void recipeRemoval() { removeRecipesByInputs(ASSEMBLER_RECIPES, OreDictUnifier.get(wireGtQuadruple, ManganesePhosphide,4), OreDictUnifier.get(plate, Steel, 2), OreDictUnifier.get(gem, EnderPearl), OreDictUnifier.get(circuit, MarkerMaterials.Tier.LV,2)); removeRecipesByInputs(ASSEMBLER_RECIPES, OreDictUnifier.get(wireGtQuadruple, MagnesiumDiboride,4), OreDictUnifier.get(plate, Aluminium, 2), OreDictUnifier.get(gem, EnderEye), OreDictUnifier.get(circuit, MarkerMaterials.Tier.MV,2)); removeRecipesByInputs(ASSEMBLER_RECIPES, OreDictUnifier.get(wireGtQuadruple, MercuryBariumCalciumCuprate,4), OreDictUnifier.get(plate, StainlessSteel, 2), QUANTUM_EYE.getStackForm(), OreDictUnifier.get(circuit, MarkerMaterials.Tier.HV,2)); - removeRecipesByInputs(ASSEMBLER_RECIPES, OreDictUnifier.get(wireGtQuadruple, UraniumTriplatinum,4), OreDictUnifier.get(plate, Titanium, 2), OreDictUnifier.get(gem, NetherStar), OreDictUnifier.get(circuit, MarkerMaterials.Tier.EV,2)); + removeRecipesByInputs(ASSEMBLER_RECIPES, OreDictUnifier.get(wireGtQuadruple, UraniumTriplatinum,4), OreDictUnifier.get(plateDouble, Titanium, 2), OreDictUnifier.get(gem, NetherStar), OreDictUnifier.get(circuit, MarkerMaterials.Tier.EV,2)); removeRecipesByInputs(ASSEMBLER_RECIPES, OreDictUnifier.get(wireGtQuadruple, SamariumIronArsenicOxide,4), OreDictUnifier.get(plateDouble, TungstenSteel, 2), QUANTUM_STAR.getStackForm(), OreDictUnifier.get(circuit, MarkerMaterials.Tier.IV,2)); @@ -203,43 +232,6 @@ private static void recipeRemoval() { //useless gcym electric implosion compressor removeRecipeByName("gcym:electric_implosion_compressor"); - /*NOT NEEDED ANYMORE BUT KEEPING - //Fusion reactor computers - removeRecipesByInputs(ASSEMBLY_LINE_RECIPES, new ItemStack[]{FUSION_CASING.getItemVariant(SUPERCONDUCTOR_COIL), OreDictUnifier.get(circuit, MarkerMaterials.Tier.ZPM,4), - OreDictUnifier.get(plateDouble, Plutonium241), OreDictUnifier.get(plateDouble, Osmiridium), FIELD_GENERATOR_IV.getStackForm(2), ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(64), - OreDictUnifier.get(wireGtSingle, IndiumTinBariumTitaniumCuprate, 32)}, new FluidStack[]{SolderingAlloy.getFluid(L*8), NiobiumTitanium.getFluid(L*8)}); - removeRecipesByInputs(SCANNER_RECIPES, TOOL_DATA_STICK.getStackForm(), OreDictUnifier.get(wireGtSingle, IndiumTinBariumTitaniumCuprate)); - - removeRecipesByInputs(ASSEMBLY_LINE_RECIPES, new ItemStack[]{FUSION_CASING.getItemVariant(FUSION_COIL), OreDictUnifier.get(circuit, MarkerMaterials.Tier.UV,4), - OreDictUnifier.get(plateDouble, Naquadria), OreDictUnifier.get(plateDouble, Europium), FIELD_GENERATOR_LuV.getStackForm(2), ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(64), - ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(32), OreDictUnifier.get(wireGtSingle, UraniumRhodiumDinaquadide, 32)}, - new FluidStack[]{SolderingAlloy.getFluid(L*8), VanadiumGallium.getFluid(L*8)}); - removeRecipesByInputs(RESEARCH_STATION_RECIPES, TOOL_DATA_ORB.getStackForm(),FUSION_REACTOR[0].getStackForm()); - - removeRecipesByInputs(ASSEMBLY_LINE_RECIPES, new ItemStack[]{FUSION_CASING.getItemVariant(FUSION_COIL), OreDictUnifier.get(circuit, MarkerMaterials.Tier.UHV,4), - QUANTUM_STAR.getStackForm(), OreDictUnifier.get(plateDouble, Americium), FIELD_GENERATOR_ZPM.getStackForm(2), ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(64), - ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(64), OreDictUnifier.get(wireGtSingle, EnrichedNaquadahTriniumEuropiumDuranide, 32)}, - new FluidStack[]{SolderingAlloy.getFluid(L*8), YttriumBariumCuprate.getFluid(L*8)}); - removeRecipesByInputs(RESEARCH_STATION_RECIPES, TOOL_DATA_MODULE.getStackForm(),FUSION_REACTOR[1].getStackForm()); - - //luv-uv emitter - removeRecipesByInputs(ASSEMBLY_LINE_RECIPES, new ItemStack[]{OreDictUnifier.get(frameGt, HSSS), ELECTRIC_MOTOR_LuV.getStackForm(), OreDictUnifier.get(stickLong, Ruridit,4), QUANTUM_STAR.getStackForm(), - OreDictUnifier.get( circuit, MarkerMaterials.Tier.LuV, 2), OreDictUnifier.get(foil, Palladium, 64), OreDictUnifier.get(foil, Palladium, 32), OreDictUnifier.get(cableGtSingle, NiobiumTitanium, 4)}, - new FluidStack[]{SolderingAlloy.getFluid(L*2)}); - removeRecipesByInputs(SCANNER_RECIPES, TOOL_DATA_STICK.getStackForm(), EMITTER_IV.getStackForm()); - removeRecipesByInputs(ASSEMBLY_LINE_RECIPES, new ItemStack[]{OreDictUnifier.get(frameGt, NaquadahAlloy), ELECTRIC_MOTOR_ZPM.getStackForm(), OreDictUnifier.get(stickLong, Osmiridium,4), QUANTUM_STAR.getStackForm(2), - OreDictUnifier.get( circuit, MarkerMaterials.Tier.ZPM, 2), OreDictUnifier.get(foil, Trinium, 64), OreDictUnifier.get(foil, Trinium, 32), OreDictUnifier.get(cableGtSingle, VanadiumGallium, 4)}, - new FluidStack[]{SolderingAlloy.getFluid(L*4)}); - removeRecipesByInputs(RESEARCH_STATION_RECIPES, TOOL_DATA_ORB.getStackForm(), EMITTER_LuV.getStackForm()); - removeRecipesByInputs(ASSEMBLY_LINE_RECIPES, new ItemStack[]{OreDictUnifier.get(frameGt, Tritanium), ELECTRIC_MOTOR_UV.getStackForm(), OreDictUnifier.get(stickLong, Tritanium,4), GRAVI_STAR.getStackForm(), - OreDictUnifier.get( circuit, MarkerMaterials.Tier.UV, 2), OreDictUnifier.get(foil, Naquadria, 64), OreDictUnifier.get(foil, Naquadria, 32), OreDictUnifier.get(cableGtSingle, YttriumBariumCuprate, 4)}, - new FluidStack[]{SolderingAlloy.getFluid(L*8), Naquadria.getFluid(L*4)}); - removeRecipesByInputs(RESEARCH_STATION_RECIPES, TOOL_DATA_MODULE.getStackForm(), EMITTER_ZPM.getStackForm()); - - */ - - - //gravi star removeRecipesByInputs(AUTOCLAVE_RECIPES, new ItemStack[]{QUANTUM_STAR.getStackForm()}, new FluidStack[]{Neutronium.getFluid(288)}); @@ -255,12 +247,13 @@ private static void recipeRemoval() { //iv motor removeRecipeByName("gregtech:electric_motor_iv"); + removeRecipesByInputs(ASSEMBLER_RECIPES, OreDictUnifier.get(cableGtDouble, Tungsten,2), OreDictUnifier.get(stick, TungstenSteel, 2), OreDictUnifier.get(stick, NeodymiumMagnetic), OreDictUnifier.get(wireGtDouble, Graphene, 4)); //neutronium removeRecipesByInputs(FUSION_RECIPES,Americium.getFluid(128),Naquadria.getFluid(128)); //sterilized growth medium - removeRecipesByInputs(FLUID_HEATER_RECIPES, RawGrowthMedium.getFluid(100)); + removeRecipesByInputs(FLUID_HEATER_RECIPES, new ItemStack[]{getIntegratedCircuit(1)}, new FluidStack[]{RawGrowthMedium.getFluid(100)}); //raw growth medium removeRecipesByInputs(MIXER_RECIPES, new ItemStack[]{OreDictUnifier.get(dust, Meat, 4),OreDictUnifier.get(dust, Salt,4),OreDictUnifier.get(dust,Calcium,4),OreDictUnifier.get(dust,Agar,4)}, new FluidStack[]{Mutagen.getFluid(4000)}); //engraved crystal chip @@ -318,9 +311,9 @@ private static void recipeRemoval() { removeRecipesByInputs(ASSEMBLER_RECIPES, new ItemStack[]{OreDictUnifier.get(wireGtDouble, RutheniumTriniumAmericiumNeutronate, 4), OreDictUnifier.get(foil, NiobiumTitanium, 4)}, new FluidStack[]{Trinium.getFluid(576)}); //fusion casings - removeRecipesByInputs(ASSEMBLER_RECIPES, new ItemStack[]{MetaBlocks.MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.LuV), FUSION_CASING.getItemVariant(SUPERCONDUCTOR_COIL), NEUTRON_REFLECTOR.getStackForm(), ELECTRIC_PUMP_LuV.getStackForm(), OreDictUnifier.get(plate, TungstenSteel, 6)}, new FluidStack[]{Polybenzimidazole.getFluid(144)}); - removeRecipesByInputs(ASSEMBLER_RECIPES, new ItemStack[]{MetaBlocks.MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.ZPM), FUSION_CASING.getItemVariant(FUSION_COIL), VOLTAGE_COIL_ZPM.getStackForm(2), FIELD_GENERATOR_LuV.getStackForm(), OreDictUnifier.get(plate, Europium, 6)}, new FluidStack[]{Polybenzimidazole.getFluid(288)}); - removeRecipesByInputs(ASSEMBLER_RECIPES, new ItemStack[]{MetaBlocks.MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.UV), FUSION_CASING.getItemVariant(FUSION_COIL), VOLTAGE_COIL_UV.getStackForm(2), FIELD_GENERATOR_ZPM.getStackForm(), OreDictUnifier.get(plate, Americium, 6)}, new FluidStack[]{Polybenzimidazole.getFluid(576)}); + removeRecipesByInputs(ASSEMBLER_RECIPES, new ItemStack[]{MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.LuV), FUSION_CASING.getItemVariant(SUPERCONDUCTOR_COIL), NEUTRON_REFLECTOR.getStackForm(), ELECTRIC_PUMP_LuV.getStackForm(), OreDictUnifier.get(plate, TungstenSteel, 6)}, new FluidStack[]{Polybenzimidazole.getFluid(144)}); + removeRecipesByInputs(ASSEMBLER_RECIPES, new ItemStack[]{MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.ZPM), FUSION_CASING.getItemVariant(FUSION_COIL), VOLTAGE_COIL_ZPM.getStackForm(2), FIELD_GENERATOR_LuV.getStackForm(), OreDictUnifier.get(plate, Europium, 6)}, new FluidStack[]{Polybenzimidazole.getFluid(288)}); + removeRecipesByInputs(ASSEMBLER_RECIPES, new ItemStack[]{MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.UV), FUSION_CASING.getItemVariant(FUSION_COIL), VOLTAGE_COIL_UV.getStackForm(2), FIELD_GENERATOR_ZPM.getStackForm(), OreDictUnifier.get(plate, Americium, 6)}, new FluidStack[]{Polybenzimidazole.getFluid(576)}); //lv solar removeRecipeByName("gregtech:solar_panel_lv"); @@ -328,11 +321,6 @@ private static void recipeRemoval() { //yttrium barium cuprate dust removeRecipesByInputs(MIXER_RECIPES, new ItemStack[]{getIntegratedCircuit(2), OreDictUnifier.get(dust, Yttrium), OreDictUnifier.get(dust, Barium, 2), OreDictUnifier.get(dust, Copper,3)}, new FluidStack[]{Oxygen.getFluid(7000)}); - //cobalt in arc furnace - removeRecipesByInputs(ARC_FURNACE_RECIPES, new ItemStack[]{OreDictUnifier.get(dust, Cobalt)}, new FluidStack[]{Oxygen.getFluid(59)}); - //antimony in arc furnace - removeRecipesByInputs(ARC_FURNACE_RECIPES, new ItemStack[]{OreDictUnifier.get(dust, Antimony)}, new FluidStack[]{Oxygen.getFluid(121)}); - //naquadah removeRecipesByInputs(BLAST_RECIPES, new ItemStack[]{OreDictUnifier.get(dust,NaquadriaSulfate, 6)}, new FluidStack[]{Hydrogen.getFluid(2000)}); removeRecipesByInputs(BLAST_RECIPES, new ItemStack[]{OreDictUnifier.get(dust,EnrichedNaquadahSulfate, 6)}, new FluidStack[]{Hydrogen.getFluid(2000)}); @@ -358,9 +346,50 @@ private static void recipeRemoval() { //gcym circuit assembler removeRecipeByName("gcym:large_circuit_assembler"); + //osmium dust + removeRecipesByInputs(CHEMICAL_RECIPES, new ItemStack[]{OreDictUnifier.get(dust, OsmiumTetroxide, 5)}, new FluidStack[]{Hydrogen.getFluid(8000)}); + removeRecipesByInputs(LARGE_CHEMICAL_RECIPES, new ItemStack[]{OreDictUnifier.get(dust, OsmiumTetroxide, 5)}, new FluidStack[]{Hydrogen.getFluid(8000)}); + + //distillation tower + removeRecipeByName("gregtech:distillation_tower"); + + //QCD matter plate + removeRecipesByInputs(FLUID_SOLIDFICATION_RECIPES, new ItemStack[]{SHAPE_MOLD_PLATE.getStackForm()}, new FluidStack[]{QCDMatter.getFluid(144)}); + + //Advanced computer casing + removeRecipesByInputs(ASSEMBLER_RECIPES, COMPUTER_CASING.getItemVariant(BlockComputerCasing.CasingType.COMPUTER_CASING), OreDictUnifier.get(circuit, MarkerMaterials.Tier.ZPM), OreDictUnifier.get(wireFine, Cobalt, 64), OreDictUnifier.get(wireFine, Electrum, 64), OreDictUnifier.get(wireGtSingle, IndiumTinBariumTitaniumCuprate, 4)); + + //computer heat vent + removeRecipesByInputs(ASSEMBLER_RECIPES, OreDictUnifier.get(frameGt, StainlessSteel), ELECTRIC_MOTOR_IV.getStackForm(2), OreDictUnifier.get(rotor, StainlessSteel, 2), OreDictUnifier.get(pipeTinyFluid, StainlessSteel, 16), OreDictUnifier.get(plate, Copper, 16), OreDictUnifier.get(wireGtSingle, SamariumIronArsenicOxide)); + + //active transformer + removeRecipesByInputs(ASSEMBLER_RECIPES, new ItemStack[]{POWER_TRANSFORMER[LuV].getStackForm(), OreDictUnifier.get(circuit, MarkerMaterials.Tier.LuV, 2),OreDictUnifier.get(wireGtSingle, IndiumTinBariumTitaniumCuprate, 8), ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(2)}, new FluidStack[]{PCBCoolant.getFluid(1000)}); + + //bulk blast chiller + removeRecipeByName("gcym:mega_vacuum_freezer"); + + //rotary hearth furnace + removeRecipeByName("gcym:mega_blast_furnace"); + + //epichlorohydrin + removeRecipesByInputs(CHEMICAL_RECIPES, Glycerol.getFluid(1000), HydrochloricAcid.getFluid(1000)); + removeRecipesByInputs(LARGE_CHEMICAL_RECIPES, Glycerol.getFluid(1000), HydrochloricAcid.getFluid(1000)); + //large scale assembler casing removeRecipeByName("gcym:casing_large_assembler"); - removeRecipesByInputs(ASSEMBLER_RECIPES,getIntegratedCircuit(6) ,OreDictUnifier.get(plate, Stellite100,6), OreDictUnifier.get(frameGt, Tungsten)); + + removeRecipesByInputs(ASSEMBLER_RECIPES, OreDictUnifier.get(plate, Stellite100,6), OreDictUnifier.get(frameGt, Tungsten, 1), getIntegratedCircuit(6)); + + //assembly line + removeRecipeByName("gregtech:assembly_line"); + + //air centrifuge + removeRecipesByInputs(CENTRIFUGE_RECIPES, Air.getFluid(10000)); + + //tungstic acid + removeRecipesByInputs(ELECTROLYZER_RECIPES, OreDictUnifier.get(dust, TungsticAcid, 7)); + + } public static void chemistryOverride() { @@ -436,6 +465,23 @@ public static void chemistryOverride() { .output(dust, Redstone) .output(dust, PreciousMetal) .buildAndRegister(); + + CHEMICAL_RECIPES.recipeBuilder() + .circuitMeta(1) + .fluidInputs(Glycerol.getFluid(1000)) + .fluidInputs(HydrochloricAcid.getFluid(1000)) + .fluidOutputs(Water.getFluid(2000)) + .fluidOutputs(Epichlorohydrin.getFluid(1000)) + .duration(480).EUt(VA[LV]).buildAndRegister(); + + //AIR + CENTRIFUGE_RECIPES.recipeBuilder().EUt(7).duration(1600) + .circuitMeta(0) + .fluidInputs(Air.getFluid(10000)) + .fluidOutputs(Nitrogen.getFluid(3900)) + .fluidOutputs(Oxygen.getFluid(1000)) + .buildAndRegister(); + } public static void gregtechOverride() { @@ -679,7 +725,7 @@ public static void gregtechOverride() { .buildAndRegister(); //advanced quarktech - ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(1000).EUt(GTValues.VA[GTValues.LuV]) + ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(1000).EUt(VA[LuV]) .inputNBT(((ArmorMetaItem) QUANTUM_CHESTPLATE.getStackForm().getItem()) .getItem(QUANTUM_CHESTPLATE.getStackForm()), NBTMatcher.ANY, NBTCondition.ANY) .inputs(HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(2)) @@ -887,7 +933,7 @@ public static void gregtechOverride() { .EUt(VA[IV])) .duration(1200).EUt(100000).buildAndRegister(); - //energy output hatches luv-uhv + //energy output hatches luv-uv ASSEMBLY_LINE_RECIPES.recipeBuilder() .input(HULL[LuV]) .input(spring, NiobiumTitanium, 4) @@ -918,8 +964,8 @@ public static void gregtechOverride() { ASSEMBLY_LINE_RECIPES.recipeBuilder() .input(HULL[UV]) - .input(spring, YttriumBariumCuprate, 4) - .input(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT, 2) + .input(spring, Duranium, 4) + .input(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT, 4) .input(circuit, MarkerMaterials.Tier.UV) .input(VOLTAGE_COIL_UV, 2) .fluidInputs(SodiumPotassium.getFluid(10000)) @@ -931,22 +977,7 @@ public static void gregtechOverride() { .EUt(VA[ZPM])) .duration(800).EUt(VA[UV]).buildAndRegister(); - ASSEMBLY_LINE_RECIPES.recipeBuilder() - .input(HULL[UHV]) - .input(spring, Europium, 4) - .input(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT, 2) - .input(circuit, MarkerMaterials.Tier.UHV) - .input(wireGtDouble, UHVSuperconductor, 2) - .fluidInputs(SodiumPotassium.getFluid(12000)) - .fluidInputs(SolderingAlloy.getFluid(5760)) - .output(ENERGY_OUTPUT_HATCH[UHV]) - .stationResearch(b -> b - .researchStack(ENERGY_OUTPUT_HATCH[UV].getStackForm()) - .CWUt(128) - .EUt(VA[UV])) - .duration(1000).EUt(VA[UHV]).buildAndRegister(); - - //energy input hatches luv-uhv + //energy input hatches luv-uv ASSEMBLY_LINE_RECIPES.recipeBuilder() .input(HULL[LuV]) .input(cableGtSingle, NiobiumTitanium, 4) @@ -977,8 +1008,8 @@ public static void gregtechOverride() { ASSEMBLY_LINE_RECIPES.recipeBuilder() .input(HULL[UV]) - .input(cableGtSingle, YttriumBariumCuprate, 4) - .input(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT, 2) + .input(cableGtSingle, Duranium, 4) + .input(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT, 4) .input(circuit, MarkerMaterials.Tier.UV) .input(VOLTAGE_COIL_UV, 2) .fluidInputs(SodiumPotassium.getFluid(10000)) @@ -990,20 +1021,6 @@ public static void gregtechOverride() { .EUt(VA[ZPM])) .duration(800).EUt(VA[UV]).buildAndRegister(); - ASSEMBLY_LINE_RECIPES.recipeBuilder() - .input(HULL[UHV]) - .input(cableGtSingle, Europium, 4) - .input(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT, 2) - .input(circuit, MarkerMaterials.Tier.UHV) - .input(wireGtDouble, UHVSuperconductor, 2) - .fluidInputs(SodiumPotassium.getFluid(12000)) - .fluidInputs(SolderingAlloy.getFluid(5760)) - .output(ENERGY_INPUT_HATCH[UHV]) - .stationResearch(b -> b - .researchStack(ENERGY_INPUT_HATCH[UV].getStackForm()) - .CWUt(128) - .EUt(VA[UV])) - .duration(1000).EUt(VA[UHV]).buildAndRegister(); //indalloy_140 ALLOY_BLAST_RECIPES.recipeBuilder().duration(12000).EUt(7680).blastFurnaceTemp(9000) @@ -1098,10 +1115,10 @@ public static void gregtechOverride() { .duration(400).EUt(157286400).buildAndRegister(); //Vacuum freezer - ModHandler.addShapedRecipe("gcyl_vacuum_freezer", MetaTileEntities.VACUUM_FREEZER.getStackForm(), + ModHandler.addShapedRecipe("gcyl_vacuum_freezer", VACUUM_FREEZER.getStackForm(), "PPP", "CMC", "WCW", - 'M', MetaBlocks.METAL_CASING.getItemVariant(ALUMINIUM_FROSTPROOF), - 'P', MetaItems.ELECTRIC_PUMP_HV, + 'M', METAL_CASING.getItemVariant(ALUMINIUM_FROSTPROOF), + 'P', ELECTRIC_PUMP_HV, 'C', new UnificationEntry(circuit, MarkerMaterials.Tier.HV), 'W', new UnificationEntry(cableGtSingle, Gold)); @@ -1109,9 +1126,16 @@ public static void gregtechOverride() { ModHandler.addShapedRecipe(true, "electric_motor_iv", ELECTRIC_MOTOR_IV.getStackForm(), "CWR", "WMW", "RWC", 'C', new UnificationEntry(cableGtDouble, Tungsten), 'W', new UnificationEntry(wireGtQuadruple, BrightSteel), 'R', new UnificationEntry(stick, TungstenSteel), 'M', new UnificationEntry(stick, NeodymiumMagnetic)); + ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(30) + .input(cableGtDouble, Tungsten, 2) + .input(stick, TungstenSteel, 2) + .input(stick, NeodymiumMagnetic) + .input(wireGtQuadruple, BrightSteel,4) + .outputs(ELECTRIC_MOTOR_IV.getStackForm()) + .buildAndRegister(); //Superconductor Coil Block //TODO change these to use liquid version of gas instead - ASSEMBLER_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.LuV]).duration(100) + ASSEMBLER_RECIPES.recipeBuilder().EUt(VA[LuV]).duration(100) .input(wireGtSingle, LuVSuperconductor, 16) .input(plate, Osmiridium, 16) .fluidInputs(Helium.getFluid( 8000)) @@ -1119,7 +1143,7 @@ public static void gregtechOverride() { .outputs(FUSION_CASING.getItemVariant(SUPERCONDUCTOR_COIL)) .buildAndRegister(); - ASSEMBLER_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.ZPM]).duration(100) + ASSEMBLER_RECIPES.recipeBuilder().EUt(VA[ZPM]).duration(100) .input(wireGtSingle, ZPMSuperconductor, 8) .input(plate, Rutherfordium, 8) .fluidInputs(Argon.getFluid(4000)) @@ -1127,7 +1151,7 @@ public static void gregtechOverride() { .outputs(FUSION_CASING.getItemVariant(SUPERCONDUCTOR_COIL)) .buildAndRegister(); - ASSEMBLER_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.UV]).duration(100) + ASSEMBLER_RECIPES.recipeBuilder().EUt(VA[UV]).duration(100) .input(wireGtSingle, UVSuperconductor, 4) .input(plate, Dubnium, 4) .fluidInputs(Krypton.getFluid(2000)) @@ -1135,7 +1159,7 @@ public static void gregtechOverride() { .outputs(FUSION_CASING.getItemVariant(SUPERCONDUCTOR_COIL)) .buildAndRegister(); - ASSEMBLER_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.UHV]).duration(100) + ASSEMBLER_RECIPES.recipeBuilder().EUt(VA[UHV]).duration(100) .input(wireGtSingle, UHVSuperconductor, 2) .input(plate, Tennessine, 2) .fluidInputs(Radon.getFluid(1000)) @@ -1143,7 +1167,7 @@ public static void gregtechOverride() { .outputs(FUSION_CASING.getItemVariant(SUPERCONDUCTOR_COIL)) .buildAndRegister(); - ASSEMBLER_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.UEV]).duration(100) + ASSEMBLER_RECIPES.recipeBuilder().EUt(VA[UEV]).duration(100) .input(wireGtSingle, UEVSuperconductor, 1) .input(plate, Bohrium, 1) .fluidInputs(Xenon.getFluid( 500)) @@ -1152,65 +1176,255 @@ public static void gregtechOverride() { .buildAndRegister(); //Fusion casings //TODO: MIGHT BE TOO EXPENSIVE, change output count to ConfigHolder.recipes.casingsPerCraft - ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.LuV]).duration(100) - .inputs(HULL[GTValues.LuV].getStackForm()) + ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(VA[LuV]).duration(100) + .inputs(HULL[LuV].getStackForm()) .inputs(FUSION_CASING.getItemVariant(SUPERCONDUCTOR_COIL)) .inputs(NEUTRON_REFLECTOR.getStackForm()) .inputs(FIELD_GENERATOR_LuV.getStackForm()) .inputs(VOLTAGE_COIL_LuV.getStackForm(2)) .input(plate, Osmiridium, 2) .fluidInputs(Polybenzimidazole.getFluid(L * 4)) - .fluidInputs(Indalloy140.getFluid(L * 2)) - .outputs(FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_CASING, 1)) + .fluidInputs(SolderingAlloy.getFluid(L * 2)) + .outputs(FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_CASING, ConfigHolder.recipes.casingsPerCraft)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); - ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.ZPM]).duration(100) - .inputs(HULL[GTValues.ZPM].getStackForm()) + ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(VA[ZPM]).duration(100) + .inputs(HULL[ZPM].getStackForm()) .inputs(FUSION_CASING.getItemVariant(FUSION_COIL)) .inputs(FIELD_GENERATOR_ZPM.getStackForm()) .inputs(VOLTAGE_COIL_ZPM.getStackForm(2)) .input(plate, Rutherfordium, 2) .fluidInputs(Polybenzimidazole.getFluid(L * 8)) - .fluidInputs(Indalloy140.getFluid(L * 4)) - .outputs(FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_CASING_MK2, 1)) + .fluidInputs(SolderingAlloy.getFluid(L * 4)) + .outputs(FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_CASING_MK2, ConfigHolder.recipes.casingsPerCraft)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); - ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.UV]).duration(100) - .inputs(HULL[GTValues.UV].getStackForm()) + ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(VA[UV]).duration(100) + .inputs(HULL[UV].getStackForm()) .inputs(FUSION_CASING.getItemVariant(FUSION_COIL)) .inputs(FIELD_GENERATOR_UV.getStackForm(2)) .inputs(VOLTAGE_COIL_UV.getStackForm(2)) .input(plate, Tritanium, 2) .fluidInputs(Polybenzimidazole.getFluid(L * 16)) .fluidInputs(Indalloy140.getFluid(L * 8)) - .outputs(FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_CASING_MK3, 1)) + .outputs(FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_CASING_MK3, ConfigHolder.recipes.casingsPerCraft)) .cleanroom(CleanroomType.CLEANROOM) .stationResearch(b->b .researchStack(FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_CASING_MK2)) - .EUt(GTValues.VA[GTValues.UV]) + .EUt(VA[UV]) .CWUt(32)) .buildAndRegister(); //large circuit assembler ModHandler.addShapedRecipe("gcyl_circuit_assembler", GCYMMetaTileEntities.LARGE_CIRCUIT_ASSEMBLER.getStackForm(), - "ARA", "CHC", "ARA", - 'A', MULTIBLOCK_CASING.getItemVariant(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_CONTROL), + "ARE", "CHC", "ARA", + 'A', GCYMMetaBlocks.LARGE_MULTIBLOCK_CASING.getItemVariant(BlockLargeMultiblockCasing.CasingType.ASSEMBLING_CASING), 'R', ROBOT_ARM_LuV, - 'C', new UnificationEntry(circuit, MarkerMaterials.Tier.LuV), - 'H', HULL[6].getStackForm()); + 'C', CONVEYOR_MODULE_LuV, + 'H', HULL[6].getStackForm(), + 'E', EMITTER_LuV); //large scale assembler casing - ASSEMBLER_RECIPES.recipeBuilder().EUt(GTValues.VA[IV]).duration(200) + ASSEMBLER_RECIPES.recipeBuilder().EUt(VA[IV]).duration(200) .circuitMeta(6) - .input(plate, Stellite100, 24) - .input(frameGt, Tungsten, 4) + .input(plate, Stellite100, 12) + .input(frameGt, Tungsten, 2) .inputs(MULTIBLOCK_CASING.getItemVariant(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_CONTROL)) - .fluidInputs(HastelloyN.getFluid(L * 16)) - .outputs(GCYMMetaBlocks.LARGE_MULTIBLOCK_CASING.getItemVariant(BlockLargeMultiblockCasing.CasingType.ASSEMBLING_CASING, 4 * ConfigHolder.recipes.casingsPerCraft)) + .fluidInputs(HastelloyN.getFluid(L * 8)) + .outputs(GCYMMetaBlocks.LARGE_MULTIBLOCK_CASING.getItemVariant(BlockLargeMultiblockCasing.CasingType.ASSEMBLING_CASING, ConfigHolder.recipes.casingsPerCraft)) + .buildAndRegister(); + + //distillation tower + ModHandler.addShapedRecipe(true, "gcyl_distillation_tower", DISTILLATION_TOWER.getStackForm(), + "CBC", "FMF", "CBC", 'M', HULL[EV].getStackForm(), 'B', + new UnificationEntry(pipeLargeFluid, StainlessSteel), 'C', + new UnificationEntry(circuit, MarkerMaterials.Tier.EV), 'F', ELECTRIC_PUMP_EV); + + //advanced computer casing + ASSEMBLER_RECIPES.recipeBuilder() + .inputs(COMPUTER_CASING.getItemVariant(BlockComputerCasing.CasingType.COMPUTER_CASING)) + .input(circuit, MarkerMaterials.Tier.ZPM) + .input(wireFine, Cobalt, 64) + .input(wireFine, Electrum, 64) + .input(wireGtSingle, LuVSuperconductor, 4) + .outputs(COMPUTER_CASING.getItemVariant(BlockComputerCasing.CasingType.ADVANCED_COMPUTER_CASING)) + .duration(200).EUt(VA[LuV]).buildAndRegister(); + + //computer heat vent + ASSEMBLER_RECIPES.recipeBuilder() + .input(frameGt, StainlessSteel) + .input(ELECTRIC_MOTOR_IV, 2) + .input(rotor, StainlessSteel, 2) + .input(pipeTinyFluid, StainlessSteel, 16) + .input(plate, Copper, 16) + .input(wireGtSingle, IVSuperconductor) + .outputs(COMPUTER_CASING.getItemVariant(BlockComputerCasing.CasingType.COMPUTER_HEAT_VENT, + ConfigHolder.recipes.casingsPerCraft)) + .duration(100).EUt(VA[EV]).buildAndRegister(); + + //active transformer + ASSEMBLER_RECIPES.recipeBuilder() + .input(POWER_TRANSFORMER[LuV]) + .input(circuit, MarkerMaterials.Tier.LuV, 2) + .input(wireGtSingle, LuVSuperconductor, 8) + .input(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT, 2) + .fluidInputs(PCBCoolant.getFluid(1000)) + .output(ACTIVE_TRANSFORMER) + .duration(300).EUt(VA[LuV]).buildAndRegister(); + + //bulk blast chiller + getAssLineResearchBuilder(UV, 2400, CRYOGENIC_FREEZER.getStackForm(), false, false) + .outputs(MEGA_VACUUM_FREEZER.getStackForm()) + .inputs(CRYOGENIC_FREEZER.getStackForm(64)) + .input(pipeSmallFluid, Zeron100, 64) + .input(foil, Rutherfordium, 64) + .input(wireFine, UVSuperconductor, 64) + .input(gearSmall, Duranium, 32) + .input(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT, 32) + .input(gear, AbyssalAlloy, 16) + .input(plateDense, IncoloyMA956, 7) + .inputs(FIELD_GENERATOR_UV.getStackForm(2)) + .input(circuit, MarkerMaterials.Tier.UHV) + .input(circuit, MarkerMaterials.Tier.UHV) + .input(circuit, MarkerMaterials.Tier.UHV) + .input(circuit, MarkerMaterials.Tier.UHV) + .fluidInputs(Indalloy140.getFluid(9216)) + .fluidInputs(Cryotheum.getFluid(32000)) + .fluidInputs(Polybenzimidazole.getFluid(9216)) + .buildAndRegister(); + + + //rotary hearth furnace + getAssLineResearchBuilder(UV, 2400, VOLCANUS.getStackForm(), false, false) + .outputs(MEGA_BLAST_FURNACE.getStackForm()) + .inputs(VOLCANUS.getStackForm(64)) + .input(wireFine, UVSuperconductor, 64) + .input(foil, Dubnium, 64) + .input(bolt, Rutherfordium, 64) + .input(gearSmall, Seaborgium, 32) + .input(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT, 32) + .input(gear, TitanSteel, 16) + .input(plateDense, HastelloyN, 7) + .inputs(FIELD_GENERATOR_UV.getStackForm(2)) + .input(circuit, MarkerMaterials.Tier.UHV) + .input(circuit, MarkerMaterials.Tier.UHV) + .input(circuit, MarkerMaterials.Tier.UHV) + .input(circuit, MarkerMaterials.Tier.UHV) + .fluidInputs(Indalloy140.getFluid(9216)) + .fluidInputs(Pyrotheum.getFluid(32000)) + .fluidInputs(Polybenzimidazole.getFluid(9216)) + .buildAndRegister(); + + //assembly line + ModHandler.addShapedRecipe(true, "assembly_line", ASSEMBLY_LINE.getStackForm(), "CRC", "SAS", + "CRC", 'A', HULL[IV].getStackForm(), 'R', ROBOT_ARM_IV, 'C', + MULTIBLOCK_CASING + .getItemVariant(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_CONTROL), + 'S', new UnificationEntry(circuit, MarkerMaterials.Tier.LuV)); + + } + + private static void waferRecipeFixes() { + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(900).EUt(VA[MV]).input(SILICON_WAFER) + .notConsumable(lens, Ruby).output(INTEGRATED_LOGIC_CIRCUIT_WAFER).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(500).EUt(VA[HV]).input(PHOSPHORUS_WAFER) + .notConsumable(lens, Ruby).output(INTEGRATED_LOGIC_CIRCUIT_WAFER, 4) + .cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(200).EUt(VA[EV]).input(NAQUADAH_WAFER) + .notConsumable(lens, Ruby).output(INTEGRATED_LOGIC_CIRCUIT_WAFER, 8) + .cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + + + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(900).EUt(VA[MV]).input(SILICON_WAFER) + .notConsumable(lens, Emerald).output(RANDOM_ACCESS_MEMORY_WAFER).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(500).EUt(VA[HV]).input(PHOSPHORUS_WAFER) + .notConsumable(lens, Emerald).output(RANDOM_ACCESS_MEMORY_WAFER, 4) + .cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(200).EUt(VA[EV]).input(NAQUADAH_WAFER) + .notConsumable(lens, Emerald).output(RANDOM_ACCESS_MEMORY_WAFER, 8) + .cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + + + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(900).EUt(VA[MV]).input(SILICON_WAFER) + .notConsumable(lens, Diamond).output(CENTRAL_PROCESSING_UNIT_WAFER).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(500).EUt(VA[HV]).input(PHOSPHORUS_WAFER) + .notConsumable(lens, Diamond).output(CENTRAL_PROCESSING_UNIT_WAFER, 4) + .cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(200).EUt(VA[EV]).input(NAQUADAH_WAFER) + .notConsumable(lens, Diamond).output(CENTRAL_PROCESSING_UNIT_WAFER, 8) + .cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + + + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(900).EUt(VA[MV]).input(SILICON_WAFER) + .notConsumable(lens, Sapphire).output(ULTRA_LOW_POWER_INTEGRATED_CIRCUIT_WAFER) .buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(500).EUt(VA[HV]).input(PHOSPHORUS_WAFER) + .notConsumable(lens, Sapphire).output(ULTRA_LOW_POWER_INTEGRATED_CIRCUIT_WAFER, 4) + .cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(200).EUt(VA[EV]).input(NAQUADAH_WAFER) + .notConsumable(lens, Sapphire).output(ULTRA_LOW_POWER_INTEGRATED_CIRCUIT_WAFER, 8) + .cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + + /* + + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(900).EUt(VA[MV]).input(SILICON_WAFER) + .notConsumable(craftingLens, MarkerMaterials.Color.Orange).output(LOW_POWER_INTEGRATED_CIRCUIT_WAFER) + .buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(500).EUt(VA[HV]).input(PHOSPHORUS_WAFER) + .notConsumable(craftingLens, MarkerMaterials.Color.Orange).output(LOW_POWER_INTEGRATED_CIRCUIT_WAFER, 4) + .cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(200).EUt(VA[EV]).input(NAQUADAH_WAFER) + .notConsumable(craftingLens, MarkerMaterials.Color.Orange).output(LOW_POWER_INTEGRATED_CIRCUIT_WAFER, 8) + .cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + + */ + } + // Cable have two recipes: one with 4x the cost of the previous tier foils and one with 1x of the on tier foil + public static void cablesInit(OrePrefix wirePrefix, Material material, WireProperties property) { + for (MaterialStack fluid : cableFluids) { + int voltageTier = GTUtility.getTierByVoltage(property.getVoltage()); + if (property.isSuperconductor() || voltageTier < UV) { + return; + } + + OrePrefix cablePrefix = getPrefix("cable" + wirePrefix.name().substring(4)); + int insulationAmount = INSULATION_AMOUNT.get(cablePrefix); + + removeRecipesByInputs(ASSEMBLER_RECIPES, new ItemStack[]{ OreDictUnifier.get(wirePrefix, material), OreDictUnifier.get(foil, PolyphenyleneSulfide, insulationAmount), OreDictUnifier.get(foil, PolyvinylChloride, insulationAmount) }, new FluidStack[]{ fluid.material.getFluid((int) fluid.amount * insulationAmount) }); + var builder = ASSEMBLER_RECIPES.recipeBuilder().EUt(VA[ULV]).duration(100) + .fluidInput(fluid.material.getFluid(), (int) fluid.amount * insulationAmount) + .input(wirePrefix, material) + .output(cablePrefix, material); + var secondBuilder = builder.copy(); + + if (voltageTier >= UHV && voltageTier < UXV) { + secondBuilder.input(foil, PolyphenyleneSulfide, 4 * insulationAmount); + secondBuilder.input(foil, PolyvinylChloride, 4 * insulationAmount); + secondBuilder.buildAndRegister(); + + builder.input(foil, Polyetheretherketone, insulationAmount); + builder.buildAndRegister(); + } + + if (voltageTier >= UXV && voltageTier < OpV) { + secondBuilder.input(foil, Polyetheretherketone, 4 * insulationAmount); + secondBuilder.buildAndRegister(); + + builder.input(foil, Zylon, insulationAmount); + builder.buildAndRegister(); + } + + if (voltageTier == OpV) { + secondBuilder.input(foil, Zylon, 4 * insulationAmount); + secondBuilder.buildAndRegister(); + + builder.input(foil, FullerenePolymerMatrix, insulationAmount); + builder.buildAndRegister(); + } + } } } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/RecipeOverrideLate.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/RecipeOverrideLate.java new file mode 100644 index 00000000..523c5d55 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/RecipeOverrideLate.java @@ -0,0 +1,44 @@ +package com.fulltrix.gcyl.recipes.categories; + +import gregtech.api.unification.OreDictUnifier; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import static com.fulltrix.gcyl.api.GCYLUtility.removeExtractorRecipe; +import static com.fulltrix.gcyl.materials.GCYLMaterials.QCDMatter; +import static com.fulltrix.gcyl.materials.chains.NewPlatinumGroupMaterials.PotassiumBisulfate; +import static gregtech.api.recipes.GTRecipeHandler.removeRecipesByInputs; +import static gregtech.api.recipes.RecipeMaps.*; +import static gregtech.api.recipes.ingredients.IntCircuitIngredient.getIntegratedCircuit; +import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.material.Materials.Oxygen; +import static gregtech.api.unification.ore.OrePrefix.dust; +import static gregtech.common.items.MetaItems.*; + +public class RecipeOverrideLate { + public static void init() { + //cobalt in arc furnace + removeRecipesByInputs(ARC_FURNACE_RECIPES, new ItemStack[]{OreDictUnifier.get(dust, Cobalt)}, new FluidStack[]{Oxygen.getFluid(59)}); + //antimony in arc furnace + removeRecipesByInputs(ARC_FURNACE_RECIPES, new ItemStack[]{OreDictUnifier.get(dust, Antimony)}, new FluidStack[]{Oxygen.getFluid(121)}); + + //potassium bisulfate extractor + removeExtractorRecipe(PotassiumBisulfate, dust); + + //monazite autoclave + removeRecipesByInputs(AUTOCLAVE_RECIPES, new ItemStack[]{OreDictUnifier.get(dust, Monazite)}, new FluidStack[]{Water.getFluid(250)}); + + //yttrium barium cuprate dust again for autogen + removeRecipesByInputs(MIXER_RECIPES, new ItemStack[]{getIntegratedCircuit(4), OreDictUnifier.get(dust, Yttrium), OreDictUnifier.get(dust, Barium, 2), OreDictUnifier.get(dust, Copper,3)}, new FluidStack[]{Oxygen.getFluid(7000)}); + + //qcdmatter solidification + removeRecipesByInputs(FLUID_SOLIDFICATION_RECIPES, new ItemStack[]{SHAPE_MOLD_BLOCK.getStackForm()}, new FluidStack[]{QCDMatter.getFluid(1296)}); + removeRecipesByInputs(FLUID_SOLIDFICATION_RECIPES, new ItemStack[]{SHAPE_MOLD_PLATE.getStackForm()}, new FluidStack[]{QCDMatter.getFluid(144)}); + removeRecipesByInputs(FLUID_SOLIDFICATION_RECIPES, new ItemStack[]{SHAPE_MOLD_GEAR.getStackForm()}, new FluidStack[]{QCDMatter.getFluid(576)}); + removeRecipesByInputs(FLUID_SOLIDFICATION_RECIPES, new ItemStack[]{SHAPE_MOLD_INGOT.getStackForm()}, new FluidStack[]{QCDMatter.getFluid(144)}); + removeRecipesByInputs(FLUID_SOLIDFICATION_RECIPES, new ItemStack[]{SHAPE_MOLD_NUGGET.getStackForm()}, new FluidStack[]{QCDMatter.getFluid(144)}); + removeRecipesByInputs(FLUID_SOLIDFICATION_RECIPES, new ItemStack[]{SHAPE_MOLD_GEAR_SMALL.getStackForm()}, new FluidStack[]{QCDMatter.getFluid(144)}); + removeRecipesByInputs(FLUID_SOLIDFICATION_RECIPES, new ItemStack[]{SHAPE_MOLD_ROTOR.getStackForm()}, new FluidStack[]{QCDMatter.getFluid(576)}); + + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/SuperconductorRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/SuperconductorRecipes.java index 077d0000..760c9163 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/SuperconductorRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/SuperconductorRecipes.java @@ -7,7 +7,7 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregicality.multiblocks.api.unification.GCYMMaterials.*; import static gregtech.api.GTValues.*; import static gregtech.api.recipes.RecipeMaps.*; @@ -102,39 +102,39 @@ public static void init() { //TODO: change pipe to fluid pipe ASSEMBLER_RECIPES.recipeBuilder().duration(500).EUt(122880) - .input(wireGtSingle, UVSuperconductorBase, 32) + .input(wireGtSingle, UVSuperconductorBase, 21) .input(pipeSmallItem, Ultimet, 7) .inputs(ELECTRIC_PUMP_UV.getStackForm()) .notConsumable(IntCircuitIngredient.getIntegratedCircuit(1)) .fluidInputs(Helium.getFluid(FluidStorageKeys.LIQUID, 10000)) - .output(wireGtSingle, UVSuperconductor, 32) + .output(wireGtSingle, UVSuperconductor, 21) .buildAndRegister(); ASSEMBLER_RECIPES.recipeBuilder().duration(500).EUt(491520) - .input(wireGtSingle, UHVSuperconductorBase, 32) + .input(wireGtSingle, UHVSuperconductorBase, 24) .input(pipeTinyFluid, Zeron100, 8) .inputs(ELECTRIC_PUMP_UHV.getStackForm()) .notConsumable(IntCircuitIngredient.getIntegratedCircuit(1)) .fluidInputs(Helium.getFluid(FluidStorageKeys.LIQUID, 12000)) - .output(wireGtSingle, UHVSuperconductor, 32) + .output(wireGtSingle, UHVSuperconductor, 24) .buildAndRegister(); ASSEMBLER_RECIPES.recipeBuilder().duration(500).EUt(1966080) - .input(wireGtSingle, UEVSuperconductorBase, 32) + .input(wireGtSingle, UEVSuperconductorBase, 27) .input(pipeTinyFluid, Lafium, 9) .inputs(ELECTRIC_PUMP_UEV.getStackForm()) .notConsumable(IntCircuitIngredient.getIntegratedCircuit(1)) .fluidInputs(MicrocrystallizingHydrogen.getFluid(14000)) - .output(wireGtSingle, UEVSuperconductor, 32) + .output(wireGtSingle, UEVSuperconductor, 27) .buildAndRegister(); ASSEMBLER_RECIPES.recipeBuilder().duration(500).EUt(7864320) - .input(wireGtSingle, UIVSuperconductorBase, 32) + .input(wireGtSingle, UIVSuperconductorBase, 30) .input(pipeTinyFluid, TantalumHafniumSeaborgiumCarbide, 10) .inputs(ELECTRIC_PUMP_UIV.getStackForm()) .notConsumable(IntCircuitIngredient.getIntegratedCircuit(1)) .fluidInputs(MicrocrystallizingHydrogen.getFluid(16000)) - .output(wireGtSingle, UIVSuperconductor, 32) + .output(wireGtSingle, UIVSuperconductor, 30) .buildAndRegister(); ASSEMBLER_RECIPES.recipeBuilder().duration(500).EUt(31457280) @@ -156,15 +156,16 @@ public static void init() { .buildAndRegister(); ASSEMBLER_RECIPES.recipeBuilder().duration(500).EUt(503316480) - .input(wireGtDouble, OpVSuperconductorBase, 64) - .input(pipeTinyFluid, Neutronium, 13) + .input(wireGtQuadruple, OpVSuperconductorBase, 32) + .input(pipeTinyFluid, CosmicNeutronium, 13) .inputs(ELECTRIC_PUMP_MAX.getStackForm()) .notConsumable(IntCircuitIngredient.getIntegratedCircuit(2)) .fluidInputs(FreeElectronGas.getFluid(22000)) - .output(wireGtSingle, MAXSuperconductor, 64) + .output(wireGtSingle, MAXSuperconductor, 32) .buildAndRegister(); + //LV superconductor Base dust MIXER_RECIPES.recipeBuilder().duration(240).EUt(30) .input(dust, SolderingAlloy, 10) @@ -316,5 +317,7 @@ public static void init() { .output(dust,LanthanumFullereneNanotubes,4) .output(dust,RheniumHassiumThalliumIsophtaloylbisdiethylthioureaHexafluorophosphate,12) .buildAndRegister(); + + } } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/CircuitComponentRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/CircuitComponentRecipes.java index 29b59c6e..ef8db058 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/CircuitComponentRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/CircuitComponentRecipes.java @@ -1,12 +1,13 @@ package com.fulltrix.gcyl.recipes.categories.circuits; +import com.fulltrix.gcyl.GCYLConfig; import com.fulltrix.gcyl.recipes.categories.circuits.components.*; import gregtech.api.GTValues; import gregtech.api.metatileentity.multiblock.CleanroomType; +import gregtech.api.unification.material.MarkerMaterials; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.materials.GCYLNuclearMaterials.Plutonium; import static gregtech.api.GTValues.*; import static gregtech.api.recipes.GTRecipeHandler.removeRecipesByInputs; import static gregtech.api.recipes.RecipeMaps.*; @@ -26,7 +27,7 @@ public static void init() { // TODO CrystalComponents.init(); circuitBoards(); WetwareComponents.init(); - biowareSMD(); + BioWareComponents.init(); OpticalComponents.init(); ExoticComponents.init(); CosmicComponents.init(); @@ -223,59 +224,6 @@ private static void quantumSMD() { .buildAndRegister(); } - private static void biowareSMD() { - - ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(30720 * 4) - .input(wireFine, Dubnium, 8) - .input(plate, GermaniumTungstenNitride, 4) - .fluidInputs(Polyimide.getFluid(L * 2)) - .outputs(SMD_TRANSISTOR_BIOWARE.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) - .buildAndRegister(); - - ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(30720 * 4) - .input(wireFine, PEDOT, 8) - .input(foil, Polytetrafluoroethylene, 4) - .input(foil, BariumTitanate, 4) - .fluidInputs(Polyimide.getFluid(L * 2)) - .outputs(SMD_CAPACITOR_BIOWARE.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) - .buildAndRegister(); - - ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(30720 * 4) - .input(wireFine, Osmiridium, 8) - .input(dust, AluminiumComplex) - .input(dust, CopperGalliumIndiumSelenide) - .fluidInputs(Polyimide.getFluid(L * 2)) - .outputs(SMD_DIODE_BIOWARE.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) - .buildAndRegister(); - - ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(30720 * 4) - .input(wireFine, NaquadahAlloy, 6) - .input(plate, BismuthRuthenate) - .input(plate, BismuthIridiate) - .fluidInputs(Polyimide.getFluid(L * 2)) - .outputs(SMD_RESISTOR_BIOWARE.getStackForm(24)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) - .buildAndRegister(); - - ASSEMBLY_LINE_RECIPES.recipeBuilder() - .input(foil, SiliconeRubber, 32) - .input(wireFine, NaquadahAlloy, 16) - .inputs(SMD_TRANSISTOR_BIOWARE.getStackForm(16)) - .inputs(SMD_RESISTOR_BIOWARE.getStackForm(16)) - .inputs(SMD_DIODE_BIOWARE.getStackForm(16)) - .inputs(SMD_CAPACITOR_BIOWARE.getStackForm(16)) - .inputs(CYBER_PROCESSING_UNIT.getStackForm()) - .inputs(STEM_CELLS.getStackForm(4)) - .fluidInputs(Tritanium.getFluid(144)) - .outputs(NEURO_PROCESSOR.getStackForm(4)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) - .EUt(30720 * 16) - .duration(150) - .buildAndRegister(); - } private static void circuitBoards() { @@ -303,6 +251,36 @@ private static void circuitBoards() { .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); - //TODO Red circuit board from GTNH + //BIO BOARD + CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(1200).EUt(GTValues.VA[GTValues.UV]) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .inputs(WETWARE_BOARD.getStackForm(32)) + .inputs(PETRI_DISH.getStackForm(8)) + .inputs(ELECTRIC_PUMP_ZPM.getStackForm()) + .inputs(SENSOR_LuV.getStackForm(2)) + .input(circuit, GCYLConfig.recipes.hardMode ? MarkerMaterials.Tier.UV : MarkerMaterials.Tier.LuV) + .input(foil, TitanSteel, 32) + .fluidInputs(SterileBioGrowthMedium.getFluid(16000)) + .outputs(BIO_BOARD.getStackForm(32)) + .buildAndRegister(); + + + //BIO CIRCUIT BOARD + CHEMICAL_RECIPES.recipeBuilder().duration(2400).EUt(GTValues.VA[GTValues.EV]) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .inputs(BIO_BOARD.getStackForm(1)) + .input(foil, TitanSteel, 64) + .fluidInputs(Iron3Chloride.getFluid(7500)) + .outputs(BIO_CIRCUIT_BOARD.getStackForm()) + .buildAndRegister(); + + CHEMICAL_RECIPES.recipeBuilder().duration(2400).EUt(GTValues.VA[GTValues.EV]) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .inputs(BIO_BOARD.getStackForm(1)) + .input(foil, TitanSteel, 64) + .fluidInputs(SodiumPersulfate.getFluid(7500 * 2)) + .outputs(BIO_CIRCUIT_BOARD.getStackForm()) + .buildAndRegister(); + } } \ No newline at end of file diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/CircuitRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/CircuitRecipes.java index 8a379fc4..de4f6c77 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/CircuitRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/CircuitRecipes.java @@ -1,11 +1,16 @@ package com.fulltrix.gcyl.recipes.categories.circuits; +import com.fulltrix.gcyl.GCYLConfig; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; import gregtech.api.GTValues; import gregtech.api.metatileentity.multiblock.CleanroomType; import gregtech.api.recipes.ModHandler; +import gregtech.api.recipes.RecipeBuilder; import gregtech.api.unification.stack.UnificationEntry; +import net.minecraft.world.gen.structure.StructureMineshaftPieces; +import static com.fulltrix.gcyl.api.GCYLUtility.*; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; import static gregtech.api.GTValues.L; @@ -20,10 +25,10 @@ public class CircuitRecipes { //TODO: higher tier soldering alloys - //TODO: research and/or move circuits to circuit assembly line - //TODO: remove tin as a soldering alloy + //TODO: move cosmic+ circuits to circuit assembly line //TODO: make smd ore prefixes to condense recipes + public static int circuitsPerCraft = GCYLConfig.recipes.circuitsPerCraft; public static void init() { primitiveCircuits(); @@ -44,6 +49,8 @@ public static void init() { CircuitComponentRecipes.init(); WaferRecipes.init(); + + GenericUnification.init(); } private static void primitiveCircuits() { @@ -76,7 +83,7 @@ private static void electronicCircuits() { .inputs(CAPACITOR.getStackForm(8)) .inputs(GOOD_CIRCUIT_BOARD.getStackForm()) .input(wireFine, Copper, 4) - .outputs(INTEGRATED_CIRCUIT_LV.getStackForm()) + .outputs(INTEGRATED_CIRCUIT_LV.getStackForm(circuitsPerCraft)) .buildAndRegister(); CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(16) @@ -84,7 +91,7 @@ private static void electronicCircuits() { .inputs(SMD_CAPACITOR_REFINED.getStackForm(4)) .inputs(GOOD_CIRCUIT_BOARD.getStackForm()) .input(wireFine, Copper, 4) - .outputs(INTEGRATED_CIRCUIT_LV.getStackForm()) + .outputs(INTEGRATED_CIRCUIT_LV.getStackForm(circuitsPerCraft)) .buildAndRegister(); // Electronic Assembly @@ -136,7 +143,8 @@ private static void refinedCircuits() { .inputs(PLASTIC_CIRCUIT_BOARD.getStackForm()) .inputs(CENTRAL_PROCESSING_UNIT.getStackForm()) .input(wireFine, TinAlloy, 2) - .outputs(REFINED_PROCESSOR.getStackForm(4)) + .fluidInputs(SolderingAlloy.getFluid(L / 2)) + .outputs(REFINED_PROCESSOR.getStackForm(circuitsPerCraft)) .buildAndRegister(); CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(60) @@ -146,16 +154,29 @@ private static void refinedCircuits() { .inputs(PLASTIC_CIRCUIT_BOARD.getStackForm()) .inputs(CENTRAL_PROCESSING_UNIT.getStackForm()) .input(wireFine, TinAlloy, 2) - .outputs(REFINED_PROCESSOR.getStackForm(4)) + .fluidInputs(SolderingAlloy.getFluid(L / 2)) + .outputs(REFINED_PROCESSOR.getStackForm(circuitsPerCraft)) .buildAndRegister(); // SoC Recipe + for(RecipeBuilder recipeBuilder : buildHigherYieldCleanroomRecipes(CIRCUIT_ASSEMBLER_RECIPES, REFINED_PROCESSOR, circuitsPerCraft, 1, 600)) { + recipeBuilder + .duration(50) + .inputs(PLASTIC_CIRCUIT_BOARD.getStackForm()) + .inputs(SYSTEM_ON_CHIP.getStackForm()) + .input(wireFine, TinAlloy, 8) + .fluidInputs(SolderingAlloy.getFluid(L / 2)) + .buildAndRegister(); + } + + /* CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(50).EUt(600) .inputs(PLASTIC_CIRCUIT_BOARD.getStackForm()) .inputs(SYSTEM_ON_CHIP.getStackForm()) .input(wireFine, TinAlloy, 8) - .outputs(REFINED_PROCESSOR.getStackForm(4)) + .outputs(REFINED_PROCESSOR.getStackForm(circuitsPerCraft)) .buildAndRegister(); + */ // Refined Assembly CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(60) @@ -165,6 +186,7 @@ private static void refinedCircuits() { .inputs(CAPACITOR.getStackForm(8)) .inputs(PLASTIC_CIRCUIT_BOARD.getStackForm()) .input(plate, StainlessSteel) + .fluidInputs(SolderingAlloy.getFluid(L)) .outputs(REFINED_ASSEMBLY.getStackForm()) .buildAndRegister(); @@ -175,6 +197,7 @@ private static void refinedCircuits() { .inputs(SMD_CAPACITOR_REFINED.getStackForm(2)) .inputs(PLASTIC_CIRCUIT_BOARD.getStackForm()) .input(plate, StainlessSteel) + .fluidInputs(SolderingAlloy.getFluid(L)) .outputs(REFINED_ASSEMBLY.getStackForm()) .buildAndRegister(); @@ -186,6 +209,7 @@ private static void refinedCircuits() { .inputs(RANDOM_ACCESS_MEMORY.getStackForm(2)) .inputs(PLASTIC_CIRCUIT_BOARD.getStackForm()) .input(wireGtSingle, MVSuperconductor) + .fluidInputs(SolderingAlloy.getFluid(L * 2)) .outputs(REFINED_COMPUTER.getStackForm()) .buildAndRegister(); @@ -196,6 +220,7 @@ private static void refinedCircuits() { .inputs(RANDOM_ACCESS_MEMORY.getStackForm(2)) .inputs(PLASTIC_CIRCUIT_BOARD.getStackForm()) .input(wireGtSingle, MVSuperconductor) + .fluidInputs(SolderingAlloy.getFluid(L * 2)) .outputs(REFINED_COMPUTER.getStackForm()) .buildAndRegister(); @@ -208,6 +233,7 @@ private static void refinedCircuits() { .inputs(RANDOM_ACCESS_MEMORY.getStackForm(4)) .input(frameGt, StainlessSteel, 4) .outputs(REFINED_MAINFRAME.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L * 4)) .buildAndRegister(); CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(500).EUt(110) @@ -218,6 +244,7 @@ private static void refinedCircuits() { .inputs(RANDOM_ACCESS_MEMORY.getStackForm(4)) .input(frameGt, StainlessSteel, 4) .outputs(REFINED_MAINFRAME.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L * 4)) .buildAndRegister(); } @@ -231,19 +258,33 @@ private static void microCircuits() { .inputs(ADVANCED_CIRCUIT_BOARD.getStackForm()) .inputs(CENTRAL_PROCESSING_UNIT.getStackForm(2)) .input(wireFine, RedAlloy, 2) - .outputs(MICRO_PROCESSOR.getStackForm(4)) + .outputs(MICRO_PROCESSOR.getStackForm(circuitsPerCraft)) .cleanroom(CleanroomType.CLEANROOM) + .fluidInputs(SolderingAlloy.getFluid(L / 2)) .buildAndRegister(); // SoC Recipe + for(RecipeBuilder recipeBuilder : buildHigherYieldCleanroomRecipes(CIRCUIT_ASSEMBLER_RECIPES, MICRO_PROCESSOR, circuitsPerCraft, 1, 2400)) { + recipeBuilder + .duration(50) + .inputs(ADVANCED_CIRCUIT_BOARD.getStackForm()) + .inputs(SYSTEM_ON_CHIP.getStackForm()) + .input(wireFine, RedAlloy, 8) + .fluidInputs(SolderingAlloy.getFluid(L / 2)) + .buildAndRegister(); + } + + /* CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(50).EUt(2400) .inputs(ADVANCED_CIRCUIT_BOARD.getStackForm()) .inputs(SYSTEM_ON_CHIP.getStackForm()) .input(wireFine, RedAlloy, 8) - .outputs(MICRO_PROCESSOR.getStackForm(4)) + .outputs(MICRO_PROCESSOR.getStackForm(circuitsPerCraft)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); + */ + // Micro Assembly CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(350) .inputs(MICRO_PROCESSOR.getStackForm(3)) @@ -253,6 +294,7 @@ private static void microCircuits() { .inputs(ADVANCED_CIRCUIT_BOARD.getStackForm()) .input(plate, Titanium) .outputs(PROCESSOR_ASSEMBLY_HV.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); @@ -265,6 +307,7 @@ private static void microCircuits() { .inputs(ADVANCED_CIRCUIT_BOARD.getStackForm()) .input(wireGtSingle, HVSuperconductor) .outputs(MICRO_COMPUTER.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L * 2)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); @@ -277,6 +320,7 @@ private static void microCircuits() { .inputs(RANDOM_ACCESS_MEMORY.getStackForm(8)) .input(frameGt, Titanium, 4) .outputs(MAINFRAME_IV.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L * 4)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); } @@ -285,25 +329,40 @@ private static void nanoCircuits() { // Nano Processor CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(2000) - .outputs(NANO_PROCESSOR_HV.getStackForm(4)) + .outputs(NANO_PROCESSOR_HV.getStackForm(circuitsPerCraft)) .inputs(SMD_RESISTOR_NANO.getStackForm(4)) .inputs(SMD_TRANSISTOR_NANO.getStackForm(4)) .inputs(SMD_CAPACITOR_NANO.getStackForm(4)) .inputs(EXTREME_CIRCUIT_BOARD.getStackForm()) .inputs(NANO_CENTRAL_PROCESSING_UNIT.getStackForm(12)) .input(wireFine, Aluminium, 2) + .fluidInputs(SolderingAlloy.getFluid(L)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); // SoC Recipe + for(RecipeBuilder recipeBuilder : buildHigherYieldCleanroomRecipes(CIRCUIT_ASSEMBLER_RECIPES, NANO_PROCESSOR_HV, circuitsPerCraft, 1, 9600)) { + recipeBuilder + .duration(50) + .inputs(EXTREME_CIRCUIT_BOARD.getStackForm()) + .inputs(ADVANCED_SYSTEM_ON_CHIP.getStackForm()) + .input(wireFine, Aluminium, 8) + .fluidInputs(SolderingAlloy.getFluid(L)) + .buildAndRegister(); + } + + /* CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(50).EUt(9600) .inputs(EXTREME_CIRCUIT_BOARD.getStackForm()) .inputs(SYSTEM_ON_CHIP.getStackForm()) .input(wireFine, Aluminium, 8) - .outputs(NANO_PROCESSOR_HV.getStackForm(4)) + .outputs(NANO_PROCESSOR_HV.getStackForm(circuitsPerCraft)) + .fluidInputs(SolderingAlloy.getFluid(L)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); + */ + // Nano Processor Assembly CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(2000) .inputs(NANO_PROCESSOR_HV.getStackForm(3)) @@ -313,6 +372,7 @@ private static void nanoCircuits() { .inputs(EXTREME_CIRCUIT_BOARD.getStackForm()) .input(plate, TungstenSteel) .outputs(NANO_PROCESSOR_ASSEMBLY_EV.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L * 2)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); @@ -325,6 +385,7 @@ private static void nanoCircuits() { .inputs(RANDOM_ACCESS_MEMORY.getStackForm(8)) .inputs(EXTREME_CIRCUIT_BOARD.getStackForm()) .input(wireGtSingle, EVSuperconductor) + .fluidInputs(SolderingAlloy.getFluid(L * 4)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); @@ -337,6 +398,7 @@ private static void nanoCircuits() { .inputs(RANDOM_ACCESS_MEMORY.getStackForm(12)) .input(frameGt, TungstenSteel, 4) .outputs(NANO_MAINFRAME_LUV.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L * 8)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); } @@ -352,19 +414,34 @@ private static void quantumCircuits() { .inputs(ELITE_CIRCUIT_BOARD.getStackForm()) .inputs(NANO_CENTRAL_PROCESSING_UNIT.getStackForm()) .input(wireFine, Platinum, 2) - .outputs(QUANTUM_PROCESSOR_EV.getStackForm(4)) + .outputs(QUANTUM_PROCESSOR_EV.getStackForm(circuitsPerCraft)) + .fluidInputs(SolderingAlloy.getFluid(L)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); // ASoC Recipe + for(RecipeBuilder recipeBuilder : buildHigherYieldCleanroomRecipes(CIRCUIT_ASSEMBLER_RECIPES, QUANTUM_PROCESSOR_EV, circuitsPerCraft, 1, 36000)) { + recipeBuilder + .duration(50) + .inputs(ELITE_CIRCUIT_BOARD.getStackForm()) + .inputs(ADVANCED_SYSTEM_ON_CHIP.getStackForm()) + .input(wireFine, Platinum, 8) + .fluidInputs(SolderingAlloy.getFluid(L)) + .buildAndRegister(); + } + + /* CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(50).EUt(36000) .inputs(ELITE_CIRCUIT_BOARD.getStackForm()) .inputs(ADVANCED_SYSTEM_ON_CHIP.getStackForm()) .input(wireFine, Platinum, 8) - .outputs(QUANTUM_PROCESSOR_EV.getStackForm(4)) + .outputs(QUANTUM_PROCESSOR_EV.getStackForm(circuitsPerCraft)) + .fluidInputs(SolderingAlloy.getFluid(L)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); + */ + // Quantum Assembly CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(4000) @@ -375,6 +452,7 @@ private static void quantumCircuits() { .inputs(ELITE_CIRCUIT_BOARD.getStackForm()) .input(plate, Osmium) .outputs(QUANTUM_ASSEMBLY_IV.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L * 2)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); @@ -383,25 +461,28 @@ private static void quantumCircuits() { .inputs(QUANTUM_ASSEMBLY_IV.getStackForm(4)) .inputs(SMD_DIODE_QUANTUM.getStackForm(8)) .inputs(QUANTUM_EYE.getStackForm()) - .inputs(POWER_INTEGRATED_CIRCUIT.getStackForm(4)) + .inputs(POWER_INTEGRATED_CIRCUIT.getStackForm(8)) .inputs(ELITE_CIRCUIT_BOARD.getStackForm()) .input(wireGtSingle, IVSuperconductor, 2) .outputs(QUANTUM_COMPUTER_LUV.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L * 4)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); // Quantum Mainframe ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(500).EUt(8000) .inputs(QUANTUM_COMPUTER_LUV.getStackForm(2)) - .inputs(SMD_RESISTOR_QUANTUM.getStackForm(32)) - .inputs(SMD_TRANSISTOR_QUANTUM.getStackForm(28)) - .inputs(SMD_CAPACITOR_QUANTUM.getStackForm(28)) - .inputs(SMD_DIODE_QUANTUM.getStackForm(16)) - .inputs(POWER_INTEGRATED_CIRCUIT.getStackForm(8)) + .inputs(SMD_RESISTOR_QUANTUM.getStackForm(64)) + .inputs(SMD_TRANSISTOR_QUANTUM.getStackForm(64)) + .inputs(SMD_CAPACITOR_QUANTUM.getStackForm(64)) + .inputs(SMD_DIODE_QUANTUM.getStackForm(64)) + .inputs(POWER_INTEGRATED_CIRCUIT.getStackForm(16)) .inputs(QUANTUM_STAR.getStackForm()) .input(frameGt, Ruridit, 4) .input(wireGtSingle, IVSuperconductor, 16) .outputs(QUANTUM_MAINFRAME_ZPM.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L * 8)) + .fluidInputs(Cryotheum.getFluid(2500)) .cleanroom(CleanroomType.CLEANROOM) .scannerResearch(b -> b .researchStack(QUANTUM_COMPUTER_LUV.getStackForm()) @@ -419,19 +500,34 @@ private static void crystalCircuits() { .inputs(KAPTON_CIRCUIT_BOARD.getStackForm()) .inputs(NANO_CENTRAL_PROCESSING_UNIT.getStackForm()) .input(wireFine, NiobiumTitanium, 2) - .outputs(CRYSTAL_PROCESSOR_IV.getStackForm(4)) + .outputs(CRYSTAL_PROCESSOR_IV.getStackForm(circuitsPerCraft)) + .fluidInputs(SolderingAlloy.getFluid(L * 2)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); // Crystal SoC Recipe + for(RecipeBuilder recipeBuilder : buildHigherYieldCleanroomRecipes(CIRCUIT_ASSEMBLER_RECIPES, CRYSTAL_PROCESSOR_IV, circuitsPerCraft, 1, 86000)) { + recipeBuilder + .duration(50) + .inputs(KAPTON_CIRCUIT_BOARD.getStackForm()) + .inputs(CRYSTAL_SYSTEM_ON_CHIP.getStackForm()) + .input(wireFine, NiobiumTitanium, 8) + .fluidInputs(SolderingAlloy.getFluid(L * 2)) + .buildAndRegister(); + } + + /* CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(50).EUt(86000) .inputs(KAPTON_CIRCUIT_BOARD.getStackForm()) .inputs(CRYSTAL_SYSTEM_ON_CHIP.getStackForm()) .input(wireFine, NiobiumTitanium, 8) .outputs(CRYSTAL_PROCESSOR_IV.getStackForm(4)) + .fluidInputs(SolderingAlloy.getFluid(L * 2)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); + */ + // Crystal Processor Assembly CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(20000) .inputs(CRYSTAL_PROCESSOR_IV.getStackForm(3)) @@ -441,22 +537,24 @@ private static void crystalCircuits() { .inputs(KAPTON_CIRCUIT_BOARD.getStackForm()) .input(wireGtSingle, LuVSuperconductor, 4) .outputs(CRYSTAL_ASSEMBLY_LUV.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L * 4)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); // Crystal Computer ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(300).EUt(30000) .inputs(CRYSTAL_ASSEMBLY_LUV.getStackForm(4)) - .inputs(SMD_DIODE_CRYSTAL.getStackForm(20)) - .inputs(SMD_RESISTOR_CRYSTAL.getStackForm(20)) - .inputs(SMD_TRANSISTOR_CRYSTAL.getStackForm(20)) - .inputs(SMD_CAPACITOR_CRYSTAL.getStackForm(20)) + .inputs(SMD_DIODE_CRYSTAL.getStackForm(32)) + .inputs(SMD_RESISTOR_CRYSTAL.getStackForm(32)) + .inputs(SMD_TRANSISTOR_CRYSTAL.getStackForm(32)) + .inputs(SMD_CAPACITOR_CRYSTAL.getStackForm(32)) .inputs(QUANTUM_EYE.getStackForm()) - .inputs(HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm()) + .inputs(HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(8)) .inputs(KAPTON_CIRCUIT_BOARD.getStackForm()) .input(plate, RhodiumPlatedPalladium, 2) .input(wireGtSingle, LuVSuperconductor, 16) .outputs(CRYSTAL_COMPUTER_ZPM.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L * 8)) .cleanroom(CleanroomType.CLEANROOM) .scannerResearch(b -> b .researchStack(CRYSTAL_ASSEMBLY_LUV.getStackForm()) @@ -464,20 +562,21 @@ private static void crystalCircuits() { .buildAndRegister(); // Crystal Mainframe - ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(500).EUt(30000) + ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(1200).EUt(30000) .inputs(CRYSTAL_COMPUTER_ZPM.getStackForm(2)) - .inputs(SMD_RESISTOR_CRYSTAL.getStackForm(48)) - .inputs(SMD_TRANSISTOR_CRYSTAL.getStackForm(48)) - .inputs(SMD_CAPACITOR_CRYSTAL.getStackForm(48)) - .inputs(SMD_DIODE_CRYSTAL.getStackForm(48)) - .inputs(HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(4)) + .inputs(SMD_RESISTOR_CRYSTAL.getStackForm(64)) + .inputs(SMD_TRANSISTOR_CRYSTAL.getStackForm(64)) + .inputs(SMD_CAPACITOR_CRYSTAL.getStackForm(64)) + .inputs(SMD_DIODE_CRYSTAL.getStackForm(64)) + .inputs(HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(16)) .inputs(QUANTUM_STAR.getStackForm(4)) .input(frameGt, HSSE, 4) .input(wireGtSingle, LuVSuperconductor, 32) .outputs(CRYSTAL_MAINFRAME_UV.getStackForm()) - .stationResearch(b -> b + .fluidInputs(SolderingAlloy.getFluid(L * 16)) + .fluidInputs(Cryotheum.getFluid(5000)) + .scannerResearch(b -> b .researchStack(CRYSTAL_COMPUTER_ZPM.getStackForm()) - .CWUt(16) .EUt(GTValues.VA[GTValues.LuV])) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); @@ -493,11 +592,23 @@ private static void wetwareCircuits() { .inputs(CYBER_PROCESSING_UNIT.getStackForm()) .inputs(QUBIT_CENTRAL_PROCESSING_UNIT.getStackForm()) .input(wireFine, YttriumBariumCuprate, 2) - .outputs(WETWARE_PROCESSOR_LUV.getStackForm(4)) + .outputs(WETWARE_PROCESSOR_LUV.getStackForm(circuitsPerCraft)) + .fluidInputs(SolderingAlloy.getFluid(L * 2)) .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); - // ASoC Recipe + // SoC Recipe + for(RecipeBuilder recipeBuilder : buildHigherYieldCleanroomRecipes(CIRCUIT_ASSEMBLER_RECIPES, WETWARE_PROCESSOR_LUV, circuitsPerCraft, 2, 614400)) { + recipeBuilder + .duration(200) + .inputs(CYBER_PROCESSING_UNIT.getStackForm()) + .inputs(LIVING_SOC.getStackForm(1)) + .input(wireFine, Vibranium, 16) + .fluidInputs(Indalloy140.getFluid(L / 2)) + .buildAndRegister(); + } + + /* CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(480000) .inputs(CYBER_PROCESSING_UNIT.getStackForm()) .inputs(ADVANCED_SYSTEM_ON_CHIP.getStackForm(4)) @@ -506,6 +617,8 @@ private static void wetwareCircuits() { .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + */ + // Wetware Assembly ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(400).EUt(120000) .inputs(WETWARE_PROCESSOR_LUV.getStackForm(3)) @@ -518,9 +631,11 @@ private static void wetwareCircuits() { .input(wireGtSingle, ZPMSuperconductor, 4) .input(wireFine, NaquadahAlloy, 64) .input(foil, SiliconeRubber, 16) - .fluidInputs(SterileGrowthMedium.getFluid(2000)) + .fluidInputs(SterileGrowthMedium.getFluid(1000)) .outputs(WETWARE_PROCESSOR_ASSEMBLY_ZPM.getStackForm()) .cleanroom(CleanroomType.STERILE_CLEANROOM) + .fluidInputs(SolderingAlloy.getFluid(L * 4)) + .fluidInputs(Cryotheum.getFluid(2500)) .stationResearch(b -> b .researchStack(WETWARE_PROCESSOR_LUV.getStackForm()) .CWUt(32) @@ -534,14 +649,17 @@ private static void wetwareCircuits() { .inputs(SMD_TRANSISTOR_WETWARE.getStackForm(32)) .inputs(SMD_CAPACITOR_WETWARE.getStackForm(32)) .inputs(SMD_DIODE_WETWARE.getStackForm(32)) - .inputs(QUANTUM_STAR.getStackForm(4)) + .inputs(HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(16)) .inputs(ARAM.getStackForm(8)) + .inputs(QUANTUM_STAR.getStackForm(4)) .input(plate, Rutherfordium, 2) .input(wireGtSingle, ZPMSuperconductor, 16) .input(foil, SiliconeRubber, 32) .fluidInputs(SterileGrowthMedium.getFluid(2000)) .outputs(WETWARE_SUPER_COMPUTER_UV.getStackForm()) .cleanroom(CleanroomType.STERILE_CLEANROOM) + .fluidInputs(SolderingAlloy.getFluid(L * 8)) + .fluidInputs(Cryotheum.getFluid(5000)) .stationResearch(b -> b .researchStack(WETWARE_PROCESSOR_ASSEMBLY_ZPM.getStackForm()) .CWUt(48) @@ -549,22 +667,24 @@ private static void wetwareCircuits() { .buildAndRegister(); // Wetware Mainframe - ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(2000).EUt(300000) + ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(1200).EUt(300000) .inputs(WETWARE_SUPER_COMPUTER_UV.getStackForm(2)) .inputs(SMD_RESISTOR_WETWARE.getStackForm(64)) .inputs(SMD_TRANSISTOR_WETWARE.getStackForm(64)) .inputs(SMD_CAPACITOR_WETWARE.getStackForm(64)) .inputs(SMD_DIODE_WETWARE.getStackForm(64)) - .inputs(HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(8)) + .inputs(HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(32)) .inputs(ARAM.getStackForm(16)) - .inputs(GRAVI_STAR.getStackForm(4)) + .inputs(GRAVI_STAR.getStackForm(8)) .input(frameGt, Tritanium, 4) .input(plate, Duranium, 4) .input(wireGtSingle, ZPMSuperconductor, 32) .input(foil, Polytetrafluoroethylene, 64) - .fluidInputs(SterileGrowthMedium.getFluid(2000)) - .fluidInputs(UUMatter.getFluid(100)) + .fluidInputs(SterileGrowthMedium.getFluid(4000)) + .fluidInputs(UUMatter.getFluid(1000)) + .fluidInputs(Cryotheum.getFluid(10000)) .outputs(WETWARE_MAINFRAME_UHV.getStackForm()) + .fluidInputs(SolderingAlloy.getFluid(L * 16)) .cleanroom(CleanroomType.STERILE_CLEANROOM) .stationResearch(b -> b .researchStack(WETWARE_SUPER_COMPUTER_UV.getStackForm()) @@ -577,17 +697,30 @@ private static void biowareCircuits() { // Bioware Processor CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(240000) + .inputs(NEURO_PROCESSOR.getStackForm()) .inputs(QUBIT_CENTRAL_PROCESSING_UNIT.getStackForm(4)) .inputs(SMD_TRANSISTOR_BIOWARE.getStackForm(8)) .inputs(SMD_CAPACITOR_BIOWARE.getStackForm(4)) - .inputs(NEURO_PROCESSOR.getStackForm()) - .inputs(HIGHLY_ADVANCED_SOC.getStackForm(4)) + .inputs(ADVANCED_CRYSTAL_SOC.getStackForm()) .input(wireFine, NaquadahAlloy, 4) - .outputs(BIOWARE_PROCESSOR.getStackForm(4)) - .solderMultiplier(4) + .outputs(BIOWARE_PROCESSOR.getStackForm(circuitsPerCraft)) + .fluidInputs(Indalloy140.getFluid(L)) .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + + //SOC recipe + for(RecipeBuilder recipeBuilder : buildHigherYieldCleanroomRecipes(CIRCUIT_ASSEMBLER_RECIPES, BIOWARE_PROCESSOR, circuitsPerCraft, 2, 7864320)) { + recipeBuilder + .duration(200) + .inputs(NEURO_PROCESSOR.getStackForm()) + .inputs(LIVING_BIO_SOC.getStackForm(1)) + .input(wireFine, HeavyQuarkDegenerateMatter, 16) + .fluidInputs(Indalloy140.getFluid(L)) + .buildAndRegister(); + } + + // Bioware Assembly ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(400).EUt(480000) .inputs(BIOWARE_PROCESSOR.getStackForm(3)) @@ -600,7 +733,7 @@ private static void biowareCircuits() { .inputs(ARAM.getStackForm(8)) .input(plate, Duranium, 2) .input(foil, Polybenzimidazole, 16) - .fluidInputs(SterileGrowthMedium.getFluid(1000)) + .fluidInputs(SterileBioGrowthMedium.getFluid(1000)) .fluidInputs(Titanium.getFluid(L * 9)) .fluidInputs(Polyethylene.getFluid(L * 18)) .fluidInputs(NaquadahEnriched.getFluid(L * 9)) @@ -620,12 +753,12 @@ private static void biowareCircuits() { .inputs(SMD_DIODE_BIOWARE.getStackForm(32)) .inputs(SMD_RESISTOR_BIOWARE.getStackForm(32)) .input(wireGtSingle, UVSuperconductor, 16) - .inputs(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(8)) + .inputs(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(16)) .inputs(ARAM.getStackForm(16)) .input(plate, Seaborgium, 2) .input(foil, Polybenzimidazole, 16) - .inputs(GRAVI_STAR.getStackForm(2)) - .fluidInputs(SterileGrowthMedium.getFluid(1000)) + .inputs(GRAVI_STAR.getStackForm(8)) + .fluidInputs(SterileBioGrowthMedium.getFluid(2000)) .fluidInputs(Tritanium.getFluid(L * 2)) .fluidInputs(Polybenzimidazole.getFluid(L * 9)) .fluidInputs(NaquadahEnriched.getFluid(L * 9)) @@ -638,21 +771,22 @@ private static void biowareCircuits() { .buildAndRegister(); // Bioware Mainframe - ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(800).EUt(1920000) + ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(1200).EUt(1920000) .inputs(BIOWARE_COMPUTER.getStackForm(2)) .inputs(SMD_CAPACITOR_BIOWARE.getStackForm(64)) .inputs(SMD_TRANSISTOR_BIOWARE.getStackForm(64)) .inputs(SMD_DIODE_BIOWARE.getStackForm(64)) .inputs(SMD_RESISTOR_BIOWARE.getStackForm(64)) .input(wireGtSingle, UVSuperconductor, 32) - .inputs(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(16)) + .inputs(getPowerIC(GTValues.UHV).getStackForm(32)) .inputs(ARAM.getStackForm(32)) + .inputs(GRAVI_STAR.getStackForm(16)) .input(foil, Tritanium, 16) - .inputs(STEM_CELLS.getStackForm(32)) + .inputs(BIO_CELLS.getStackForm(32)) .input(plate, Naquadria, 8) .input(foil, Polybenzimidazole, 64) .input(frameGt, Seaborgium, 4) - .fluidInputs(SterileGrowthMedium.getFluid(1000)) + .fluidInputs(SterileBioGrowthMedium.getFluid(4000)) .fluidInputs(Tritanium.getFluid(L * 9)) .fluidInputs(Polybenzimidazole.getFluid(L * 18)) .fluidInputs(Naquadria.getFluid(L * 9)) @@ -661,26 +795,49 @@ private static void biowareCircuits() { .stationResearch(b -> b .researchStack(BIOWARE_COMPUTER.getStackForm()) .CWUt(128) - .EUt(GTValues.VA[GTValues.UV])) + .EUt(GTValues.VA[GTValues.UHV])) .buildAndRegister(); } private static void opticalCircuits() { // Optical Processor - CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(960000) + + for(RecipeBuilder recipeBuilder : buildHigherYieldCleanroomRecipes(CIRCUIT_ASSEMBLER_RECIPES, OPTICAL_PROCESSOR, circuitsPerCraft, 3, 960000)) { + recipeBuilder + .duration(200) .inputs(QUBIT_CENTRAL_PROCESSING_UNIT.getStackForm(4)) .inputs(SMD_TRANSISTOR_OPTICAL.getStackForm(8)) .inputs(SMD_CAPACITOR_OPTICAL.getStackForm(4)) .inputs(OPTICAL_PROCESSING_CORE.getStackForm()) .inputs(OPTICAL_SOC.getStackForm(4)) .input(wireFine, Pikyonium, 4) - .outputs(OPTICAL_PROCESSOR.getStackForm(4)) - .solderMultiplier(4) - .cleanroom(CleanroomType.STERILE_CLEANROOM) - .buildAndRegister(); + .fluidInputs(Indalloy140.getFluid(L * 2)) + .buildAndRegister(); + } + + //.solderMultiplier(4); // Optical Assembly + getAssLineResearchBuilder(GTValues.UHV, 400, OPTICAL_PROCESSOR.getStackForm(), false, true, GCYLCleanroomType.ISO3, 960000) + .inputs(OPTICAL_PROCESSOR.getStackForm(3)) + .inputs(SMD_CAPACITOR_OPTICAL.getStackForm(16)) + .inputs(SMD_TRANSISTOR_OPTICAL.getStackForm(16)) + .inputs(SMD_DIODE_OPTICAL.getStackForm(16)) + .inputs(SMD_RESISTOR_OPTICAL.getStackForm(16)) + .input(wireGtSingle, UHVSuperconductor, 4) + .input(wireFine, TungstenTitaniumCarbide, 64) + .inputs(ARAM.getStackForm(16)) + .inputs(NANO_CENTRAL_PROCESSING_UNIT.getStackForm(64)) + .input(plate, HDCS, 2) + .input(foil, Polyetheretherketone, 32) + .fluidInputs(Duranium.getFluid(L * 9)) + .fluidInputs(Polytetrafluoroethylene.getFluid(L * 18)) + .fluidInputs(NaquadahEnriched.getFluid(L * 9)) + .outputs(OPTICAL_ASSEMBLY.getStackForm()) + .buildAndRegister(); + + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(400).EUt(960000) .inputs(OPTICAL_PROCESSOR.getStackForm(3)) .inputs(SMD_CAPACITOR_OPTICAL.getStackForm(16)) @@ -697,10 +854,33 @@ private static void opticalCircuits() { .fluidInputs(Polytetrafluoroethylene.getFluid(L * 18)) .fluidInputs(NaquadahEnriched.getFluid(L * 9)) .outputs(OPTICAL_ASSEMBLY.getStackForm()) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO3) .buildAndRegister(); + */ + // Optical Computer + getAssLineResearchBuilder(GTValues.UHV, 600, OPTICAL_ASSEMBLY.getStackForm(), false, true, GCYLCleanroomType.ISO3, 1920000) + .inputs(OPTICAL_ASSEMBLY.getStackForm(4)) + .inputs(SMD_CAPACITOR_OPTICAL.getStackForm(32)) + .inputs(SMD_TRANSISTOR_OPTICAL.getStackForm(32)) + .inputs(SMD_DIODE_OPTICAL.getStackForm(32)) + .inputs(SMD_RESISTOR_OPTICAL.getStackForm(32)) + .inputs(OPTICAL_SOC.getStackForm(4)) + .input(wireGtSingle, UHVSuperconductor, 16) + .inputs(CLADDED_OPTICAL_FIBER_CORE.getStackForm(16)) + .inputs(getPowerIC(GTValues.UHV).getStackForm(16)) + .inputs(ARAM.getStackForm(32)) + .input(plate, Quantum, 2) + .input(foil, Polybenzimidazole, 16) + .inputs(GRAVI_STAR.getStackForm(16)) + .fluidInputs(Tritanium.getFluid(L * 9)) + .fluidInputs(Polyetheretherketone.getFluid(L * 9)) + .fluidInputs(Adamantium.getFluid(L * 2)) + .outputs(OPTICAL_COMPUTER.getStackForm()) + .buildAndRegister(); + + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(600).EUt(1920000) .inputs(OPTICAL_ASSEMBLY.getStackForm(4)) .inputs(SMD_CAPACITOR_OPTICAL.getStackForm(32)) @@ -719,10 +899,35 @@ private static void opticalCircuits() { .fluidInputs(Polyetheretherketone.getFluid(L * 9)) .fluidInputs(Adamantium.getFluid(L * 2)) .outputs(OPTICAL_COMPUTER.getStackForm()) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO3) .buildAndRegister(); + */ + // Optical Mainframe + getAssLineResearchBuilder(GTValues.UEV, 1200, OPTICAL_COMPUTER.getStackForm(), false, true, GCYLCleanroomType.ISO3, 6000000) + .inputs(OPTICAL_COMPUTER.getStackForm(2)) + .inputs(SMD_CAPACITOR_OPTICAL.getStackForm(64)) + .inputs(SMD_TRANSISTOR_OPTICAL.getStackForm(64)) + .inputs(SMD_DIODE_OPTICAL.getStackForm(64)) + .inputs(SMD_RESISTOR_OPTICAL.getStackForm(64)) + .input(wireGtSingle, UHVSuperconductor, 32) + .inputs(getPowerIC(GTValues.UEV).getStackForm(32)) + .inputs(UHASOC.getStackForm(16)) + .inputs(ARAM.getStackForm(64)) + .input(plate, EnrichedNaquadahAlloy, 4) + .input(frameGt, Bohrium, 4) + .input(foil, Polyetheretherketone, 32) + .inputs(UNSTABLE_STAR.getStackForm(8)) + .inputs(CLADDED_OPTICAL_FIBER_CORE.getStackForm(48)) + .fluidInputs(Cinobite.getFluid(L * 6)) + .fluidInputs(Adamantium.getFluid(L * 3)) + .fluidInputs(Polyetheretherketone.getFluid(L * 18)) + .fluidInputs(Naquadria.getFluid(L * 9)) + .outputs(OPTICAL_MAINFRAME.getStackForm()) + .buildAndRegister(); + + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(800).EUt(6000000) .inputs(OPTICAL_COMPUTER.getStackForm(2)) .inputs(SMD_CAPACITOR_OPTICAL.getStackForm(64)) @@ -743,13 +948,29 @@ private static void opticalCircuits() { .fluidInputs(Polyetheretherketone.getFluid(L * 18)) .fluidInputs(Naquadria.getFluid(L * 9)) .outputs(OPTICAL_MAINFRAME.getStackForm()) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO3) .buildAndRegister(); + + */ } private static void exoticCircuits() { //Exotic Processor + for(RecipeBuilder recipeBuilder : buildHigherYieldCleanroomRecipes(CIRCUIT_ASSEMBLER_RECIPES, EXOTIC_PROCESSOR, circuitsPerCraft, 4, (int) 4E+6)) { + recipeBuilder + .duration(200) + .inputs(SMD_CAPACITOR_EXOTIC.getStackForm(8)) + .inputs(SMD_TRANSISTOR_EXOTIC.getStackForm(8)) + .inputs(EXOTIC_PROCESSING_CORE.getStackForm()) + .input(wireFine, Cinobite, 4) + .inputs(QUBIT_CENTRAL_PROCESSING_UNIT.getStackForm(4)) + .inputs(EXOTIC_CHIP.getStackForm(4)) + .fluidInputs(Indalloy140.getFluid(L * 4)) + .buildAndRegister(); + } + + /* CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt((int)4E+6) .inputs(SMD_CAPACITOR_EXOTIC.getStackForm(8)) .inputs(SMD_TRANSISTOR_EXOTIC.getStackForm(8)) @@ -762,7 +983,29 @@ private static void exoticCircuits() { .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + */ + //Exotic Assembly + getAssLineResearchBuilder(GTValues.UEV, 400, EXOTIC_PROCESSOR.getStackForm(), false, true, GCYLCleanroomType.ISO2, (int) 4E+6) + .inputs(SMD_RESISTOR_EXOTIC.getStackForm(16)) + .inputs(SMD_DIODE_EXOTIC.getStackForm(16)) + .inputs(SMD_TRANSISTOR_EXOTIC.getStackForm(16)) + .inputs(SMD_CAPACITOR_EXOTIC.getStackForm(16)) + .inputs(EXOTIC_PROCESSOR.getStackForm(3)) + .input(wireFine, Cinobite, 64) + .input(foil, Zylon, 4) + .inputs(QUBIT_CENTRAL_PROCESSING_UNIT.getStackForm(64)) + .input(plate, EnrichedNaquadahAlloy, 2) + .inputs(ARAM.getStackForm(32)) + .input(wireGtSingle, UEVSuperconductor, 4) + .fluidInputs(EnrichedNaquadahAlloy.getFluid(L * 6)) + .fluidInputs(TriniumTitanium.getFluid(L * 4)) + .fluidInputs(Quantum.getFluid(L * 6)) + .fluidInputs(QuantumDots.getFluid(250)) + .outputs(EXOTIC_ASSEMBLY.getStackForm()) + .buildAndRegister(); + + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(200).EUt((int)4E+6) .inputs(SMD_RESISTOR_EXOTIC.getStackForm(16)) .inputs(SMD_DIODE_EXOTIC.getStackForm(16)) @@ -782,8 +1025,29 @@ private static void exoticCircuits() { .outputs(EXOTIC_ASSEMBLY.getStackForm()) .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + */ //Exotic Computer + getAssLineResearchBuilder(GTValues.UEV, 600, EXOTIC_ASSEMBLY.getStackForm(), false, true, GCYLCleanroomType.ISO2, (int) 4E+6) + .inputs(SMD_DIODE_EXOTIC.getStackForm(32)) + .inputs(SMD_RESISTOR_EXOTIC.getStackForm(32)) + .inputs(SMD_TRANSISTOR_EXOTIC.getStackForm(32)) + .inputs(SMD_CAPACITOR_EXOTIC.getStackForm(32)) + .inputs(EXOTIC_ASSEMBLY.getStackForm(4)) + .input(foil, Zylon, 32) + .inputs(EXOTIC_CHIP.getStackForm(8)) + .inputs(getPowerIC(GTValues.UEV).getStackForm(32)) + .inputs(ARAM.getStackForm(64)) + .input(plate, EnrichedNaquadahAlloy, 4) + .inputs(UNSTABLE_STAR.getStackForm(8)) + .input(wireGtSingle, UEVSuperconductor, 16) + .fluidInputs(Polyetheretherketone.getFluid(L * 18)) + .fluidInputs(Vibranium.getFluid(L * 2)) + .fluidInputs(EnrichedNaquadahAlloy.getFluid(L * 9)) + .fluidInputs(TriniumTitanium.getFluid(L * 4)) + .outputs(EXOTIC_COMPUTER.getStackForm()) + .buildAndRegister(); + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(300).EUt((int)4E+6) .inputs(SMD_DIODE_EXOTIC.getStackForm(32)) .inputs(SMD_RESISTOR_EXOTIC.getStackForm(32)) @@ -804,7 +1068,33 @@ private static void exoticCircuits() { .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + */ + //Exotic Mainframe + getAssLineResearchBuilder(GTValues.UIV, 1200, EXOTIC_COMPUTER.getStackForm(), false, true, GCYLCleanroomType.ISO2, (int) 1E+7) + .inputs(SMD_RESISTOR_EXOTIC.getStackForm(64)) + .inputs(SMD_DIODE_EXOTIC.getStackForm(64)) + .inputs(SMD_TRANSISTOR_EXOTIC.getStackForm(64)) + .inputs(SMD_CAPACITOR_EXOTIC.getStackForm(64)) + .inputs(EXOTIC_COMPUTER.getStackForm(2)) + .input(foil, FullerenePolymerMatrix, 16) + .inputs(QUBIT_CENTRAL_PROCESSING_UNIT.getStackForm(4)) + .inputs(UHASOC.getStackForm(32)) + .input(frameGt, Vibranium, 4) + .inputs(getPowerIC(GTValues.UIV).getStackForm(64)) + .inputs(ARAM.getStackForm(64)) + .inputs(ARAM.getStackForm(64)) + .input(plate, MetastableFlerovium, 4) + .inputs(UNSTABLE_STAR.getStackForm(16)) + .input(wireGtSingle, UEVSuperconductor, 32) + .fluidInputs(LiquidEnrichedHelium.getFluid(1000)) + .fluidInputs(FullerenePolymerMatrix.getFluid(L * 4)) + .fluidInputs(Quantum.getFluid(L * 9)) + .fluidInputs(Naquadria.getFluid(L * 9)) + .outputs(EXOTIC_MAINFRAME.getStackForm()) + .buildAndRegister(); + + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(400).EUt((int)1E+7) .inputs(SMD_RESISTOR_EXOTIC.getStackForm(64)) .inputs(SMD_DIODE_EXOTIC.getStackForm(64)) @@ -827,11 +1117,28 @@ private static void exoticCircuits() { .outputs(EXOTIC_MAINFRAME.getStackForm()) .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + + */ } private static void cosmicCircuits() { // Cosmic Processor + + for(RecipeBuilder recipeBuilder : buildHigherYieldCleanroomRecipes(CIRCUIT_ASSEMBLER_RECIPES, COSMIC_PROCESSOR, circuitsPerCraft, 5, 30_720_000)) { + recipeBuilder + .duration(200) + .inputs(QUBIT_CENTRAL_PROCESSING_UNIT.getStackForm(4)) + .inputs(SMD_TRANSISTOR_COSMIC.getStackForm(8)) + .inputs(SMD_CAPACITOR_COSMIC.getStackForm(16)) + .inputs(COSMIC_PROCESSING_CORE.getStackForm()) + .inputs(UHASOC.getStackForm(4)) + .input(wireFine, AbyssalAlloy, 4) + .fluidInputs(Indalloy140.getFluid(L * 8)) + .buildAndRegister(); + } + + /* CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(50).EUt(30_720_000) .inputs(QUBIT_CENTRAL_PROCESSING_UNIT.getStackForm(4)) .inputs(SMD_TRANSISTOR_COSMIC.getStackForm(8)) @@ -844,7 +1151,29 @@ private static void cosmicCircuits() { .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + */ + // Cosmic Assembly + getAssLineResearchBuilder(GTValues.UIV, 400, COSMIC_PROCESSOR.getStackForm(), false, true, GCYLCleanroomType.ISO1, 30_720_000) + .inputs(COSMIC_PROCESSOR.getStackForm(3)) + .inputs(SMD_CAPACITOR_COSMIC.getStackForm(32)) + .inputs(SMD_TRANSISTOR_COSMIC.getStackForm(32)) + .inputs(SMD_DIODE_COSMIC.getStackForm(32)) + .inputs(SMD_RESISTOR_COSMIC.getStackForm(32)) + .input(wireGtSingle, UIVSuperconductor, 4) + .input(wireFine, MetastableOganesson, 64) + .input(wireFine, MetastableHassium, 64) + .input(wireFine, MetastableFlerovium, 64) + .inputs(ARAM.getStackForm(64)) + .input(plate, Quantum, 2) + .input(foil, Zylon, 16) + .fluidInputs(Tritanium.getFluid(L * 18)) + .fluidInputs(Polyetheretherketone.getFluid(L * 18)) + .fluidInputs(NaquadahEnriched.getFluid(L * 9)) + .outputs(COSMIC_ASSEMBLY.getStackForm()) + .buildAndRegister(); + + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(100).EUt(30_720_000) .inputs(COSMIC_PROCESSOR.getStackForm(3)) .inputs(SMD_CAPACITOR_COSMIC.getStackForm(32)) @@ -865,7 +1194,31 @@ private static void cosmicCircuits() { .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + */ + // Cosmic Computer + getAssLineResearchBuilder(GTValues.UIV, 600, COSMIC_ASSEMBLY.getStackForm(), false, true, GCYLCleanroomType.ISO1, 30_720_000) + .inputs(COSMIC_ASSEMBLY.getStackForm(4)) + .inputs(SMD_CAPACITOR_COSMIC.getStackForm(48)) + .inputs(SMD_TRANSISTOR_COSMIC.getStackForm(48)) + .inputs(SMD_DIODE_COSMIC.getStackForm(48)) + .inputs(SMD_RESISTOR_COSMIC.getStackForm(48)) + .input(wireGtSingle, UIVSuperconductor, 16) + .inputs(getPowerIC(GTValues.UIV).getStackForm(64)) + .inputs(ARAM.getStackForm(64)) + .inputs(ARAM.getStackForm(64)) + .inputs(OPTICAL_SOC.getStackForm(16)) + .input(plate, HastelloyK243, 4) + .input(foil, FullerenePolymerMatrix, 12) + .inputs(UNSTABLE_STAR.getStackForm(16)) + .fluidInputs(CosmicComputingMix.getFluid(4000)) + .fluidInputs(Tritanium.getFluid(L * 9)) + .fluidInputs(Zylon.getFluid(L * 18)) + .fluidInputs(Naquadria.getFluid(L * 9)) + .outputs(COSMIC_COMPUTER.getStackForm()) + .buildAndRegister(); + + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(100).EUt(30_720_000) .inputs(COSMIC_ASSEMBLY.getStackForm(4)) .inputs(SMD_CAPACITOR_COSMIC.getStackForm(48)) @@ -885,10 +1238,34 @@ private static void cosmicCircuits() { .fluidInputs(Zylon.getFluid(L * 18)) .fluidInputs(Naquadria.getFluid(L * 9)) .outputs(COSMIC_COMPUTER.getStackForm()) - .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + */ + // Cosmic Mainframe + getAssLineResearchBuilder(GTValues.UXV, 1200, COSMIC_COMPUTER.getStackForm(), false, true, GCYLCleanroomType.ISO1, 30_720_000 * 2) + .inputs(COSMIC_COMPUTER.getStackForm(2)) + .inputs(SMD_CAPACITOR_COSMIC.getStackForm(64)) + .inputs(SMD_TRANSISTOR_COSMIC.getStackForm(64)) + .inputs(SMD_DIODE_COSMIC.getStackForm(64)) + .inputs(SMD_RESISTOR_COSMIC.getStackForm(64)) + .inputs(COSMIC_COMPUTE_UNIT.getStackForm(16)) + .input(wireGtSingle, UIVSuperconductor, 32) + .inputs(UHASOC.getStackForm(64)) + .inputs(getPowerICStack(GTValues.UXV)) + .inputs(PHOTOCOATED_HASSIUM_WAFER.getStackForm(16)) + .input(frameGt, HeavyQuarkDegenerateMatter, 4) + .input(plate, HastelloyK243, 8) + .input(foil, FullerenePolymerMatrix, 64) + .inputs(NUCLEAR_STAR.getStackForm(4)) + .fluidInputs(Taranium.getFluid(L * 2)) + .fluidInputs(TriniumTitanium.getFluid(L * 9)) + .fluidInputs(Zylon.getFluid(L * 18)) + .fluidInputs(Vibranium.getFluid(L * 6)) + .outputs(COSMIC_MAINFRAME.getStackForm()) + .buildAndRegister(); + + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(200).EUt(30_720_000) .inputs(COSMIC_COMPUTER.getStackForm(2)) .inputs(SMD_CAPACITOR_COSMIC.getStackForm(64)) @@ -908,27 +1285,51 @@ private static void cosmicCircuits() { .fluidInputs(Zylon.getFluid(L * 18)) .fluidInputs(Vibranium.getFluid(L * 6)) .outputs(COSMIC_MAINFRAME.getStackForm()) - .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + + */ } private static void supracausalCircuits() { // Supracausal Processor - CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(50).EUt(122_880_000) + CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(122_880_000) .inputs(COSMIC_COMPUTE_UNIT.getStackForm(16)) .inputs(MANIFOLD_OSCILLATORY_POWER_CELL.getStackForm()) .inputs(MICROWORMHOLE_GENERATOR.getStackForm()) .inputs(SUPRACAUSAL_PROCESSING_CORE.getStackForm()) .input(plate, SuperheavyHAlloy) .input(wireGtSingle, UXVSuperconductor, 2) - .outputs(SUPRACAUSAL_PROCESSOR.getStackForm(4)) - .solderMultiplier(4) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .outputs(SUPRACAUSAL_PROCESSOR.getStackForm(circuitsPerCraft)) + .fluidInputs(Indalloy140.getFluid(L * 16)) + .cleanroom(GCYLCleanroomType.ISO0) .buildAndRegister(); // Supracausal Assembly + getAssLineResearchBuilder(GTValues.OpV, 400, SUPRACAUSAL_PROCESSOR.getStackForm(), false, true, GCYLCleanroomType.ISO0, 122_880_000) + .inputs(SMD_CAPACITOR_SUPRACAUSAL.getStackForm(16)) + .inputs(SMD_DIODE_SUPRACAUSAL.getStackForm(16)) + .inputs(SMD_TRANSISTOR_SUPRACAUSAL.getStackForm(16)) + .inputs(SMD_RESISTOR_SUPRACAUSAL.getStackForm(16)) + .inputs(SUPRACAUSAL_PROCESSOR.getStackForm(3)) + .inputs(ARAM.getStackForm(64)) + .inputs(ARAM.getStackForm(64)) + .inputs(RECURSIVELY_FOLDED_NEGATIVE_SPACE.getStackForm()) + .inputs(CONTAINED_EXOTIC_MATTER.getStackForm()) + .input(plate, TriniumTitanium, 16) + .input(foil, FullerenePolymerMatrix, 24) + .input(wireGtSingle, UXVSuperconductor, 8) + .input(wireFine, HeavyQuarkDegenerateMatter, 64) + .fluidInputs(Taranium.getFluid(L * 3)) + .fluidInputs(TriniumTitanium.getFluid(L * 9)) + .fluidInputs(ProtoAdamantium.getFluid(L * 4)) + .fluidInputs(FullerenePolymerMatrix.getFluid(L * 16)) + .outputs(SUPRACAUSAL_ASSEMBLY.getStackForm()) + .buildAndRegister(); + + /* + ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(50).EUt(122_880_000) .inputs(SMD_CAPACITOR_SUPRACAUSAL.getStackForm(16)) .inputs(SMD_DIODE_SUPRACAUSAL.getStackForm(16)) @@ -948,10 +1349,35 @@ private static void supracausalCircuits() { .fluidInputs(ProtoAdamantium.getFluid(L * 4)) .fluidInputs(FullerenePolymerMatrix.getFluid(L * 16)) .outputs(SUPRACAUSAL_ASSEMBLY.getStackForm()) - .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + */ + // Supracausal Computer + getAssLineResearchBuilder(GTValues.OpV, 600, SUPRACAUSAL_ASSEMBLY.getStackForm(), false, true, GCYLCleanroomType.ISO0, 491_520_000) + .inputs(SMD_CAPACITOR_SUPRACAUSAL.getStackForm(32)) + .inputs(SMD_DIODE_SUPRACAUSAL.getStackForm(32)) + .inputs(SMD_TRANSISTOR_SUPRACAUSAL.getStackForm(32)) + .inputs(SMD_RESISTOR_SUPRACAUSAL.getStackForm(32)) + .inputs(SUPRACAUSAL_ASSEMBLY.getStackForm(4)) + .inputs(EXOTIC_CHIP.getStackForm(32)) + .inputs(COSMIC_COMPUTE_UNIT.getStackForm(16)) + .inputs(EIGENFOLDED_KERR_MANIFOLD.getStackForm()) + .inputs(getPowerIC(GTValues.OpV).getStackForm(32)) + .input(plate, TriniumTitanium, 32) + .input(plate, MetastableFlerovium, 16) + .input(plate, Neutronium, 4) + .input(plate, CosmicNeutronium, 3) + .input(wireGtSingle, UXVSuperconductor, 64) + .inputs(PHOTOCOATED_HASSIUM_WAFER.getStackForm(16)) + .fluidInputs(Taranium.getFluid(L * 2)) + .fluidInputs(TriniumTitanium.getFluid(L * 9)) + .fluidInputs(ProtoAdamantium.getFluid(L * 3)) + .fluidInputs(FullerenePolymerMatrix.getFluid(L * 6)) + .outputs(SUPRACAUSAL_COMPUTER.getStackForm()) + .buildAndRegister(); + + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(100).EUt(491_520_000) .inputs(SMD_CAPACITOR_SUPRACAUSAL.getStackForm(32)) .inputs(SMD_DIODE_SUPRACAUSAL.getStackForm(32)) @@ -972,10 +1398,35 @@ private static void supracausalCircuits() { .fluidInputs(ProtoAdamantium.getFluid(L * 3)) .fluidInputs(FullerenePolymerMatrix.getFluid(L * 6)) .outputs(SUPRACAUSAL_COMPUTER.getStackForm()) - .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + */ + // Supracausal Mainframe + getAssLineResearchBuilder(GTValues.MAX, 1200, SUPRACAUSAL_COMPUTER.getStackForm(), false, true, GCYLCleanroomType.ISO0, GTValues.VA[GTValues.MAX]) + .inputs(SMD_CAPACITOR_SUPRACAUSAL.getStackForm(64)) + .inputs(SMD_DIODE_SUPRACAUSAL.getStackForm(64)) + .inputs(SMD_TRANSISTOR_SUPRACAUSAL.getStackForm(64)) + .inputs(SMD_RESISTOR_SUPRACAUSAL.getStackForm(64)) + .inputs(SUPRACAUSAL_COMPUTER.getStackForm(2)) + .inputs(ULTRASHORT_PULSE_LASER.getStackForm(8)) + .inputs(COSMIC_COMPUTE_UNIT.getStackForm(32)) + .inputs(CTC_COMPUTATIONAL_UNIT.getStackForm()) + .inputs(getPowerICStack(GTValues.MAX)) + .inputs(COSMIC_MESH.getStackForm(64)) + .input(frameGt, QCDMatter, 4) + .input(wireGtSingle, OpVSuperconductor, 64) + .inputs(COSMIC_FABRIC.getStackForm(64)) + .input(plate, QCDMatter, 64) + .inputs(NUCLEAR_STAR.getStackForm(16)) + .fluidInputs(Taranium.getFluid(L * 64)) + .fluidInputs(TriniumTitanium.getFluid(L * 64)) + .fluidInputs(ProtoAdamantium.getFluid(L * 64)) + .fluidInputs(FullerenePolymerMatrix.getFluid(L * 64)) + .outputs(SUPRACAUSAL_MAINFRAME.getStackForm()) + .buildAndRegister(); + + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(100).EUt(Integer.MAX_VALUE) .inputs(SMD_CAPACITOR_SUPRACAUSAL.getStackForm(64)) .inputs(SMD_DIODE_SUPRACAUSAL.getStackForm(64)) @@ -995,7 +1446,8 @@ private static void supracausalCircuits() { .fluidInputs(ProtoAdamantium.getFluid(L * 64)) .fluidInputs(FullerenePolymerMatrix.getFluid(L * 64)) .outputs(SUPRACAUSAL_MAINFRAME.getStackForm()) - .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); + + */ } } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/GenericUnification.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/GenericUnification.java new file mode 100644 index 00000000..fc99977b --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/GenericUnification.java @@ -0,0 +1,45 @@ +package com.fulltrix.gcyl.recipes.categories.circuits; + +import gregtech.api.GTValues; +import gregtech.api.items.metaitem.MetaItem; +import gregtech.api.unification.material.MarkerMaterials; + +import static com.fulltrix.gcyl.api.GCYLUtility.getMarkerMaterialByTier; +import static com.fulltrix.gcyl.item.GCYLCoreItems.*; +import static gregtech.api.recipes.RecipeMaps.ASSEMBLER_RECIPES; +import static gregtech.api.unification.ore.OrePrefix.circuit; + +public class GenericUnification { + public static void init() { + + for(int i = 0; i < 15; i++) { + ASSEMBLER_RECIPES.recipeBuilder().EUt(8).duration(20) + .circuitMeta(29) + .input(circuit, getMarkerMaterialByTier(i), 16) + .outputs(getGenericCircuitByTier(i).getStackForm(16)) + .buildAndRegister(); + } + + } + + private static MetaItem.MetaValueItem getGenericCircuitByTier(int tier) { + return switch (tier) { + case (0) -> GENERIC_CIRCUIT_ULV; + case (1) -> GENERIC_CIRCUIT_LV; + case (2) -> GENERIC_CIRCUIT_MV; + case (3) -> GENERIC_CIRCUIT_HV; + case (4) -> GENERIC_CIRCUIT_EV; + case (5) -> GENERIC_CIRCUIT_IV; + case (6) -> GENERIC_CIRCUIT_LuV; + case (7) -> GENERIC_CIRCUIT_ZPM; + case (8) -> GENERIC_CIRCUIT_UV; + case (9) -> GENERIC_CIRCUIT_UHV; + case (10) -> GENERIC_CIRCUIT_UEV; + case (11) -> GENERIC_CIRCUIT_UIV; + case (12) -> GENERIC_CIRCUIT_UXV; + case (13) -> GENERIC_CIRCUIT_OpV; + case (14) -> GENERIC_CIRCUIT_MAX; + default -> null; + }; + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/MagnetoRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/MagnetoRecipes.java index df7b3832..6387e863 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/MagnetoRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/MagnetoRecipes.java @@ -1,6 +1,7 @@ package com.fulltrix.gcyl.recipes.categories.circuits; import com.fulltrix.gcyl.GCYLConfig; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; import gregtech.api.metatileentity.multiblock.CleanroomType; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; @@ -31,7 +32,7 @@ private static void circuits() { .inputs(CAPACITOR.getStackForm(4)) .inputs(TRANSISTOR.getStackForm(4)) .fluidInputs(SolderingAlloy.getFluid(L / 4)) - .outputs(CIRCUIT_MAGNETIC_ULV.getStackForm(4)) + .outputs(CIRCUIT_MAGNETIC_ULV.getStackForm(GCYLConfig.recipes.circuitsPerCraft)) .buildAndRegister(); CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(150).EUt(120) @@ -42,7 +43,7 @@ private static void circuits() { .inputs(SMD_CAPACITOR_REFINED.getStackForm(4)) .inputs(SMD_TRANSISTOR_REFINED.getStackForm(4)) .fluidInputs(SolderingAlloy.getFluid(L / 2)) - .outputs(CIRCUIT_MAGNETIC_LV.getStackForm(4)) + .outputs(CIRCUIT_MAGNETIC_LV.getStackForm(GCYLConfig.recipes.circuitsPerCraft)) .buildAndRegister(); CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(225).EUt(480) @@ -53,7 +54,7 @@ private static void circuits() { .inputs(SMD_CAPACITOR.getStackForm(8)) .inputs(SMD_TRANSISTOR.getStackForm(8)) .fluidInputs(SolderingAlloy.getFluid(L * 3/4)) - .outputs(CIRCUIT_MAGNETIC_MV.getStackForm(4)) + .outputs(CIRCUIT_MAGNETIC_MV.getStackForm(GCYLConfig.recipes.circuitsPerCraft)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); @@ -65,7 +66,7 @@ private static void circuits() { .inputs(SMD_CAPACITOR_NANO.getStackForm(8)) .inputs(SMD_TRANSISTOR_NANO.getStackForm(8)) .fluidInputs(SolderingAlloy.getFluid(L)) - .outputs(CIRCUIT_MAGNETIC_HV.getStackForm(4)) + .outputs(CIRCUIT_MAGNETIC_HV.getStackForm(GCYLConfig.recipes.circuitsPerCraft)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); @@ -77,7 +78,7 @@ private static void circuits() { .inputs(SMD_CAPACITOR_QUANTUM.getStackForm(16)) .inputs(SMD_TRANSISTOR_QUANTUM.getStackForm(16)) .fluidInputs(SolderingAlloy.getFluid(L * 5/4)) - .outputs(CIRCUIT_MAGNETIC_EV.getStackForm(4)) + .outputs(CIRCUIT_MAGNETIC_EV.getStackForm(GCYLConfig.recipes.circuitsPerCraft)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); @@ -89,7 +90,7 @@ private static void circuits() { .inputs(SMD_CAPACITOR_CRYSTAL.getStackForm(16)) .inputs(SMD_TRANSISTOR_CRYSTAL.getStackForm(16)) .fluidInputs(SolderingAlloy.getFluid(L * 6)) - .outputs(CIRCUIT_MAGNETIC_IV.getStackForm(4)) + .outputs(CIRCUIT_MAGNETIC_IV.getStackForm(GCYLConfig.recipes.circuitsPerCraft)) .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); @@ -101,7 +102,7 @@ private static void circuits() { .inputs(SMD_CAPACITOR_WETWARE.getStackForm(24)) .inputs(SMD_TRANSISTOR_WETWARE.getStackForm(24)) .fluidInputs(SolderingAlloy.getFluid(L * 7)) - .outputs(CIRCUIT_MAGNETIC_LUV.getStackForm(4)) + .outputs(CIRCUIT_MAGNETIC_LUV.getStackForm(GCYLConfig.recipes.circuitsPerCraft)) .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); @@ -113,7 +114,7 @@ private static void circuits() { .inputs(SMD_CAPACITOR_BIOWARE.getStackForm(24)) .inputs(SMD_TRANSISTOR_BIOWARE.getStackForm(24)) .fluidInputs(SolderingAlloy.getFluid(L * 32)) - .outputs(CIRCUIT_MAGNETIC_ZPM.getStackForm(4)) + .outputs(CIRCUIT_MAGNETIC_ZPM.getStackForm(GCYLConfig.recipes.circuitsPerCraft)) .cleanroom(CleanroomType.STERILE_CLEANROOM) .buildAndRegister(); @@ -125,8 +126,8 @@ private static void circuits() { .inputs(SMD_CAPACITOR_OPTICAL.getStackForm(32)) .inputs(SMD_TRANSISTOR_OPTICAL.getStackForm(32)) .fluidInputs(SolderingAlloy.getFluid(L * 36)) - .outputs(CIRCUIT_MAGNETIC_UV.getStackForm(4)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .outputs(CIRCUIT_MAGNETIC_UV.getStackForm(GCYLConfig.recipes.circuitsPerCraft)) + .cleanroom(GCYLCleanroomType.ISO3) .buildAndRegister(); CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(750).EUt(7864320) @@ -137,8 +138,8 @@ private static void circuits() { .inputs(SMD_CAPACITOR_EXOTIC.getStackForm(32)) .inputs(SMD_TRANSISTOR_EXOTIC.getStackForm(32)) .fluidInputs(SolderingAlloy.getFluid(L * 40)) - .outputs(CIRCUIT_MAGNETIC_UHV.getStackForm(4)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .outputs(CIRCUIT_MAGNETIC_UHV.getStackForm(GCYLConfig.recipes.circuitsPerCraft)) + .cleanroom(GCYLCleanroomType.ISO2) .buildAndRegister(); CIRCUIT_ASSEMBLER_RECIPES.recipeBuilder().duration(825).EUt(31457280) @@ -149,8 +150,8 @@ private static void circuits() { .inputs(SMD_CAPACITOR_COSMIC.getStackForm(64)) .inputs(SMD_TRANSISTOR_COSMIC.getStackForm(64)) .fluidInputs(SolderingAlloy.getFluid(L * 64)) - .outputs(CIRCUIT_MAGNETIC_UEV.getStackForm(4)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .outputs(CIRCUIT_MAGNETIC_UEV.getStackForm(GCYLConfig.recipes.circuitsPerCraft)) + .cleanroom(GCYLCleanroomType.ISO1) .buildAndRegister(); } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/WaferRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/WaferRecipes.java index 5505a403..81336dc3 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/WaferRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/WaferRecipes.java @@ -1,12 +1,14 @@ package com.fulltrix.gcyl.recipes.categories.circuits; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; +import gregtech.api.GTValues; import gregtech.api.metatileentity.multiblock.CleanroomType; import gregtech.api.recipes.ingredients.IntCircuitIngredient; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES; import static gregtech.api.GTValues.L; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.MarkerMaterials.Color.*; @@ -59,7 +61,6 @@ public static void init() { //TODO remove neutronium, verify recipes work .blastFurnaceTemp(9100) .outputs(NEUTRONIUM_BOULE.getStackForm()) .fluidInputs(Radon.getFluid(8000)) - .cleanroom(CleanroomType.CLEANROOM) .buildAndRegister(); CUTTER_RECIPES.recipeBuilder().EUt(98304).duration(1600) @@ -87,14 +88,14 @@ public static void init() { //TODO remove neutronium, verify recipes work .inputs(HASSIUM_BOULE.getStackForm()) .outputs(HASSIUM_SEED_CRYSTAL.getStackForm()) .outputs(HASSIUM_WAFER.getStackForm(8)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO1) .buildAndRegister(); CHEMICAL_BATH_RECIPES.recipeBuilder().duration(240).EUt(345000) .inputs(HASSIUM_WAFER.getStackForm()) .fluidInputs(Trichloroferane.getFluid(250)) .outputs(COATED_HASSIUM_WAFER.getStackForm()) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO1) .buildAndRegister(); // WAFER ENGRAVING ============================================================================================= @@ -143,18 +144,29 @@ public static void init() { //TODO remove neutronium, verify recipes work LASER_ENGRAVER_RECIPES.recipeBuilder().duration(25).EUt(122880).inputs(NEUTRONIUM_WAFER.getStackForm()).notConsumable(craftingLens, Blue).outputs(POWER_INTEGRATED_CIRCUIT_WAFER.getStackForm(16)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); // UHPIC Wafer - LASER_ENGRAVER_RECIPES.recipeBuilder().duration(100).EUt(491_520).inputs(WAFER_RUTHERFORDIUM.getStackForm()).notConsumable(lens, Amethyst).outputs(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT_WAFER.getStackForm(1)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); - LASER_ENGRAVER_RECIPES.recipeBuilder().duration(25).EUt(1_966_080).inputs(WAFER_DUBNIUM.getStackForm()).notConsumable(lens, Amethyst).outputs(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT_WAFER.getStackForm(2)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); - LASER_ENGRAVER_RECIPES.recipeBuilder().duration(12).EUt(7_864_320).inputs(NEUTRONIUM_WAFER.getStackForm()).notConsumable(lens, Amethyst).outputs(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT_WAFER.getStackForm(4)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + //LASER_ENGRAVER_RECIPES.recipeBuilder().duration(100).EUt(491_520).inputs(WAFER_RUTHERFORDIUM.getStackForm()).notConsumable(lens, Amethyst).outputs(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT_WAFER.getStackForm(1)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + // LASER_ENGRAVER_RECIPES.recipeBuilder().duration(25).EUt(1_966_080).inputs(WAFER_DUBNIUM.getStackForm()).notConsumable(lens, Amethyst).outputs(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT_WAFER.getStackForm(2)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + // LASER_ENGRAVER_RECIPES.recipeBuilder().duration(12).EUt(7_864_320).inputs(NEUTRONIUM_WAFER.getStackForm()).notConsumable(lens, Amethyst).outputs(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT_WAFER.getStackForm(4)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + + //NPIC Wafer + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(600).EUt(GTValues.VA[GTValues.UHV]).inputs(WAFER_RUTHERFORDIUM.getStackForm()).notConsumable(lens, Amethyst).outputs(NPIC_WAFER.getStackForm(1)).cleanroom(CleanroomType.STERILE_CLEANROOM).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(300).EUt(GTValues.VA[GTValues.UEV]).inputs(WAFER_DUBNIUM.getStackForm()).notConsumable(lens, Amethyst).outputs(NPIC_WAFER.getStackForm(2)).cleanroom(GCYLCleanroomType.ISO3).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(150).EUt(GTValues.VA[GTValues.UIV]).inputs(NEUTRONIUM_WAFER.getStackForm()).notConsumable(lens, Amethyst).outputs(NPIC_WAFER.getStackForm(4)).cleanroom(GCYLCleanroomType.ISO2).buildAndRegister(); + + //PPIC WAFER + CHEMICAL_RECIPES.recipeBuilder().duration(600).EUt(GTValues.VA[GTValues.UIV]).inputs(NPIC_WAFER.getStackForm(1)).input(dust, IndiumGalliumPhosphide, 64).fluidInputs(Xenon.getFluid(1000)).outputs(PPIC_WAFER.getStackForm(1)).cleanroom(GCYLCleanroomType.ISO2).buildAndRegister(); + + //QPIC WAFER + CHEMICAL_RECIPES.recipeBuilder().duration(600).EUt(GTValues.VA[GTValues.OpV]).inputs(PPIC_WAFER.getStackForm(1)).input(dust, Neutronium, 16).fluidInputs(MetastableOganesson.getFluid(1000)).outputs(QPIC_WAFER.getStackForm(1)).cleanroom(GCYLCleanroomType.ISO1).buildAndRegister(); // HASoC Wafer - LASER_ENGRAVER_RECIPES.recipeBuilder().duration(100).EUt(491_520).inputs(WAFER_RUTHERFORDIUM.getStackForm()).notConsumable(lens, CubicZirconia).outputs(HIGHLY_ADVANCED_SOC_WAFER.getStackForm(1)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); - LASER_ENGRAVER_RECIPES.recipeBuilder().duration(25).EUt(1_966_080).inputs(WAFER_DUBNIUM.getStackForm()).notConsumable(lens, CubicZirconia).outputs(HIGHLY_ADVANCED_SOC_WAFER.getStackForm(4)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); - LASER_ENGRAVER_RECIPES.recipeBuilder().duration(12).EUt(7_864_320).inputs(NEUTRONIUM_WAFER.getStackForm()).notConsumable(lens, CubicZirconia).outputs(HIGHLY_ADVANCED_SOC_WAFER.getStackForm(8)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(600).EUt(491_520).inputs(WAFER_RUTHERFORDIUM.getStackForm()).notConsumable(lens, CubicZirconia).outputs(HIGHLY_ADVANCED_SOC_WAFER.getStackForm(1)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(300).EUt(1_966_080).inputs(WAFER_DUBNIUM.getStackForm()).notConsumable(lens, CubicZirconia).outputs(HIGHLY_ADVANCED_SOC_WAFER.getStackForm(4)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(150).EUt(7_864_320).inputs(NEUTRONIUM_WAFER.getStackForm()).notConsumable(lens, CubicZirconia).outputs(HIGHLY_ADVANCED_SOC_WAFER.getStackForm(8)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); // UHASoC Wafer - LASER_ENGRAVER_RECIPES.recipeBuilder().duration(25).EUt(1_966_080).inputs(WAFER_DUBNIUM.getStackForm()).notConsumable(lens, Prasiolite).outputs(UHASOC_WAFER.getStackForm(1)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); - LASER_ENGRAVER_RECIPES.recipeBuilder().duration(12).EUt(7_864_320).inputs(NEUTRONIUM_WAFER.getStackForm()).notConsumable(lens, Prasiolite).outputs(UHASOC_WAFER.getStackForm(4)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(600).EUt(1_966_080).inputs(WAFER_DUBNIUM.getStackForm()).notConsumable(lens, Prasiolite).outputs(UHASOC_WAFER.getStackForm(1)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(300).EUt(7_864_320).inputs(NEUTRONIUM_WAFER.getStackForm()).notConsumable(lens, Prasiolite).outputs(UHASOC_WAFER.getStackForm(4)).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); // Misc Cutting Recipes //CUTTER_RECIPES.recipeBuilder().inputs(UHPIC_WAFER.getStackForm()) .outputs(UHPIC.getStackForm(2)) .EUt(491_520).duration(600).buildAndRegister(); @@ -162,14 +174,13 @@ public static void init() { //TODO remove neutronium, verify recipes work //CUTTER_RECIPES.recipeBuilder().inputs(HASOC_WAFER.getStackForm()) .outputs(HASOC.getStackForm(6)) .EUt(491_520).duration(600).buildAndRegister(); CUTTER_RECIPES.recipeBuilder().inputs(UHASOC_WAFER.getStackForm()).outputs(UHASOC.getStackForm(6)).EUt(1_966_080).duration(600).cleanroom(CleanroomType.CLEANROOM).buildAndRegister(); + //NPIC + CUTTER_RECIPES.recipeBuilder().inputs(NPIC_WAFER.getStackForm()).outputs(NPIC.getStackForm(2)).EUt(GTValues.VA[GTValues.UHV]).duration(600).cleanroom(CleanroomType.STERILE_CLEANROOM).buildAndRegister(); + //PPIC + CUTTER_RECIPES.recipeBuilder().inputs(PPIC_WAFER.getStackForm()).outputs(PPIC.getStackForm(2)).EUt(GTValues.VA[GTValues.UIV]).duration(600).cleanroom(GCYLCleanroomType.ISO2).buildAndRegister(); + //QPIC + CUTTER_RECIPES.recipeBuilder().inputs(QPIC_WAFER.getStackForm()).outputs(QPIC.getStackForm(2)).EUt(GTValues.VA[GTValues.OpV]).duration(600).cleanroom(GCYLCleanroomType.ISO1).buildAndRegister(); // Optical SoC - /* - EXTRACTOR_RECIPES.recipeBuilder().duration(260).EUt(30) - .input(dust, ZBLANDust,1) - .fluidOutputs(ZBLANDust.getFluid(L)) - .buildAndRegister(); - - */ LARGE_CHEMICAL_RECIPES.recipeBuilder().duration(390).EUt(983040) .inputs(UHASOC_WAFER.getStackForm()) diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/BioWareComponents.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/BioWareComponents.java new file mode 100644 index 00000000..fc330381 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/BioWareComponents.java @@ -0,0 +1,146 @@ +package com.fulltrix.gcyl.recipes.categories.circuits.components; + +import com.fulltrix.gcyl.GCYLConfig; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; +import gregtech.api.GTValues; +import gregtech.api.metatileentity.multiblock.CleanroomType; +import gregtech.api.unification.material.MarkerMaterials; + +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.ADVANCED_MIXER_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.BIO_REACTOR_RECIPES; +import static com.fulltrix.gcyl.item.GCYLCoreItems.*; +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; +import static gregtech.api.GTValues.L; +import static gregtech.api.recipes.RecipeMaps.*; +import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.material.Materials.UUMatter; +import static gregtech.api.unification.ore.OrePrefix.*; +import static gregtech.api.unification.ore.OrePrefix.wireFine; +import static gregtech.common.items.MetaItems.*; + +public class BioWareComponents { + public static void init() { + + //BIO CELLS + BIO_REACTOR_RECIPES.recipeBuilder().duration(600).EUt(GTValues.VA[GTValues.UV]) + .inputs(STEM_CELLS.getStackForm(32)) + .input(dust, Tennessine, 16) + .outputs(BIO_CELLS.getStackForm(32)) + .fluidInputs(SterileBioGrowthMedium.getFluid(2000)) + .fluidOutputs(DepletedGrowthMedium.getFluid(1000)) //TODO mutagen + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .buildAndRegister(); + + //RAW BIO GROWTH MEDIUM + BIO_REACTOR_RECIPES.recipeBuilder().duration(1200).EUt(GTValues.VA[GTValues.ZPM]) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .inputs(STEM_CELLS.getStackForm(16)) + .input(dust, Tritanium, 4) + .fluidInputs(RawGrowthMedium.getFluid(16000)) + .fluidOutputs(RawBioGrowthMedium.getFluid(8000)) + .buildAndRegister(); + + //BIO GROWTH MEDIUM + MIXER_RECIPES.recipeBuilder().duration(200).EUt(GTValues.VA[GTValues.LuV]) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .fluidInputs(Sulfanilamide.getFluid(1000)) + .fluidInputs(RawBioGrowthMedium.getFluid(1000)) + .fluidOutputs(SterileBioGrowthMedium.getFluid(2000)) + .buildAndRegister(); + + //BIO WAFER + AUTOCLAVE_RECIPES.recipeBuilder().EUt(1966080).duration(600) + .cleanroom(GCYLCleanroomType.ISO3) + .input(OPTICAL_SOC_WAFER) + .input(dust, HeavyQuarkDegenerateMatter, 16) + .output(BIO_WAFER) + .fluidInputs(SterileBioGrowthMedium.getFluid(8000)) + .buildAndRegister(); + + + + //BIOWARE SOC + CUTTER_RECIPES.recipeBuilder().EUt(7864320).duration(150) + .fluidInputs(UUMatter.getFluid(8000)) + .inputs(BIO_WAFER.getStackForm()) + .outputs(LIVING_BIO_SOC.getStackForm(16)) + .outputs(BIO_CELLS.getStackForm(16)) + .cleanroom(GCYLCleanroomType.ISO3) + .buildAndRegister(); + + //SMDS + ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(30720 * 4) + .input(wireFine, Dubnium, 8) + .input(plate, GermaniumTungstenNitride, 4) + .fluidInputs(Polyimide.getFluid(L * 2)) + .outputs(SMD_TRANSISTOR_BIOWARE.getStackForm(32)) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .buildAndRegister(); + + ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(30720 * 4) + .input(wireFine, PEDOT, 8) + .input(foil, Polytetrafluoroethylene, 4) + .input(foil, BariumTitanate, 4) + .fluidInputs(Polyimide.getFluid(L * 2)) + .outputs(SMD_CAPACITOR_BIOWARE.getStackForm(32)) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .buildAndRegister(); + + ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(30720 * 4) + .input(wireFine, Osmiridium, 8) + .input(dust, AluminiumComplex) + .input(dust, CopperGalliumIndiumSelenide) + .fluidInputs(Polyimide.getFluid(L * 2)) + .outputs(SMD_DIODE_BIOWARE.getStackForm(32)) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .buildAndRegister(); + + ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(30720 * 4) + .input(wireFine, NaquadahAlloy, 6) + .input(plate, BismuthRuthenate) + .input(plate, BismuthIridiate) + .fluidInputs(Polyimide.getFluid(L * 2)) + .outputs(SMD_RESISTOR_BIOWARE.getStackForm(24)) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .buildAndRegister(); + + //NEURO PROCESSOR + /* + ASSEMBLY_LINE_RECIPES.recipeBuilder() + .input(foil, SiliconeRubber, 32) + .input(wireFine, NaquadahAlloy, 16) + .inputs(SMD_TRANSISTOR_BIOWARE.getStackForm(16)) + .inputs(SMD_RESISTOR_BIOWARE.getStackForm(16)) + .inputs(SMD_DIODE_BIOWARE.getStackForm(16)) + .inputs(SMD_CAPACITOR_BIOWARE.getStackForm(16)) + .inputs(CYBER_PROCESSING_UNIT.getStackForm()) + .inputs(STEM_CELLS.getStackForm(4)) + .fluidInputs(Tritanium.getFluid(144)) + .outputs(NEURO_PROCESSOR.getStackForm(4)) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .EUt(30720 * 16) + .duration(150) + .buildAndRegister(); + */ + + ASSEMBLY_LINE_RECIPES.recipeBuilder() + .inputs(BIO_CIRCUIT_BOARD.getStackForm()) + .input(foil, SiliconeRubber, 64) + .input(wireFine, NaquadahAlloy, 16) + .inputs(SMD_TRANSISTOR_BIOWARE.getStackForm(16)) + .inputs(SMD_RESISTOR_BIOWARE.getStackForm(16)) + .inputs(SMD_DIODE_BIOWARE.getStackForm(16)) + .inputs(SMD_CAPACITOR_BIOWARE.getStackForm(16)) + .inputs(CYBER_PROCESSING_UNIT.getStackForm()) + .inputs(BIO_CELLS.getStackForm(16)) + .fluidInputs(Tritanium.getFluid(144)) + .fluidInputs(UUMatter.getFluid(500)) + .fluidInputs(SterileBioGrowthMedium.getFluid(500)) + .fluidInputs(SupercooledCryotheum.getFluid(2000)) + .outputs(NEURO_PROCESSOR.getStackForm(GCYLConfig.recipes.circuitCoresPerCraft)) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .EUt(30720 * 16) + .duration(150) + .buildAndRegister(); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/CosmicComponents.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/CosmicComponents.java index 2e8e1f96..f031e894 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/CosmicComponents.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/CosmicComponents.java @@ -1,5 +1,7 @@ package com.fulltrix.gcyl.recipes.categories.circuits.components; +import com.fulltrix.gcyl.GCYLConfig; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; import gregtech.api.metatileentity.multiblock.CleanroomType; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; @@ -23,7 +25,7 @@ public static void init() { .input(plate, AbyssalAlloy, 4) .fluidInputs(FullerenePolymerMatrix.getFluid(L)) .outputs(SMD_DIODE_COSMIC.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO1) .buildAndRegister(); // SMD Transistor @@ -33,7 +35,7 @@ public static void init() { .inputs(DEGENERATE_RHENIUM_PLATE.getStackForm(4)) .fluidInputs(Zylon.getFluid(L)) .outputs(SMD_TRANSISTOR_COSMIC.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO1) .buildAndRegister(); // SMD Capacitor @@ -43,7 +45,7 @@ public static void init() { .inputs(AEROGRAPHENE.getStackForm()) .fluidInputs(Zylon.getFluid(L)) .outputs(SMD_CAPACITOR_COSMIC.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO1) .buildAndRegister(); // SMD Resistor @@ -53,10 +55,11 @@ public static void init() { .input(plate, TriniumTitanium, 4) .fluidInputs(FullerenePolymerMatrix.getFluid(L)) .outputs(SMD_RESISTOR_COSMIC.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO1) .buildAndRegister(); // Cosmic Processing Core + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(320).EUt(11796480) .inputs(COSMIC_COMPUTE_UNIT.getStackForm()) .inputs(SMD_DIODE_COSMIC.getStackForm(48)) @@ -74,7 +77,28 @@ public static void init() { .fluidInputs(SolderingAlloy.getFluid(L * 9)) .fluidInputs(ProtoAdamantium.getFluid(L * 3)) .outputs(COSMIC_PROCESSING_CORE.getStackForm(8)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO1) + .buildAndRegister(); + */ + + ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(320).EUt(11796480) + .inputs(COSMIC_COMPUTE_UNIT.getStackForm()) + .inputs(SMD_DIODE_COSMIC.getStackForm(48)) + .inputs(SMD_RESISTOR_COSMIC.getStackForm(48)) + .inputs(SMD_TRANSISTOR_COSMIC.getStackForm(48)) + .inputs(SMD_CAPACITOR_COSMIC.getStackForm(48)) + .input(foil, FullerenePolymerMatrix, 2) + .inputs(ULTRASHORT_PULSE_LASER.getStackForm()) + .input(wireGtSingle, Cinobite, 8) + .inputs(CLADDED_OPTICAL_FIBER_CORE.getStackForm(8)) + .inputs(BOSE_EINSTEIN_COOLING_CONTAINER.getStackForm(4)) + .input(plate,BlackTitanium,4) + .fluidInputs(Zylon.getFluid(L * 6)) + .fluidInputs(Quantum.getFluid(L * 3)) + .fluidInputs(SolderingAlloy.getFluid(L * 9)) + .fluidInputs(ProtoAdamantium.getFluid(L * 3)) + .outputs(COSMIC_PROCESSING_CORE.getStackForm(GCYLConfig.recipes.circuitCoresPerCraft)) + .cleanroom(GCYLCleanroomType.ISO1) .buildAndRegister(); CHEMICAL_BATH_RECIPES.recipeBuilder().duration(240).EUt(695000) @@ -145,7 +169,7 @@ public static void init() { .input(gemFlawless, Tanzanite, 2) .fluidInputs(CosmicComputingMix.getFluid(1000)) .outputs(COSMIC_COMPUTE_UNIT.getStackForm()) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO1) .buildAndRegister(); } } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/ExoticComponents.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/ExoticComponents.java index 2b983cd3..f65877f6 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/ExoticComponents.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/ExoticComponents.java @@ -1,7 +1,8 @@ package com.fulltrix.gcyl.recipes.categories.circuits.components; import com.fulltrix.gcyl.GCYLConfig; -import com.fulltrix.gcyl.GCYLUtility; +import com.fulltrix.gcyl.api.GCYLUtility; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; import gregtech.api.fluids.store.FluidStorageKeys; import gregtech.api.metatileentity.multiblock.CleanroomType; import net.minecraftforge.fluids.FluidRegistry; @@ -53,28 +54,28 @@ public static void init(){ .input(foil, Cinobite) .input(foil, Quantum) .outputs(SMD_CAPACITOR_EXOTIC.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO2) .buildAndRegister(); ASSEMBLER_RECIPES.recipeBuilder().duration(160).EUt((int)1E+6).fluidInputs(Polyetheretherketone.getFluid(144 * 4)) .input(wireFine, Cinobite) .input(foil, TriniumTitanium) .outputs(SMD_RESISTOR_EXOTIC.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO2) .buildAndRegister(); ASSEMBLER_RECIPES.recipeBuilder().duration(160).EUt((int)1E+6).fluidInputs(Polyetheretherketone.getFluid(144 * 4)) .input(plate, Vibranium) .input(plate, Quantum) .outputs(SMD_DIODE_EXOTIC.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO2) .buildAndRegister(); ASSEMBLER_RECIPES.recipeBuilder().duration(160).EUt((int)1E+6).fluidInputs(Polyetheretherketone.getFluid(144 * 4)) .inputs(DEGENERATE_RHENIUM_PLATE.getStackForm()) .input(foil, TriniumTitanium) .outputs(SMD_TRANSISTOR_EXOTIC.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO2) .buildAndRegister(); ARC_FURNACE_RECIPES.recipeBuilder().duration(160).EUt(800000) @@ -87,13 +88,13 @@ public static void init(){ .inputs(UNTREATED_EXOTIC_WAFER.getStackForm()) .fluidInputs(MicrocrystallizingHydrogen.getFluid(100)) .outputs(EXOTIC_WAFER.getStackForm()) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO2) .buildAndRegister(); CUTTER_RECIPES.recipeBuilder().duration(160).EUt(200000) .inputs(EXOTIC_WAFER.getStackForm()) .outputs(EXOTIC_CHIP.getStackForm(16)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO2) .buildAndRegister(); ASSEMBLER_RECIPES.recipeBuilder().duration(160).EUt(2000) @@ -125,6 +126,8 @@ public static void init(){ .outputs(RYDBERG_SPINORIAL_ASSEMBLY.getStackForm()) .buildAndRegister(); + //EXOTIC PROCESSING CORE + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(160).EUt(4000000) .inputs(NON_LINEAR_OPTICAL_LENS.getStackForm(4)) .inputs(DEGENERATE_RHENIUM_PLATE.getStackForm(3)) @@ -141,7 +144,27 @@ public static void init(){ .fluidInputs(SolderingAlloy.getFluid(L * 9)) .fluidInputs(Polybenzimidazole.getFluid(L * 6)) .outputs(EXOTIC_PROCESSING_CORE.getStackForm(6)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO2) + .buildAndRegister(); + */ + + ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(160).EUt(4000000) + .inputs(NON_LINEAR_OPTICAL_LENS.getStackForm(4)) + .inputs(DEGENERATE_RHENIUM_PLATE.getStackForm(3)) + .input(foil, TriniumTitanium, 8) + .inputs(RYDBERG_SPINORIAL_ASSEMBLY.getStackForm()) + .inputs(X_RAY_LASER.getStackForm()) + .inputs(SMD_CAPACITOR_EXOTIC.getStackForm(32)) + .inputs(SMD_DIODE_EXOTIC.getStackForm(32)) + .inputs(SMD_TRANSISTOR_EXOTIC.getStackForm(32)) + .inputs(SMD_RESISTOR_EXOTIC.getStackForm(32)) + .input(wireGtSingle, Pikyonium, 8) + .inputs(CLADDED_OPTICAL_FIBER_CORE.getStackForm(4)) + .fluidInputs(QuantumDots.getFluid(100)) + .fluidInputs(SolderingAlloy.getFluid(L * 9)) + .fluidInputs(Polybenzimidazole.getFluid(L * 6)) + .outputs(EXOTIC_PROCESSING_CORE.getStackForm(GCYLConfig.recipes.circuitCoresPerCraft)) + .cleanroom(GCYLCleanroomType.ISO2) .buildAndRegister(); ASSEMBLER_RECIPES.recipeBuilder().duration(160).EUt(5000) diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/OpticalComponents.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/OpticalComponents.java index 021fcd27..e89832a8 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/OpticalComponents.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/OpticalComponents.java @@ -1,5 +1,7 @@ package com.fulltrix.gcyl.recipes.categories.circuits.components; +import com.fulltrix.gcyl.GCYLConfig; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; import gregtech.api.metatileentity.multiblock.CleanroomType; import net.minecraft.item.ItemStack; @@ -23,7 +25,7 @@ public static void init() { .input(plate, Polyetheretherketone, 4) .fluidInputs(Polybenzimidazole.getFluid(L * 4)) .outputs(SMD_DIODE_OPTICAL.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO3) .buildAndRegister(); @@ -34,7 +36,7 @@ public static void init() { .input(plate, LithiumTitanate, 4) .fluidInputs(Polybenzimidazole.getFluid(L * 4)) .outputs(SMD_TRANSISTOR_OPTICAL.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO3) .buildAndRegister(); // SMD Capacitor @@ -44,7 +46,7 @@ public static void init() { .input(foil, Polyetheretherketone, 4) .fluidInputs(Polybenzimidazole.getFluid(L * 4)) .outputs(SMD_CAPACITOR_OPTICAL.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO3) .buildAndRegister(); // SMD Resistor @@ -54,13 +56,14 @@ public static void init() { .input(dust, TBCCODust, 4) .fluidInputs(Polybenzimidazole.getFluid(L * 4)) .outputs(SMD_RESISTOR_OPTICAL.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO3) .buildAndRegister(); // SMD Inductor - // TODO add optical inductor & research // Optical Processing Core + + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(320).EUt(1474560) .inputs(OPTICAL_SOC.getStackForm(6)) .inputs(SMD_DIODE_OPTICAL.getStackForm(16)) @@ -80,9 +83,33 @@ public static void init() { .fluidInputs(SolderingAlloy.getFluid(L * 9)) .fluidInputs(FullereneDopedNanotubes.getFluid(L)) .outputs(OPTICAL_PROCESSING_CORE.getStackForm(6)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO3) + .buildAndRegister(); + + */ + ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(320).EUt(1474560) + .inputs(OPTICAL_SOC.getStackForm(6)) + .inputs(SMD_DIODE_OPTICAL.getStackForm(16)) + .inputs(SMD_RESISTOR_OPTICAL.getStackForm(16)) + .inputs(SMD_TRANSISTOR_OPTICAL.getStackForm(16)) + .inputs(SMD_CAPACITOR_OPTICAL.getStackForm(16)) + .input(foil, Polyetheretherketone, 2) + .inputs(LOW_FREQUENCY_LASER.getStackForm()) + .inputs(MEDIUM_FREQUENCY_LASER.getStackForm()) + .inputs(HIGH_FREQUENCY_LASER.getStackForm()) + .inputs(NON_LINEAR_OPTICAL_LENS.getStackForm(2)) + .inputs(CLADDED_OPTICAL_FIBER_CORE.getStackForm(2)) + .inputs(BOSE_EINSTEIN_COOLING_CONTAINER.getStackForm()) + .input(plate,Graphene,4) + .fluidInputs(Polytetrafluoroethylene.getFluid(L * 6)) + .fluidInputs(EnrichedNaquadahAlloy.getFluid(L * 3)) + .fluidInputs(SolderingAlloy.getFluid(L * 9)) + .fluidInputs(FullereneDopedNanotubes.getFluid(L)) + .outputs(OPTICAL_PROCESSING_CORE.getStackForm(GCYLConfig.recipes.circuitCoresPerCraft)) + .cleanroom(GCYLCleanroomType.ISO3) .buildAndRegister(); + ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(750000) .input(dustSmall, Radium) .input(plate, Polybenzimidazole, 4) diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/SupraCausalComponents.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/SupraCausalComponents.java index 68402ba9..2db574b9 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/SupraCausalComponents.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/SupraCausalComponents.java @@ -1,14 +1,15 @@ package com.fulltrix.gcyl.recipes.categories.circuits.components; +import com.fulltrix.gcyl.GCYLConfig; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; import gregtech.api.fluids.store.FluidStorageKeys; -import gregtech.api.metatileentity.multiblock.CleanroomType; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.item.GCYLExplosive.ExplosiveType.*; -import static com.fulltrix.gcyl.item.GCYLMetaBlocks.*; -import static com.fulltrix.gcyl.item.fusion.GCYLFusionCasing.CasingType.ADV_FUSION_COIL_1; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.blocks.GCYLExplosive.ExplosiveType.*; +import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.*; +import static com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils.CasingType.ADV_FUSION_COIL_1; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregtech.api.GTValues.L; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; @@ -27,7 +28,7 @@ public static void init(){ .inputs(HIGHLY_INSULATING_FOIL.getStackForm(64)) .notConsumable(MICROWORMHOLE_GENERATOR.getStackForm()) .outputs(SMD_CAPACITOR_SUPRACAUSAL.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO0) .buildAndRegister(); // SMD Diode @@ -37,7 +38,7 @@ public static void init(){ .input(dust,Tetracene,8) .notConsumable(MICROWORMHOLE_GENERATOR.getStackForm()) .outputs(SMD_DIODE_SUPRACAUSAL.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO0) .buildAndRegister(); // SMD Transistor @@ -47,7 +48,7 @@ public static void init(){ .input(dust,Tetracene,64) .notConsumable(MICROWORMHOLE_GENERATOR.getStackForm()) .outputs(SMD_TRANSISTOR_SUPRACAUSAL.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO0) .buildAndRegister(); // SMD Resistor @@ -57,10 +58,11 @@ public static void init(){ .input(dust, ChargedCaesiumCeriumCobaltIndium,16) .notConsumable(MICROWORMHOLE_GENERATOR.getStackForm()) .outputs(SMD_RESISTOR_SUPRACAUSAL.getStackForm(32)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO0) .buildAndRegister(); // Supracausal Processing Core + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(800).EUt(33550000) .inputs(NUCLEAR_CLOCK.getStackForm()) .inputs(TOPOLOGICAL_MANIPULATOR_UNIT.getStackForm(1)) @@ -75,7 +77,24 @@ public static void init(){ .inputs(SMD_RESISTOR_SUPRACAUSAL.getStackForm(64)) .fluidInputs(FullerenePolymerMatrix.getFluid(L * 9)) .outputs(SUPRACAUSAL_PROCESSING_CORE.getStackForm(8)) - .cleanroom(CleanroomType.STERILE_CLEANROOM) + .cleanroom(GCYLCleanroomType.ISO0) + .buildAndRegister(); + */ + ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(800).EUt(33550000) + .inputs(NUCLEAR_CLOCK.getStackForm()) + .inputs(TOPOLOGICAL_MANIPULATOR_UNIT.getStackForm(1)) + .inputs(RELATIVISTIC_SPINORIAL_MEMORY_SYSTEM.getStackForm(1)) + .inputs(GRAVITON_TRANSDUCER.getStackForm(1)) + .inputs(QCD_PROTECTIVE_PLATING.getStackForm(3)) + .input(plate, Neutronium) + .input(wireGtSingle, UXVSuperconductor, 2) + .inputs(SMD_CAPACITOR_SUPRACAUSAL.getStackForm(64)) + .inputs(SMD_DIODE_SUPRACAUSAL.getStackForm(64)) + .inputs(SMD_TRANSISTOR_SUPRACAUSAL.getStackForm(64)) + .inputs(SMD_RESISTOR_SUPRACAUSAL.getStackForm(64)) + .fluidInputs(FullerenePolymerMatrix.getFluid(L * 9)) + .outputs(SUPRACAUSAL_PROCESSING_CORE.getStackForm(GCYLConfig.recipes.circuitCoresPerCraft)) + .cleanroom(GCYLCleanroomType.ISO0) .buildAndRegister(); // Topological Manipulator Unit @@ -105,7 +124,7 @@ public static void init(){ .inputs(NEUTRON_REFLECTOR.getStackForm(2)) .inputs(BATTERY_MEDIUM_LIS.getStackForm()) .input(wireGtSingle, UXVSuperconductor, 2) - .inputs(FUSION_CASING.getItemVariant(ADV_FUSION_COIL_1)) + .inputs(FUSION_COILS.getItemVariant(ADV_FUSION_COIL_1)) .fluidInputs(Neutronium.getFluid(L * 9)) .outputs(RELATIVISTIC_SPINORIAL_MEMORY_SYSTEM.getStackForm()) .buildAndRegister(); diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/WetwareComponents.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/WetwareComponents.java index 78bc48f4..5ba996ca 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/WetwareComponents.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/circuits/components/WetwareComponents.java @@ -1,5 +1,6 @@ package com.fulltrix.gcyl.recipes.categories.circuits.components; +import com.fulltrix.gcyl.GCYLConfig; import gregtech.api.metatileentity.multiblock.CleanroomType; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -7,8 +8,8 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.BIO_REACTOR_RECIPES; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.BIO_REACTOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.GTValues.L; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; @@ -24,7 +25,23 @@ public static void init() { private static void components() { - //TODO: add wetware inductor + // wetware crystal chip + LASER_ENGRAVER_RECIPES.recipeBuilder().duration(600).EUt(80000) + .inputs(CRYSTAL_SYSTEM_ON_CHIP.getStackForm()) + .notConsumable(lens, MagnetoResonatic) + .outputs(ADVANCED_CRYSTAL_SOC.getStackForm()) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .buildAndRegister(); + + // wetware soc + CHEMICAL_RECIPES.recipeBuilder().duration(600).EUt(160000) + .inputs(HIGHLY_ADVANCED_SOC.getStackForm(8)) + .inputs(ADVANCED_CRYSTAL_SOC.getStackForm()) + .outputs(LIVING_SOC.getStackForm()) + .fluidInputs(SterileBioGrowthMedium.getFluid(50)) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .buildAndRegister(); + // SMD Capacitor ASSEMBLER_RECIPES.recipeBuilder().duration(80).EUt(30720) @@ -80,6 +97,8 @@ private static void components() { .buildAndRegister(); // Cyber Processing Unit + + /* ASSEMBLY_LINE_RECIPES.recipeBuilder() .inputs(ELECTRICALLY_WIRED_PETRI_DISH.getStackForm()) .input(foil, SiliconeRubber, 8) @@ -99,6 +118,28 @@ private static void components() { .EUt(30720 * 4) .duration(250) .buildAndRegister(); + */ + + ASSEMBLY_LINE_RECIPES.recipeBuilder() + .inputs(ELECTRICALLY_WIRED_PETRI_DISH.getStackForm()) + .input(foil, SiliconeRubber, 64) + .input(wireFine, Gold, 64) + .inputs(SMD_TRANSISTOR_WETWARE.getStackForm(4)) + .inputs(SMD_DIODE_WETWARE.getStackForm(4)) + .inputs(SMD_RESISTOR_WETWARE.getStackForm(4)) + .inputs(SMD_CAPACITOR_WETWARE.getStackForm(4)) + .inputs(WETWARE_CIRCUIT_BOARD.getStackForm()) + .inputs(STEM_CELLS.getStackForm(16)) + .inputs(NEURO_SUPPORT_UNIT.getStackForm()) + .fluidInputs(Polybenzimidazole.getFluid(L * 8)) + .fluidInputs(SterileGrowthMedium.getFluid(1000)) + .fluidInputs(Titanium.getFluid(L * 9)) + .fluidInputs(Cryotheum.getFluid(1000)) + .outputs(CYBER_PROCESSING_UNIT.getStackForm(GCYLConfig.recipes.circuitCoresPerCraft)) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .EUt(30720 * 4) + .duration(250) + .buildAndRegister(); } private static void bacteriaCultures() { diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/elevator/SpaceMiningRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/elevator/SpaceMiningRecipes.java new file mode 100644 index 00000000..64a1e519 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/elevator/SpaceMiningRecipes.java @@ -0,0 +1,281 @@ +package com.fulltrix.gcyl.recipes.categories.elevator; + +import gregtech.api.items.metaitem.MetaItem; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.ore.OrePrefix; +import gregtech.api.util.GTLog; +import it.unimi.dsi.fastutil.objects.Object2ObjectMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import org.eclipse.xtext.xbase.lib.Pair; +import org.jetbrains.annotations.Nullable; + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + + +import static com.fulltrix.gcyl.item.GCYLCoreItems.*; +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; +import static gregtech.api.unification.material.Materials.*; + + +public class SpaceMiningRecipes { + + public static final int STICK_INPUT_STACK_SIZE = 4; + public static final int DRILL_HEAD_INPUT_STACK_SIZE = 4; + + + public static Object2ObjectMap> SPACE_MINING_RECIPES = new Object2ObjectOpenHashMap<>(); + + public static Object2ObjectMap> HASH_TO_ITEMS = new Object2ObjectOpenHashMap<>(); + + public static void init() { + + + addNewRecipesForDroneAndMaterial(1, Steel, + Arrays.asList( + new SpaceMiningRecipePartTwo(Arrays.asList(new Pair<>(Coal, 70), new Pair<>(Lignite, 10), new Pair<>(Graphite, 20)), + 1920, 20, 200, 30,120, 200, 1,40, 1), + + new SpaceMiningRecipePartTwo(generateListOfPairs(Salt, 40, RockSalt, 20, Saltpeter, 40), + 1920, 20, 300, 30, 120, 200, 1, 250, 1), + + new SpaceMiningRecipePartTwo(generateListOfPairs(Iron, 40, Gold, 20, Magnetite, 10, Pyrite, 10, BasalticMineralSand, 5, GraniticMineralSand, 5), + 1920, 10, 600, 30, 150, 200, 1, 180, 1), + + new SpaceMiningRecipePartTwo(generateListOfPairs(Copper, 50, Chalcopyrite, 30, Malachite, 20), + 1920, 10, 500, 30,150,200, 3, 12, 1), + + new SpaceMiningRecipePartTwo(generateListOfPairs(Lead, 30, Arsenic, 25, Barium, 25, Lepidolite, 20), + 1920, 20, 220, 30, 100, 500, 5,150, 1), + + makeSpaceMiningRecipePart(7680, 50, 1, 2, 100, 50, 200, 10, 400, Cassiterite, 20, CassiteriteSand, 15, Tin, 60, Asbestos, 5), + + makeSpaceMiningRecipePart(7680, 50, 1, 5, 20, 20,40,20,170, Nickel, 40, Pentlandite, 30, Garnierite, 30), + + makeSpaceMiningRecipePart(7680, 800, 1, 20, 100, 30, 60, 30, 200, Clay, 100), + + makeSpaceMiningRecipePart(30720, 100, 1, 17,40,30,160,60,180, Ruby, 30, Emerald, 30, Sapphire, 30, GreenSapphire, 30, Diamond, 15, Opal, 15, Topaz, 20, BlueTopaz, 10, Bauxite, 10, Vinteum, 8, NetherStar, 1), + + makeSpaceMiningRecipePart(30720, 500, 1, 60, 200, 30, 70, 120, 100, Tungsten, 30, Titanium, 30, Neodymium, 20, Molybdenum, 15, Tungstate, 5) + )); + + addNewRecipesForDroneAndMaterial(2, Steel, upTierAllRecipes(1, Steel, 1)); + } + + public static SpaceMiningRecipePartTwo makeSpaceMiningRecipePart(int EUt, int duration, int minModuleTier, int minDistance, int maxDistance, int minSize, int maxSize, int CWUt, int weight, Object... outputsAndWeights) { + return new SpaceMiningRecipePartTwo(generateListOfPairs(outputsAndWeights), EUt, CWUt, weight, minSize, maxSize, duration, minDistance, maxDistance, minModuleTier); + } + + public static void addNewRecipeForDroneAndMaterial(int droneTier, Material material, SpaceMiningRecipePartTwo recipe) { + + ItemStack droneStack = getDroneByTier(droneTier); + + if(SPACE_MINING_RECIPES.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()) == null) { + SPACE_MINING_RECIPES.put(new SpaceMiningRecipePartOne(droneStack, material).hashCode(), new ArrayList<>()); + } + + SPACE_MINING_RECIPES.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()).add(recipe); + + if(HASH_TO_ITEMS.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()) == null) + HASH_TO_ITEMS.put(new SpaceMiningRecipePartOne(droneStack, material).hashCode(), Arrays.asList(droneStack, OreDictUnifier.get(OrePrefix.stick, material, STICK_INPUT_STACK_SIZE), OreDictUnifier.get(OrePrefix.toolHeadDrill, material, DRILL_HEAD_INPUT_STACK_SIZE))); + } + + + public static void addNewRecipesForDroneAndMaterial(int droneTier, Material material, List list) { + + ItemStack droneStack = getDroneByTier(droneTier); + + if(SPACE_MINING_RECIPES.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()) == null) { + SPACE_MINING_RECIPES.put(new SpaceMiningRecipePartOne(droneStack, material).hashCode(), new ArrayList<>()); + } + + SPACE_MINING_RECIPES.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()).addAll(list); + + if(HASH_TO_ITEMS.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()) == null) + HASH_TO_ITEMS.put(new SpaceMiningRecipePartOne(droneStack, material).hashCode(), Arrays.asList(droneStack, OreDictUnifier.get(OrePrefix.stick, material, STICK_INPUT_STACK_SIZE), OreDictUnifier.get(OrePrefix.toolHeadDrill, material, DRILL_HEAD_INPUT_STACK_SIZE))); + } + + public static void removeRecipeForDroneAndMaterial(int droneTier, Material material, SpaceMiningRecipePartTwo recipe) { + + ItemStack droneStack = getDroneByTier(droneTier); + + if(SPACE_MINING_RECIPES.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()) == null) { + throw new RuntimeException("No matching Drone and Material found!"); + } + + if(!SPACE_MINING_RECIPES.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()).remove(recipe)) { + throw new RuntimeException("No matching Recipe found for Drone and Material!"); + } + + if(SPACE_MINING_RECIPES.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()).isEmpty()) + HASH_TO_ITEMS.remove(new SpaceMiningRecipePartOne(droneStack, material).hashCode()); + + } + + public static void removeAllRecipesForDroneAndMaterial(int droneTier, Material material) { + + ItemStack droneStack = getDroneByTier(droneTier); + + if(SPACE_MINING_RECIPES.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()) == null) { + throw new RuntimeException("No matching Drone and Material found!"); + } + + SPACE_MINING_RECIPES.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()).clear(); + + HASH_TO_ITEMS.remove(new SpaceMiningRecipePartOne(droneStack, material).hashCode()); + } + + public static List upTierAllRecipes(int droneTier, Material material, int tier) { + + ItemStack droneStack = getDroneByTier(droneTier); + + if(SPACE_MINING_RECIPES.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()) == null) { + throw new RuntimeException("No matching Drone and Material found!"); + } + + List recipes = SPACE_MINING_RECIPES.get(new SpaceMiningRecipePartOne(droneStack, material).hashCode()); + List recipesUp = new ArrayList<>(); + + for(SpaceMiningRecipePartTwo recipe : recipes) { + recipesUp.add(recipe.copyAndUpTierRecipe(tier)); + } + + return recipesUp; + } + + private static ItemStack getDroneByTier(int tier) { + return switch (tier) { + case (1) -> MINING_DRONE_1.getStackForm(); + case (2) -> MINING_DRONE_2.getStackForm(); + case (3) -> MINING_DRONE_3.getStackForm(); + case (4) -> MINING_DRONE_4.getStackForm(); + case (5) -> MINING_DRONE_5.getStackForm(); + case (6) -> MINING_DRONE_6.getStackForm(); + case (7) -> MINING_DRONE_7.getStackForm(); + case (8) -> MINING_DRONE_8.getStackForm(); + case (9) -> MINING_DRONE_9.getStackForm(); + case (10) -> MINING_DRONE_10.getStackForm(); + case (11) -> MINING_DRONE_11.getStackForm(); + case (12) -> MINING_DRONE_12.getStackForm(); + case (13) -> MINING_DRONE_13.getStackForm(); + case (14) -> MINING_DRONE_14.getStackForm(); + default -> null; + }; + } + + + public static List> generateListOfPairs(Object... objects) { + List> stuff = new ArrayList<>(); + for(int i = 0; i < objects.length; i+=2) { + if(!(objects[i] instanceof Material mat) || !(objects[i + 1] instanceof Integer weight)) + return null; + + stuff.add(new Pair<>(mat, weight)); + } + + return stuff; + } + + public static class SpaceMiningRecipePartOne { + + private final int drone; + private final Material rodAndDrill; + + public SpaceMiningRecipePartOne(@Nullable ItemStack drone, Material rodAndDrill) { + this.drone = drone != null ? drone.getMetadata() : 0; + this.rodAndDrill = rodAndDrill; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SpaceMiningRecipePartOne that = (SpaceMiningRecipePartOne) o; + return Objects.equals(drone, that.drone) && Objects.equals(rodAndDrill, that.rodAndDrill); + } + + @Override + public int hashCode() { + return Objects.hash(drone, rodAndDrill); + } + } + + public static class SpaceMiningRecipePartTwo { + private final List> outputs; + private final int computation; + private final int weight; + private final int minSize; + private final int maxSize; + private final int minDistance; + private final int maxDistance; + private final long EUt; + private final int duration; + private final int minModuleTier; + + + private SpaceMiningRecipePartTwo(List> outputs, long EUt, int computation, int weight, int minSize, int maxSize, int duration, int minDistance, int maxDistance, int minModuleTier) { + this.outputs = outputs; + this.computation = computation; + this.weight = weight; + this.minSize = minSize; + this.maxSize = maxSize; + this.duration = duration; + this.minDistance = minDistance; + this.maxDistance = maxDistance; + this.EUt = EUt; + this.minModuleTier = minModuleTier; + } + + public SpaceMiningRecipePartTwo copyAndUpTierRecipe(int tier) { + return new SpaceMiningRecipePartTwo(this.outputs, this.EUt, this.computation, this.weight, this.minSize + tier * 4, this.maxSize + tier * 8, (int) (this.duration - (this.duration * .1 * tier)), this.minDistance, this.maxDistance, this.minModuleTier); + } + + + public List> getOutputs() { + return outputs; + } + + public int getComputation() { + return computation; + } + + public int getWeight() { + return weight; + } + + + public int getDuration() { + return duration; + } + + public int getMinSize() { + return minSize; + } + + public int getMaxSize() { + return maxSize; + } + + public int getMinDistance() { + return minDistance; + } + + public int getMaxDistance() { + return maxDistance; + } + + public long getEUt() { + return EUt; + } + + public int getMinModuleTier() { + return minModuleTier; + } + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/elevator/SpacePumpRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/elevator/SpacePumpRecipes.java new file mode 100644 index 00000000..1ddd134f --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/elevator/SpacePumpRecipes.java @@ -0,0 +1,49 @@ +package com.fulltrix.gcyl.recipes.categories.elevator; + +import com.fulltrix.gcyl.GCYLConfig; +import it.unimi.dsi.fastutil.objects.Object2ObjectMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import net.minecraftforge.fluids.FluidStack; + +import static gregtech.api.unification.material.Materials.*; + +public class SpacePumpRecipes { + + public static Object2ObjectMap GAS_SIPHON_RECIPES = new Object2ObjectOpenHashMap<>(); + + public static Object2ObjectMap PLANET_ID_TO_PLANET_NAME_MAP = new Object2ObjectOpenHashMap<>(); + + public static void init() { + initSpacePumpPlanets(); + gasSiphon(); + } + + private static void gasSiphon() { + addSpacePumpRecipe(1,2, Hydrogen.getFluid(1000000)); + addSpacePumpRecipe(2,1, Helium3.getFluid(32000)); + addSpacePumpRecipe(3,4, Radon.getFluid(8000)); + addSpacePumpRecipe(4,3, Nitrogen.getFluid(1000000)); + } + + private static void initSpacePumpPlanets() { + for(int i = 0; i < GCYLConfig.space.planetNames.length; i++) { + PLANET_ID_TO_PLANET_NAME_MAP.put(i+1, GCYLConfig.space.planetNames[i]); + } + } + + private static void addSpacePumpRecipe(int planetID, int fluidID, FluidStack fluidStack) { + try { + if (planetID < 1 || fluidID < 1) { + throw new Exception(); + } + } catch (Exception e) { + throw new RuntimeException("Planet ID or Fluid ID is less than 1! This is not allowed!"); + } + + GAS_SIPHON_RECIPES.put(planetID + "," + fluidID, fluidStack); + } + + public static String getPlanetNameByID(int id) { + return PLANET_ID_TO_PLANET_NAME_MAP.get(id); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/handlers/ElectricImplosionHandler.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/handlers/ElectricImplosionHandler.java index dc2e1543..bfaea5fc 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/handlers/ElectricImplosionHandler.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/handlers/ElectricImplosionHandler.java @@ -1,9 +1,10 @@ package com.fulltrix.gcyl.recipes.categories.handlers; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregtech.api.recipes.Recipe; import gregtech.api.recipes.RecipeMaps; import gregtech.api.recipes.ingredients.GTRecipeInput; +import gregtech.api.recipes.properties.impl.ImplosionExplosiveProperty; import gregtech.api.util.ItemStackHashStrategy; import it.unimi.dsi.fastutil.Hash; import it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet; @@ -21,7 +22,7 @@ public class ElectricImplosionHandler { * Note that it does NOT compare count, since I needed this * to properly remove the explosive without knowing its count. */ - private static final Hash.Strategy strategy = new ItemStackHashStrategy.ItemStackHashStrategyBuilder() + private static final Hash.Strategy strategy = new ItemStackHashStrategy.Builder() .compareItem(true) .compareDamage(true) .build(); @@ -51,7 +52,7 @@ public static void buildElectricImplosionRecipes() { RecipeMaps.IMPLOSION_RECIPES.getRecipeList().forEach(recipe -> { // Get the explosive type used in this recipe - ItemStack explosive = (ItemStack) recipe.getRecipePropertyStorage().getRawRecipePropertyValue(PROPERTY); + ItemStack explosive = (ItemStack) recipe.propertyStorage().get(ImplosionExplosiveProperty.getInstance(), ItemStack.EMPTY); // Get the input list, converting from CountableIngredient to ItemStack AtomicInteger stackCount = new AtomicInteger(); diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/handlers/VoidMinerHandler.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/handlers/VoidMinerHandler.java index a9c114ba..c7bc23b8 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/handlers/VoidMinerHandler.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/handlers/VoidMinerHandler.java @@ -21,41 +21,46 @@ public class VoidMinerHandler { public static void register() { OrePrefix.ore.addProcessingHandler(PropertyKey.ORE, VoidMinerHandler::processVoidOre); + addWhitelist(); } - private static void processVoidOre(OrePrefix dustPrefix, Material material, OreProperty property) { + private static void processVoidOre(OrePrefix orePrefix, Material material, OreProperty property) { OrePrefix currentOre = OrePrefix.ore; //TODO: add support for other products in ore processing chain? or add ore processing factory from GTNH if (GCYLConfig.multis.voidMiner.oreVariants) { - if (!Arrays.asList(GCYLConfig.multis.voidMiner.oreBlacklist).contains(material.toString())) { + if (!Arrays.asList(GCYLConfig.multis.voidMiner.oreBlacklist).contains(material.toString()) && !Arrays.asList(GCYLConfig.multis.voidMiner.oreBlackListDeepMinerConflict).contains(material.toString()) && !Arrays.asList(GCYLConfig.multis.voidMiner.oreBlackListUniversal).contains(material.toString())) { ORES.addAll(OreDictUnifier.getAll(new UnificationEntry(currentOre, material))); } - if (!Arrays.asList(GCYLConfig.multis.voidMiner.oreBlacklistUHV).contains(material.toString())) { + if (!Arrays.asList(GCYLConfig.multis.voidMiner.oreBlacklistUHV).contains(material.toString()) && !Arrays.asList(GCYLConfig.multis.voidMiner.oreBlackListDeepMinerConflict).contains(material.toString()) && !Arrays.asList(GCYLConfig.multis.voidMiner.oreBlackListUniversal).contains(material.toString())) { ORES_2.addAll(OreDictUnifier.getAll(new UnificationEntry(currentOre, material))); } - if (!Arrays.asList(GCYLConfig.multis.voidMiner.oreBlacklistUEV).contains(material.toString())) { + if (!Arrays.asList(GCYLConfig.multis.voidMiner.oreBlacklistUEV).contains(material.toString()) && !Arrays.asList(GCYLConfig.multis.voidMiner.oreBlackListDeepMinerConflict).contains(material.toString()) && !Arrays.asList(GCYLConfig.multis.voidMiner.oreBlackListUniversal).contains(material.toString())) { ORES_3.addAll(OreDictUnifier.getAll(new UnificationEntry(currentOre, material))); } } else { - if (!Arrays.asList(GCYLConfig.multis.voidMiner.oreBlacklist).contains(material.toString())) { + if (!Arrays.asList(GCYLConfig.multis.voidMiner.oreBlacklist).contains(material.toString()) && !Arrays.asList(GCYLConfig.multis.voidMiner.oreBlackListDeepMinerConflict).contains(material.toString()) && !Arrays.asList(GCYLConfig.multis.voidMiner.oreBlackListUniversal).contains(material.toString())) { ORES.add(OreDictUnifier.get(new UnificationEntry(currentOre, material))); } - if (!Arrays.asList(GCYLConfig.multis.voidMiner.oreBlacklistUHV).contains(material.toString())) { + if (!Arrays.asList(GCYLConfig.multis.voidMiner.oreBlacklistUHV).contains(material.toString()) && !Arrays.asList(GCYLConfig.multis.voidMiner.oreBlackListDeepMinerConflict).contains(material.toString()) && !Arrays.asList(GCYLConfig.multis.voidMiner.oreBlackListUniversal).contains(material.toString())) { ORES_2.add(OreDictUnifier.get(new UnificationEntry(currentOre, material))); } - if (!Arrays.asList(GCYLConfig.multis.voidMiner.oreBlacklistUEV).contains(material.toString())) { + if (!Arrays.asList(GCYLConfig.multis.voidMiner.oreBlacklistUEV).contains(material.toString()) && !Arrays.asList(GCYLConfig.multis.voidMiner.oreBlackListDeepMinerConflict).contains(material.toString()) && !Arrays.asList(GCYLConfig.multis.voidMiner.oreBlackListUniversal).contains(material.toString())) { ORES_3.add(OreDictUnifier.get(new UnificationEntry(currentOre, material))); } } } public static void addWhitelist() { - addItemsToList(GCYLConfig.multis.voidMiner.oreWhitelist, ORES); - addItemsToList(GCYLConfig.multis.voidMiner.oreWhitelistUHV, ORES_2); - addItemsToList(GCYLConfig.multis.voidMiner.oreWhitelistUEV, ORES_3); + if(GCYLConfig.multis.voidMiner.oreWhitelist.length > 0) + addItemsToList(GCYLConfig.multis.voidMiner.oreWhitelist, ORES); + if(GCYLConfig.multis.voidMiner.oreWhitelistUHV.length > 0) + addItemsToList(GCYLConfig.multis.voidMiner.oreWhitelistUHV, ORES_2); + if(GCYLConfig.multis.voidMiner.oreWhitelistUEV.length > 0) + addItemsToList(GCYLConfig.multis.voidMiner.oreWhitelistUEV, ORES_3); + } private static void addItemsToList(String[] itemStrings, List list) { diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/machines/MachineCraftingRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/machines/MachineCraftingRecipes.java index 16819075..dc195b96 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/machines/MachineCraftingRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/machines/MachineCraftingRecipes.java @@ -1,5 +1,6 @@ package com.fulltrix.gcyl.recipes.categories.machines; +import com.fulltrix.gcyl.api.GCYLUtility; import com.fulltrix.gcyl.machines.GCYLTileEntities; import gregtech.api.GTValues; import gregtech.api.recipes.ModHandler; @@ -10,9 +11,12 @@ import gregtech.common.blocks.MetaBlocks; import gregtech.common.items.MetaItems; import gregtech.common.metatileentities.MetaTileEntities; +import gregtech.loaders.recipe.CraftingComponent; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; +import static com.fulltrix.gcyl.machines.GCYLTileEntities.HIGH_DIODES; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.TOOL_DATA_MODULE_CLUSTER; import static com.fulltrix.gcyl.item.GCYLCoreItems.UVA_HALIDE_LAMP; @@ -30,16 +34,40 @@ import static gregtech.common.items.MetaItems.*; import static gregtech.common.metatileentities.MetaTileEntities.CLEANING_MAINTENANCE_HATCH; import static gregtech.common.metatileentities.MetaTileEntities.HULL; +import static gregtech.loaders.recipe.CraftingComponent.CABLE_QUAD; +import static gregtech.loaders.recipe.CraftingComponent.PLATE; +import static gregtech.loaders.recipe.MetaTileEntityLoader.registerMachineRecipe; public class MachineCraftingRecipes { public static void init() { hullOverride(); + diodeOverride(); MultiblockCraftingRecipes.init(); SingleblockCraftingRecipes.init(); misc(); } + private static void diodeOverride() { + removeTieredRecipeByName("gregtech:gregtech.machine.diode.", GTValues.MV, GTValues.MAX); + + for (int i = 2; i < GTValues.MAX + 1; i++) { + registerMachineRecipe(ArrayUtils.subarray(MetaTileEntities.DIODES, i, i+1), "CDC", "DHD", + "PDP", 'H', CraftingComponent.HULL, 'D', GCYLUtility.getDiodeByTier(i), 'P', PLATE, 'C', CABLE_QUAD); + } + + for (int i = GTValues.IV; i < GTValues.MAX; i++) { + ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(VA[i]) + .input(MetaTileEntities.DIODES[i]) + .input(GCYLUtility.getDiodeByTier(i), 16) + .input(cableGtHex, GCYLUtility.getCableByTier(i), 2) + .input(plate, GCYLUtility.getMaterialByTier(i), 8) + .fluidInputs(GCYLUtility.getPolymerByTier(i).getFluid(L * 4)) + .output(HIGH_DIODES[i - GTValues.IV]) + .buildAndRegister(); + } + } + private static void hullOverride() { //TODO add OpV machine hull recipes removeTieredRecipeByName("gregtech:gregtech.machine.hull.", GTValues.ZPM, GTValues.MAX); @@ -74,8 +102,8 @@ private static void hullOverride() { //TODO add OpV machine hull recipes ASSEMBLER_RECIPES.recipeBuilder().EUt(16).duration(50).inputs(MetaBlocks.MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.UEV)).input(cableGtQuadruple, Pikyonium, 2).fluidInputs(Polyetheretherketone.getFluid(L * 2)).outputs(HULL[10].getStackForm()).buildAndRegister(); ASSEMBLER_RECIPES.recipeBuilder().EUt(16).duration(50).inputs(MetaBlocks.MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.UIV)).input(cableGtQuadruple, Cinobite, 2).fluidInputs(Zylon.getFluid(L * 2)).outputs(HULL[11].getStackForm()).buildAndRegister(); ASSEMBLER_RECIPES.recipeBuilder().EUt(16).duration(50).inputs(MetaBlocks.MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.UXV)).input(cableGtQuadruple, NaquadriaticTaranium, 2).fluidInputs(Zylon.getFluid(L * 2)).outputs(HULL[12].getStackForm()).buildAndRegister(); - ASSEMBLER_RECIPES.recipeBuilder().EUt(16).duration(50).inputs(MetaBlocks.MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.UXV)).input(cableGtQuadruple, Neutronium, 2).fluidInputs(FullerenePolymerMatrix.getFluid(L * 2)).outputs(HULL[13].getStackForm()).buildAndRegister(); - ASSEMBLER_RECIPES.recipeBuilder().EUt(16).duration(50).inputs(MetaBlocks.MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.UXV)).input(cableGtQuadruple, CosmicNeutronium, 2).fluidInputs(FullerenePolymerMatrix.getFluid(L * 2)).outputs(HULL[14].getStackForm()).buildAndRegister(); + ASSEMBLER_RECIPES.recipeBuilder().EUt(16).duration(50).inputs(MetaBlocks.MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.OpV)).input(cableGtQuadruple, Neutronium, 2).fluidInputs(FullerenePolymerMatrix.getFluid(L * 2)).outputs(HULL[13].getStackForm()).buildAndRegister(); + ASSEMBLER_RECIPES.recipeBuilder().EUt(16).duration(50).inputs(MetaBlocks.MACHINE_CASING.getItemVariant(BlockMachineCasing.MachineCasingType.MAX)).input(cableGtQuadruple, CosmicNeutronium, 2).fluidInputs(FullerenePolymerMatrix.getFluid(L * 2)).outputs(HULL[14].getStackForm()).buildAndRegister(); removeTieredRecipeByName("gregtech:casing_", GTValues.ZPM, GTValues.MAX); // UHV+ Casings @@ -220,25 +248,6 @@ private static void misc() { */ - //STERILE FILTRATION MAINTENANCE HATCH - ASSEMBLY_LINE_RECIPES.recipeBuilder() - .outputs(STERILE_CLEANING_MAINTENANCE_HATCH.getStackForm()) - .inputs(CLEANING_MAINTENANCE_HATCH.getStackForm()) - .inputs(ROBOT_ARM_UIV.getStackForm(4)) - .input(circuit, MarkerMaterials.Tier.UIV, 6) - .inputs(HULL[GTValues.UIV].getStackForm()) - .inputs(EMITTER_UIV.getStackForm(2)) - .inputs(UVA_HALIDE_LAMP.getStackForm(4)) - .fluidInputs(Indalloy140.getFluid(L * 8)) - .fluidInputs(Lubricant.getFluid(L * 4)) - .stationResearch(b -> b - .researchStack(CLEANING_MAINTENANCE_HATCH.getStackForm()) - .CWUt(512) - .dataStack(TOOL_DATA_MODULE_CLUSTER.getStackForm()) - .EUt(VA[GTValues.UIV])) - .duration(300).EUt(GTValues.VA[GTValues.UIV]) - .buildAndRegister(); - } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/machines/MultiblockCraftingRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/machines/MultiblockCraftingRecipes.java index c658b4c5..484b213b 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/categories/machines/MultiblockCraftingRecipes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/machines/MultiblockCraftingRecipes.java @@ -1,23 +1,27 @@ package com.fulltrix.gcyl.recipes.categories.machines; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.GCYLMultiblockCasing2; +import com.fulltrix.gcyl.blocks.component_al.GCYLComponentALCasing; +import com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils; import com.fulltrix.gcyl.machines.GCYLTileEntities; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; import gregtech.api.GTValues; +import gregtech.api.metatileentity.multiblock.CleanroomType; import gregtech.api.recipes.ModHandler; -import gregtech.api.unification.OreDictUnifier; import gregtech.api.unification.material.MarkerMaterials; import gregtech.api.unification.stack.UnificationEntry; -import gregtech.common.blocks.BlockBoilerCasing; -import gregtech.common.blocks.BlockMetalCasing; -import gregtech.common.blocks.MetaBlocks; +import gregtech.common.blocks.*; import gregtech.common.items.MetaItems; import gregtech.common.metatileentities.MetaTileEntities; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.item.fusion.GCYLFusionCasing.CasingType.ADV_FUSION_COIL_3; +import static com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3; import static com.fulltrix.gcyl.machines.GCYLTileEntities.*; import static com.fulltrix.gcyl.materials.GCYLNuclearMaterials.Einsteinium253; +import static com.fulltrix.gcyl.api.GCYLUtility.*; import static gregicality.multiblocks.api.unification.GCYMMaterials.*; import static gregtech.api.GTValues.IV; import static gregtech.api.GTValues.L; @@ -63,10 +67,10 @@ public static void multiblockOverride() { 'C', new UnificationEntry(circuit, MarkerMaterials.Tier.IV), 'H', new UnificationEntry(spring, MolybdenumDisilicide), 'P', new UnificationEntry(pipeHugeFluid, StainlessSteel), - 'R', MetaTileEntities.CENTRIFUGE[IV].getStackForm(), - 'T', MetaTileEntities.THERMAL_CENTRIFUGE[IV].getStackForm(), - 'M', MetaItems.ELECTRIC_MOTOR_IV.getStackForm(), - 'W', new UnificationEntry(cableGtSingle, Platinum)); + 'R', MetaTileEntities.CENTRIFUGE[GTValues.EV].getStackForm(), + 'T', MetaTileEntities.THERMAL_CENTRIFUGE[GTValues.EV].getStackForm(), + 'M', MetaItems.ELECTRIC_MOTOR_EV.getStackForm(), + 'W', new UnificationEntry(cableGtDouble, Aluminium)); /* Backup recipe ModHandler.addShapedRecipe("large_centrifuge", ADVANCED_CENTRIFUGE.getStackForm(), "CBC", "RHR", "DED", @@ -177,10 +181,10 @@ private static void otherMultiblockInit() { // Bio Reactor ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(30720).duration(500) .fluidInputs(SolderingAlloy.getFluid(L * 9)) - .inputs(SENSOR_LuV.getStackForm(2)) - .inputs(ELECTRIC_PUMP_LuV.getStackForm(2)) - .inputs(ROBOT_ARM_LuV.getStackForm(2)) - .inputs(EMITTER_LuV.getStackForm(2)) + .inputs(SENSOR_LuV.getStackForm(1)) + .inputs(ELECTRIC_PUMP_LuV.getStackForm(1)) + .inputs(ROBOT_ARM_LuV.getStackForm(1)) + .inputs(EMITTER_LuV.getStackForm(1)) .input(plate, HSSS, 8) .input(screw, NaquadahEnriched, 16) .input(circuit, UV, 8) @@ -238,8 +242,8 @@ private static void otherMultiblockInit() { .inputs(DEGENERATE_RHENIUM_PLATE.getStackForm(4)) .input(foil, Zylon, 64) .input(foil, Zylon, 64) - .inputs(FIELD_GENERATOR_UXV.getStackForm(2)) - .inputs(ELECTRIC_PUMP_UXV.getStackForm(2)) + .inputs(FIELD_GENERATOR_OpV.getStackForm(2)) + .inputs(ELECTRIC_PUMP_OpV.getStackForm(2)) .inputs(HYPER_REACTOR[1].getStackForm()) .outputs(HYPER_REACTOR[2].getStackForm()) .buildAndRegister(); @@ -283,7 +287,7 @@ private static void otherMultiblockInit() { .inputs(SENSOR_UIV.getStackForm(4)) .inputs(SCINTILLATOR.getStackForm(2)) .inputs(LEPTON_TRAP_CRYSTAL.getStackForm(4)) - .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(ADV_FUSION_COIL_3, 2)) + .inputs(GCYLMetaBlocks.FUSION_COILS.getItemVariant(ADV_FUSION_COIL_3, 2)) .outputs(COSMIC_RAY_DETECTOR.getStackForm()) .buildAndRegister(); @@ -296,8 +300,13 @@ private static void otherMultiblockInit() { .input(block, IncoloyMA956, 2) .input(stickLong, Osmium, 64) .input(ring, Osmium, 64) - .input(wireGtSingle, UVSuperconductor, 16) + .input(wireGtSingle, UVSuperconductor, 64) + .input(wireGtSingle, UVSuperconductor, 64) .inputs(ELECTRIC_PISTON_UV.getStackForm(16)) + .stationResearch(b -> b + .researchStack(IMPLOSION_COMPRESSOR.getStackForm()) + .CWUt(64) + .EUt(GTValues.VA[GTValues.UV])) .outputs(ELECTRIC_IMPLOSION.getStackForm()) .buildAndRegister(); @@ -344,11 +353,11 @@ private static void otherMultiblockInit() { //Decay chamber ModHandler.addShapedRecipe("gcyl_decay_chamber", DECAY_CHAMBER.getStackForm(), "RCR", "FAF","WCW", - 'R', new UnificationEntry(stick, Plutonium241), - 'F', FIELD_GENERATOR_IV, + 'R', new UnificationEntry(stick, Plutonium239), + 'F', FIELD_GENERATOR_EV, 'C', new UnificationEntry(circuit, MarkerMaterials.Tier.IV), - 'A', HULL[IV].getStackForm(), - 'W', new UnificationEntry(cableGtDouble, NaquadahAlloy)); + 'A', HULL[GTValues.EV].getStackForm(), + 'W', new UnificationEntry(cableGtDouble, Tungsten)); //Greenhouses ModHandler.addShapedRecipe("gcyl_greenhouse_mv", GREEN_HOUSE[0].getStackForm(), @@ -391,13 +400,147 @@ private static void otherMultiblockInit() { .input(rotor, HSSE, 8) .inputs(ELECTRIC_MOTOR_ZPM.getStackForm(8)) .input(circuit, MarkerMaterials.Tier.ZPM, 4) - .fluidInputs(Indalloy140.getFluid(L * 8)) + .fluidInputs(SolderingAlloy.getFluid(L * 8)) + .fluidInputs(Lubricant.getFluid(L * 16)) .outputs(MEGA_CLEANROOM.getStackForm()) .scannerResearch(b->b .researchStack(CLEANROOM.getStackForm()) .EUt(GTValues.VA[GTValues.ZPM])) .buildAndRegister(); + //WIRELESS PSS + ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.UV]).duration(1200) + .outputs(WIRELESS_PSS.getStackForm()) + .inputs(POWER_SUBSTATION.getStackForm()) + .inputs(GCYLMetaBlocks.MULTIBLOCK_CASING2.getItemVariant(GCYLMultiblockCasing2.CasingType.SEABORGIUM_SUBSTATION, 4)) + .input(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT, 64) + .input(ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT, 64) + .input(MetaItems.ENERGY_CLUSTER, 16) + .input(circuit, UEV) + .input(circuit, UEV) + .input(circuit, UEV) + .input(circuit, UEV) + .input(wireGtSingle, UVSuperconductor, 64) + .input(wireGtSingle, UVSuperconductor, 64) + .input(wireGtSingle, UVSuperconductor, 64) + .input(wireGtSingle, UVSuperconductor, 64) + .fluidInputs(Indalloy140.getFluid(L * 16)) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .stationResearch(b-> b + .researchStack(POWER_SUBSTATION.getStackForm()) + .CWUt(128) + .EUt(GTValues.VA[GTValues.UV])) + .buildAndRegister(); + + //WIRELESS DATA BANK + ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.UIV]).duration(1200) + .outputs(WIRELESS_DATA_BANK.getStackForm()) + .inputs(DATA_BANK.getStackForm()) + .input(circuit, UXV, 8) + .input(TOOL_DATA_ULTIMATE) + .inputs(FIELD_GENERATOR_UIV.getStackForm(4)) + .input(wireGtDouble, UIVSuperconductor, 64) + .input(wireGtDouble, UIVSuperconductor, 64) + .fluidInputs(Indalloy140.getFluid(L * 32)) + .fluidInputs(MetastableOganesson.getFluid(L * 16)) + .cleanroom(GCYLCleanroomType.ISO2) + .stationResearch(b -> b + .researchStack(RESEARCH_STATION.getStackForm()) + .dataStack(TOOL_DATA_ULTIMATE.getStackForm()) + .CWUt(1024) + .EUt(GTValues.VA[GTValues.UIV])) + .buildAndRegister(); + + //LARGE GAS COLLECTOR + ModHandler.addShapedRecipe("large_gas_collector", LARGE_AIR_COLLECTOR.getStackForm(), + "FFF", "CAC", "MRM", + 'F', MetaBlocks.CLEANROOM_CASING.getItemVariant(BlockCleanroomCasing.CasingType.FILTER_CASING), + 'C', new UnificationEntry(circuit, MarkerMaterials.Tier.IV), + 'A', GAS_COLLECTOR[5].getStackForm(), + 'M', new UnificationEntry(plate, MaragingSteel250), + 'R', new UnificationEntry(rotor, MaragingSteel250)); + + //Large Fisher + ModHandler.addShapedRecipe("large_fisher", LARGE_FISHER.getStackForm(), + "CDC", "PAP","MBM", + 'D', new UnificationEntry(plateDense, WatertightSteel), + 'C', new UnificationEntry(circuit, MarkerMaterials.Tier.IV), + 'A', FISHER[3].getStackForm(), + 'M', ELECTRIC_MOTOR_IV.getStackForm(), + 'P', ELECTRIC_PISTON_IV.getStackForm(), + 'B', ELECTRIC_PUMP_IV.getStackForm()); + + //Large Rock Breaker + getAssLineResearchBuilder(GTValues.UHV, 2400, ROCK_BREAKER[8].getStackForm(), false, false) + .outputs(LARGE_ROCK_BREAKER.getStackForm()) + .inputs(ROCK_BREAKER[8].getStackForm()) + .input(COMPONENT_GRINDER_TUNGSTEN, 2) + .inputs(ELECTRIC_MOTOR_UHV.getStackForm(4)) + .inputs(ELECTRIC_PISTON_UHV.getStackForm(4)) + .inputs(MetaBlocks.TRANSPARENT_CASING.getItemVariant(BlockGlassCasing.CasingType.FUSION_GLASS, 8)) + .input(cableGtDouble, TungstenTitaniumCarbide,2) + .fluidInputs(Indalloy140.getFluid(9216)) + .fluidInputs(Lava.getFluid(32000)) + .fluidInputs(Water.getFluid(32000)) + .fluidInputs(getPolymerByTier(9).getFluid(9216)) + .buildAndRegister(); + + //Ore Processing Factory + ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(VA[GTValues.UHV]).duration(1200) + .outputs(ORE_FACTORY.getStackForm()) + .input(HULL[GTValues.UHV]) + .inputs(ELECTRIC_MOTOR_UHV.getStackForm(32)) + .inputs(ELECTRIC_PISTON_UHV.getStackForm(8)) + .inputs(ELECTRIC_PUMP_UHV.getStackForm(16)) + .inputs(CONVEYOR_MODULE_UHV.getStackForm(8)) + .inputs(ROBOT_ARM_UHV.getStackForm(8)) + .input(circuit, UEV, 4) + .input(cableGtQuadruple, Duranium, 32) + .input(pipeNormalFluid, Polybenzimidazole, 64) + .input(COMPONENT_GRINDER_TUNGSTEN, 64) + .input(plateDouble, StainlessSteel, 32) + .input(rotor, Chrome, 16) + .fluidInputs(Indalloy140.getFluid(L * 16)) + .fluidInputs(Seaborgium.getFluid(L*8)) + .buildAndRegister(); + + //Component Assembly Line + getAssLineResearchBuilder(GTValues.UHV, 600, GCYLMetaBlocks.GCYL_COMPONENT_AL_CASING.getItemVariant(GCYLComponentALCasing.CasingType.CASING_EV), false, false) + .outputs(COMPONENT_ASSEMBLY_LINE.getStackForm()) + .inputs(ASSEMBLY_LINE.getStackForm(16)) + .inputs(MetaBlocks.MULTIBLOCK_CASING.getItemVariant(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_LINE_CASING, 16)) + .inputs(MetaBlocks.MULTIBLOCK_CASING.getItemVariant(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_CONTROL, 32)) + .inputs(ROBOT_ARM_UV.getStackForm(16)) + .inputs(CONVEYOR_MODULE_UV.getStackForm(32)) + .inputs(ELECTRIC_MOTOR_UV.getStackForm(32)) + .input(pipeNormalFluid, Polybenzimidazole, 16) + .input(plateDense, Iridium, 32) + .inputs(FLUID_SOLIDIFIER[8].getStackForm(16)) + .input(circuit, MarkerMaterials.Tier.UV, 16) + .input(circuit, ZPM, 20) + .input(circuit, MarkerMaterials.Tier.LuV, 24) + .fluidInputs(Indalloy140.getFluid(12 * L)) + .fluidInputs(Naquadria.getFluid(L * 16)) + .fluidInputs(Lubricant.getFluid(5000)) + .buildAndRegister(); + + //Advanced Assembly Line + ASSEMBLY_LINE_RECIPES.recipeBuilder().EUt(GTValues.VA[GTValues.LuV]).duration(1200) + .outputs(ADVANCED_ASSLINE.getStackForm()) + .inputs(ASSEMBLY_LINE.getStackForm()) + .inputs(GCYMMetaTileEntities.PARALLEL_HATCH[1].getStackForm(16)) + .inputs(EMITTER_ZPM.getStackForm(4)) + .inputs(ROBOT_ARM_ZPM.getStackForm(8)) + .inputs(CONVEYOR_MODULE_ZPM.getStackForm(8)) + .fluidInputs(SolderingAlloy.getFluid(L * 16)) + .fluidInputs(Lubricant.getFluid(2500)) + .scannerResearch(b -> b + .researchStack(ASSEMBLY_LINE.getStackForm()) + .EUt(GTValues.VA[GTValues.ZPM])) + .buildAndRegister(); + + + /* diff --git a/src/main/java/com/fulltrix/gcyl/recipes/categories/machines/MultiblockPartCraftingRecipes.java b/src/main/java/com/fulltrix/gcyl/recipes/categories/machines/MultiblockPartCraftingRecipes.java new file mode 100644 index 00000000..dee93277 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/categories/machines/MultiblockPartCraftingRecipes.java @@ -0,0 +1,400 @@ +package com.fulltrix.gcyl.recipes.categories.machines; + +import com.fulltrix.gcyl.api.multi.GCYLCleanroomType; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.component_al.GCYLComponentALCasing; +import com.fulltrix.gcyl.blocks.metal.GCYLCleanroomCasing; +import gregtech.api.GTValues; +import gregtech.api.metatileentity.multiblock.CleanroomType; +import gregtech.api.unification.OreDictUnifier; +import gregtech.api.unification.material.MarkerMaterials; +import gregtech.common.blocks.BlockCleanroomCasing; +import gregtech.common.blocks.MetaBlocks; +import net.minecraft.item.ItemStack; + +import static com.fulltrix.gcyl.api.GCYLUtility.*; +import static com.fulltrix.gcyl.api.GCYLUtility.getPowerIC; +import static com.fulltrix.gcyl.item.GCYLCoreItems.TOOL_DATA_MODULE_CLUSTER; +import static com.fulltrix.gcyl.item.GCYLCoreItems.UVA_HALIDE_LAMP; +import static com.fulltrix.gcyl.machines.GCYLTileEntities.*; +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; +import static gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities.PARALLEL_HATCH; +import static gregtech.api.GTValues.*; +import static gregtech.api.recipes.GTRecipeHandler.removeRecipesByInputs; +import static gregtech.api.recipes.RecipeMaps.ASSEMBLER_RECIPES; +import static gregtech.api.recipes.RecipeMaps.ASSEMBLY_LINE_RECIPES; +import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.ore.OrePrefix.*; +import static gregtech.common.items.MetaItems.*; +import static gregtech.common.metatileentities.MetaTileEntities.*; + +public class MultiblockPartCraftingRecipes { + public static void init() { + wirelessEnergyHatches(); + cleanroomFilterCasings(); + cleanroomMaintenanceHatch(); + uhvPlusEnergyHatches(); + parallelHatches(); + computerHatches(); + otherHatches(); + componentALCasings(); + energyHatchCorrections(); + } + + //TODO: finish the rest of these + private static void energyHatchCorrections() { + //UHV 4A Input + removeRecipesByInputs(ASSEMBLER_RECIPES, ENERGY_INPUT_HATCH[UHV].getStackForm(), OreDictUnifier.get(wireGtQuadruple, Europium, 2), OreDictUnifier.get(plate, Neutronium, 2)); + ASSEMBLER_RECIPES.recipeBuilder() + .input(ENERGY_INPUT_HATCH[UHV]) + .input(wireGtQuadruple, Europium, 2) + .input(plate, Seaborgium, 2) + .output(ENERGY_INPUT_HATCH_4A[UHV]) + .duration(100).EUt(VA[UV]).buildAndRegister(); + + //UHV 16A Input + removeRecipesByInputs(ASSEMBLER_RECIPES, HI_AMP_TRANSFORMER[UV].getStackForm(), ENERGY_INPUT_HATCH_4A[5].getStackForm(2), OreDictUnifier.get(wireGtOctal, Europium, 2), OreDictUnifier.get(plate, Neutronium, 4)); + ASSEMBLER_RECIPES.recipeBuilder() + .input(HI_AMP_TRANSFORMER[UV]) + .input(ENERGY_INPUT_HATCH_4A[5], 2) + .input(wireGtOctal, Europium, 2) + .input(plate, Seaborgium, 4) + .output(ENERGY_INPUT_HATCH_16A[UHV]) + .duration(200).EUt(VA[UV]).buildAndRegister(); + + //UHV 4A Output + removeRecipesByInputs(ASSEMBLER_RECIPES, ENERGY_OUTPUT_HATCH[UHV].getStackForm(), OreDictUnifier.get(wireGtQuadruple, Europium, 2), OreDictUnifier.get(plate, Neutronium, 2)); + ASSEMBLER_RECIPES.recipeBuilder() + .input(ENERGY_OUTPUT_HATCH[UHV]) + .input(wireGtQuadruple, Europium, 2) + .input(plate, Seaborgium, 2) + .output(ENERGY_OUTPUT_HATCH_4A[UHV]) + .duration(100).EUt(VA[UV]).buildAndRegister(); + + //UHV 16A Input + removeRecipesByInputs(ASSEMBLER_RECIPES, HI_AMP_TRANSFORMER[UV].getStackForm(), ENERGY_OUTPUT_HATCH_4A[5].getStackForm(2), OreDictUnifier.get(wireGtOctal, Europium, 2), OreDictUnifier.get(plate, Neutronium, 4)); + ASSEMBLER_RECIPES.recipeBuilder() + .input(HI_AMP_TRANSFORMER[UV]) + .input(ENERGY_OUTPUT_HATCH_4A[5], 2) + .input(wireGtOctal, Europium, 2) + .input(plate, Seaborgium, 4) + .output(ENERGY_OUTPUT_HATCH_16A[UHV]) + .duration(200).EUt(VA[UV]).buildAndRegister(); + } + + private static void componentALCasings() { + + for(int i = 1; i < 6; i++) { + ASSEMBLER_RECIPES.recipeBuilder().EUt(VA[i]).duration(150) + .outputs(GCYLMetaBlocks.GCYL_COMPONENT_AL_CASING.getItemVariant(GCYLComponentALCasing.CasingType.CASING_LV.getCasingByTier(i))) + .input(frameGt, getMaterialByTier(i)) + .input(plateDense, getMaterialByTier(i), 4) + .inputs(getRobotArmByTier(i).getStackForm(4)) + .inputs(getPistonByTier(i).getStackForm(8)) + .inputs(getMotorByTier(i).getStackForm(10)) + .input(gear, getMaterialByTier(i), 4) + .input(wireGtQuadruple, getCableByTier(i), 6) + .input(circuit, getMarkerMaterialByTier(i), 8) + .input(circuit, getMarkerMaterialByTier(i-1), 16) + .fluidInputs(SolderingAlloy.getFluid(L * 2 * i)) + .buildAndRegister(); + } + + for(int i = 6; i < 15; i++) { + getAssLineResearchBuilder(i, 300, GCYLMetaBlocks.GCYL_COMPONENT_AL_CASING.getItemVariant(GCYLComponentALCasing.CasingType.CASING_LV.getCasingByTier(i-1)), false, false) + .outputs(GCYLMetaBlocks.GCYL_COMPONENT_AL_CASING.getItemVariant(GCYLComponentALCasing.CasingType.CASING_LV.getCasingByTier(i))) + .input(frameGt, getMaterialByTier(i)) + .input(plateDense, getMaterialByTier(i), 6) + .inputs(getRobotArmByTier(i).getStackForm(8)) + .inputs(getPistonByTier(i).getStackForm(10)) + .inputs(getMotorByTier(i).getStackForm(16)) + .input(gear, getMaterialByTier(i)) + .input(gearSmall, getMaterialByTier(i)) + .input(cableGtQuadruple, getCableByTier(i), 8) + .input(circuit, getMarkerMaterialByTier(i), 8) + .input(circuit, getMarkerMaterialByTier(i-1), 16) + .fluidInputs(Indalloy140.getFluid(L * 2 * i)) + .fluidInputs(getPolymerByTier(i).getFluid(L * 4 * i)) + .fluidInputs(getFluidMaterialByTier(i).getFluid(L * 4 * i)) + .buildAndRegister(); + } + } + + private static void otherHatches() { + getAssLineResearchBuilder(UIV, 600, ADVANCED_DATA_ACCESS_HATCH.getStackForm(), false,false, GCYLCleanroomType.ISO2) + .outputs(WIRELESS_DATA_HATCH.getStackForm()) + .inputs(ADVANCED_DATA_ACCESS_HATCH.getStackForm()) + .input(TOOL_DATA_MODULE_CLUSTER, 8) + .inputs(SENSOR_UIV.getStackForm(2)) + .fluidInputs(Indalloy140.getFluid( L * 8)) + .fluidInputs(getPolymerByTier(UIV).getFluid(L * 8)) + .buildAndRegister(); + } + + private static void computerHatches() { + for (int i = 0; i < 7; i++) { + ASSEMBLER_RECIPES.recipeBuilder().EUt(GTValues.VA[i+8]).duration(200) + .outputs(HPCA_COMPUTATION_PLUS[i].getStackForm()) + .inputs(i == 0 ? HPCA_ADVANCED_COMPUTATION_COMPONENT.getStackForm(2) : HPCA_COMPUTATION_PLUS[i - 1].getStackForm(2)) + .input(circuit, getMarkerMaterialByTier(i+9), i == 6 ? 8 : 4) + .inputs(getFieldGeneratorByTier(i+8).getStackForm(i < 3 ? 2 : 4)) + .fluidInputs(PCBCoolant.getFluid((int) (2000 * Math.pow(2, i)))) + .cleanroom(getCleanroomTypeByTierNotV(i + 1)) + .buildAndRegister(); + + ASSEMBLER_RECIPES.recipeBuilder().EUt(GTValues.VA[i+6]).duration(200) + .outputs(HPCA_COOLING_PLUS[i].getStackForm()) + .inputs(i == 0 ? HPCA_ACTIVE_COOLER_COMPONENT.getStackForm(2) : HPCA_COOLING_PLUS[i - 1].getStackForm(2)) + .input(circuit, getMarkerMaterialByTier(i+8), 2) + .input(getPumpByTier(i+8), 2) + .input(getEmitterByTier(i + 8)) + .fluidInputs(PCBCoolant.getFluid((int) (2000 * Math.pow(2, i)))) + .cleanroom(getCleanroomTypeByTierNotV(i + 1)) + .buildAndRegister(); + } + } + + private static void parallelHatches() { + + for (int i = 0; i < 5; i+=2) { + getAssLineResearchBuilder(i+10, 1000, i == 0 ? PARALLEL_HATCH[3].getStackForm() : GCYL_PARALLEL_HATCH[i / 2 - 1].getStackForm(), false, false) + .outputs(GCYL_PARALLEL_HATCH[i / 2].getStackForm()) + .inputs(HULL[i+10].getStackForm()) + .inputs(i == 0 ? PARALLEL_HATCH[3].getStackForm(3) : GCYL_PARALLEL_HATCH[i / 2 - 1].getStackForm(3)) + .input(circuit, getMarkerMaterialByTier(i+11), i == 4 ? 16 : (int) (16 * Math.pow(2, i / 2.0))) + .inputs(getSensorByTier(i+10).getStackForm(i == 4 ? 8 : (int) (8 * Math.pow(2, i / 2.0)))) + .inputs(getEmitterByTier(i+10).getStackForm(i == 4 ? 8 : (int) (8 * Math.pow(2, i / 2.0)))) + .input(cableGtDouble, getCableByTier(i+10), 2) + .fluidInputs(Indalloy140.getFluid((int) (L * 8 * Math.pow(2, i)))) + .fluidInputs(getPolymerByTier(i+10).getFluid((int) (L * 16 * Math.pow(2, i)))) + .buildAndRegister(); + } + + } + + //TODO finish for max hatches + private static void uhvPlusEnergyHatches() { + // energy input + for(int i = 9; i < 14; i++) { + getAssLineResearchBuilder(i, 1000, ENERGY_INPUT_HATCH[i-1].getStackForm(), false, false) + .outputs(ENERGY_INPUT_HATCH[i].getStackForm()) + .inputs(HULL[i].getStackForm()) + .input(cableGtSingle, getCableByTier(i), 4) + .inputs(getPowerIC(i).getStackForm((int) (4 * Math.pow(2, i - 9)))) + .inputs(getPowerIC(i).getStackForm((int) (4 * Math.pow(2, i - 9)))) + .input(circuit, getMarkerMaterialByTier(i), (int) (2 * Math.pow(2, i - 9))) + .input(wireGtSingle, getSuperconductorByTier(i),(int) (4 * Math.pow(2, i - 9))) + .inputs(getVoltageCoilByTier(i).getStackForm(2)) + .fluidInputs(i == 9 ? SodiumPotassium.getFluid(12000) : SupercooledCryotheum.getFluid((int) (12000 * Math.pow(2, i - 9)))) + .fluidInputs(Indalloy140.getFluid((int) (5760 * Math.pow(2, i-9)))) + .buildAndRegister(); + } + + // energy output + for(int i = 9; i < 14; i++) { + getAssLineResearchBuilder(i, 1000, ENERGY_OUTPUT_HATCH[i-1].getStackForm(), false, false) + .outputs(ENERGY_OUTPUT_HATCH[i].getStackForm()) + .inputs(HULL[i].getStackForm()) + .input(spring, getCableByTier(i), 4) + .inputs(getPowerIC(i).getStackForm((int) (4 * Math.pow(2, i - 9)))) + .inputs(getPowerIC(i).getStackForm((int) (4 * Math.pow(2, i - 9)))) + .input(circuit, getMarkerMaterialByTier(i), (int) (2 * Math.pow(2, i - 9))) + .input(wireGtSingle, getSuperconductorByTier(i),(int) (4 * Math.pow(2, i - 9))) + .inputs(getVoltageCoilByTier(i).getStackForm(2)) + .fluidInputs(i == 9 ? SodiumPotassium.getFluid(12000) : SupercooledCryotheum.getFluid((int) (12000 * Math.pow(2, i - 9)))) + .fluidInputs(Indalloy140.getFluid((int) (5760 * Math.pow(2, i-9)))) + .buildAndRegister(); + } + } + + private static void cleanroomMaintenanceHatch() { + //STERILE FILTRATION MAINTENANCE HATCH + ASSEMBLY_LINE_RECIPES.recipeBuilder() + .outputs(STERILE_CLEANING_MAINTENANCE_HATCH.getStackForm()) + .inputs(CLEANING_MAINTENANCE_HATCH.getStackForm()) + .inputs(ROBOT_ARM_UHV.getStackForm(4)) + .input(circuit, MarkerMaterials.Tier.UHV, 6) + .inputs(HULL[GTValues.UHV].getStackForm()) + .inputs(EMITTER_UHV.getStackForm(2)) + .inputs(UVA_HALIDE_LAMP.getStackForm(4)) + .fluidInputs(Indalloy140.getFluid(L * 8)) + .fluidInputs(Lubricant.getFluid(L * 16)) + .fluidInputs(Polyetheretherketone.getFluid(L * 4)) + .stationResearch(b -> b + .researchStack(CLEANING_MAINTENANCE_HATCH.getStackForm()) + .CWUt(128) + .EUt(VA[GTValues.UHV])) + .duration(300).EUt(GTValues.VA[GTValues.UHV]) + .cleanroom(CleanroomType.STERILE_CLEANROOM) + .buildAndRegister(); + + getAssLineResearchBuilder(GTValues.UEV, 300, STERILE_CLEANING_MAINTENANCE_HATCH.getStackForm(), false, false, GCYLCleanroomType.ISO3) + .outputs(ISO3_CLEANING_MAINTENANCE_HATCH.getStackForm()) + .inputs(STERILE_CLEANING_MAINTENANCE_HATCH.getStackForm()) + .inputs(HULL[GTValues.UEV].getStackForm()) + .inputs(ROBOT_ARM_UEV.getStackForm(4)) + .inputs(EMITTER_UEV.getStackForm(2)) + .input(circuit, MarkerMaterials.Tier.UEV, 6) + .inputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO3)) + .inputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO3)) + .inputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO3)) + .inputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO3)) + .input(wireGtSingle, UEVSuperconductor, 64) + .fluidInputs(Indalloy140.getFluid(L * 16)) + .fluidInputs(Lubricant.getFluid(L * 32)) + .fluidInputs(Polyetheretherketone.getFluid(L * 8)) + .buildAndRegister(); + + getAssLineResearchBuilder(GTValues.UIV, 300, ISO3_CLEANING_MAINTENANCE_HATCH.getStackForm(), false, false, GCYLCleanroomType.ISO2) + .outputs(ISO2_CLEANING_MAINTENANCE_HATCH.getStackForm()) + .inputs(ISO3_CLEANING_MAINTENANCE_HATCH.getStackForm()) + .inputs(HULL[GTValues.UIV].getStackForm()) + .inputs(ROBOT_ARM_UIV.getStackForm(4)) + .inputs(EMITTER_UIV.getStackForm(2)) + .input(circuit, MarkerMaterials.Tier.UIV, 6) + .inputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO2)) + .inputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO2)) + .inputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO2)) + .inputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO2)) + .input(wireGtSingle, UIVSuperconductor, 64) + .fluidInputs(Indalloy140.getFluid(L * 32)) + .fluidInputs(Lubricant.getFluid(L * 64)) + .fluidInputs(Zylon.getFluid(L * 16)) + .buildAndRegister(); + + getAssLineResearchBuilder(GTValues.UXV, 300, ISO2_CLEANING_MAINTENANCE_HATCH.getStackForm(), false, false, GCYLCleanroomType.ISO1) + .outputs(ISO1_CLEANING_MAINTENANCE_HATCH.getStackForm()) + .inputs(ISO2_CLEANING_MAINTENANCE_HATCH.getStackForm()) + .inputs(HULL[GTValues.UXV].getStackForm()) + .inputs(ROBOT_ARM_UXV.getStackForm(4)) + .inputs(EMITTER_UXV.getStackForm(2)) + .input(circuit, MarkerMaterials.Tier.UXV, 6) + .inputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO1)) + .inputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO1)) + .inputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO1)) + .inputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO1)) + .input(wireGtSingle, UXVSuperconductor, 64) + .fluidInputs(Indalloy140.getFluid(L * 64)) + .fluidInputs(Lubricant.getFluid(L * 128)) + .fluidInputs(Zylon.getFluid(L * 32)) + .buildAndRegister(); + + + } + + private static void cleanroomFilterCasings() { + getAssLineResearchBuilder(GTValues.UHV, 100, MetaBlocks.CLEANROOM_CASING.getItemVariant(BlockCleanroomCasing.CasingType.FILTER_CASING_STERILE), false, false, CleanroomType.STERILE_CLEANROOM) + .input(frameGt, HDCS) + .inputs(ELECTRIC_MOTOR_UHV.getStackForm(2)) + .inputs(EMITTER_UHV.getStackForm(2)) + .inputs(UVA_HALIDE_LAMP.getStackForm(2)) + .inputs(ITEM_FILTER.getStackForm(4)) + .input(rotor, HDCS, 2) + .input(wireFine, UHVSuperconductor, 64) + .fluidInputs(Indalloy140.getFluid(L * 4)) + .fluidInputs(Lubricant.getFluid(L * 8)) + .outputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO3, 2)) + .buildAndRegister(); + + getAssLineResearchBuilder(GTValues.UEV, 100, GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO3), false, false, GCYLCleanroomType.ISO3) + .input(frameGt, EnrichedNaquadahAlloy) + .inputs(ELECTRIC_MOTOR_UEV.getStackForm(2)) + .inputs(EMITTER_UEV.getStackForm(2)) + .inputs(UVA_HALIDE_LAMP.getStackForm(4)) + .inputs(ITEM_FILTER.getStackForm(8)) + .input(rotor, EnrichedNaquadahAlloy, 2) + .input(wireFine, UEVSuperconductor, 64) + .fluidInputs(Indalloy140.getFluid(L * 8)) + .fluidInputs(Lubricant.getFluid(L * 16)) + .outputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO2, 2)) + .buildAndRegister(); + + getAssLineResearchBuilder(GTValues.UIV, 100, GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO2), false, false, GCYLCleanroomType.ISO2) + .input(frameGt, HastelloyX78) + .inputs(ELECTRIC_MOTOR_UIV.getStackForm(2)) + .inputs(EMITTER_UIV.getStackForm(2)) + .inputs(UVA_HALIDE_LAMP.getStackForm(8)) + .inputs(ITEM_FILTER.getStackForm(16)) + .input(rotor, HastelloyX78, 2) + .input(wireFine, UIVSuperconductor, 64) + .fluidInputs(Indalloy140.getFluid(L * 16)) + .fluidInputs(Lubricant.getFluid(L * 32)) + .outputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO1, 2)) + .buildAndRegister(); + + getAssLineResearchBuilder(GTValues.UXV, 100, GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO1), false, false, GCYLCleanroomType.ISO1) + .input(frameGt, HastelloyK243) + .inputs(ELECTRIC_MOTOR_UXV.getStackForm(2)) + .inputs(EMITTER_UXV.getStackForm(2)) + .inputs(UVA_HALIDE_LAMP.getStackForm(16)) + .inputs(ITEM_FILTER.getStackForm(32)) + .input(rotor, HastelloyK243, 2) + .input(wireFine, UXVSuperconductor, 64) + .fluidInputs(Indalloy140.getFluid(L * 16)) + .fluidInputs(Lubricant.getFluid(L * 64)) + .outputs(GCYLMetaBlocks.GCYL_CLEANROOM_CASING.getItemVariant(GCYLCleanroomCasing.CasingType.FILTER_CASING_ISO0, 1)) + .buildAndRegister(); + + } + + private static void wirelessEnergyHatches() { + + for(int i = 0; i < WIRELESS_ENERGY_HATCH_INPUT.length - 1; i++) { + getAssLineResearchBuilder(i, 400, i == 0 ? ENERGY_INPUT_HATCH[0].getStackForm() : WIRELESS_ENERGY_HATCH_INPUT[i - 1].getStackForm(), true, true) + .outputs(WIRELESS_ENERGY_HATCH_INPUT[i].getStackForm()) + .inputs(ENERGY_INPUT_HATCH[i].getStackForm()) + .inputs(getPowerICStack(i)) + .inputs(getPowerICStack(i)) + .inputs(getSensorByTier(i+1).getStackForm(6)) + .input(circuit, getMarkerMaterialByTier(i+1), 4) + .input(wireGtSingle, getSuperconductorByTier(i), 64) + .input(wireGtSingle, getSuperconductorByTier(i), 64) + .fluidInputs(SuperfluidHelium.getFluid((int) (100 * Math.pow(2, i)))) + .fluidInputs(Seaborgium.getFluid(i == 0 ? L : L * i * 2)) + .fluidInputs(Indalloy140.getFluid(i == 0 ? L * 2: L * i * 4)) + .buildAndRegister(); + + if(i > 3 && i < 14) { + + getAssLineResearchBuilder(i, 400, i == 4 ? ENERGY_INPUT_HATCH_4A[i].getStackForm() : WIRELESS_ENERGY_HATCH_INPUT_4A[i - 5].getStackForm(), true, true) + .outputs(WIRELESS_ENERGY_HATCH_INPUT_4A[i - 4].getStackForm()) + .inputs(ENERGY_INPUT_HATCH_4A[i].getStackForm()) + .inputs(getPowerICStack(i)) + .inputs(getPowerICStack(i)) + .inputs(getSensorByTier(i + 1).getStackForm(6)) + .input(circuit, getMarkerMaterialByTier(i + 1), 4) + .input(wireGtQuadruple, getSuperconductorByTier(i), 64) + .input(wireGtQuadruple, getSuperconductorByTier(i), 64) + .fluidInputs(SuperfluidHelium.getFluid((int) (10 * Math.pow(2, i)))) + .fluidInputs(HeavyQuarkDegenerateMatter.getFluid(L * i * 2)) + .fluidInputs(Indalloy140.getFluid(L * i * 4)) + .buildAndRegister(); + + } + + if(i > 4 && i < 14) { + getAssLineResearchBuilder(i, 400, i == 5 ? ENERGY_INPUT_HATCH_16A[i].getStackForm() : WIRELESS_ENERGY_HATCH_INPUT_16A[i - 5].getStackForm(), true, true) + .outputs(WIRELESS_ENERGY_HATCH_INPUT_16A[i - 5].getStackForm()) + .inputs(ENERGY_INPUT_HATCH_16A[i].getStackForm()) + .inputs(getPowerICStack(i)) + .inputs(getPowerICStack(i)) + .inputs(getSensorByTier(i + 1).getStackForm(6)) + .input(circuit, getMarkerMaterialByTier(i + 1), 4) + .input(wireGtHex, getSuperconductorByTier(i), 64) + .input(wireGtHex, getSuperconductorByTier(i), 64) + .fluidInputs(SuperfluidHelium.getFluid((int) (10 * Math.pow(2, i)))) + .fluidInputs(Neutronium.getFluid(L * i * 2)) + .fluidInputs(Indalloy140.getFluid(L * i * 4)) + .buildAndRegister(); + } + + //TODO Add 64A Wireless recipes use Cosmic Neutronium as the fluid + + + //TODO Add MAX Wireless recipes + } + + } + + +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/AluminiumChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/AluminiumChain.java index 26e5683b..57cd0b62 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/AluminiumChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/AluminiumChain.java @@ -3,7 +3,7 @@ import gregtech.api.recipes.ingredients.IntCircuitIngredient; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/Batteries.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/Batteries.java index 6f2b514a..a24f66a7 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/Batteries.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/Batteries.java @@ -2,7 +2,7 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/BrineChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/BrineChain.java index 1ec7b872..2e1650cd 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/BrineChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/BrineChain.java @@ -1,12 +1,13 @@ package com.fulltrix.gcyl.recipes.chain; +import com.fulltrix.gcyl.GCYLConfig; import gregtech.api.recipes.ingredients.IntCircuitIngredient; import gregtech.api.unification.OreDictUnifier; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.BIO_REACTOR_RECIPES; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.BIO_REACTOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; @@ -413,15 +414,18 @@ public static void init() { .output(dust, Boron, 2) .buildAndRegister(); - // Na + H -> NaH - CHEMICAL_RECIPES.recipeBuilder().duration(140).EUt(30) - .input(dust, Sodium) - .fluidInputs(Hydrogen.getFluid(1000)) - .output(dust, SodiumHydride, 2) - .buildAndRegister(); + if(!GCYLConfig.recipes.useNewPlatinumChain) { + // Na + H -> NaH + CHEMICAL_RECIPES.recipeBuilder().duration(140).EUt(30) + .input(dust, Sodium) + .fluidInputs(Hydrogen.getFluid(1000)) + .output(dust, SodiumHydride, 2) + .buildAndRegister(); + } // C + 2S -> CS2 BLAST_RECIPES.recipeBuilder().duration(120).EUt(120).blastFurnaceTemp(1000) + .circuitMeta(1) .input(dust, Carbon) .input(dust, Sulfur, 2) .fluidOutputs(CarbonSulfide.getFluid(1000)) diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/Bromine.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/Bromine.java new file mode 100644 index 00000000..9a4b9ae8 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/Bromine.java @@ -0,0 +1,64 @@ +package com.fulltrix.gcyl.recipes.chain; + +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; +import static com.fulltrix.gcyl.materials.GCYLMaterials.DampBromine; +import static gregtech.api.recipes.RecipeMaps.CENTRIFUGE_RECIPES; +import static gregtech.api.recipes.RecipeMaps.CHEMICAL_RECIPES; +import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.material.Materials.Bromine; +import static gregtech.api.unification.ore.OrePrefix.dust; + +public class Bromine { + + public static void init() { + + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(SaltWater.getFluid(1500)) + .fluidInputs(Chlorine.getFluid(1000)) + .fluidInputs(SulfuricAcid.getFluid(500)) + .fluidOutputs(AcidicSaltWater.getFluid(3000)) + .EUt(480) + .duration(180) + .buildAndRegister(); + + // H2SO4(NaCl)3(H2O)3Cl2 -> 3NaCl + H2SO4Br(H2O)Cl2 + 2H2O + CENTRIFUGE_RECIPES.recipeBuilder() + .fluidInputs(AcidicSaltWater.getFluid(6000)) + .output(dust, Salt, 6) + .fluidOutputs(SulfuricBromineSolution.getFluid(2000)) + .fluidOutputs(DebrominatedWater.getFluid(2000)) + .EUt(480) + .duration(180) + .buildAndRegister(); + + // H2SO4Br(H2O)Cl2 + H2O -> H2SO4Br(H2O)2Cl2 + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(SulfuricBromineSolution.getFluid(2000)) + .fluidInputs(Steam.getFluid(1000)) + .fluidOutputs(HotVapourMixture.getFluid(3000)) + .EUt(480) + .duration(150) + .buildAndRegister(); + + // H2SO4Br(H2O)2Cl2 -> H2SO4 + H2O + 2Cl + Br(H2O) + CENTRIFUGE_RECIPES.recipeBuilder() + .fluidInputs(HotVapourMixture.getFluid(3000)) + .fluidOutputs(SulfuricAcid.getFluid(1000)) + .fluidOutputs(DebrominatedWater.getFluid(1000)) + .fluidOutputs(Chlorine.getFluid(2000)) + .fluidOutputs(DampBromine.getFluid(1000)) + .EUt(480) + .duration(180) + .buildAndRegister(); + + // Br(H2O) -> Br + CHEMICAL_DEHYDRATOR_RECIPES.recipeBuilder() + .fluidInputs(DampBromine.getFluid(1000)) + .fluidOutputs(Bromine.getFluid(1000)) + .EUt(480) + .duration(400) + .buildAndRegister(); + + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/ChromiumChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/ChromiumChain.java index 978ff93f..796eb878 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/ChromiumChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/ChromiumChain.java @@ -3,7 +3,7 @@ import gregtech.api.unification.OreDictUnifier; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/CombinedChains.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/CombinedChains.java index 868d7cd4..e87dd046 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/CombinedChains.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/CombinedChains.java @@ -3,7 +3,7 @@ import gregtech.api.GTValues; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; @@ -123,7 +123,7 @@ public static void init() { .fluidOutputs(Polyetheretherketone.getFluid(2592)) .fluidOutputs(Water.getFluid(2000)) .output(dust, SodiumFluoride, 4) - .EUt(122880) + .EUt(GTValues.VA[GTValues.UEV]) .duration(250) .buildAndRegister(); diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/CosmicChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/CosmicChain.java index e7f03783..9f55b185 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/CosmicChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/CosmicChain.java @@ -1,12 +1,12 @@ package com.fulltrix.gcyl.recipes.chain; -import com.fulltrix.gcyl.item.GCYLExplosive; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.GCYLExplosive; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; import gregtech.api.recipes.ingredients.IntCircuitIngredient; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/Dyes.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/Dyes.java index bf143257..26de7728 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/Dyes.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/Dyes.java @@ -8,8 +8,8 @@ import net.minecraft.item.ItemStack; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; @@ -336,7 +336,7 @@ public static void init() { // NaOH + H2SO4 + C6H5NH2 -> 2 H2O + C6H6NNaO3S CHEMICAL_RECIPES.recipeBuilder().duration(240).EUt(1800) .input(dust, SodiumHydroxide, 3) - .circuitMeta(1) + .circuitMeta(18) .fluidInputs(SulfuricAcid.getFluid(1000)) .fluidInputs(Aniline.getFluid(1000)) .fluidOutputs(Water.getFluid(2000)) @@ -463,7 +463,7 @@ public static void init() { .fluidInputs(HydrogenPeroxide.getFluid(1000)) .fluidInputs(Ammonia.getFluid(1000)) .input(dust,Anthraquinone,24) - .circuitMeta(1) + .circuitMeta(6) .output(dust,Aminoanthraquinone,26) .fluidOutputs(DilutedSulfuricAcid.getFluid(3000)) .buildAndRegister(); diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/FullereneChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/FullereneChain.java index ed777d8d..538a8eec 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/FullereneChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/FullereneChain.java @@ -4,7 +4,7 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.UVA_HALIDE_LAMP; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.MarkerMaterials.Color.Magenta; import static gregtech.api.unification.material.Materials.*; @@ -212,6 +212,7 @@ public static void init() { // KCl + H2O -> KOH + HCl CHEMICAL_RECIPES.recipeBuilder() + .circuitMeta(1) .input(dust, RockSalt, 2) .fluidInputs(Water.getFluid(1000)) .fluidOutputs(PotassiumHydroxide.getFluid(1000)) @@ -288,7 +289,7 @@ public static void init() { .fluidInputs(Ethanol.getFluid(1000)) .fluidOutputs(Water.getFluid(1000)) .output(dust, SodiumEthoxide, 9) - .circuitMeta(1) + .circuitMeta(9) .EUt(7680) .duration(50) .buildAndRegister(); diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/FusionComponents.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/FusionComponents.java index 8c2673f9..cb778701 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/FusionComponents.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/FusionComponents.java @@ -1,17 +1,15 @@ package com.fulltrix.gcyl.recipes.chain; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; -import com.fulltrix.gcyl.item.fusion.GCYLCryostatCasing; -import com.fulltrix.gcyl.item.fusion.GCYLDivertorCasing; -import com.fulltrix.gcyl.item.fusion.GCYLFusionCasing; -import com.fulltrix.gcyl.item.fusion.GCYLVacuumCasing; -import com.fulltrix.gcyl.machines.GCYLTileEntities; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.fusion.*; import gregtech.api.GTValues; import gregtech.api.unification.OreDictUnifier; +import gregtech.common.ConfigHolder; import gregtech.common.blocks.BlockFusionCasing; import gregtech.common.blocks.MetaBlocks; -import gregtech.common.metatileentities.MetaTileEntities; +import static com.fulltrix.gcyl.api.GCYLUtility.*; +import static com.fulltrix.gcyl.machines.GCYLTileEntities.ADVANCED_FUSION_REACTOR; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static gregicality.multiblocks.api.unification.GCYMMaterials.Zeron100; import static gregtech.api.GTValues.VA; @@ -21,11 +19,13 @@ import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; import static gregtech.common.items.MetaItems.*; +import static gregtech.common.metatileentities.MetaTileEntities.FUSION_REACTOR; public class FusionComponents { public static void init() { + /* ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(1000).EUt(500000) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_1)) .inputs(OreDictUnifier.get(plate, TantalumHafniumSeaborgiumCarbide, 8)) @@ -37,13 +37,34 @@ public static void init() { .input(circuit, UEV, 4) .input(screw, Trinium, 16) .fluidInputs(SolderingAlloy.getFluid(2880 * 2)) - .outputs(GCYLTileEntities.ADVANCED_FUSION_REACTOR[0].getStackForm()) + .outputs(ADVANCED_FUSION_REACTOR[0].getStackForm()) .stationResearch(b -> b .researchStack(MetaTileEntities.FUSION_REACTOR[2].getStackForm()) .CWUt(128) .EUt(VA[GTValues.UHV])) .buildAndRegister(); + */ + + for(int i = 0; i < 5; i++) { + getAssLineResearchBuilder(i+9, 1000, i == 0 ? FUSION_REACTOR[2].getStackForm() : ADVANCED_FUSION_REACTOR[i-1].getStackForm(), false, false) + .outputs(ADVANCED_FUSION_REACTOR[i].getStackForm()) + .inputs(GCYLMetaBlocks.FUSION_COILS.getItemVariant(getAdvFusionCoilByAdvTier(i), 4)) + .inputs(OreDictUnifier.get(plate, getAdvFusionMaterialByAdvTier1(i), (int) (4 * Math.pow(2, i)))) + .inputs(OreDictUnifier.get(plate, getAdvFusionMaterialByAdvTier2(i), (int) (4 * Math.pow(2, i)))) + .inputs(getFieldGeneratorByTier(i+8).getStackForm(4)) + .inputs(getPowerIC(i+9).getStackForm(i < 3 ? 16 : 32)) + .inputs(getPowerIC(i+9).getStackForm(i < 3 ? 16 : 32)) + .inputs(getPowerIC(i+9).getStackForm(i < 3 ? 16 : 32)) + .inputs(getPowerIC(i+9).getStackForm(i < 3 ? 16 : 32)) + .inputs(OreDictUnifier.get(wireGtDouble, getSuperconductorByTier(i+8), 64)) + .inputs(OreDictUnifier.get(wireGtDouble, getSuperconductorByTier(i+8), 64)) + .input(circuit, getMarkerMaterialByTier(i+9), 8) + .input(screw, i == 0 ? Trinium : getMainComponentMaterialByTier(i+8), 16) + .fluidInputs(Indalloy140.getFluid((int) (2880 * Math.pow(2, i)))) + .buildAndRegister(); + } + ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(100).EUt(500000) .input(wireGtOctal, UVSuperconductor, 4) .input(plate, TantalumHafniumSeaborgiumCarbide, 2) @@ -52,7 +73,7 @@ public static void init() { .input(circuit, UHV) .inputs(FIELD_GENERATOR_UV.getStackForm()) .fluidInputs(SolderingAlloy.getFluid(144)) - .outputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_1, 4)) + .outputs(GCYLMetaBlocks.FUSION_COILS.getItemVariant(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_1, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(MetaBlocks.FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_COIL)) .CWUt(128) @@ -67,9 +88,9 @@ public static void init() { .input(circuit, UEV) .inputs(FIELD_GENERATOR_UHV.getStackForm()) .fluidInputs(SolderingAlloy.getFluid(288)) - .outputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_2, 4)) + .outputs(GCYLMetaBlocks.FUSION_COILS.getItemVariant(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_2, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b - .researchStack(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_1)) + .researchStack(GCYLMetaBlocks.FUSION_COILS.getItemVariant(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_1)) .CWUt(256) .EUt(VA[GTValues.UEV])) .buildAndRegister(); @@ -82,9 +103,9 @@ public static void init() { .input(circuit, UIV) .inputs(FIELD_GENERATOR_UEV.getStackForm()) .fluidInputs(SolderingAlloy.getFluid(576)) - .outputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_3, 4)) + .outputs(GCYLMetaBlocks.FUSION_COILS.getItemVariant(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b - .researchStack(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_2)) + .researchStack(GCYLMetaBlocks.FUSION_COILS.getItemVariant(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_2)) .CWUt(512) .EUt(VA[GTValues.UIV])) .buildAndRegister(); @@ -97,9 +118,9 @@ public static void init() { .input(circuit, UXV) .inputs(FIELD_GENERATOR_UIV.getStackForm()) .fluidInputs(SolderingAlloy.getFluid(1152)) - .outputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_4, 4)) + .outputs(GCYLMetaBlocks.FUSION_COILS.getItemVariant(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_4, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b - .researchStack(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_3)) + .researchStack(GCYLMetaBlocks.FUSION_COILS.getItemVariant(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3)) .CWUt(1024) .EUt(VA[GTValues.UXV])) .buildAndRegister(); @@ -112,9 +133,9 @@ public static void init() { .input(circuit, OpV) .inputs(FIELD_GENERATOR_UXV.getStackForm()) .fluidInputs(SolderingAlloy.getFluid(2304)) - .outputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_5, 4)) + .outputs(GCYLMetaBlocks.FUSION_COILS.getItemVariant(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_5, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b - .researchStack(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_4)) + .researchStack(GCYLMetaBlocks.FUSION_COILS.getItemVariant(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_4)) .CWUt(2048) .EUt(VA[GTValues.OpV])) .buildAndRegister(); @@ -131,7 +152,7 @@ public static void init() { .inputs(SENSOR_UHV.getStackForm()) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(144)) - .outputs(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_1, 4)) + .outputs(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_1, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(MetaBlocks.FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_CASING)) .CWUt(128) @@ -147,7 +168,7 @@ public static void init() { .inputs(SENSOR_UEV.getStackForm()) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(288)) - .outputs(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_2, 4)) + .outputs(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_2, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_1)) .CWUt(256) @@ -161,9 +182,9 @@ public static void init() { .input(screw, LithiumTitanate, 64) .inputs(ELECTRIC_PUMP_UIV.getStackForm()) .inputs(SENSOR_UIV.getStackForm()) - .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING, 2)) + .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(576)) - .outputs(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_3, 4)) + .outputs(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_3, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_2)) .CWUt(512) @@ -177,9 +198,9 @@ public static void init() { .input(screw, TriniumTitanium, 64) .inputs(ELECTRIC_PUMP_UXV.getStackForm()) .inputs(SENSOR_UXV.getStackForm()) - .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING, 4)) + .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(1152)) - .outputs(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_4, 4)) + .outputs(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_4, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_3)) .CWUt(1024) @@ -193,9 +214,9 @@ public static void init() { .input(screw, MetastableHassium, 64) .inputs(ELECTRIC_PUMP_OpV.getStackForm()) .inputs(SENSOR_OpV.getStackForm()) - .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING, 8)) + .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(2304)) - .outputs(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_5, 4)) + .outputs(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_5, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(GCYLMetaBlocks.DIVERTOR_CASING.getItemVariant(GCYLDivertorCasing.CasingType.DIVERTOR_4)) .CWUt(2048) @@ -213,7 +234,7 @@ public static void init() { .inputs(SENSOR_UHV.getStackForm()) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(144)) - .outputs(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_1, 4)) + .outputs(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_1, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(MetaBlocks.FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_CASING)) .CWUt(128) @@ -229,7 +250,7 @@ public static void init() { .inputs(SENSOR_UEV.getStackForm()) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(288)) - .outputs(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_2, 4)) + .outputs(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_2, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_1)) .CWUt(256) @@ -245,7 +266,7 @@ public static void init() { .inputs(SENSOR_UIV.getStackForm()) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(576)) - .outputs(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_3, 4)) + .outputs(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_3, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_2)) .CWUt(512) @@ -262,7 +283,7 @@ public static void init() { .inputs(SENSOR_UXV.getStackForm()) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(1152)) - .outputs(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_4, 4)) + .outputs(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_4, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_3)) .CWUt(1024) @@ -278,7 +299,7 @@ public static void init() { .inputs(SENSOR_OpV.getStackForm()) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(2304)) - .outputs(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_5, 4)) + .outputs(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_5, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(GCYLMetaBlocks.VACUUM_CASING.getItemVariant(GCYLVacuumCasing.CasingType.VACUUM_4)) .CWUt(2048) @@ -296,7 +317,7 @@ public static void init() { .inputs(SENSOR_UHV.getStackForm()) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(144)) - .outputs(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_1, 4)) + .outputs(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_1, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(MetaBlocks.FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_CASING)) .CWUt(128) @@ -312,7 +333,7 @@ public static void init() { .inputs(SENSOR_UEV.getStackForm()) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(288)) - .outputs(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_2, 4)) + .outputs(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_2, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_1)) .CWUt(256) @@ -328,7 +349,7 @@ public static void init() { .inputs(SENSOR_UIV.getStackForm()) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(576)) - .outputs(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_3, 4)) + .outputs(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_3, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_2)) .CWUt(512) @@ -345,7 +366,7 @@ public static void init() { .inputs(SENSOR_UXV.getStackForm()) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(1152)) - .outputs(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_4, 4)) + .outputs(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_4, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_3)) .CWUt(1024) @@ -361,7 +382,7 @@ public static void init() { .inputs(SENSOR_OpV.getStackForm()) .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_CASING)) .fluidInputs(SolderingAlloy.getFluid(2304)) - .outputs(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_5, 4)) + .outputs(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_5, ConfigHolder.recipes.casingsPerCraft)) .stationResearch(b -> b .researchStack(GCYLMetaBlocks.CRYOSTAT_CASING.getItemVariant(GCYLCryostatCasing.CasingType.CRYOSTAT_4)) .CWUt(2048) diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/FusionElementsChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/FusionElementsChain.java index d71fd5db..a8d741e1 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/FusionElementsChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/FusionElementsChain.java @@ -4,11 +4,14 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.materials.GCYLNuclearMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregicality.multiblocks.api.unification.GCYMMaterials.*; +import static supercritical.api.recipes.SCRecipeMaps.GAS_CENTRIFUGE_RECIPES; +import static supercritical.api.unification.material.SCMaterials.Plutonium244; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.FUSION_RECIPES; import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.material.Materials.Plutonium; import static gregtech.api.unification.material.Materials.Vanadium; import static gregtech.api.unification.ore.OrePrefix.*; import static gregtech.common.items.MetaItems.SHAPE_MOLD_INGOT; @@ -155,6 +158,8 @@ public static void init() { .fluidOutputs(TitaniumTetrafluoride.getFluid(9482)) .buildAndRegister(); + + BLAST_RECIPES.recipeBuilder().duration(340).EUt(120) .blastFurnaceTemp(Titanium.getBlastTemperature()) .fluidInputs(Titanium50Tetrafluoride.getFluid(1000)) diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/GoldChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/GoldChain.java index 698719d9..7855c2d3 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/GoldChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/GoldChain.java @@ -5,7 +5,7 @@ import gregtech.api.unification.OreDictUnifier; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/HNIWChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/HNIWChain.java index 257d6649..caee9230 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/HNIWChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/HNIWChain.java @@ -4,7 +4,7 @@ import gregtech.api.recipes.ingredients.IntCircuitIngredient; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; @@ -237,7 +237,7 @@ public static void init() { CHEMICAL_RECIPES.recipeBuilder() .fluidInputs(Formaldehyde.getFluid(6000)) .fluidInputs(Ammonia.getFluid(4000)) - .notConsumable(IntCircuitIngredient.getIntegratedCircuit(1)) + .notConsumable(IntCircuitIngredient.getIntegratedCircuit(22)) .output(dust, Hexamethylenetetramine, 22) .fluidOutputs(Water.getFluid(6000)) .EUt(480) diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/InsulationWireAssemblyChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/InsulationWireAssemblyChain.java index e6796ffa..602c9621 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/InsulationWireAssemblyChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/InsulationWireAssemblyChain.java @@ -102,7 +102,7 @@ public static void init() { .input(dust, SodiumAzide, 8) .input(dust, DitertbutylDicarbonate, 33) .output(dust, Sodium, 2) - .output(dust, Potash, 6) + .output(dust, Potash, 3) .fluidOutputs(TertButylAzidoformate.getFluid(2000)) .buildAndRegister(); diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/IodineChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/IodineChain.java index 1ecd10f1..0361195d 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/IodineChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/IodineChain.java @@ -1,7 +1,7 @@ package com.fulltrix.gcyl.recipes.chain; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/LithiumChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/LithiumChain.java index b6bffef1..92a05593 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/LithiumChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/LithiumChain.java @@ -1,7 +1,7 @@ package com.fulltrix.gcyl.recipes.chain; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/NanotubeChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/NanotubeChain.java index f3490c46..a13911b5 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/NanotubeChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/NanotubeChain.java @@ -5,8 +5,8 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.NANOTOME; import static com.fulltrix.gcyl.item.GCYLCoreItems.PIEZOELECTRIC_CRYSTAL; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; @@ -81,7 +81,7 @@ public static void init() { // CH2O + 2C2H4O + NH3 -> C5H5N + 3H2O + 2H LARGE_CHEMICAL_RECIPES.recipeBuilder().duration(240).EUt(1920) .notConsumable(dust, ThalliumChloride, 1) - .circuitMeta(1) + .circuitMeta(6) .fluidInputs(Formaldehyde.getFluid(1000)) .fluidInputs(Acetaldehyde.getFluid(2000)) .fluidInputs(Ammonia.getFluid(1000)) @@ -94,6 +94,7 @@ public static void init() { MIXER_RECIPES.recipeBuilder().duration(150).EUt(120) .input(dust, Nickel) .input(dust, Aluminium) + .circuitMeta(2) .output(dust, NiAlCatalyst, 2) .buildAndRegister(); diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/NaquadahChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/NaquadahChain.java index 9a8b13ca..f41b0d14 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/NaquadahChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/NaquadahChain.java @@ -1,20 +1,28 @@ package com.fulltrix.gcyl.recipes.chain; +import com.fulltrix.gcyl.GCYLConfig; import gregtech.api.recipes.ingredients.IntCircuitIngredient; +import gregtech.api.unification.material.Material; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.materials.GCYLNuclearMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.ADVANCED_CENTRIFUGE_RECIPES; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.ADVANCED_MIXER_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.ADVANCED_CENTRIFUGE_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.ADVANCED_MIXER_RECIPES; +import static com.fulltrix.gcyl.materials.chains.NewPlatinumGroupMaterials.AcidicOsmiumTetroxideSolution; +import static supercritical.api.unification.material.SCMaterials.Plutonium244; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.DISTILLATION_RECIPES; import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.material.Materials.Plutonium; import static gregtech.api.unification.ore.OrePrefix.dust; import static gregtech.api.unification.ore.OrePrefix.dustTiny; public class NaquadahChain { + public static void init() { + Material OSolution = GCYLConfig.recipes.useNewPlatinumChain ? AcidicOsmiumTetroxideSolution : OsmiumSolution; + // Nq + 2[HNO3 + HCl] -> Naquadric Solution [Nq + NO2] + [H2O + HNO3] + HCl + Cl LARGE_CHEMICAL_RECIPES.recipeBuilder() .input(dust, NaquadricCompound) @@ -582,7 +590,7 @@ public static void init() { CENTRIFUGE_RECIPES.recipeBuilder() .fluidInputs(ENaquadahSolution.getFluid(2000)) .output(dustTiny, PlatinumRaw, 3) - .fluidOutputs(OsmiumSolution.getFluid(350)) + .fluidOutputs(OSolution.getFluid(350)) .output(dustTiny, NaquadahEnriched) .fluidOutputs(ClearENaquadahLiquid.getFluid(1000)) .EUt(7680) @@ -604,7 +612,7 @@ public static void init() { .fluidOutputs(HeavyENaquadah.getFluid(1000)) .output(dustTiny, Naquadria) .output(dustTiny, IridiumChloride, 8) - .fluidOutputs(OsmiumSolution.getFluid(350)) + .fluidOutputs(OSolution.getFluid(350)) .EUt(7680) .duration(200) .buildAndRegister(); @@ -614,7 +622,7 @@ public static void init() { .fluidOutputs(LightENaquadah.getFluid(1000)) .output(dustTiny, Naquadria) .output(dustTiny, IridiumChloride, 8) - .fluidOutputs(OsmiumSolution.getFluid(350)) + .fluidOutputs(OSolution.getFluid(350)) .EUt(7680) .duration(200) .buildAndRegister(); @@ -624,7 +632,7 @@ public static void init() { .fluidOutputs(MediumENaquadah.getFluid(1000)) .output(dustTiny, Naquadria) .output(dustTiny, IridiumChloride, 8) - .fluidOutputs(OsmiumSolution.getFluid(350)) + .fluidOutputs(OSolution.getFluid(350)) .EUt(7680) .duration(200) .buildAndRegister(); diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/NuclearChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/NuclearChain.java index 48dcc93b..43665427 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/NuclearChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/NuclearChain.java @@ -1,16 +1,10 @@ package com.fulltrix.gcyl.recipes.chain; -import gregtech.api.GTValues; -import gregtech.api.unification.material.Material; - import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.materials.GCYLNuclearMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.DECAY_CHAMBERS_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; import static gregtech.api.unification.ore.OrePrefix.ingot; -import static kono.ceu.materialreplication.api.unification.materials.MRMaterials.NeutralMatter; public class NuclearChain { public static void init() { diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/OpticalChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/OpticalChain.java index fba80e18..56bc6742 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/OpticalChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/OpticalChain.java @@ -4,7 +4,7 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/PEEKChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/PEEKChain.java index 201f032b..7f719700 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/PEEKChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/PEEKChain.java @@ -152,7 +152,7 @@ public static void init() { .fluidOutputs(Acetone.getFluid(1000)) .fluidOutputs(Hydroquinone.getFluid(1000)) .fluidOutputs(Resorcinol.getFluid(1000)) - .circuitMeta(1) + .circuitMeta(6) .EUt(7860) .duration(200) .buildAndRegister(); diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/PlatinumSludgeGroupChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/PlatinumSludgeGroupChain.java index 09cb3cd8..708d48f0 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/PlatinumSludgeGroupChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/PlatinumSludgeGroupChain.java @@ -5,7 +5,7 @@ import gregtech.common.items.MetaItems; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.material.Materials.Palladium; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/PolymerChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/PolymerChain.java index 56bfc4ee..728c4157 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/PolymerChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/PolymerChain.java @@ -1,9 +1,8 @@ package com.fulltrix.gcyl.recipes.chain; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; -import static gregtech.api.recipes.RecipeMaps.CHEMICAL_RECIPES; -import static gregtech.api.recipes.RecipeMaps.PYROLYSE_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; import static gregtech.api.unification.ore.OrePrefix.stick; @@ -13,6 +12,7 @@ public static void init() { polyimideInit(); fluorinatedEthylenePropyleneInit(); polybenzimidazoleInit(); + polystyreneInit(); } public static void polybenzimidazoleInit() { @@ -113,4 +113,37 @@ public static void fluorinatedEthylenePropyleneInit() { .duration(125) .buildAndRegister(); } + + public static void polystyreneInit() { + CHEMICAL_RECIPES.recipeBuilder() + .circuitMeta(1) + .fluidInputs(Air.getFluid(1000)) + .fluidInputs(Styrene.getFluid(144)) + .fluidOutputs(Polystyrene.getFluid(144)) + .duration(160).EUt(30).buildAndRegister(); + + CHEMICAL_RECIPES.recipeBuilder() + .circuitMeta(1) + .fluidInputs(Oxygen.getFluid(1000)) + .fluidInputs(Styrene.getFluid(144)) + .fluidOutputs(Polystyrene.getFluid(216)) + .duration(160).EUt(30).buildAndRegister(); + + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .circuitMeta(4) + .fluidInputs(Air.getFluid(7500)) + .fluidInputs(Styrene.getFluid(2160)) + .fluidInputs(TitaniumTetrachloride.getFluid(100)) + .fluidOutputs(Polystyrene.getFluid(3240)) + .duration(800).EUt(30).buildAndRegister(); + + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .circuitMeta(4) + .fluidInputs(Oxygen.getFluid(7500)) + .fluidInputs(Styrene.getFluid(2160)) + .fluidInputs(TitaniumTetrachloride.getFluid(100)) + .fluidOutputs(Polystyrene.getFluid(4320)) + .duration(800).EUt(30).buildAndRegister(); + + } } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/QuantumDotsChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/QuantumDotsChain.java index 67976c2a..8fe03c54 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/QuantumDotsChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/QuantumDotsChain.java @@ -3,7 +3,7 @@ import net.minecraftforge.fluids.FluidStack; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.RecipeMaps.CHEMICAL_RECIPES; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/REEChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/REEChain.java index 07789153..8be4d723 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/REEChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/REEChain.java @@ -1,8 +1,8 @@ package com.fulltrix.gcyl.recipes.chain; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.ADVANCED_CENTRIFUGE_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.ADVANCED_CENTRIFUGE_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; @@ -33,53 +33,6 @@ public static void init() { // 3NaCl(H2O) + 2Cl + H2SO4 -> H2SO4(NaCl)3(H2O)3Cl2 // Formula above multiplied up for simplicity - CHEMICAL_RECIPES.recipeBuilder() - .fluidInputs(SaltWater.getFluid(1500)) - .fluidInputs(Chlorine.getFluid(1000)) - .fluidInputs(SulfuricAcid.getFluid(500)) - .fluidOutputs(AcidicSaltWater.getFluid(3000)) - .EUt(480) - .duration(180) - .buildAndRegister(); - - // H2SO4(NaCl)3(H2O)3Cl2 -> 3NaCl + H2SO4Br(H2O)Cl2 + 2H2O - CENTRIFUGE_RECIPES.recipeBuilder() - .fluidInputs(AcidicSaltWater.getFluid(6000)) - .output(dust, Salt, 6) - .fluidOutputs(SulfuricBromineSolution.getFluid(2000)) - .fluidOutputs(DebrominatedWater.getFluid(2000)) - .EUt(480) - .duration(180) - .buildAndRegister(); - - // H2SO4Br(H2O)Cl2 + H2O -> H2SO4Br(H2O)2Cl2 - CHEMICAL_RECIPES.recipeBuilder() - .fluidInputs(SulfuricBromineSolution.getFluid(2000)) - .fluidInputs(Steam.getFluid(1000)) - .fluidOutputs(HotVapourMixture.getFluid(3000)) - .EUt(480) - .duration(150) - .buildAndRegister(); - - // H2SO4Br(H2O)2Cl2 -> H2SO4 + H2O + 2Cl + Br(H2O) - CENTRIFUGE_RECIPES.recipeBuilder() - .fluidInputs(HotVapourMixture.getFluid(3000)) - .fluidOutputs(SulfuricAcid.getFluid(1000)) - .fluidOutputs(DebrominatedWater.getFluid(1000)) - .fluidOutputs(Chlorine.getFluid(2000)) - .fluidOutputs(DampBromine.getFluid(1000)) - .EUt(480) - .duration(180) - .buildAndRegister(); - - // Br(H2O) -> Br - CHEMICAL_DEHYDRATOR_RECIPES.recipeBuilder() - .fluidInputs(DampBromine.getFluid(1000)) - .fluidOutputs(Bromine.getFluid(1000)) - .EUt(480) - .duration(400) - .buildAndRegister(); - // 2C4H8O + 4H -> C8H18O + H2O CHEMICAL_RECIPES.recipeBuilder() .fluidInputs(Butyraldehyde.getFluid(2000)) @@ -186,182 +139,6 @@ public static void init() { .duration(220) .buildAndRegister(); - // 3C + 2La2O3 -> 4La + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, LanthanumOxide, 10) - .output(dust, Lanthanum, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Pr2O3 -> 4Pr + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, PraseodymiumOxide, 10) - .output(dust, Praseodymium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Nd2O3 -> 4Nd + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, NeodymiumOxide, 10) - .output(dust, Neodymium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Ce2O3 -> 4Ce + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, CeriumOxide, 10) - .output(dust, Cerium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Sc2O3 -> 4Sc + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, ScandiumOxide, 10) - .output(dust, Scandium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Eu2O3 -> 4Eu + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, EuropiumOxide, 10) - .output(dust, Europium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Gd2O3 -> 4Gd + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, GadoliniumOxide, 10) - .output(dust, Gadolinium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Sm2O3 -> 4Sm + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, SamariumOxide, 10) - .output(dust, Samarium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Y2O3 -> 4Y + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, YttriumOxide, 10) - .output(dust, Yttrium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Tb2O3 -> 4Tb + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, TerbiumOxide, 10) - .output(dust, Terbium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Dy2O3 -> 4Dy + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, DysprosiumOxide, 10) - .output(dust, Dysprosium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Ho2O3 -> 4Ho + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, HolmiumOxide, 10) - .output(dust, Holmium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Er2O3 -> 4Er + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, ErbiumOxide, 10) - .output(dust, Erbium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Tm2O3 -> 4Tm + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, ThuliumOxide, 10) - .output(dust, Thulium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + Yt2O3 -> 4Yt + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, YtterbiumOxide, 10) - .output(dust, Ytterbium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - - // 3C + 2Lu2O3 -> 4Lu + 3CO2 - BLAST_RECIPES.recipeBuilder() - .blastFurnaceTemp(2500) - .input(dust, Carbon, 3) - .input(dust, LutetiumOxide, 10) - .output(dust, Lutetium, 4) - .fluidOutputs(CarbonDioxide.getFluid(3000)) - .EUt(480) - .duration(100) - .buildAndRegister(); - // 2ThU + O -> 0.5ThO + Th(20%) + U(20%) //TODO: nuclear stuff /* diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/REEOxides.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/REEOxides.java new file mode 100644 index 00000000..952a8b30 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/REEOxides.java @@ -0,0 +1,192 @@ +package com.fulltrix.gcyl.recipes.chain; + +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; +import static com.fulltrix.gcyl.materials.GCYLMaterials.LutetiumOxide; +import static gregtech.api.recipes.RecipeMaps.BLAST_RECIPES; +import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.material.Materials.CarbonDioxide; +import static gregtech.api.unification.ore.OrePrefix.dust; + +public class REEOxides { + + public static void init() { + + // 3C + 2La2O3 -> 4La + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, LanthanumOxide, 10) + .output(dust, Lanthanum, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Pr2O3 -> 4Pr + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, PraseodymiumOxide, 10) + .output(dust, Praseodymium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Nd2O3 -> 4Nd + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, NeodymiumOxide, 10) + .output(dust, Neodymium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Ce2O3 -> 4Ce + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, CeriumOxide, 10) + .output(dust, Cerium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Sc2O3 -> 4Sc + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, ScandiumOxide, 10) + .output(dust, Scandium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Eu2O3 -> 4Eu + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, EuropiumOxide, 10) + .output(dust, Europium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Gd2O3 -> 4Gd + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, GadoliniumOxide, 10) + .output(dust, Gadolinium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Sm2O3 -> 4Sm + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, SamariumOxide, 10) + .output(dust, Samarium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Y2O3 -> 4Y + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, YttriumOxide, 10) + .output(dust, Yttrium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Tb2O3 -> 4Tb + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, TerbiumOxide, 10) + .output(dust, Terbium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Dy2O3 -> 4Dy + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, DysprosiumOxide, 10) + .output(dust, Dysprosium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Ho2O3 -> 4Ho + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, HolmiumOxide, 10) + .output(dust, Holmium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Er2O3 -> 4Er + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, ErbiumOxide, 10) + .output(dust, Erbium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Tm2O3 -> 4Tm + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, ThuliumOxide, 10) + .output(dust, Thulium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + Yt2O3 -> 4Yt + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, YtterbiumOxide, 10) + .output(dust, Ytterbium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + // 3C + 2Lu2O3 -> 4Lu + 3CO2 + BLAST_RECIPES.recipeBuilder() + .blastFurnaceTemp(2500) + .input(dust, Carbon, 3) + .input(dust, LutetiumOxide, 10) + .output(dust, Lutetium, 4) + .fluidOutputs(CarbonDioxide.getFluid(3000)) + .EUt(480) + .duration(100) + .buildAndRegister(); + + } + +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/RheniumChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/RheniumChain.java index 6df7aab6..e333ad2b 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/RheniumChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/RheniumChain.java @@ -2,7 +2,7 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.UVA_HALIDE_LAMP; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; @@ -271,16 +271,6 @@ public static void init() { .duration(20) .buildAndRegister(); - // 3C8H18O + NH3 -> 3H2O + C24H51N - CHEMICAL_RECIPES.recipeBuilder() - .fluidInputs(Octanol.getFluid(3000)) - .fluidInputs(Ammonia.getFluid(1000)) - .fluidOutputs(Water.getFluid(3000)) - .fluidOutputs(Trioctylamine.getFluid(1000)) - .EUt(480) - .duration(90) - .buildAndRegister(); - // 2C12H26 + 0.5C24H51N + 0.25C8H18O + 0.5C6H12O + 0.375CH3COOH + 0.375C5H12O -> ~4C11H24 ADVANCED_MIXER_RECIPES.recipeBuilder() .fluidInputs(Kerosene.getFluid(8000)) diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/SeleniumChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/SeleniumChain.java index ea821dba..5e08a52c 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/SeleniumChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/SeleniumChain.java @@ -1,7 +1,7 @@ package com.fulltrix.gcyl.recipes.chain; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/SensorEmitter.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/SensorEmitter.java index 5a12928e..61ecf11c 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/SensorEmitter.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/SensorEmitter.java @@ -2,8 +2,8 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.ADVANCED_MIXER_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.ADVANCED_MIXER_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/SuperconductorsSMDChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/SuperconductorsSMDChain.java index 9acd249a..7ef869dc 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/SuperconductorsSMDChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/SuperconductorsSMDChain.java @@ -1,7 +1,7 @@ package com.fulltrix.gcyl.recipes.chain; -import com.fulltrix.gcyl.item.GCYLExplosive; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.GCYLExplosive; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; import gregtech.api.fluids.store.FluidStorageKeys; import gregtech.api.items.metaitem.MetaItem; import gregtech.api.recipes.ingredients.IntCircuitIngredient; @@ -12,7 +12,7 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.INDUCTOR; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregicality.multiblocks.api.recipes.GCYMRecipeMaps.ALLOY_BLAST_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.MarkerMaterials.Color.Magenta; @@ -260,6 +260,12 @@ public static void init() { .buildAndRegister(); */ + BLAST_RECIPES.recipeBuilder().duration(500).EUt(120).blastFurnaceTemp(2400) + .input(dust, Tungsten, 9) + .input(dust, Thorium) + .output(ingot, ThoriumDopedTungsten, 10) + .buildAndRegister(); + ////////////////////////////////////////////////////////////////////////// BLAST_RECIPES.recipeBuilder().duration(270).EUt(120).blastFurnaceTemp(1800) .input(dust, Quartzite) @@ -623,7 +629,7 @@ public static void init() { .fluidInputs(HydrogenCyanide.getFluid(3000)) .fluidInputs(Water.getFluid(3000)) .notConsumable(dust, PotassiumDichromate) - .circuitMeta(1) + .circuitMeta(2) .fluidOutputs(CitricAcid.getFluid(1000)) .fluidOutputs(AmmoniumChloride.getFluid(3000)) .buildAndRegister(); @@ -667,6 +673,12 @@ public static void init() { .fluidOutputs(OxalicAcid.getFluid(3000)) .buildAndRegister(); + FLUID_SOLIDFICATION_RECIPES.recipeBuilder().duration(20).EUt(8) + .notConsumable(SHAPE_MOLD_BALL) + .fluidInputs(OxalicAcid.getFluid(144)) + .output(dust, OxalicAcid) + .buildAndRegister(); + // 2C2H2O4 + 2O + Ac -> Ac(C2O4)2 + 2H2O CHEMICAL_RECIPES.recipeBuilder().duration(180).EUt(30720) .fluidInputs(OxalicAcid.getFluid(2000)) @@ -863,6 +875,8 @@ public static void init() { .buildAndRegister(); // 4B + 3C -> B4C3 + //TODO Nuclear + /* BLAST_RECIPES.recipeBuilder().duration(550).EUt(120).blastFurnaceTemp(4000) .input(dust, Boron, 4) .input(dust, Carbon, 3) @@ -875,6 +889,7 @@ public static void init() { .input(dust, BoronCarbide, 7) .output(dust, BoronFranciumCarbide, 15) .buildAndRegister(); + */ // At + H2SO4 -> [At + H2O + SO3] MIXER_RECIPES.recipeBuilder().duration(140).EUt(7680) diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/TaraniumChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/TaraniumChain.java index 5f7c5c8c..c51600c5 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/TaraniumChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/TaraniumChain.java @@ -7,7 +7,7 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/TriniumChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/TriniumChain.java index e4c868a3..3eafce9d 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/TriniumChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/TriniumChain.java @@ -4,8 +4,8 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.ADVANCED_CENTRIFUGE_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.ADVANCED_CENTRIFUGE_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.ELECTROLYZER_RECIPES; import static gregtech.api.unification.material.Materials.*; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/TungstenChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/TungstenChain.java index 5492a554..c756d945 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/TungstenChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/TungstenChain.java @@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.GTRecipeHandler.removeRecipesByInputs; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.CHEMICAL_RECIPES; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/UHVMaterials.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/UHVMaterials.java index 6d4dda6e..fc6f5b80 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/UHVMaterials.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/UHVMaterials.java @@ -1,14 +1,14 @@ package com.fulltrix.gcyl.recipes.chain; -import com.fulltrix.gcyl.item.GCYLExplosive; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; -import com.fulltrix.gcyl.item.GCYLSimpleBlock; +import com.fulltrix.gcyl.blocks.GCYLExplosive; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.GCYLSimpleBlock; import gregtech.api.fluids.store.FluidStorageKeys; import gregtech.common.items.MetaItems; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregicality.multiblocks.api.recipes.GCYMRecipeMaps.ALLOY_BLAST_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; @@ -100,16 +100,16 @@ public static void init() { .buildAndRegister(); ALLOY_BLAST_RECIPES.recipeBuilder().EUt(1000000).duration(160) - .input(dust, Rutherfordium) - .input(dust, Dubnium) + .input(dust, Rutherfordium, 4) + .input(dust, Dubnium, 4) .circuitMeta(8) .fluidOutputs(Fordnium.getFluid(1152)) .blastFurnaceTemp(11200) .buildAndRegister(); ALLOY_BLAST_RECIPES.recipeBuilder().EUt(1000000).duration(160) - .input(dust, Seaborgium) - .input(dust, Bohrium) + .input(dust, Seaborgium, 4) + .input(dust, Bohrium, 4) .circuitMeta(8) .fluidOutputs(Seabohrgium.getFluid(1152)) .blastFurnaceTemp(11200) @@ -118,7 +118,8 @@ public static void init() { ADV_FUSION_RECIPES.recipeBuilder() .fluidInputs(Seabohrgium.getFluid(288)) .fluidInputs(Fordnium.getFluid(288)) - .fluidOutputs(SuperheavyMix.getFluid(1000)) + // .fluidOutputs(SuperheavyMix.getFluid(1000)) + .fluidOutputs(SuperheavyMix.getFluid(576)) .EUt(4000000) .AdvCoilTier(4) .EUToStart(10000000000L) diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/UltimateMaterials.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/UltimateMaterials.java index 5fc53a7d..85933a11 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/UltimateMaterials.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/UltimateMaterials.java @@ -1,8 +1,8 @@ package com.fulltrix.gcyl.recipes.chain; -import com.fulltrix.gcyl.item.GCYLExplosive; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; -import com.fulltrix.gcyl.item.fusion.GCYLFusionCasing; +import com.fulltrix.gcyl.blocks.GCYLExplosive; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils; import gregtech.api.fluids.store.FluidStorageKeys; import gregtech.api.items.metaitem.MetaItem; import gregtech.api.recipes.ingredients.IntCircuitIngredient; @@ -10,8 +10,7 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.materials.GCYLNuclearMaterials.Plutonium; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.MarkerMaterials.Tier.UIV; import static gregtech.api.unification.material.Materials.*; @@ -126,7 +125,9 @@ public static void init() { //TODO Verify Recipes .fluidInputs(Plutonium.getFluid(144)) .fluidInputs(Mendelevium.getFluid(144)) .fluidInputs(Einsteinium.getFluid(144)) - .output(dust, Actinoids, 13) + .fluidInputs(Lawrencium.getFluid(144)) + .fluidInputs(Nobelium.getFluid(144)) + .output(dust, Actinoids, 15) .buildAndRegister(); ADVANCED_MIXER_RECIPES.recipeBuilder().duration(450).EUt(250000) @@ -159,7 +160,7 @@ public static void init() { //TODO Verify Recipes .buildAndRegister(); ADVANCED_MIXER_RECIPES.recipeBuilder().duration(360).EUt(5400000) - .input(dust, SuperheavyLAlloy, 7) + .input(dust, SuperheavyLAlloy, 8) .input(dust, SuperheavyHAlloy, 7) .input(dust, Alkalis, 14) .input(dust, RefractoryMetals, 7) @@ -167,10 +168,10 @@ public static void init() { //TODO Verify Recipes .input(dust, PreciousMetals, 9) .input(dust, PostTransitionMetals, 14) .input(dust, Lanthanoids, 15) - .input(dust, Actinoids, 13) + .input(dust, Actinoids, 15) .fluidInputs(NonMetals.getFluid(15000)) .fluidInputs(NobleGases.getFluid(6000)) - .output(dust, Periodicium, 115) + .output(dust, Periodicium, 118) .buildAndRegister(); @@ -194,7 +195,7 @@ public static void init() { //TODO Verify Recipes ASSEMBLY_LINE_RECIPES.recipeBuilder().duration(150).EUt(15000000) .input(frameGt, QCDMatter) - .inputs(GCYLMetaBlocks.FUSION_CASING.getItemVariant(GCYLFusionCasing.CasingType.ADV_FUSION_COIL_3)) + .inputs(GCYLMetaBlocks.FUSION_COILS.getItemVariant(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3)) .inputs(ELECTRIC_PUMP_UXV.getStackForm(2)) .input(circuit, UIV) .input(pipeLargeFluid, Neutronium, 4) diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/VanadiumChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/VanadiumChain.java index 0950e957..149b0ffe 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/VanadiumChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/VanadiumChain.java @@ -3,7 +3,7 @@ import gregtech.api.unification.OreDictUnifier; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/VariousChains.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/VariousChains.java index d604cd65..e19f604f 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/VariousChains.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/VariousChains.java @@ -8,9 +8,8 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.materials.GCYLNuclearMaterials.Plutonium; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.ADVANCED_MIXER_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.ADVANCED_MIXER_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; @@ -39,17 +38,6 @@ private static void misc() { .fluidOutputs(UUMatter.getFluid(1000)) .buildAndRegister(); - // Sodium Hypochlorite ========================================================================================= - // 2NaOH + 2Cl -> H2O + NaCl + NaClO - LARGE_CHEMICAL_RECIPES.recipeBuilder().duration(80).EUt(120) - .fluidInputs(Chlorine.getFluid(2000)) - .input(dust, SodiumHydroxide, 6) - .fluidOutputs(Water.getFluid(1000)) - .output(dust, Salt, 2) - .output(dust, SodiumHypochlorite, 3) - .circuitMeta(1) - .buildAndRegister(); - // HClO + NaOH -> H2O + NaClO CHEMICAL_RECIPES.recipeBuilder().duration(90).EUt(120) .fluidInputs(HypochlorousAcid.getFluid(1000)) @@ -604,6 +592,7 @@ private static void fuels() { // Rocket fuel chemicals // 2NH3 + H2O2 = N2H4 + H2O CHEMICAL_RECIPES.recipeBuilder().duration(320).EUt(30) + .circuitMeta(1) .fluidInputs(Ammonia.getFluid(2000)) .fluidInputs(HydrogenPeroxide.getFluid(1000)) .fluidOutputs(Hydrazine.getFluid(1000)) diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/WetwareChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/WetwareChain.java index 1ae803ce..d174a989 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/WetwareChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/WetwareChain.java @@ -7,7 +7,7 @@ import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.*; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.*; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; @@ -373,12 +373,14 @@ public static void init() { .duration(100) .buildAndRegister(); + //TODO RIPPLE EFFECT IN BALANCING? // H2O + Na2CO3 -> NaHCO3 + NaOH LARGE_CHEMICAL_RECIPES.recipeBuilder().duration(140).EUt(30) .fluidInputs(Water.getFluid(1000)) - .input(dust, SodaAsh, 6) - .output(dust, SodiumBicarbonate, 6) - .output(dust, SodiumHydroxide, 3) + .circuitMeta(2) + .input(dust, SodaAsh, 1) + .output(dust, SodiumBicarbonate, 1) //6 + .output(dust, SodiumHydroxide, 1) //3 .buildAndRegister(); // NaHCO3 -> NaOH + CO2 diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/WormholeGeneratorChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/WormholeGeneratorChain.java index 84baa2c5..bb0cf9d3 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/WormholeGeneratorChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/WormholeGeneratorChain.java @@ -1,13 +1,13 @@ package com.fulltrix.gcyl.recipes.chain; -import com.fulltrix.gcyl.item.GCYLExplosive; -import com.fulltrix.gcyl.item.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.GCYLExplosive; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; import gregtech.api.fluids.store.FluidStorageKeys; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static com.fulltrix.gcyl.item.GCYLCoreItems.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.PLASMA_CONDENSER_RECIPES; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.STELLAR_FORGE_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.PLASMA_CONDENSER_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.STELLAR_FORGE_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/ZincChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/ZincChain.java index 3d4f5643..e21841c5 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/ZincChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/ZincChain.java @@ -6,7 +6,7 @@ import net.minecraft.item.ItemStack; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.*; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/ZirconChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/ZirconChain.java index 35dbf21c..2e96d151 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/chain/ZirconChain.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/ZirconChain.java @@ -3,7 +3,7 @@ import gregtech.api.unification.OreDictUnifier; import static com.fulltrix.gcyl.materials.GCYLMaterials.*; -import static com.fulltrix.gcyl.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; import static gregtech.api.recipes.RecipeMaps.*; import static gregtech.api.unification.material.Materials.*; import static gregtech.api.unification.ore.OrePrefix.dust; diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/updated/MiscChemistry.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/updated/MiscChemistry.java new file mode 100644 index 00000000..b085bd88 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/updated/MiscChemistry.java @@ -0,0 +1,239 @@ +package com.fulltrix.gcyl.recipes.chain.updated; + + +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; +import static com.fulltrix.gcyl.materials.chains.MiscMaterials.*; +import static com.fulltrix.gcyl.materials.chains.NewPlatinumGroupMaterials.*; +import static com.fulltrix.gcyl.materials.chains.NewREEMaterials.*; +import static gregtech.api.GTValues.*; +import static gregtech.api.recipes.RecipeMaps.*; +import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.ore.OrePrefix.*; + +public class MiscChemistry { + + public static void init() { + + + // Hydryoxlyammonium Sulfate and Dimethylglyoxime + // C4H8 (g) + H2O (l) -> C4H10O (l) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(Butene.getFluid(1000)) + .fluidInputs(Water.getFluid(1000)) + .fluidOutputs(Butanol.getFluid(1000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // C4H1OO (l) -> C4H8O (l) + H2 (g) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(Butanol.getFluid(1000)) + .notConsumable(plate, ZincBronze, 1) + .fluidOutputs(Butanone.getFluid(1000)) + .fluidOutputs(Hydrogen.getFluid(2000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // NaOH (s) + HNO3 (aq) -> NaNO3 (s) + H2O (l) + CHEMICAL_RECIPES.recipeBuilder() + .circuitMeta(10) + .input(dust, SodiumHydroxide, 3) + .fluidInputs(NitricAcid.getFluid(1000)) + .output(dust, SodiumNitrate, 5) + .fluidOutputs(Water.getFluid(1000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // 3NaNO3 (l) + 2Fe (s) -> 3NaNO2 (s) + Fe2O3 (s) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(SodiumNitrate.getFluid(3000)) + .input(dust, Iron, 2) + .output(dust, SodiumNitrite, 12) + .output(dust, BandedIron, 5) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // C2H5OH (l) + NaNO2 (s) -> C2H5NO2 (g) + NaOH (s) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(Ethanol.getFluid(1000)) + .input(dust, SodiumNitrite, 4) + .notConsumable(SulfuricAcid.getFluid(500)) + .output(dust, SodiumHydroxide, 3) + .fluidOutputs(EthylNitrite.getFluid(1000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // C4H8O (l) + C2H5NO2 (g) -> C4H7NO2 (s) + C2H5OH (l) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(Butanone.getFluid(1000)) + .fluidInputs(EthylNitrite.getFluid(1000)) + .notConsumable(HydrochloricAcid.getFluid(500)) + .output(dust, DiacetylMonoxime, 14) + .fluidOutputs(Ethanol.getFluid(1000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // NH4OH (aq) + NO2 (g) + NO (g) -> NH4NO2 (s) + HNO2 (aq) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(AmmoniumHydroxide.getFluid(1000)) + .fluidInputs(NitrogenDioxide.getFluid(1000)) + .fluidInputs(NitricOxide.getFluid(1000)) + .fluidOutputs(AmmoniumNitrite.getFluid(1000)) + .fluidOutputs(NitrousAcid.getFluid(1000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // 2(NH4)NO2 (s) + 4SO2 (g) + 6H2O (l) -> (NH3OH)2SO4 (s) + 3H2SO4 (aq) + 2NH3 (g) + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(AmmoniumNitrite.getFluid(2000)) + .fluidInputs(SulfurDioxide.getFluid(4000)) + .fluidInputs(Water.getFluid(6000)) + .fluidOutputs(HydroxylammoniumSulfate.getFluid(1000)) + .fluidOutputs(SulfuricAcid.getFluid(3000)) + .fluidOutputs(Ammonia.getFluid(2000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // 2C4H7NO2 (s) + (NH3OH)2SO4 (s) -> 2C4H8N2O2 (s) + H2SO4 (aq) + 2H2O (l) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, DiacetylMonoxime, 28) + .fluidInputs(HydroxylammoniumSulfate.getFluid(1000)) + .output(dust, Dimethylglyoxime, 2) + .fluidOutputs(SulfuricAcid.getFluid(1000)) + .fluidOutputs(Water.getFluid(2000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // potassium stuffs + // KCl + H2SO4 = HCl + KHSO4 + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, RockSalt, 2) + .fluidInputs(SulfuricAcid.getFluid(1000)) + .output(dust, PotassiumBisulfate, 7) + .fluidOutputs(HydrochloricAcid.getFluid(1000)) + .duration(800) + .EUt(VH[MV]) + .buildAndRegister(); + + // 2 KHSO4 -> K2S2O8 + 2H + ELECTROLYZER_RECIPES.recipeBuilder() + .input(dust, PotassiumBisulfate, 14) + .notConsumable(SulfuricAcid.getFluid(50)) + .output(dust, PotassiumPersulfate, 12) + .fluidOutputs(Hydrogen.getFluid(2000)) + .duration(600) + .EUt(VA[MV]) + .buildAndRegister(); + + // 2 KCl + 2 H2O -> 2KOH + 2Cl + 2H + //TODO CHANGE BACK TO ELECTROLYZER? + CENTRIFUGE_RECIPES.recipeBuilder() + .input(dust, RockSalt, 4) + .fluidInputs(Water.getFluid(2000)) + .output(dust, PotassiumHydroxide, 6) + .fluidOutputs(Chlorine.getFluid(2000)) + .fluidOutputs(Hydrogen.getFluid(2000)) + .duration(600) + .EUt(VA[MV]) + .buildAndRegister(); + + // ferrous chloride + // 2 FeCl3 + C6H5Cl -> 2 FeCl2 + C6H4Cl2 + HCl + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(Iron3Chloride.getFluid(2000)) + .fluidInputs(Chlorobenzene.getFluid(1000)) + .fluidOutputs(FerrousChloride.getFluid(2000)) + .fluidOutputs(HydrochloricAcid.getFluid(1000)) + .fluidOutputs(Dichlorobenzene.getFluid(1000)) + .duration(800) + .EUt(VA[HV]) + .buildAndRegister(); + + // potassium nitrate + // NaNO3 + KCl -> NaCl + KNO3 + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(SodiumNitrate.getFluid(1000)) + .input(dust, RockSalt, 2) + .output(dust, Salt, 2) + .fluidOutputs(PotassiumNitrate.getFluid(1000)) + .duration(100) + .EUt(VH[MV]) + .buildAndRegister(); + + // Palm oil -> octanoic acid + DISTILLERY_RECIPES.recipeBuilder() + .fluidInputs(PalmOil.getFluid(1000)) + .fluidOutputs(OctanicAcid.getFluid(70)) + .EUt(120) + .duration(80) + .buildAndRegister(); + + // octanoic acid -> octanol + CHEMICAL_RECIPES.recipeBuilder() + .notConsumable(dust, Cobalt, 1) + .fluidInputs(Hydrogen.getFluid(3000)) + .fluidInputs(OctanicAcid.getFluid(1000)) + .fluidOutputs(Octanol.getFluid(1000)) + .fluidOutputs(Water.getFluid(1000)) + .EUt(480) + .duration(320) + .buildAndRegister(); + + // octanol -> trioctylamine + CHEMICAL_RECIPES.recipeBuilder() + .notConsumable(dust, Nickel, 1) + .fluidInputs(Octanol.getFluid(3000)) + .fluidInputs(Ammonia.getFluid(1000)) + .fluidOutputs(Trioctylamine.getFluid(1000)) + .fluidOutputs(Water.getFluid(3000)) + .EUt(480) + .duration(320) + .buildAndRegister(); + + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(Butyraldehyde.getFluid(2000)) + .fluidInputs(Hydrogen.getFluid(2000)) + .fluidOutputs(Ethylhexanol.getFluid(1000)) + .duration(320) + .EUt(480) + .buildAndRegister(); + + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(Ethylhexanol.getFluid(4000)) + .input(dust, PhosphorusPentoxide, 14) + .input(dust, SodiumHydroxide, 9) + .output(dust, TrisodiumPhosphate, 8) + .fluidOutputs(DEHPA.getFluid(1000)) + .fluidOutputs(Water.getFluid(2000)) + .duration(320) + .EUt(480) + .buildAndRegister(); + + BLAST_RECIPES.recipeBuilder() + .circuitMeta(2) + .input(dust, Carbon, 1) + .input(dust, Sulfur, 2) + .output(dust, CarbonDisulfide, 3) + .blastFurnaceTemp(600) + .duration(400) + .EUt(120) + .buildAndRegister(); + + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, CarbonDisulfide, 3) + .fluidInputs(Ammonia.getFluid(2000)) + .fluidOutputs(AmmoniumThiocyanate.getFluid(1000)) + .fluidOutputs(HydrogenSulfide.getFluid(1000)) + .duration(1000) + .EUt(120) + .buildAndRegister(); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/updated/NewPlatinumGroupMetals.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/updated/NewPlatinumGroupMetals.java new file mode 100644 index 00000000..1c80cce4 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/updated/NewPlatinumGroupMetals.java @@ -0,0 +1,676 @@ +package com.fulltrix.gcyl.recipes.chain.updated; + +import gregtech.api.fluids.store.FluidStorageKeys; +import gregtech.api.unification.OreDictUnifier; + +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; +import static com.fulltrix.gcyl.materials.chains.NewPlatinumGroupMaterials.*; +import static gregtech.api.GTValues.*; +import static gregtech.api.recipes.RecipeMaps.*; +import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.ore.OrePrefix.crushedPurified; +import static gregtech.api.unification.ore.OrePrefix.dust; + +//TODO add additional ores for processing +//TODO cleanroom requirements? +//TODO duration and eut fixes +public class NewPlatinumGroupMetals { + + public static void init() { + initial(); + osmium(); + platinum(); + iridium(); + palladium(); + ruthenium(); + rhodium(); + inerts(); + } + + private static void initial() { + + CENTRIFUGE_RECIPES.recipeBuilder().duration(100).EUt(VA[EV]) + .input(dust, PlatinumMetallicPowder) + .chancedOutput(dust, PlatinumGroupSludge, 2500, 1000) + .buildAndRegister(); + + //TODO: replace 2 of them with higher tier pgs material + CENTRIFUGE_RECIPES.recipeBuilder().duration(984).EUt(30) + .input(dust, Bowieite, 5) + .output(dust, Sulfur, 3) + .chancedOutput(dust, PlatinumGroupSludge, 2, 3300, 330) + .chancedOutput(dust, PlatinumGroupSludge, 2, 3300, 330) + .chancedOutput(dust, PlatinumGroupSludge, 2, 3300, 330) + //.chancedOutput(OreDictUnifier.get(dust, PlatinumMetallicPowder, 2), 3300, 330) + //.chancedOutput(OreDictUnifier.get(dust, IridiumMetalResidue, 2), 3300, 330) + //.chancedOutput(OreDictUnifier.get(dust, CrudeRhodiumMetal, 2), 3300, 330) + .buildAndRegister(); + + CHEMICAL_RECIPES.recipeBuilder().duration(50).EUt(VA[EV]) + .input(crushedPurified, PlatinumMetallicPowder) + .fluidInputs(NitricAcid.getFluid(400)) + .output(dust, PlatinumGroupSludge, 8) + .fluidOutputs(SulfuricNickelSolution.getFluid(2000)) + .fluidOutputs(PGMSolution1Plat.getFluid(100)) + .buildAndRegister(); + + CHEMICAL_RECIPES.recipeBuilder().duration(50).EUt(VA[EV]) + .input(crushedPurified, PalladiumMetallicPowder) + .fluidInputs(NitricAcid.getFluid(400)) + .output(dust, PlatinumGroupSludge, 8) + .fluidOutputs(SulfuricNickelSolution.getFluid(2000)) + .fluidOutputs(PGMSolution1Pall.getFluid(100)) + .buildAndRegister(); + + + // should be technically 2.9 dust(every input was divided by 10), but w/e + MIXER_RECIPES.recipeBuilder() + .input(dust, PlatinumGroupSludge, 15) + .fluidInputs(AquaRegia.getFluid(20550)) + .fluidInputs(NitricAcid.getFluid(1850)) + .fluidOutputs(PlatinumGroupSludge.getFluid(2900)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // [H2OsCl6 (aq) + 7 H2PtCl6 (aq) + 3 H2IrCl6 (aq) + 7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + // + 2 HAgCl2 (aq)] -> + // H2OsCl6 (aq) + [7 H2PtCl6 (aq) + 3 H2IrCl6 (aq) + 7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + // + 2 HAgCl2 (aq)] + DISTILLATION_RECIPES.recipeBuilder() + .fluidInputs(PlatinumGroupSludge.getFluid(2900)) + .fluidOutputs(OsmiumChlorideSolution.getFluid(100)) + .fluidOutputs(PGMSolution1.getFluid(2800)) + .fluidOutputs(NitrogenDioxide.getFluid(8700)) + .fluidOutputs(Water.getFluid(8700)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // Cl + NH3 -> NH4Cl + CHEMICAL_RECIPES.recipeBuilder() + .circuitMeta(2) + .fluidInputs(HydrochloricAcid.getFluid(1000)) + .fluidInputs(Ammonia.getFluid(1000)) + .output(dust, AmmoniumChloride, 2) + .duration(500) + .EUt(VA[MV]) + .buildAndRegister(); + } + + private static void osmium() { + // H2OsCl6 (aq) + 2K2S2O8 (s) + 4H2O (l) -> [4KHSO4 (aq) + OsO4 (aq) + 6HCl (aq)] + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(OsmiumChlorideSolution.getFluid(1000)) + .input(dust, PotassiumPersulfate, 24) + .fluidOutputs(AcidicOsmiumTetroxideSolution.getFluid(1000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // [4KHSO4 (aq) + OsO4 (aq) + 4HCl (aq)] -> 4KHSO4 (s) + OsO4 (g) + 4HCl (g) + DISTILLATION_RECIPES.recipeBuilder() + .fluidInputs(AcidicOsmiumTetroxideSolution.getFluid(1000)) + .output(dust, PotassiumBisulfate, 28) + .fluidOutputs(OsmiumTetroxide.getFluid(FluidStorageKeys.GAS, 1000)) + .fluidOutputs(HydrochloricAcid.getFluid(4000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // 2OsO4 (g) + 5KOH (s) + CH3CH2OH (l) -> 2K2OsO2(OH)4 (s) + KCH3CO2 (s) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(OsmiumTetroxide.getFluid(FluidStorageKeys.GAS, 2000)) + .fluidInputs(Ethanol.getFluid(1000)) + .input(dust, PotassiumHydroxide, 15) + .output(dust, PotassiumOsmate, 26) + .output(dust, PotassiumAcetate, 8) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // first route, needs funny catalyst + // 2K2OsO2(OH)4 (s) + 6NaBH4 (aq) --> 2Os (s) + 3B2H6 (g) + 4KOH (aq) + 6NaOH (aq) + 2H2O (l) + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .input(dust, PotassiumOsmate, 26) + .fluidInputs(SodiumBorohydride.getFluid(6000)) + .output(dust, Osmium, 2) + .fluidOutputs(Diborane.getFluid(3000)) + .fluidOutputs(PotassiumHydroxide.getFluid(4000)) + .output(dust, SodiumHydroxide, 18) + .fluidOutputs(Water.getFluid(2000)) + .duration(3600 / 4) + .EUt(VH[LuV]) + .buildAndRegister(); + + // FASTER ROUTE, unlocked later? + // K2OsO2(OH)4 + 3H2 (g) -> Os (s) + 2KOH (s) + 4H2O (g) + BLAST_RECIPES.recipeBuilder() + .input(dust, PotassiumOsmate, 13) + .fluidInputs(Hydrogen.getFluid(6000)) + .output(dust, Osmium, 1) + .output(dust, PotassiumHydroxide, 6) + .fluidOutputs(Steam.getFluid(4000)) + .blastFurnaceTemp(9200) + .duration(1200 / 4) + .EUt(VH[UV]) + .buildAndRegister(); + + // recycling/catalysts + // Na + H -> NaH + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, Sodium, 1) + .fluidInputs(Hydrogen.getFluid(1000)) + .notConsumable(MineralOil.getFluid(), 150) + .output(dust, SodiumHydride, 2) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // H3BO3 (s) + 3CH3OH (l) -> (CH3)3BO3 (l) + 3H2O (l) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, BoricAcid, 7) + .fluidInputs(Methanol.getFluid(3000)) + .fluidOutputs(TrimethylBorate.getFluid(1000)) + .fluidOutputs(Water.getFluid(3000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // (CH3)3BO3 (l) + 4NaH (s) -> NaBH4 (s) + 3NaCH3O (s) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(TrimethylBorate.getFluid(3000)) + .input(dust, SodiumHydride, 8) + .output(dust, SodiumBorohydride, 6) + .output(dust, SodiumMethoxide, 18) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // NaCH3O (s) + H2O (l) -> CH3OH (l) + NaOH (s) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(Water.getFluid(3000)) + .input(dust, SodiumMethoxide, 6) + .fluidOutputs(Methanol.getFluid(1000)) + .output(dust, SodiumHydroxide, 3) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // KCH3CO2 (s) + HCl (aq) -> KCl (s) + CH3COOH (aq) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, PotassiumAcetate, 8) + .fluidInputs(HydrochloricAcid.getFluid(1000)) + .output(dust, RockSalt, 1) + .fluidOutputs(AceticAcid.getFluid(1000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // KHSO4 (s) -> KHSO4 (l) + EXTRACTOR_RECIPES.recipeBuilder() + .input(dust, PotassiumBisulfate, 7) + .fluidOutputs(PotassiumBisulfate.getFluid(1000)) + .duration(800) + .EUt(VA[LV]) + .buildAndRegister(); + + // 2KHSO4 -> K2SO4 + SO3 + H2O + ELECTROLYZER_RECIPES.recipeBuilder() + .circuitMeta(3) + .fluidInputs(PotassiumBisulfate.getFluid(2000)) + .output(dust, PotassiumSulfate, 7) + .fluidOutputs(SulfurTrioxide.getFluid(1000)) + .fluidOutputs(Water.getFluid(1000)) + .duration(1000) + .EUt(VH[MV]) + .buildAndRegister(); + } + + private static void platinum() { + { + // [7 H2PtCl6 (aq) + 3 H2IrCl6 (aq) + 7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 + // (aq)] + FeCl2 (s) -> + // [7 H2PtCl6 (aq) + 3 HIrCl4 (aq) + 7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 + // (aq) + HCl (aq)] + FeCl3 (s) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(PGMSolution1.getFluid(28000)) + .fluidInputs(FerrousChloride.getFluid(1000)) + .fluidOutputs(PGMSolution1IR.getFluid(28000)) + .fluidOutputs(Iron3Chloride.getFluid(1000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + } + + // the amount of NH4Cl it needs is 2x platinum chloride sol + { + // [7 H2PtCl6 (aq) + 3 HIrCl4 (aq) + 7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 + // (aq) + HCl (aq)] + 14NH4Cl (s) -> + // [7 (NH4)2PtCl6 (aq) + 3 HIrCl4 (aq) + 7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 + // HAgCl2 (aq) + 15HCl (aq)] + MIXER_RECIPES.recipeBuilder() + .input(dust, AmmoniumChloride, 28) + .fluidInputs(PGMSolution1IR.getFluid(28000)) + .fluidOutputs(PGMSolution1Plat.getFluid(28000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + } + + // the amount of HCl it gives is 1 + 2n(n is amount of platinate) + { + // [7 (NH4)2PtCl6 (aq) + 3 HIrCl4 (aq) + 7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 + // HAgCl2 (aq) + 15HCl (aq)] -> + // 7 (NH4)2PtCl6 (s) + [3 HIrCl4 (aq) + 7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 + // HAgCl2 (aq)] + 15HCl (aq) + DISTILLATION_RECIPES.recipeBuilder() + .fluidInputs(PGMSolution1Plat.getFluid(28000)) + .output(dust, AmmoniumHexachloroplatinate, 7) + .fluidOutputs(PGMSolution1Iri.getFluid(21000)) + .fluidOutputs(HydrochloricAcid.getFluid(15000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + } + + // slower route? + // (NH4)2PtCl6 (s) + 2H2 (g) -> Pt (s) + 2NH4Cl (s) + 4HCl (g) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, AmmoniumHexachloroplatinate, 1) + .fluidInputs(Hydrogen.getFluid(4000)) + .output(dust, Platinum, 1) + .output(dust, AmmoniumChloride, 4) + .fluidOutputs(HydrochloricAcid.getFluid(4000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // (NH4)2PtCl6 (s) + N2H4 (g) -> Pt (s) + 2NH4Cl (s) + 4HCl (g) + N2 (g) + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .input(dust, AmmoniumHexachloroplatinate, 1) + .fluidInputs(Hydrazine.getFluid(1000)) + .output(dust, Platinum, 1) + .output(dust, AmmoniumChloride, 4) + .fluidOutputs(HydrochloricAcid.getFluid(4000)) + .fluidOutputs(Nitrogen.getFluid(2000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + } + + private static void iridium() { + // HCl and Cl2 need to be the same as the iridate + { + // 2[3 HIrCl4 (aq) + 7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 (aq)] + 6 HCl + // (aq) + 3 Cl2 (g) -> + // 2[3 H2IrCl6 (aq) + 7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 (aq)] + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(PGMSolution1Iri.getFluid(21000 * 2)) + .fluidInputs(HydrochloricAcid.getFluid(6000)) + .fluidInputs(Chlorine.getFluid(6000)) + .fluidOutputs(PGMSolution1IriOxide.getFluid(21000 * 2)) + .duration(160) + .EUt(120) + .buildAndRegister(); + } + + // NH4Cl is double what iridate your making, gives same amount of HCl + { + // [3 H2IrCl6 (aq) + 7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 (aq)] + 6 NH4Cl + // (s) -> + // 3(NH4)2IrCl6 (s) + 6 HCl (aq) + [7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 + // (aq)] + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, AmmoniumChloride, 12) + .fluidInputs(PGMSolution1IriOxide.getFluid(21000)) + .output(dust, AmmoniumHexachloroiridate, 6) + .fluidOutputs(HydrochloricAcid.getFluid(6000)) + .fluidOutputs(PGMSolution1Pall.getFluid(18000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + } + + // first path, slower + // (NH4)2IrCl6 (s) + 2H2 (g) -> Ir (s) + 2NH4Cl (s) + 4HCl (g) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, AmmoniumHexachloroiridate, 2) + .fluidInputs(Hydrogen.getFluid(4000)) + .output(dust, Iridium, 1) + .output(dust, AmmoniumChloride, 4) + .fluidOutputs(HydrochloricAcid.getFluid(4000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // second path + // (NH4)2IrCl6 (s) + N2H4 (l) + 6NaOH (aq) -> Ir (s) + N2 (g) + 2NH3 (g) + 6NaCl (aq) + 6H2O (l) + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .input(dust, AmmoniumHexachloroiridate, 2) + .input(dust, SodiumHydroxide, 6) + .fluidInputs(Hydrazine.getFluid(1000)) + .output(dust, Iridium, 1) + .fluidOutputs(Nitrogen.getFluid(2000)) + .fluidOutputs(Ammonia.getFluid(2000)) + .fluidOutputs(SaltWater.getFluid(6000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + } + + private static void palladium() { + // route 1 + // need double the C4H8N2O2 as palladium, makes 4 times the HCl + { + // [7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 (aq)] + 14 C4H8N2O2 (s) -> + // 7 (C4H7N2O2)2Pd (s) + 28 HCl (aq) + [4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 (aq)] + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(PGMSolution1Pall.getFluid(18000)) + .input(dust, Dimethylglyoxime, 14) + .output(dust, PalladiumDimethylglyoxime, 21) + .fluidOutputs(HydrochloricAcid.getFluid(28000)) + .fluidOutputs(PGMSolution1Rho.getFluid(11000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + } + + // (C4H7N2O2)2Pd (s) + 2HCl (aq) -> PdCl2 (s) + 2C4H8N2O2 (s) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, PalladiumDimethylglyoxime, 3) + .fluidInputs(HydrochloricAcid.getFluid(2000)) + .output(dust, PalladiumChloride, 3) + .output(dust, Dimethylglyoxime, 2) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // PdCl2 (s) + H2 (g) -> Pd (s) + 2HCl (g) + BLAST_RECIPES.recipeBuilder() + .input(dust, PalladiumChloride, 3) + .fluidInputs(Hydrogen.getFluid(2000)) + .output(dust, Palladium, 1) + .fluidOutputs(HydrochloricAcid.getFluid(2000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // route 2 + { + // [7 H2PdCl4 (aq) + 4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 (aq)] + 7 Cl2 (g) + 14 NH4Cl (s) + // -> + // 7 (NH4)2PdCl6 (s) + 14HCl (aq) + [4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 (aq)] + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, AmmoniumChloride, 28) + .fluidInputs(PGMSolution1Pall.getFluid(18000)) + .fluidInputs(Chlorine.getFluid(14000)) + .output(dust, AmmoniumHexachloropalladate, 63) + .fluidOutputs(HydrochloricAcid.getFluid(14000)) + .fluidOutputs(PGMSolution1Rho.getFluid(11000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + } + + // 3(NH4)2PdCl6 (s) + 20NH3 (g) -> 3Pd(NH3)4Cl2 (s) + 12NH4Cl (s) + N2 (g) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, AmmoniumHexachloropalladate, 27) + .fluidInputs(Ammonia.getFluid(20000)) + .output(dust, TetraaminePalladiumChloride, 21) + .output(dust, AmmoniumChloride, 24) + .fluidOutputs(Nitrogen.getFluid(2000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // Pd(NH3)4Cl2 (s) + 2HCl (aq) -> Pd(NH3)2Cl2 (s) + 2NH4Cl (s) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, TetraaminePalladiumChloride, 7) + .fluidInputs(HydrochloricAcid.getFluid(2000)) + .output(dust, DiamineDichloropalladium, 5) + .output(dust, AmmoniumChloride, 4) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // path 1 + // 3 Pd(NH3)2Cl2 (s) —> 3Pd (s) + 4NH4Cl (s) + 2HCl (g) + N2 (g) + ELECTROLYZER_RECIPES.recipeBuilder() + .input(dust, DiamineDichloropalladium, 15) + .output(dust, Palladium, 3) + .output(dust, AmmoniumChloride, 8) + .fluidOutputs(HydrochloricAcid.getFluid(2000)) + .fluidOutputs(Nitrogen.getFluid(2000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // path 2, faster + // 2 Pd(NH3)2Cl2 (s) + N2H4 (l) —> 2Pd (s) + 4NH4Cl (s) + N2 (g) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, DiamineDichloropalladium, 10) + .fluidInputs(Hydrazine.getFluid(1000)) + .output(dust, Palladium, 2) + .output(dust, AmmoniumChloride, 8) + .fluidOutputs(Nitrogen.getFluid(2000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + } + + private static void rhodium() { + // need 3x the nitric acid as rhodium and makes 3x the HCl + { + // [4 RhCl3 (aq) + 3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 (aq)] + 12 HNO3 (aq) -> + // 4 Rh(NO3)3 (aq) + 12 HCl (aq) + [3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 (aq)] + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(PGMSolution1Rho.getFluid(11000)) + .fluidInputs(NitricAcid.getFluid(12000)) + .fluidOutputs(RhodiumNitrate.getFluid(4000)) + .fluidOutputs(HydrochloricAcid.getFluid(12000)) + .fluidOutputs(PGMSolution1Ruth.getFluid(7000)) + .duration(160) + .EUt(120) + .buildAndRegister(); + } + + // KNO3 (l) + Pb (l) -> KNO2 (s) + PbO (s) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(PotassiumNitrate.getFluid(1000)) + .fluidInputs(Lead.getFluid(144)) + .output(dust, PotassiumNitrite, 4) + .output(dust, LeadOxide, 2) + .duration(160) + .EUt(120) + .buildAndRegister(); + + // Rh(NO3)3 (aq) + 6KNO2 (s) -> K3Rh(NO2)6 (s) + 3KNO3 (aq) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(RhodiumNitrate.getFluid(1000)) + .input(dust, PotassiumNitrite, 24) + .output(dust, PotassiumHexanitrorhodate, 10) + .fluidOutputs(PotassiumNitrate.getFluid(3000)) + .duration(4000 / 4) + .EUt(VH[EV]) + .buildAndRegister(); + + // K3Rh(NO2)6 (s) + 6HCl (aq) -> K3RhCl6 (aq) + 3H2O (l) + 3NO2 (g) + 3NO (g) + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .input(dust, PotassiumHexanitrorhodate, 10) + .fluidInputs(HydrochloricAcid.getFluid(6000)) + .fluidOutputs(PotassiumHexachlororhodateSolution.getFluid(1000)) + .fluidOutputs(NitrogenDioxide.getFluid(3000)) + .fluidOutputs(NitricOxide.getFluid(3000)) + .duration(3000 / 4) + .EUt(VH[IV]) + .buildAndRegister(); + + // K3RhCl6 (aq) + 3H2O (l) + 3NH4Cl (s) -> (NH4)3RhCl6 (s) + 3KCl (aq) + 3H2O (l) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, AmmoniumChloride, 6) + .fluidInputs(PotassiumHexachlororhodateSolution.getFluid(1000)) + .output(dust, AmmoniumHexachlororhodate, 10) + .fluidOutputs(PotassiumChlorideSolution.getFluid(3000)) + .duration(3600 / 4) + .EUt(VH[EV]) + .buildAndRegister(); + + // route 1 + // 2(NH4)3RhCl6 (s) + 3H2 (g) -> 2Rh (s) + 6NH4Cl (s) + 6HCl (g) + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .input(dust, AmmoniumHexachlororhodate, 20) + .fluidInputs(Hydrogen.getFluid(6000)) + .output(dust, Rhodium, 2) + .fluidOutputs(HydrochloricAcid.getFluid(6000)) + .output(dust, AmmoniumChloride, 12) + .duration(14400 / 4) + .EUt(VA[EV]) + .buildAndRegister(); + + // route 2 + // 4(NH4)3RhCl6 (s) + 3N2H4 (l) + 24NaOH (aq) -> 4Rh (s) + 3N2 (g) + 12NH3 (g) + 24NaCl (aq) + 24H2O (l) + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .input(dust, AmmoniumHexachlororhodate, 40) + .input(dust, SodiumHydroxide, 72) + .fluidInputs(Hydrazine.getFluid(3000)) + .output(dust, Rhodium, 4) + .fluidOutputs(Nitrogen.getFluid(6000)) + .fluidOutputs(Ammonia.getFluid(12000)) + .fluidOutputs(SaltWater.getFluid(24000)) + .duration(3600 / 4) + .EUt(VH[IV]) + .buildAndRegister(); + + ELECTROLYZER_RECIPES.recipeBuilder() + .fluidInputs(PotassiumChlorideSolution.getFluid(1000)) + .output(dust, Potassium) + .fluidOutputs(Chlorine.getFluid(1000)) + .duration(300) + .EUt(VH[MV]) + .buildAndRegister(); + } + + private static void ruthenium() { + // needs 3x the KCl and water + // [3 RuCl3 (aq) + 2 AuCl3 (aq) + 2 HAgCl2 (aq)] + 9 KCl (s) + 3H2O -> 3[K3RuCl6 (aq) + H2O] + [2 AuCl3 (aq) + 2 + // HAgCl2 (aq)] + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(PGMSolution1Ruth.getFluid(7000)) + .input(dust, RockSalt, 18) + .fluidInputs(Water.getFluid(3000)) + .fluidOutputs(PGMSolution1InertMetals.getFluid(4000)) + .fluidOutputs(PotassiumHexachlororuthenate.getFluid(3000)) + .duration(1800 / 16) + .EUt(VA[HV]) + .buildAndRegister(); + + // [6K3RuCl6 (aq) + 6H2O (l)] + 8NaClO3 (s) -> [6RuO4 (aq) + 6H2O (l) + 18KCl (aq) + 9Cl2 (aq)] + 8NaCl (s) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, SodiumChlorate, 20) + .fluidInputs(PotassiumHexachlororuthenate.getFluid(3000)) + .output(dust, Salt, 8) + .fluidOutputs(ChlorinatedRutheniumTetroxideSolution.getFluid(3000)) + .duration(1500 / 16) + .EUt(VH[HV]) + .buildAndRegister(); + + // [2RuO4 (aq) + 3Cl2 (aq) + 6KCl (aq) + 2H2O (l)] -> 6KCl (s) + 2H2O (l) + 2RuO4 (g) + 3Cl2 (g) + DISTILLATION_RECIPES.recipeBuilder() + .fluidInputs(ChlorinatedRutheniumTetroxideSolution.getFluid(1000)) + .output(dust, RockSalt, 12) + .fluidOutputs(Water.getFluid(2000)) + .fluidOutputs(RutheniumTetroxide.getFluid(FluidStorageKeys.GAS, 2000)) + .fluidOutputs(Chlorine.getFluid(6000)) + .duration(800 / 16) + .EUt(VA[HV]) + .buildAndRegister(); + + // RuO4 (g) + [NaOH (aq) + H2O (l)] —> [NaHRuO5 (aq) + H2O (aq)] + MIXER_RECIPES.recipeBuilder() + .fluidInputs(RutheniumTetroxide.getFluid(FluidStorageKeys.GAS, 1000)) + .fluidInputs(SodiumHydroxideSolution.getFluid(1000)) + .fluidOutputs(BasicRutheniumTetroxideSolution.getFluid(1000)) + .duration(200 / 4) + .EUt(VA[MV]) + .buildAndRegister(); + + // [NaHRuO5 (aq) + H2O (aq)] + CH3CH2OH (l) —> RuO2 (s) + NaCH3CO2 (aq) + 3H2O (l) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(BasicRutheniumTetroxideSolution.getFluid(1000)) + .fluidInputs(Ethanol.getFluid(1000)) + .output(dust, RutheniumDioxide, 3) + .fluidOutputs(SodiumAcetate.getFluid(1000)) + .fluidOutputs(Water.getFluid(3000)) + .duration(300 / 4) + .EUt(VA[EV]) + .buildAndRegister(); + + // RuO2 (s) + 2H2 (g) -> Ru (s) + 2H2O (g) + BLAST_RECIPES.recipeBuilder() + .input(dust, RutheniumDioxide, 3) + .fluidInputs(Hydrogen.getFluid(4000)) + .output(dust, Ruthenium, 1) + .fluidOutputs(Steam.getFluid(2000)) + .blastFurnaceTemp(3300) + .duration(1600 / 16) + .EUt(VA[EV]) + .buildAndRegister(); + + // 2 NaOH (s) + 2 Cl (aq) -> H2O (l) + NaCl (s) + NaClO (s) + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .circuitMeta(6) + .fluidInputs(Chlorine.getFluid(2000)) + .input(dust, SodiumHydroxide, 6) + .fluidOutputs(Water.getFluid(1000)) + .output(dust, Salt, 2) + .output(dust, SodiumHypochlorite, 3) + .duration(240 / 4) + .EUt(120) + .buildAndRegister(); + + // 3 NaClO (s) -> 2 NaCl (s) + NaClO3 (s) + ELECTROLYZER_RECIPES.recipeBuilder() + .input(dust, SodiumHypochlorite, 9) + .output(dust, Salt, 4) + .output(dust, SodiumChlorate, 5) + .duration(450 / 4) + .EUt(120) + .buildAndRegister(); + + // NaCH3CO2 (s) + HCl (aq) -> NaCl (s) + CH3COOH (aq) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(SodiumAcetate.getFluid(1000)) + .fluidInputs(HydrochloricAcid.getFluid(1000)) + .output(dust, Salt, 2) + .fluidOutputs(AceticAcid.getFluid(1000)) + .duration(300 / 4) + .EUt(120) + .buildAndRegister(); + } + + private static void inerts() { + // [2 AuCl3 (aq) + 2 HAgCl2 (aq)] -> 2 AgCl (s) + 2 HCl (l) + 2 AuCl3 (aq) + DISTILLATION_RECIPES.recipeBuilder() + .fluidInputs(PGMSolution1InertMetals.getFluid(4000)) + .output(dust, SilverChloride, 4) + .fluidOutputs(HydrochloricAcid.getFluid(2000)) + .fluidOutputs(GoldChloride.getFluid(2000)) + .duration(600) + .EUt(480) + .buildAndRegister(); + + // 2 AuCl3 (aq) + 3SO2 (g) + 6H2O (l) -> 2 Au (s) + 3SO3 (aq) + 6HCl (aq) + 3 H2O (aq) + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(GoldChloride.getFluid(2000)) + .fluidInputs(SulfurDioxide.getFluid(3000)) + .fluidInputs(Water.getFluid(6000)) + .output(dust, Gold, 2) + .fluidOutputs(SulfurTrioxide.getFluid(3000)) + .fluidOutputs(HydrochloricAcid.getFluid(6000)) + .fluidOutputs(Water.getFluid(3000)) + .duration(400) + .EUt(480) + .buildAndRegister(); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/chain/updated/NewREEChain.java b/src/main/java/com/fulltrix/gcyl/recipes/chain/updated/NewREEChain.java new file mode 100644 index 00000000..fe5a5ec4 --- /dev/null +++ b/src/main/java/com/fulltrix/gcyl/recipes/chain/updated/NewREEChain.java @@ -0,0 +1,230 @@ +package com.fulltrix.gcyl.recipes.chain.updated; + +import gregtech.api.recipes.chance.output.ChancedOutputLogic; +import gregtech.api.unification.material.Material; + +import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.CHEMICAL_DEHYDRATOR_RECIPES; +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; +import static com.fulltrix.gcyl.materials.chains.NewREEMaterials.*; +import static gregtech.api.GTValues.IV; +import static gregtech.api.GTValues.VA; +import static gregtech.api.recipes.RecipeMaps.*; +import static gregtech.api.unification.material.Materials.*; +import static gregtech.api.unification.ore.OrePrefix.dust; + +public class NewREEChain { + + public static void init() { + Bastnasite(); + Monazite(); + Xenotime(); + + CENTRIFUGE_RECIPES.recipeBuilder().duration(400).EUt(480) + .input(dust, RareEarth, 3) + .chancedOutput(dust, Monazite, 2500, 1000) + .chancedOutput(dust, Xenotime, 2500, 1000) + .chancedOutput(dust, Bastnasite, 2500, 1000) + .buildAndRegister(); + + } + + private static void Bastnasite() { + // 2CeCO3F (s) + 3H2SO4 (aq) -> Ce2(SO4)3 (aq) + 2CO2 (g) + 2HF (aq) + 2H2O (l) + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .input(dust, Bastnasite, 12) + .fluidInputs(SulfuricAcid.getFluid(3000)) + .fluidOutputs(CeriumRichLREESulfateSolution.getFluid(1000)) + .fluidOutputs(CarbonDioxide.getFluid(2000)) + .fluidOutputs(HydrofluoricAcid.getFluid(2000)) + .fluidOutputs(Water.getFluid(2000)) + .EUt(1920) + .duration(600) + .buildAndRegister(); + + // Ce2(SO4)3 (aq) + 6NaOH (s) -> 2Ce(OH)3 (s) + 3Na2SO4 (s) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, SodiumHydroxide, 18) + .fluidInputs(CeriumRichLREESulfateSolution.getFluid(1000)) + .fluidOutputs(CeriumRichLREEHydroxides.getFluid(2000)) + .output(dust, SodiumSulfate, 21) + .EUt(960) + .duration(450) + .buildAndRegister(); + + // 4Ce(OH)3 (s) + O (g) -> 2CeO2 (s) + REE2O3 (s) + 3H2O (l) + MIXER_RECIPES.recipeBuilder() + .fluidInputs(CeriumRichLREEHydroxides.getFluid(2000)) + .fluidInputs(Oxygen.getFluid(1000)) + .output(dust, CeriumOxide, 6) + .output(dust, LREEOxides, 5) + .fluidOutputs(Water.getFluid(3000)) + .EUt(960) + .duration(450) + .buildAndRegister(); + + SeparationProcess(LREENitrateSolution, LREEOxalates, LREEOxides, LREEPentachlorides, LREEChlorides); + + ELECTROLYZER_RECIPES.recipeBuilder() + .input(dust, LREEChlorides, 4) + .chancedOutputLogic(ChancedOutputLogic.XOR) + .chancedOutput(dust, LanthanumOxide, 5, 5000, 50) + .chancedOutput(dust, PraseodymiumOxide, 5, 1400, 50) + .chancedOutput(dust, NeodymiumOxide, 5, 3600, 50) + .fluidOutputs(Chlorine.getFluid(3000)) + .duration(400) + .EUt(480) + .buildAndRegister(); + } + + private static void Monazite() { + // LnPO4Th3(PO4)4 (s) + 15NaOH (s) + H2O (l) -> Ln(OH)3 (aq) + 3Th(OH)4 (aq) + H2O (l) + 5Na3PO4 (s) + AUTOCLAVE_RECIPES.recipeBuilder() + .input(dust, Monazite, 30) + .input(dust, SodiumHydroxide, 45) + .fluidInputs(Water.getFluid(1000)) + .fluidOutputs(MonaziteHydroxideSolution.getFluid(1000)) + .output(dust, TrisodiumPhosphate, 40) + .duration(450) + .EUt(480) + .buildAndRegister(); + + // Ln(OH)3 (aq) + 3Th(OH)4 (aq) + 15HNO3 (aq) -> Ln(NO3)3 (aq) + 3Th(NO3)4*5H2O (s) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(MonaziteHydroxideSolution.getFluid(1000)) + .fluidInputs(NitricAcid.getFluid(15000)) + .fluidOutputs(MREENitrateSolution.getFluid(500)) + .fluidOutputs(LREENitrateSolution.getFluid(500)) + .output(dust, ThoriumNitratePentahydrate, 30) + .duration(450) + .EUt(VA[IV]) + .buildAndRegister(); + + // Th(NO3)4*5H2O (s) -> ThO2 (s) + 4NO2 (aq) + 5H2O (g) + O2 (g) + CENTRIFUGE_RECIPES.recipeBuilder() + .circuitMeta(1) + .input(dust, ThoriumNitratePentahydrate, 30) + .fluidInputs(Air.getFluid(30000)) + .output(dust, ThoriumDioxide, 3) + .fluidOutputs(NitrogenDioxide.getFluid(4000)) + .fluidOutputs(Steam.getFluid(5000)) + .fluidOutputs(IrradiatedAir.getFluid(30000)) + .duration(400) + .EUt(1920) + .buildAndRegister(); + + SeparationProcess(MREENitrateSolution, MREEOxalates, MREEOxides, MREEPentachlorides, MREEChlorides); + + ELECTROLYZER_RECIPES.recipeBuilder() + .input(dust, MREEChlorides, 8) + .chancedOutputLogic(ChancedOutputLogic.XOR) + .chancedOutput(dust, SamariumOxide, 5, 5000, 50) + .chancedOutput(dust, EuropiumOxide, 5, 500, 50) + .chancedOutput(dust, GadoliniumOxide, 5, 3000, 50) + .chancedOutput(dust, TerbiumOxide, 5, 1500, 50) + .fluidOutputs(Chlorine.getFluid(6000)) + .duration(400) + .EUt(480) + .buildAndRegister(); + } + + private static void Xenotime() { + // 2REEPO4 (s) + 3H2SO4 (aq) -> REE2(SO4)3 (aq) + 2H3PO4 (aq) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, Xenotime, 8) + .fluidInputs(SulfuricAcid.getFluid(3000)) + .fluidOutputs(XenotimeSulfateSolution.getFluid(1000)) + .fluidOutputs(PhosphoricAcid.getFluid(2000)) + .duration(400) + .EUt(1920) + .buildAndRegister(); + + // REE2(SO4)3 (aq) + 10NaOH (s) -> [2REE(OH)3 (aq) + Th(OH)4 (aq) + Fe (aq)] + 3Na2SO4 (s) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(XenotimeSulfateSolution.getFluid(1000)) + .input(dust, SodiumHydroxide, 30) + .fluidOutputs(XenotimeHydroxideSolution.getFluid(1000)) + .output(dust, SodiumSulfate, 21) + .duration(400) + .EUt(1920) + .buildAndRegister(); + + LARGE_CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(XenotimeHydroxideSolution.getFluid(1000)) + .fluidInputs(NitricAcid.getFluid(10000)) + .notConsumable(DEHPA.getFluid(3000)) + .notConsumable(Kerosene.getFluid(7000)) + .fluidOutputs(HREENitrateSolution.getFluid(900)) + .fluidOutputs(MREENitrateSolution.getFluid(100)) + .output(dust, ThoriumNitratePentahydrate, 10) + .output(dust, Iron, 1) + .fluidOutputs(Water.getFluid(5000)) + .duration(900) + .EUt(1920) + .buildAndRegister(); + + SeparationProcess(HREENitrateSolution, HREEOxalates, HREEOxides, HREEPentachlorides, HREEChlorides); + + CHEMICAL_DEHYDRATOR_RECIPES.recipeBuilder() + .input(dust, HREEChlorides, 8) + .notConsumable(AmmoniumThiocyanate.getFluid(10000)) + .chancedOutputLogic(ChancedOutputLogic.XOR) + .chancedOutput(dust, DysprosiumOxide, 5, 1000, 50) + .chancedOutput(dust, HolmiumOxide, 5, 200, 50) + .chancedOutput(dust, ErbiumOxide, 5, 600, 50) + .chancedOutput(dust, ThuliumOxide, 5, 100, 50) + .chancedOutput(dust, YtterbiumOxide, 5, 700, 50) + .chancedOutput(dust, LutetiumOxide, 5, 40, 50) + .chancedOutput(dust, YttriumOxide, 5, 7200, 50) + .chancedOutput(dust, ScandiumOxide, 5, 10000, 50) //TODO: is this right? + .fluidOutputs(Chlorine.getFluid(6000)) + .duration(300) + .EUt(480) + .buildAndRegister(); + } + + private static void SeparationProcess(Material nitrate, Material oxalate, Material oxide, Material pentachloride, + Material chloride) { + // 2REE(NO3)3 (aq) + 3C2H2O4 (s) -> REE2(C2O4)3 (s) + 6HNO3 (aq) + CHEMICAL_RECIPES.recipeBuilder() + .fluidInputs(nitrate.getFluid(2000)) + .input(dust, OxalicAcid, 24) + .output(dust, oxalate, 1) + .fluidOutputs(NitricAcid.getFluid(6000)) + //.duration(2000 / 4) //TODO: ? + .duration(300) + .EUt(1920) + .buildAndRegister(); + + // 2REE2(C2O4)3 (s) + 3O2 (g) -> 2REE2O3 + 12CO2 + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, oxalate, 2) + .fluidInputs(Oxygen.getFluid(6000)) + .output(dust, oxide, 10) + .fluidOutputs(CarbonDioxide.getFluid(12000)) + //.duration(2000 / 4) //TODO: ? + .duration(300) + .EUt(1920) + .buildAndRegister(); + + // REE2O3 (s) + 10NH4Cl (s) -> 2(NH4)2[REECl5] (s) + 6NH3 (g) + 3H2O (l) + CHEMICAL_RECIPES.recipeBuilder() + .input(dust, oxide, 5) + .input(dust, AmmoniumChloride, 20) + .output(dust, pentachloride, 6) + .fluidOutputs(Ammonia.getFluid(6000)) + .fluidOutputs(Water.getFluid(3000)) + //.duration(2000 / 4) //TODO: ? + .duration(300) + .EUt(1920) + .buildAndRegister(); + + // (NH4)2[REECl5] (s) -> REECl3 (s) + 2NH4Cl (s) + CENTRIFUGE_RECIPES.recipeBuilder() + .input(dust, pentachloride, 3) + .output(dust, chloride, 4) + .output(dust, AmmoniumChloride, 4) + .duration(300) + .EUt(480) + .buildAndRegister(); + } +} diff --git a/src/main/java/com/fulltrix/gcyl/recipes/helper/GCYLComponents.java b/src/main/java/com/fulltrix/gcyl/recipes/helper/GCYLComponents.java index 08d35c0d..e124a618 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/helper/GCYLComponents.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/helper/GCYLComponents.java @@ -14,11 +14,14 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +//TODO Finish cables public class GCYLComponents { public static Component PLATE_DENSE; public static Component CABLE_DOUBLE; public static Component GEAR; + public static Component SUPERCONDUCTOR_WIRE; + public static void initializeComponents() { PLATE_DENSE = new Component(Stream.of(new Object[][]{ @@ -33,7 +36,9 @@ public static void initializeComponents() { {9, new UnificationEntry(plateDense, Seaborgium)}, {10, new UnificationEntry(plateDense, Bohrium)}, {11, new UnificationEntry(plateDense, Quantum)}, - {12, new UnificationEntry(plateDense, Neutronium)} + {12, new UnificationEntry(plate, BlackTitanium)}, + {13, new UnificationEntry(plate, HeavyQuarkDegenerateMatter)}, + {14, new UnificationEntry(plate, Neutronium)} }).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1]))); @@ -52,8 +57,8 @@ public static void initializeComponents() { {10, new UnificationEntry(cableGtDouble, TitanSteel)}, {11, new UnificationEntry(cableGtDouble, BlackTitanium)}, {12, new UnificationEntry(cableGtDouble, NaquadriaticTaranium)}, - {13, new UnificationEntry(cableGtDouble, CosmicNeutronium)}, - {14, new UnificationEntry(cableGtDouble, MAXSuperconductor)} + {13, new UnificationEntry(cableGtDouble, Neutronium)}, + {14, new UnificationEntry(cableGtDouble, CosmicNeutronium)} }).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1]))); @@ -74,6 +79,25 @@ public static void initializeComponents() { }).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1]))); + SUPERCONDUCTOR_WIRE = new Component(Stream.of(new Object[][]{ + + {1, new UnificationEntry(wireGtSingle, LVSuperconductor)}, + {2, new UnificationEntry(wireGtSingle, MVSuperconductor)}, + {3, new UnificationEntry(wireGtSingle, HVSuperconductor)}, + {4, new UnificationEntry(wireGtSingle, EVSuperconductor)}, + {5, new UnificationEntry(wireGtSingle, IVSuperconductor)}, + {6, new UnificationEntry(wireGtSingle, LuVSuperconductor)}, + {7, new UnificationEntry(wireGtSingle, ZPMSuperconductor)}, + {8, new UnificationEntry(wireGtSingle, UVSuperconductor)}, + {9, new UnificationEntry(wireGtSingle, UHVSuperconductor)}, + {10, new UnificationEntry(wireGtSingle, UEVSuperconductor)}, + {11, new UnificationEntry(wireGtSingle, UIVSuperconductor)}, + {12, new UnificationEntry(wireGtSingle, UXVSuperconductor)}, + {13, new UnificationEntry(wireGtSingle, OpVSuperconductor)}, + {14, new UnificationEntry(wireGtSingle, MAXSuperconductor)} + + }).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1]))); + CraftingComponent.CABLE = new Component(Stream.of(new Object[][] { { 0, new UnificationEntry(OrePrefix.cableGtSingle, Materials.RedAlloy) }, @@ -85,7 +109,7 @@ public static void initializeComponents() { { 6, new UnificationEntry(OrePrefix.cableGtSingle, Materials.NiobiumTitanium) }, { 7, new UnificationEntry(OrePrefix.cableGtSingle, Materials.Naquadah) }, { 8, new UnificationEntry(OrePrefix.cableGtSingle, Materials.NaquadahAlloy) }, - { 9, new UnificationEntry(OrePrefix.cableGtSingle, TungstenTitaniumCarbide) }, + { 9, new UnificationEntry(OrePrefix.cableGtSingle, TungstenTitaniumCarbide) } }).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1]))); @@ -101,6 +125,12 @@ public static void initializeComponents() { { 7, new UnificationEntry(OrePrefix.cableGtQuadruple, Naquadah) }, { 8, new UnificationEntry(OrePrefix.cableGtQuadruple, NaquadahAlloy) }, { 9, new UnificationEntry(OrePrefix.cableGtQuadruple, TungstenTitaniumCarbide) }, + //TODO: Change these? + {10, new UnificationEntry(cableGtQuadruple, TitanSteel)}, + {11, new UnificationEntry(cableGtQuadruple, BlackTitanium)}, + {12, new UnificationEntry(cableGtQuadruple, NaquadriaticTaranium)}, + {13, new UnificationEntry(cableGtQuadruple, Neutronium)}, + {14, new UnificationEntry(cableGtQuadruple, CosmicNeutronium)} }).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1]))); @@ -164,6 +194,26 @@ public static void initializeComponents() { }).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1]))); + CraftingComponent.PLATE = new Component(Stream.of(new Object[][] { + + {0, new UnificationEntry(plate, Lead)}, + {1, new UnificationEntry(plate, Steel)}, + {2, new UnificationEntry(plate, Aluminium)}, + {3, new UnificationEntry(plate, StainlessSteel)}, + {4, new UnificationEntry(plate, Titanium)}, + {5, new UnificationEntry(plate, TungstenSteel)}, + {6, new UnificationEntry(plate, RhodiumPlatedPalladium)}, + {7, new UnificationEntry(plate, Duranium)}, + {8, new UnificationEntry(plate, Tritanium)}, + {9, new UnificationEntry(plate, Seaborgium)}, + {10, new UnificationEntry(plate, Bohrium)}, + {11, new UnificationEntry(plate, Quantum)}, + {12, new UnificationEntry(plate, BlackTitanium)}, + {13, new UnificationEntry(plate, HeavyQuarkDegenerateMatter)}, + {14, new UnificationEntry(plate, Neutronium)} + + }).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1]))); + } } diff --git a/src/main/java/com/fulltrix/gcyl/recipes/helper/HelperMethods.java b/src/main/java/com/fulltrix/gcyl/recipes/helper/HelperMethods.java index 2e14675d..d06f3422 100644 --- a/src/main/java/com/fulltrix/gcyl/recipes/helper/HelperMethods.java +++ b/src/main/java/com/fulltrix/gcyl/recipes/helper/HelperMethods.java @@ -1,14 +1,9 @@ package com.fulltrix.gcyl.recipes.helper; -import com.fulltrix.gcyl.recipes.GCYLRecipeMaps; +import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregtech.api.GTValues; -import gregtech.api.recipes.ModHandler; -import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityEnergyHatch; import net.minecraftforge.fluids.FluidStack; -import java.util.Arrays; -import java.util.List; - public class HelperMethods { /* TODO: implement diff --git a/src/main/resources/assets/gcyl/blockstates/elevator_casing.json b/src/main/resources/assets/gcyl/blockstates/elevator_casing.json new file mode 100644 index 00000000..9c6213fe --- /dev/null +++ b/src/main/resources/assets/gcyl/blockstates/elevator_casing.json @@ -0,0 +1,45 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/rendering_error" + } + }, + "variants": { + "variant": { + "concrete_strong": { + "model": "minecraft:cube_all", + "textures": { + "all": "gcyl:blocks/casings/elevator/concrete_strong" + } + }, + "elevator_base": { + "model": "minecraft:cube_all", + "textures": { + "all": "gcyl:blocks/casings/elevator/elevator_base" + } + }, + "elevator_internal": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/elevator_internal", + "side": "gcyl:blocks/casings/elevator/elevator_internal_side" + } + }, + "elevator_support": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/elevator_support", + "side": "gcyl:blocks/casings/elevator/elevator_support_side" + } + }, + "elevator_cable": { + "model": "minecraft:cube_all", + "textures": { + "all": "gcyl:blocks/casings/elevator/cable" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gcyl/blockstates/elevator_casing_tiered.json b/src/main/resources/assets/gcyl/blockstates/elevator_casing_tiered.json new file mode 100644 index 00000000..2abed5ed --- /dev/null +++ b/src/main/resources/assets/gcyl/blockstates/elevator_casing_tiered.json @@ -0,0 +1,48 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/rendering_error" + } + }, + "variants": { + "variant": { + "elevator_motor_1": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/tiered/motor", + "side": "gcyl:blocks/casings/elevator/tiered/1" + } + }, + "elevator_motor_2": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/tiered/motor", + "side": "gcyl:blocks/casings/elevator/tiered/2" + } + }, + "elevator_motor_3": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/tiered/motor", + "side": "gcyl:blocks/casings/elevator/tiered/3" + } + }, + "elevator_motor_4": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/tiered/motor", + "side": "gcyl:blocks/casings/elevator/tiered/4" + } + }, + "elevator_motor_5": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/tiered/motor", + "side": "gcyl:blocks/casings/elevator/tiered/5" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gcyl/blockstates/gcyl_cleanroom_casing.json b/src/main/resources/assets/gcyl/blockstates/gcyl_cleanroom_casing.json new file mode 100644 index 00000000..6193cd90 --- /dev/null +++ b/src/main/resources/assets/gcyl/blockstates/gcyl_cleanroom_casing.json @@ -0,0 +1,30 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all" + }, + "variants": { + "variant": { + "filter_casing_iso_3": { + "textures": { + "all": "gregtech:blocks/casings/cleanroom/filter_casing_iso_3" + } + }, + "filter_casing_iso_2": { + "textures": { + "all": "gregtech:blocks/casings/cleanroom/filter_casing_iso_2" + } + }, + "filter_casing_iso_1": { + "textures": { + "all": "gregtech:blocks/casings/cleanroom/filter_casing_iso_1" + } + }, + "filter_casing_iso_0": { + "textures": { + "all": "gregtech:blocks/casings/cleanroom/filter_casing_iso_0" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gcyl/blockstates/gcyl_component_al_casing.json b/src/main/resources/assets/gcyl/blockstates/gcyl_component_al_casing.json new file mode 100644 index 00000000..61f73d19 --- /dev/null +++ b/src/main/resources/assets/gcyl/blockstates/gcyl_component_al_casing.json @@ -0,0 +1,83 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/rendering_error" + } + }, + "variants": { + "variant": { + "lv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/lv" + } + }, + "mv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/mv" + } + }, + "hv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/hv" + } + }, + "ev": { + "textures": { + "all": "gcyl:blocks/casings/component_al/ev" + } + }, + "iv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/iv" + } + }, + "luv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/luv" + } + }, + "zpm": { + "textures": { + "all": "gcyl:blocks/casings/component_al/zpm" + } + }, + "uv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/uv" + } + }, + "uhv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/uhv" + } + }, + "uev": { + "textures": { + "all": "gcyl:blocks/casings/component_al/uev" + } + }, + "uiv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/uiv" + } + }, + "uxv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/uxv" + } + }, + "opv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/opv" + } + }, + "max": { + "textures": { + "all": "gcyl:blocks/casings/component_al/max" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gcyl/blockstates/gcyl_fusion_coil.json b/src/main/resources/assets/gcyl/blockstates/gcyl_fusion_coil.json new file mode 100644 index 00000000..4364c28d --- /dev/null +++ b/src/main/resources/assets/gcyl/blockstates/gcyl_fusion_coil.json @@ -0,0 +1,76 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/rendering_error" + } + }, + "variants": { + "active=false,variant=adv_fusion_coil_1": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uhv" + } + }, + "active=false,variant=adv_fusion_coil_2": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uev" + } + }, + "active=false,variant=adv_fusion_coil_3": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uiv" + } + }, + "active=false,variant=adv_fusion_coil_4": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/casings/solid/advanced_fusion_coil_umv" + } + }, + "active=false,variant=adv_fusion_coil_5": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uxv" + } + }, + "active=true,variant=adv_fusion_coil_1": { + "model": "gregtech:cube_2_layer_all", + "textures": { + "bot_all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uhv", + "top_all": "gregtech:blocks/casings/fusion/machine_coil_fusion_uhv_bloom" + } + }, + "active=true,variant=adv_fusion_coil_2": { + "model": "gregtech:cube_2_layer_all", + "textures": { + "bot_all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uev", + "top_all": "gregtech:blocks/casings/fusion/machine_coil_fusion_uev_bloom" + } + }, + "active=true,variant=adv_fusion_coil_3": { + "model": "gregtech:cube_2_layer_all", + "textures": { + "bot_all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uiv", + "top_all": "gregtech:blocks/casings/fusion/machine_coil_fusion_uiv_bloom" + } + }, + "active=true,variant=adv_fusion_coil_4": { + "model": "gregtech:cube_2_layer_all", + "textures": { + "bot_all": "gregtech:blocks/casings/solid/advanced_fusion_coil_umv", + "top_all": "gregtech:blocks/casings/fusion/machine_coil_fusion_umv_bloom" + } + }, + "active=true,variant=adv_fusion_coil_5": { + "model": "gregtech:cube_2_layer_all", + "textures": { + "bot_all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uxv", + "top_all": "gregtech:blocks/casings/fusion/machine_coil_fusion_uxv_bloom" + } + } + } +} diff --git a/src/main/resources/assets/gcyl/blockstates/gcyl_metal_casing_2.json b/src/main/resources/assets/gcyl/blockstates/gcyl_metal_casing_2.json index eab3b27b..af771dc4 100644 --- a/src/main/resources/assets/gcyl/blockstates/gcyl_metal_casing_2.json +++ b/src/main/resources/assets/gcyl/blockstates/gcyl_metal_casing_2.json @@ -67,6 +67,11 @@ "textures": { "all": "gcyl:blocks/casings/naquadria" } + }, + "casing_iridium": { + "textures": { + "all": "gcyl:blocks/casings/iridium" + } } } } diff --git a/src/main/resources/assets/gcyl/blockstates/gcyl_multiblock_casing2.json b/src/main/resources/assets/gcyl/blockstates/gcyl_multiblock_casing2.json index 6b95cdc1..8dccd65f 100644 --- a/src/main/resources/assets/gcyl/blockstates/gcyl_multiblock_casing2.json +++ b/src/main/resources/assets/gcyl/blockstates/gcyl_multiblock_casing2.json @@ -79,6 +79,13 @@ "bottom": "gregtech:blocks/casings/solid/laser_engraver_casing", "top": "gregtech:blocks/casings/solid/laser_engraver_casing" } + }, + "seaborgium_substation_casing": { + "textures": { + "side": "gregtech:blocks/casings/solid/seaborgium_substation_casing", + "bottom": "gregtech:blocks/casings/solid/seaborgium_substation_casing", + "top": "gregtech:blocks/casings/solid/seaborgium_substation_casing" + } } } } diff --git a/src/main/resources/assets/gcyl/lang/en_us.lang b/src/main/resources/assets/gcyl/lang/en_us.lang index bc421da4..f7afb805 100644 --- a/src/main/resources/assets/gcyl/lang/en_us.lang +++ b/src/main/resources/assets/gcyl/lang/en_us.lang @@ -1,3 +1,92 @@ +################################# LANG FROM TJ + +tile.casing_block.steel_plated_firebrick.name=Steel Plated Firebrick + + +gcyl.material.ammonium_hydroxide=Ammonium Hydroxide +gcyl.material.spodumene_ore_slurry=Spodumene Ore Slurry +gcyl.material.lepidolite_ore_slurry=Lepidolite Ore Slurry +gcyl.material.aluminium_sulfate_solution=Aluminium Sulfate Solution +gcyl.material.heated_sodium_hydroxide_bauxite=Heated Sodium Hydroxide Bauxite +gcyl.material.red_mud_slurry=Red Mud Slurry +gcyl.material.sodium_aluminate=Sodium Aluminate +gcyl.material.sodium_aluminate_solution=Sodium Aluminate Solution +gcyl.material.sodium_silicate=Sodium Silicate +gcyl.material.cryolite=Cryolite +gcyl.material.unpure_ilmenite=Impure Ilmenite +gcyl.material.ferrovanadium_i=Ferrovanadium (I) +gcyl.material.ferrovanadium_ii=Ferrovanadium (II) +gcyl.material.palladium_carbon_catalyst=Palladium Carbon Catalyst +gcyl.material.zirconium_hafnium_oxides=Zirconium-Hafnium Oxides +gcyl.material.zirconium_oxide=Zirconium Oxide +gcyl.material.zirconium_chloride=Zirconium Chloride +gcyl.material.wolframite=Wolframite +gcyl.material.ammonium_paratungstate_solution=Ammonium Paratungstate Solution +gcyl.material.sodium_tungstate_solution=Sodium Tungstate Solution +gcyl.material.tungsten_oxide=Tungsten (VI) Oxide +gcyl.material.iron_hydroxide=Iron (II) Hydroxide +gcyl.material.manganese_hydroxide=Manganese (II) Hydroxide +gcyl.material.palm_oil=Palm Oil +gcyl.material.octanic_acid=Octanic Acid +gcyl.material.trioctylamine_isoparatungstate=Trioctylamine Isoparatungstate +gcyl.material.oleum=Oleum +gcyl.material.potassium_sulfide=Potassium Sulfide +gcyl.material.wrought_iron_magnetic=Magnetic Wrought Iron +gcyl.material.boron_trioxide=Boron Trioxide +gcyl.material.boron_trifluoride=Boron Trifluoride +gcyl.material.lithium_tetrafluoroborate=Lithium Tetrafluoroborate +gcyl.material.colemanite=Colemanite +gcyl.material.strontianite=Strontianite +gcyl.material.strontium_aluminate=Strontium Aluminate +gcyl.material.strontium_sulfide=Strontium Sulfide +gcyl.material.osmium_chloride_solution=Osmium Chloride Solution +gcyl.material.acidic_osmium_tetroxide_solution=Acidic Osmium Tetroxide Solution +gcyl.material.potassium_osmate=Potassium Osmate +gcyl.material.ammonium_hexachloroplatinate=Ammonium Hexachloroplatinate +gcyl.material.ammonium_hexachloroiridate=Ammonium Hexachloroiridate +gcyl.material.palladium_dimethylglyoxime=Palladium Dimethylglyoxime +gcyl.material.tetraamine_palladium_chloride=Tetraamine Palladium Chloride +gcyl.material.diamine_dichloropalladium=Diamine Dichloropalladium +gcyl.material.ammonium_hexachlororhodate=Ammonium Hexachlororhodate +gcyl.material.potassium_hexachlororuthenate=Potassium Hexachlororuthenate +gcyl.material.chlorinated_ruthenium_tetroxide_solution=Chlorinated Ruthenium Tetroxide Solution +gcyl.material.basic_ruthenium_tetroxide_solution=Ruthenium Tetroxide Solution +gcyl.material.potassium_persulfate=Potassium Persulfate +gcyl.material.potassium_bisulfate=Potassium Bisulfate +gcyl.material.potassium_acetate=Potassium Acetate +gcyl.material.sodium_methoxide=Sodium Methoxide +gcyl.material.trimethyl_borate=Trimethyl Borate +gcyl.material.mineral_oil=Mineral Oil +gcyl.material.ferrous_chloride=Ferrous Chloride +gcyl.material.dimethylglyoxime=Dimethylglyoxime +gcyl.material.butanone=Butanone +gcyl.material.ethyl_nitrite=Ethyl Nitrite +gcyl.material.diacetyl_monoxime=Diacetyl Monoxime +gcyl.material.ammonium_nitrite=Ammonium Nitrite +gcyl.material.hydroxyammonium_sulfate=Hydroxammonium Sulfate +gcyl.material.potassium_nitrate=Potassium Nitrate +gcyl.material.lead_oxide=Lead Oxide +gcyl.material.zinc_bronze=Zinc-Bronze +gcyl.material.potassium_chloride_solution=Potassium Chloride Solution +gcyl.material.gold_chloride=Gold Chloride +gcyl.material.pgm_solution_one=Platinum Group Sludge Solution +gcyl.material.pgm_solution_one_ir=Iridium Reducted Sludge Solution +gcyl.material.pgm_solution_one_plat=Platinum Rich Sludge Solution +gcyl.material.pgm_solution_one_iri=Iridium Rich Sludge Solution +gcyl.material.pgm_solution_one_irioxide=Iridium (VI) Rich Sludge Solution +gcyl.material.pgm_solution_one_pall=Palladium Rich Sludge Solution +gcyl.material.pgm_solution_one_rho=Rhodium Rich Sludge Solution +gcyl.material.pgm_solution_one_ruth=Ruthenium Rich Sludge Solution +gcyl.material.pgm_solution_one_inert=Inert Rich Sludge Solution + + +metaitem.ore_strainer.name=Ore Strainer + +################################################################################################################################### + + + + metaitem.board.coated.name=Coated Circuit Board metaitem.board.coated.tooltip=A Basic Board metaitem.board.epoxy.name=Epoxy Circuit Board @@ -222,7 +311,7 @@ metaitem.small.lithium.ion.battery.tooltip=Reusable metaitem.nickel.metal.hydride.battery.tooltip=Reusable -metaitem.electrically.wired.petri.dish.name=Electricaly Wired Petri Dish +metaitem.electrically.wired.petri.dish.name=Electrically Wired Petri Dish metaitem.neuro.support.unit.name=Neuro Support Unit metaitem.cyber.processing.unit.name=Cyber Processing Unit metaitem.ultrasonic.homogenizer.name=Ultrasonic Homogenizer @@ -493,7 +582,7 @@ gcyl.material.palladium_chloride=Palladium Chloride gcyl.material.palladium_bisdibenzylidieneacetone=Palladium Bisdibenzylidieneacetone gcyl.material.potassium_tetrachloroplatinate=Potassium Tetrachloroplatinate gcyl.material.nickel_triphenyl_phosphite=Nickel Triphenylphosphite -gcyl.material.dichlorocyclooctadieneplatinium=Dichlorocyclooctadieneplatinium +gcyl.material.dichlorocyclooctadieneplatinium=Dichlorocyclooctadieneplatinum gcyl.material.graphene_nanotube_mix=Graphene-Nanotube Mixture gcyl.material.graphene_aligned_cnt=Graphene-Aligned CNT gcyl.material.nial_catalyst=Nickel Aluminium Catalyst @@ -885,8 +974,8 @@ gcyl.material.crude_hexanitrohexaazaisowurtzitane=Crude Hexanitrohexaazaisowurtz gcyl.material.sodium_borohydride=Sodium Borohydride gcyl.material.sodium_tetrafluoroborate=Sodium Tetrafluoroborate gcyl.material.decaborane=Decaborane -gcyl.material.cesium_carborane_precursor=Cesium Carborane Precursor -gcyl.material.cesium_carborane=Cesium Carborane +gcyl.material.cesium_carborane_precursor=Caesium Carborane Precursor +gcyl.material.cesium_carborane=Caesium Carborane gcyl.material.fluorocarborane=Fluorocarborane gcyl.material.caesium_nitrate=Caesium Nitrate gcyl.material.silver_iodide=Silver Iodide @@ -1634,7 +1723,11 @@ gcyl.machine.cracker_unit.name=[Deprecated] Cracking Unit gcyl.machine.large_turbine.hot_coolant.name=Hot Coolant Turbine (HCT) gcyl.machine.hot_coolant_turbine.description=The Hot Coolant Turbine takes in hot coolant and converts it regular coolant. The rate and power produced from this is based on the rotor holder efficiency and speed. gcyl.machine.large_transformer.name=Large Transformer (LT) -gcyl.machine.void_miner.name=Void Ore Miner (VOM) +gcyl.machine.void_miner.name=Void Ore Miner MK-I (VOM) +void_miner_ores.name=Void Miner Ores +gcyl.jei.void_miner_tier_1=Void Ore Miner I +gcyl.jei.void_miner_tier_2=Void Ore Miner II +gcyl.jei.void_miner_tier_3=Void Ore Miner III gcyl.multiblock.void_miner.description=The Void Ore Miner produces massive amounts of ores at very fast rates. gcyl.machine.industrial_primitive_blast_furnace.name=Industrial Primitive Blast Furnace (IPBF) gcyl.machine.advanced_distillation_tower.name=Advanced Distillation Tower (ADT) @@ -1812,8 +1905,8 @@ gcyl.multiblock.gas_centrifuge.description=The Gas Centrifuge primarily separate gcyl.machine.qubit_computer.name=Quantum Computer (QC) gcyl.multiblock.qubit_computer.description=Utilizes circuits to produce qubits for advanced machine recipes. gcyl.machine.stellar_forge.name=Stellar Forge (SF) -gcyl.machine.void_miner.uhv.name=Void Ore Miner MK II (VOM) -gcyl.machine.void_miner.uev.name=Void Ore Miner MK III (VOM) +gcyl.machine.void_miner.uhv.name=Void Ore Miner MK-II (VOM) +gcyl.machine.void_miner.uev.name=Void Ore Miner MK-III (VOM) gcyl.machine.hyper_reactor.i.name=Hyper Reactor I (HR I) gcyl.machine.hyper_reactor.ii.name=Hyper Reactor II (HR II) gcyl.machine.hyper_reactor.iii.name=Hyper Reactor III (HR III) @@ -1834,7 +1927,7 @@ gcyl.machine.fluid_drilling_plant_hv.name=Fluid Drilling Plant 2 (FDP) gcyl.machine.fluid_drilling_plant_ev.name=Fluid Drilling Plant 3 (FDP) gcyl.machine.cosmic_ray_detector.name=Cosmic Ray Detector (CRD) -gcyl.multiblock.cosmic_ray_detector.description=The Cosmic Ray Detector produced Heavy Lepton Mixture based on its height. +gcyl.multiblock.cosmic_ray_detector.description=The Cosmic Ray Detector produces Heavy Lepton Mixture based on its height. @@ -2674,7 +2767,7 @@ gcyl.material.opv_superconductor_base=OpV Superconductor Base gcyl.material.samarium_magnetic=Magnetic Samarium gcyl.material.quantum=Quantum gcyl.material.black_titanium=Black Titanium -gcyl.material.tungsten_titanium_carbide=Tungsten Titanium Carbide +gcyl.material.tungsten_titanium_carbide=Tungsten Titanium Carbide 70/30 gcyl.material.titan_steel=Titan Steel gcyl.material.inconel_b=Inconel 792 gcyl.material.pikyonium=Pikyonium @@ -3000,11 +3093,16 @@ gcyl.multiblock.monitor_screen.tooltip.2=The proxy mode of Digital Interface Cov gcyl.multiblock.monitor_screen.tooltip.3=The screen also supports plugins. gcyl.multiblock.void_miner.description.1=The Void Ore Miner will produce tons of ores. -gcyl.multiblock.void_miner.description.2=It will consume Pyrotheum and Cryotheum alternating each second. -gcyl.multiblock.void_miner.description.3=Temperature will increase if there is only Pyrotheum and will decrease if there is only Cryotheum. -gcyl.multiblock.void_miner.description.4=The First step will be to only feed with Pyrotheum and when the temperature is at the perfect spot, slowly add Cryotheum. +gcyl.multiblock.void_miner.description.2=It will consume Pyrotheum and Cryotheum alternating every 10 seconds and constantly consumes Drilling Mud. +gcyl.multiblock.void_miner.description.11=Pyrotheum and Cryotheum are consumed 10x less than Drilling Mud. +gcyl.multiblock.void_miner.description.3=Temperature & Fluid use will increase with Pyrotheum and will decrease if there Cryotheum. +gcyl.multiblock.void_miner.description.10=Fluid use Increase is by %s%% and Decrease is 1 - (1 / %f) ≈ %s%% +gcyl.multiblock.void_miner.description.4=Temperature increase and decrease amount is Current Fluid Use / 100. +gcyl.multiblock.void_miner.description.7=Temperature & Fluid use will decrease by half the normal amount if there is no Pyrotheum. +gcyl.multiblock.void_miner.description.8=Fluid use does not reset unless overheated or breaking the controller. +gcyl.multiblock.void_miner.description.9=Temperature will decrease slowly if work is paused. gcyl.multiblock.void_miner.description.5=If temperature is above the max temperature the Void Ore Miner will stop working and slowly cool down. -gcyl.multiblock.void_miner.description.6=Consumes Drilling Mud and outputs Used Drilling Mud every second at the same rate as Pyrotheum. +gcyl.multiblock.void_miner.description.6=Used Drilling Mud, and 10 random ores with each having a stack size of (Temperature/1000)^2 every 10 seconds. gcyl.multiblock.large_transformer.description=Large Transformer can convert any GTEU/AMPS by any GTEU/AMPS. gcyl.multiblock.industrial_primitive_blast_furnace.description=The Industrial Primitive Blast Furnace is a large multiblock structure consisting of 1 to 64 "slices". gregtech.machine.primitive_blast_furnace.industrial.tooltip.1=It's an upgraded version of The Primitive Blast Furnace. @@ -3020,14 +3118,14 @@ gcyl.multiblock.large_rocket_engine.tooltip.3=Use Liquid Oxygen to boost the out gcyl.multiblock.alloy_blast_furnace.tooltip.1=Quicker than the Blast Furnace gcyl.multiblock.large_naquadah_reactor.tooltip.1=Consumes 1000mb of Tritium every 20 fuel cycles'. gcyl.multiblock.large_naquadah_reactor.tooltip.2=Increase output by 3X with 50mb Oxygen Plasma every fuel consume (also consumes 2X fuel). -gcyl.multiblock.large_naquadah_reactor.tooltip.3=Overclocks to UV tier. +gcyl.multiblock.large_naquadah_reactor.tooltip.3=Overclocks to UHV tier. gregtech.multiblock.large_naquadah_reactor.tritium_amount=Tritium: %dmb gregtech.multiblock.large_naquadah_reactor.oxygen_amount=Oxygen Plasma: %sL gregtech.multiblock.large_naquadah_reactor.oxygen_boosted=Oxygen Plasma boosted. gregtech.multiblock.large_naquadah_reactor.supply_tritium_to_boost=Supply Oxygen Plasma to boost. gcyl.multiblock.large_naquadah_reactor.description=Large Version of the Naquadah Reactor generator. gcyl.multiblock.hyper_reactor.tooltip.1=Boost With: %s -gcyl.multiblock.hyper_reactor.tooltip.2=Max Voltage: %,d +gcyl.multiblock.hyper_reactor.tooltip.2=Max Voltage: %s gcyl.multiblock.hyper_reactor.description=The Hyper Reactor uses Hyper Fuel to produce large amounts of power. The power output can be boosted with various fluids. gcyl.multiblock.stellar_forge.description=The Stellar Forge produces late game materials using very powerful explosives. @@ -3038,12 +3136,9 @@ gcyl.multiblock.battery_tower.tooltip.4=Each maintenance problem increases loss gcyl.multiblock.cosmic_ray_detector.tooltip.1=The Cosmic Ray Detector can't see the sky! gcyl.multiblock.cosmic_ray_detector.tooltip.2=Produces Heavy Lepton Mix based on the Y-level it is built at. -gcyl.multiblock.cosmic_ray_detector.tooltip.3=At Bedrock it will produce 15 mb/t and at build limit it will produce 50 mb/t. -gcyl.multiblock.cosmic_ray_detector.tooltip.4=Requires a minimum of 2097152 EU/t to function. -gcyl.multiblock.cosmic_ray_detector.tooltip.5=Generating %d mb/t of Heavy Lepton Mix. -gcyl.multiblock.cosmic_ray_detector.tooltip.6=The top Sensor Block needs to be able to see the sky. -gcyl.multiblock.cosmic_ray_detector.tooltip.7=Overclocks increase the production by approximately 150%%. -gcyl.multiblock.cosmic_ray_detector.tooltip.8=Output Hatch Full! +gcyl.multiblock.cosmic_ray_detector.tooltip.3=The recipe duration, before overclocking, is reduced by the Y-level in ticks. +gcyl.multiblock.cosmic_ray_detector.tooltip.4=Requires a minimum of 2097152 EU/t and computation to function. +gcyl.multiblock.cosmic_ray_detector.tooltip.5=Has recipes to provide Data for the Laser Miner gregtech.multiblock.recipe=Screw to change recipe. Currently using: %s @@ -3051,8 +3146,9 @@ gregtech.multiblock.recipe=Screw to change recipe. Currently using: %s gregtech.universal.tooltip.efficiency=Efficiency: %s %% gregtech.multiblock.universal.energy_used=Energy Use: %d EU -gregtech.multiblock.universal.vom.temperature=Temperature: %s K -gregtech.multiblock.universal.drilling_fluid_amount=Current Drilling Mud: %.2fmB +gregtech.multiblock.universal.vom.temperature=Temperature: %sK +gregtech.multiblock.universal.vom.max_temperature=Max Temperature: %sK +gregtech.multiblock.universal.drilling_fluid_amount=Fluids Consumption: %.2fmB gregtech.multiblock.universal.overheat=Overheated! gregtech.machine.world_accelerator.mode.tile=Tile Entity Mode @@ -3581,20 +3677,6 @@ gcyl.machine.transformer.opv.8.name=Extended Mega Ultimate Voltage Transformer 8 gcyl.machine.transformer.opv.12.name=Extended Mega Ultimate Voltage Transformer 12 Amps gcyl.machine.transformer.opv.16.name=Extended Mega Ultimate Voltage Transformer 16 Amps -gcyl.machine.diode.lv.name=Low Voltage Diode -gcyl.machine.diode.mv.name=Medium Voltage Diode -gcyl.machine.diode.hv.name=High Voltage Diode -gcyl.machine.diode.ev.name=Extreme Voltage Diode -gcyl.machine.diode.iv.name=Insane Voltage Diode -gcyl.machine.diode.luv.name=Ludicrous Voltage Diode -gcyl.machine.diode.zpm.name=ZPM Voltage Diode -gcyl.machine.diode.uv.name=Ultimate Voltage Diode -gcyl.machine.diode.uhv.name=Ultimately High Voltage Diode -gcyl.machine.diode.uev.name=Ultimately Extreme Voltage Diode -gcyl.machine.diode.uiv.name=Ultimately Insane Voltage Diode -gcyl.machine.diode.uxv.name=Mega Ultimate Voltage Diode -gcyl.machine.diode.opv.name=Extended Mega Ultimate Voltage Diode - gcyl.machine.energy_hatch.input.ulv.4.name=Energy Input Hatch 4 Amps (ULV) gcyl.machine.energy_hatch.input.ulv.16.name=Energy Input Hatch 16 Amps (ULV) gcyl.machine.energy_hatch.input.ulv.64.name=Energy Input Hatch 64 Amps (ULV) @@ -3836,7 +3918,7 @@ gcyl.material.acidic_mixture=Acidic Mixture gcyl.material.benzenesulfonyl_chloride=Benzenesulfonyl Chloride gcyl.material.sulfanilamide=Sulfanilamide gcyl.material.silica_gel_base=Silica Gel Base -gcyl.material.ethanol_100=100% Ethanol +gcyl.material.ethanol_100=100%% Ethanol gcyl.material.piranha_solution=Piranha Solution gcyl.material.water_agar_mix=Water-Agar Mix gcyl.material.bacterial_growth_medium=Bacterial Growth Medium @@ -3911,7 +3993,7 @@ gcyl.material.potassium_chloride=Potassium Chloride gcyl.material.methylamine=Methylamine gcyl.material.phosgene=Phosgene gcyl.material.isopropyl_alcohol=Isopropyl Alcohol -gcyl.material.degenerate_rhenium_plasma=Degenerate Rhenium Plasma +gcyl.material.degenerate_rhenium_plasma=Degenerate Rhenium gcyl.material.liquid_helium=Liquid Helium @@ -4127,7 +4209,7 @@ gcyl.material.basr_titanate_preparation=Barium-Strontium Titanate Preparation gcyl.material.carbon_tetrachloride=Carbon Tetrachloride gcyl.material.chloroethane=Chloroethane gcyl.material.actinium_superhydride_plasma=Actinium Superhydride Plasma -gcyl.material.neutron_plasma=Neutron Plasma +gcyl.material.neutron_plasma=Neutron gcyl.material.superheavy_mix=Superheavy Mix gcyl.material.chlorinated_solvents=Chlorinated Solvents @@ -4242,7 +4324,7 @@ gcyl.material.iron_ii_chloride=Iron II Chloride gcyl.material.propadiene=Propadiene gcyl.material.cyclopentadiene=Cyclopentadiene gcyl.material.chloroauric_acid=Chloroauric Acid -gcyl.material.helium_4=Helium 4 +gcyl.material.helium_4=Helium-4 gcyl.material.fermionic_uu_matter=Fermionic UU-Matter gcyl.material.bosonic_uu_matter=Bosonic UU-Matter gcyl.material.free_electrons=Free Electrons @@ -4647,7 +4729,10 @@ gregtech.multiblock.extreme_diesel_engine.description=The Diesel Engine is a mul gcyl.multiblock.electric_blast_furnace.tooltip.1=For every §a900K§7 above the recipe temperature, a multiplicative §a95%%§7 energy multiplier is applied pre-overclocking. gcyl.multiblock.electric_blast_furnace.tooltip.2=For every §a1800K§7 above the recipe temperature, one overclock becomes §a100%%§7 efficient. gcyl.multiblock.electric_blast_furnace.tooltip.3=For every voltage tier above §aMV§7, temperature is increased by §a100K§7. -gregtech.multiblock.volcanus.description=The Volcanus is built the same as the EBF, but with different casings. It consumes pyrotheum 2^ max voltage tier mB of pyrotheum per tick. Max Voltage of ZPM. +gregtech.multiblock.volcanus.description.1=Consumes pyrotheum 2^ max voltage tier mB of pyrotheum per tick. +gregtech.multiblock.volcanus.description.4=Max Overclock Voltage of ZPM. +gregtech.multiblock.volcanus.description.2=Can run recipes of a higher tier given the right energy hatch, but there are no bonuses. +gregtech.multiblock.volcanus.description.3=Parallels 8 times. Recipes run 120%% faster. EUt usage is 0.90 recipemap.volcanus.name=Volcanus gcyl.machine.volcanus.name=Volcanus gregtech.multiblock.cryogenic_freezer.description=The Cryogenic Freezer is built the same as the Vacuum Freezer, but with different casings. It consumes cryothium 2^ max voltage tier mB of cryotheum per tick. @@ -4737,8 +4822,18 @@ gcyl.machine.ore_factory.config.1=Macerate>Ore Wash>Macerate>Centrifuge gcyl.machine.ore_factory.config.2=Macerate>Ore Wash>Sifter gcyl.machine.ore_factory.config.3=Macerate>Macerate>Centrifuge gcyl.machine.ore_factory.config.4=Macerate>Thermal Centrifuge>Macerate - -gcyl.machine.maintenance_hatch_sterile_cleanroom_auto.name=Automatic Sterile Filtration Maintenance Hatch +gcyl.multiblock.opf.description.1=Processes §f2^(Tier - 1)§7 Ores, Max Parallel of %s (%s). §fDuration§7 depends on §eProcess Mode§7. Max Duration of 1 Second. +gcyl.multiblock.opf.description.10=For every tier above UXV, 50%% chance to multiply the outputs. Stacks past 100%%. +gcyl.multiblock.opf.description.6=Uses 100mb of §9Distilled Water§7 and 10mb of §6Lubricant§7 per §fOre Processed§7. +gcyl.multiblock.opf.description.2=Use a §bScrewdriver§7 to change between §eProcess Modes§7. +gcyl.multiblock.opf.description.9=§6Chanced output byproducts are calculated per operation, not per ore! +gcyl.multiblock.opf.description.7=Only supports §fOre & Crushed Ore§7 as Input. (Crushed skips first Macerate Step) +gcyl.multiblock.opf.description.8=§cDoes not support Sifting! +gcyl.multiblock.opf.description.3=Will §cVoid§7 if there is not enough output space! +gcyl.multiblock.opf.description.4=Use a §aStocking Input Bus, Hatch & ME Output Bus§7 for optimal performance. +gcyl.multiblock.opf.description.5=Set input bus to §fAuto-Collapse§7 items if not using a Stocking Bus. +gcyl.machine.ore_factory.current_mode=Mode: +gcyl.machine.ore_factory.max_amount=Max Parallel: %s metaitem.tool.data.deep_miner.name=Deep Miner Data Storage metaitem.tool.data.deep_miner.tooltip=Data Storage Material Scans @@ -4760,6 +4855,14 @@ gcyl.research.deep_salts=§6Deep Salts Data gcyl.research.deep_salts.tooltip=§aScan a Salt Block with Hydrofluoric Acid for this Data gcyl.research.deep_radioactive=§6Deep Radioactive Data gcyl.research.deep_radioactive.tooltip=§aScan a Plutonium 244 Block for this Data +gcyl.research.deep_rare_earth=§6Deep Rare Earth Data +gcyl.research.deep_rare_earth.tooltip=§aScan a Neodymium Block for this Data +gcyl.research.deep_overworld_gas=§6Deep Overworld Gas Data +gcyl.research.deep_overworld_gas.tooltip=§aScan Liquid Air for this Data +gcyl.research.deep_nether_gas=§6Deep Nether Gas Data +gcyl.research.deep_nether_gas.tooltip=§aScan Liquid Nether Air for this Data +gcyl.research.deep_tantalum=§6Deep Tantalum Data +gcyl.research.deep_tantalum.tooltip=§aScan a Tantalum Block for this Data gcyl.machine.deep_miner.name=Deep Miner (DM) gcyl.machine.deep_miner.config.0=Fluid type set to Lava @@ -4772,11 +4875,13 @@ gcyl.multiblock.deep_miner.tooltip.3=Use a §bScrewdriver§r§7 to change betwee gcyl.multiblock.deep_miner.tooltip.4=Accepts §cLava§r§7 (.75), §6Pyrotheum§r§7 (1), §eHelium Plasma§r§7 (4), or §8Neutron Plasma§r§7 (16) with §bBonuses§r§7 increasing from left to right. gcyl.multiblock.deep_miner.tooltip.5=Maximum §bTemperature§r§7 depends on §bFluid§r§7 input and §bCoil§r§7 tier. gcyl.multiblock.deep_miner.tooltip.6=Gains §cHeat§r§7 from §bFluid§r§7 input. Hotter §bFluids§r§7 increases the §bTemperature§r§7 faster. -gcyl.multiblock.deep_miner.tooltip.7=Loses §cHeat§r§7 when not running §lOR§r§7 when there is no heating §bFluids§r§7. (§bFluids§r§7 is not consumed when at maximum §bTemperature§r§7) -gcyl.multiblock.deep_miner.tooltip.8=For every §b1000K§r§7 above recipe temperature, the recipe duration is multiplied by §e0.80§r§7. +gcyl.multiblock.deep_miner.tooltip.11=§cHeating Fluid§r§7 Consumption is based on §eEnergy Tier§7. (§bHeating Fluids§r§7 are consumed at 10% normal rate at maximum §bTemperature§r§7) +gcyl.multiblock.deep_miner.tooltip.7=Loses §cHeat§r§7 when not running §lOR§r§7 when there is no heating §bFluids§r§7. +gcyl.multiblock.deep_miner.tooltip.8=For every §b1000K§r§7 above recipe temperature, the recipe duration is multiplied by §e%s§r§7. (Additive) gcyl.multiblock.deep_miner.tooltip.9=To use §eHelium Plasma§r§7, the casings and frames need to be §2Incoloy 813§r§7. gcyl.multiblock.deep_miner.tooltip.10=To use §8Neutron Plasma§r§7, the casings and frames need to be §aHastelloy K243§r§7. -gregtech.multiblock.deep_miner.max.temperature=Max Temperature: %s K +gregtech.multiblock.deep_miner.max.temperature=Max Temperature: %sK +gregtech.multiblock.deep_miner.max.fluid consumption=Fluid Consumption: %smB gregtech.multiblock.deep_miner_error=§cY LEVEL TOO HIGH! RECIPES WILL NOT RUN! recipemap.deep_miner.name=Deep Miner @@ -4786,16 +4891,421 @@ tile.gcyl_reactor_casing.cladded_reactor_casing.name=Radiation Safe Casing gcyl.machine.greenhouse_mv.name=Greenhouse (GH) gcyl.machine.greenhouse_uv.name=Industrial Greenhouse (IGH) +recipemap.greenhouse.name=Greenhouse metaitem.cover.ender.item_link.name=Ender Item Link Cover metaitem.cover.ender.item_link.tooltip=Transports §rItems§7 with a §rWireless §dEnder§r Connection§7 as §rCover§7. cover.conveyor.mode=Conveyor Mode -gcyl.machine.mega_cleanroom.name=Mega Cleanroom (MC) +gcyl.machine.mega_cleanroom.name=Large Cleaning Facility (LCF) gcyl.machine.cleanroom.tooltip.1=§bSize: §f21x21x10 to 101x101x101 gcyl.machine.cleanroom.tooltip.2=§cMay cause performance issues! Read additional structure info. gcyl.machine.cleanroom.tooltip.3=§cTo increase performance, the multiblock only checks its structure pattern on forming and when saving the world. +gcyl.machine.cleanroom.tooltip.7=§aYou can force an update by using a Screwdriver! You must do this everytime you add a new machine! gcyl.machine.cleanroom.tooltip.4=§c§lDO NOT TRY TO CHEAT THIS! §r§cDoing so will cause the multiblock to constantly check its structure upon loading into the world, causing major TPS lag until fixed. gcyl.machine.cleanroom.tooltip.5=§c§lMake sure the structure is valid if you make changes to the multiblock! +gcyl.machine.cleanroom.tooltip.6=§aReplace the controller block if you are having issues before reporting a bug! +gcyl.machine.cleanroom.screwdriver=Updated Structure Pattern and Cleanroom Machines. +gcyl.recipe.cleanroom_iso_3.display_name=ISO 3 Cleanroom +gcyl.recipe.cleanroom_iso_2.display_name=ISO 2 Cleanroom +gcyl.recipe.cleanroom_iso_1.display_name=ISO 1 Cleanroom +gcyl.recipe.cleanroom_iso_0.display_name=ISO 0 Cleanroom +tile.cleanroom_casing.filter_casing_iso_3.name=ISO 3 Filter Casing +tile.cleanroom_casing.filter_iso_3.tooltip=Creates an §aISO 3 Specification§7 Environment +tile.cleanroom_casing.filter_casing_iso_2.name=ISO 2 Filter Casing +tile.cleanroom_casing.filter_iso_2.tooltip=Creates an §aISO 2 Specification§7 Environment +tile.cleanroom_casing.filter_casing_iso_1.name=ISO 1 Filter Casing +tile.cleanroom_casing.filter_iso_1.tooltip=Creates an §aISO 1 Specification§7 Environment +tile.cleanroom_casing.filter_casing_iso_0.name=ISO 0 Filter Casing +tile.cleanroom_casing.filter_iso_0.tooltip=Creates an §aISO 0 Specification§7 Environment +tile.cleanroom_casing.warning=Can only be used in the Large Cleaning Facility! -gcyl.material.bismuth_210=Bismuth 210 \ No newline at end of file +gcyl.machine.maintenance_hatch_sterile_cleanroom_auto.name=Automatic Sterile Filtration Maintenance Hatch +gcyl.machine.maintenance_hatch_iso_3_cleanroom_auto.name=Automatic ISO 3 Filtration Maintenance Hatch +gcyl.machine.maintenance_hatch_iso_2_cleanroom_auto.name=Automatic ISO 2 Filtration Maintenance Hatch +gcyl.machine.maintenance_hatch_iso_1_cleanroom_auto.name=Automatic ISO 1 Filtration Maintenance Hatch + + +gcyl.material.bismuth_210=Bismuth 210 + +gcyl.machine.wireless_pss.name=§dWireless Power Substation +gcyl.machine.wireless_power_substation.tooltip1=Use a Screwdriver to activate Wireless. Use while Sneaking to make it Private. +gcyl.machine.wireless_power_substation.tooltip4=Can only be changed by replacing the controller. +gcyl.machine.wireless_power_substation.tooltip2=Every 60 seconds, it will balance the power between itself and the Wireless Network. +gcyl.machine.wireless_power_substation.tooltip3=More restrictive on minimum casings! +gcyl.multiblock.wireless_pss.wireless_eu=§dWireless EU: %s +gcyl.multiblock.wireless_pss.player_offline=§c(Player Offworld) +gcyl.multiblock.wireless_pss.public=(Public) +gcyl.multiblock.wireless_pss.private=(%s) +gcyl.multiblock.wireless_pss.not_initialized=§dWireless EU: §cNot Initialized +tile.gcyl_multiblock_casing2.seaborgium_substation_casing.name=§dField Generating Substation Casing +gcyl.wireless_initialized_private=Initialized (Private) +gcyl.wireless_initialized_public=Initialized (Public) + + +gcyl.wireless_hatch.tooltip1=Use a Screwdriver to activate Wireless. Use while Sneaking to make it Private. +gcyl.wireless_hatch.tooltip2=Can only be changed by replacing. +gcyl.machine.wireless_energy_hatch.input.ulv.name=§dULV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.ulv.4.name=§dULV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.ulv.16.name=§dULV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.ulv.64.name=§dULV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.lv.name=§dLV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.lv.4.name=§dLV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.lv.16.name=§dLV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.lv.64.name=§dLV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.mv.name=§dMV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.mv.4.name=§dMV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.mv.16.name=§dMV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.mv.64.name=§dMV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.hv.name=§dHV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.hv.4.name=§dHV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.hv.16.name=§dHV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.hv.64.name=§dHV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.ev.name=§dEV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.ev.4.name=§dEV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.ev.16.name=§dEV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.ev.64.name=§dEV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.iv.name=§dIV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.iv.4.name=§dIV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.iv.16.name=§dIV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.iv.64.name=§dIV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.luv.name=§dLuV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.luv.4.name=§dLuV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.luv.16.name=§dLuV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.luv.64.name=§dLuV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.zpm.name=§dZPM Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.zpm.4.name=§dZPM 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.zpm.16.name=§dZPM 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.zpm.64.name=§dZPM 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.uv.name=§dUV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uv.4.name=§dUV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uv.16.name=§dUV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uv.64.name=§dUV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.uhv.name=§dUHV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uhv.4.name=§dUHV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uhv.16.name=§dUHV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uhv.64.name=§dUHV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.uev.name=§dUEV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uev.4.name=§dUEV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uev.16.name=§dUEV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uev.64.name=§dUEV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.uiv.name=§dUIV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uiv.4.name=§dUIV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uiv.16.name=§dUIV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uiv.64.name=§dUIV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.uxv.name=§dUXV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uxv.4.name=§dUXV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uxv.16.name=§dUXV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.uxv.64.name=§dUXV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.opv.name=§dOpV Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.opv.4.name=§dOpV 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.opv.16.name=§dOpV 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.opv.64.name=§dOpV 64A Wireless Energy Hatch + +gcyl.machine.wireless_energy_hatch.input.max.name=§dMAX Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.max.4.name=§dMAX 4A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.max.16.name=§dMAX 16A Wireless Energy Hatch +gcyl.machine.wireless_energy_hatch.input.max.64.name=§dMAX 64A Wireless Energy Hatch + +metaitem.nuclear.star.name=Nuclear Star + +gcyl.material.deep_overworld_gas=Deep Overworld Gas +gcyl.material.deep_nether_gas=Deep Nether Gas + +gcyl.machine.parallel_hatch.uev.name=Super Parallel Control Hatch II +gcyl.machine.parallel_hatch.uxv.name=Super Parallel Control Hatch III +gcyl.machine.parallel_hatch.max.name=Perfected Parallel Control Hatch + +gcyl.machine.hpca.cooling_component.uv.name=UV HPCA Cooling Component +gcyl.machine.hpca.cooling_component.uhv.name=UHV HPCA Cooling Component +gcyl.machine.hpca.cooling_component.uev.name=UEV HPCA Cooling Component +gcyl.machine.hpca.cooling_component.uiv.name=UIV HPCA Cooling Component +gcyl.machine.hpca.cooling_component.uxv.name=UXV HPCA Cooling Component +gcyl.machine.hpca.cooling_component.opv.name=OpV HPCA Cooling Component +gcyl.machine.hpca.cooling_component.max.name=MAX HPCA Cooling Component + +gcyl.machine.hpca.computation_component.uv.name=UV HPCA Computation Component +gcyl.machine.hpca.computation_component.uhv.name=UHV HPCA Computation Component +gcyl.machine.hpca.computation_component.uev.name=UEV HPCA Computation Component +gcyl.machine.hpca.computation_component.uiv.name=UIV HPCA Computation Component +gcyl.machine.hpca.computation_component.uxv.name=UXV HPCA Computation Component +gcyl.machine.hpca.computation_component.opv.name=OpV HPCA Computation Component +gcyl.machine.hpca.computation_component.max.name=MAX HPCA Computation Component + +gcyl.machine.laser_miner.name=High Precision Laser Miner + +gcyl.material.sterile_bio_growth_medium=Sterilized Bio Growth Medium +gcyl.material.raw_bio_growth_medium=Raw Bio Growth Medium + +metaitem.bio_cells.name=Stem Bio Cells +metaitem.bio_cells.tooltip=Mutated Raw Intelligence +metaitem.board.bio.name=Bioware Lifesupport Circuit Board +metaitem.board.bio.tooltip=The Board That Keeps More Life +metaitem.board_circuit.bio.name=Bio Master Circuit Board +metaitem.board_circuit.bio.tooltip=The Board That Keeps More Life +metaitem.crystal.asoc.name=Crystal ASoC +metaitem.crystal.asoc.tooltip=Advanced Crystal System on Chip +metaitem.living.soc.name=Living SoC +metaitem.living.soc.tooltip=Living System on Chip +metaitem.living_bio.soc.name=Living Bio SoC +metaitem.living_bio.soc.tooltip=Mutated Living System on Chip +metaitem.wafer.bio.name=Living Bio Wafer +metaitem.wafer.bio.tooltip=Mutated Living Raw Circuit + +metaitem.wafer.npic.name=NPIC Wafer +metaitem.wafer.npic.tooltip=Raw NPIC +metaitem.wafer.ppic.name=PPIC Wafer +metaitem.wafer.ppic.tooltip=Raw PPIC +metaitem.wafer.qpic.name=QPIC Wafer +metaitem.wafer.qpic.tooltip=Raw QPIC + +#TODO Add tooltips to these +metaitem.npic.name=NPIC +metaitem.npic.tooltip= +metaitem.ppic.name=PPIC +metaitem.ppic.tooltip= +metaitem.qpic.name=QPIC +metaitem.qpic.tooltip= + +gcyl.machine.wireless_data_bank.name=§dWireless Data Bank +gcyl.machine.wireless_data_bank.tooltip.1=Use a Screwdriver to activate Wireless. Use while Sneaking to make it Private. +gcyl.machine.wireless_data_bank.tooltip.2=Can only be changed by replacing the controller. +gcyl.machine.wireless_data_bank.tooltip.3=Every 60 seconds, it will send Data stored in its Input Buses to the Wireless Network. +gcyl.machine.wireless_data_bank.tooltip.6=Can only have 1 Wireless Data Bank for a Public Network or per Private Network. +gcyl.machine.wireless_data_bank.tooltip.4=Wireless Bulk Data Storage +gcyl.machine.wireless_data_bank.tooltip.5=Uses §f%s EU/t§7 per Input Bus. +gcyl.machine.wireless_data_bank.tooltip.7=Uses §f%s mB/t§7 of Dielectric PCB Coolant per Input Bus. +gcyl.machine.wireless_data_hatch.name=§dWireless Data Access Hatch +gcyl.machine.wireless_data_hatch.tooltip.1=Wireless Data Access for Multiblocks +gcyl.machine.wireless_data_hatch.tooltip.2=Use a Screwdriver to activate Wireless. Use while Sneaking to make it Private. +gcyl.machine.wireless_data_hatch.tooltip.3=Can only be changed by replacing. +gcyl.machine.wireless_data_hatch.tooltip.4=Every 60 seconds, it will retrieve Data from the Wireless Network. +gcyl.multiblock.wireless_pss.not_enough_coolant=Not Enough Coolant! + +gcyl.machine.large_air_collector.name=Large Gas Collector (LGC) +gcyl.machine.large_air_collector.tooltip.1=Gains §fDuration§7 and §eEU/t§7 bonuses depending on §bFilter Tier§7. +gcyl.machine.large_air_collector.tooltip.2=§fDuration§7 Bonus: Base §fDuration§7 / §bFilter Tier§7 +gcyl.machine.large_air_collector.tooltip.3=§eEU/t§7 Bonus: Base §eEU/t§7 / §bFilter Tier§7 + +gcyl.machine.large_fisher.name=Large Fisher (LF) +gcyl.machine.large_fisher.tooltip.1=Requires being in one of these §fBiomes§7: +gcyl.machine.large_fisher.tooltip.2=§9%s +recipemap.fisher.name=Large Fisher + +gcyl.machine.large_rock_breaker.name=Large Rock Breaker (LRB) +gcyl.machine.large_rock_breaker.tooltip.1=Requires §f3^Tier mb/t§7 §9Water§7 and §cLava§7 to operate. + +metaitem.wireless_electric.not_initialized.tooltip=Not Initialized. Sneak while using for Private, just use for Public. Cannot be changed later! +metaitem.wireless_electric.private.tooltip=Private (%s) +metaitem.wireless_electric.public.tooltip=Public + +metaitem.wireless_battery_uv.name=§dWireless Energy Cluster + +gcyl.multiblock.vom.fluid_output_full=Fluid Output Full! + +tile.gcyl_metal_casing_2.casing_iridium.name=Advanced Iridium Plated Machine Casing + +gcyl.machine.component_assembly_line.name=Component Assembly Line (CoAL) +gcyl.multiblock.coal.description.1=Creates large batches of §fComponents§7 for §e75%%§7 of the Cost. +gcyl.multiblock.coal.description.2=Recipes are limited by §bCasing Tier§7. +gcyl.multiblock.coal.description.3=Higher tier Filter Casings speed up recipes. +gcyl.multiblock.coal.max_recipe_tier=Max Component Tier: %s +gregtech.recipe.component_al_casing_tier=Casing Tier: +recipemap.component_al_recipes.name=Component Assembly Line +tile.gcyl_component_al_casing.lv.name=Component Assembly Line Casing (LV) +tile.gcyl_component_al_casing.mv.name=Component Assembly Line Casing (MV) +tile.gcyl_component_al_casing.hv.name=Component Assembly Line Casing (HV) +tile.gcyl_component_al_casing.ev.name=Component Assembly Line Casing (EV) +tile.gcyl_component_al_casing.iv.name=Component Assembly Line Casing (IV) +tile.gcyl_component_al_casing.luv.name=Component Assembly Line Casing (LuV) +tile.gcyl_component_al_casing.zpm.name=Component Assembly Line Casing (ZPM) +tile.gcyl_component_al_casing.uv.name=Component Assembly Line Casing (UV) +tile.gcyl_component_al_casing.uhv.name=Component Assembly Line Casing (UHV) +tile.gcyl_component_al_casing.uev.name=Component Assembly Line Casing (UEV) +tile.gcyl_component_al_casing.uiv.name=Component Assembly Line Casing (UIV) +tile.gcyl_component_al_casing.uxv.name=Component Assembly Line Casing (UXV) +tile.gcyl_component_al_casing.opv.name=Component Assembly Line Casing (OpV) +tile.gcyl_component_al_casing.max.name=Component Assembly Line Casing (MAX) + +recipemap.cosmic_ray_detector.name=Cosmic Ray Detector + +gcyl.machine.space_elevator.name=§dSpace Elevator +gcyl.machine.space_elevator.max_modules=Maximum Installed Modules: %s +gcyl.machine.space_elevator.total_modules=Modules Installed Total: %s +gcyl.machine.space_elevator.modules.none=No Modules Installed! +gcyl.machine.space_elevator.modules=Modules Installed: +gcyl.machine.space_elevator.motor_tier=Motor Tier: %s +gcyl.gui.multiblock.space_elevator_extended=Extension Toggle +gcyl.gui.multiblock.space_elevator_teleport=Travel +gcyl.gui.multiblock.space_elevator.enable_all_modules=Enable All Modules +gcyl.gui.multiblock.space_elevator.disable_all_modules=Disable All Modules + + +gcyl.multiblock.pump_module.planet=Planet: +gcyl.multiblock.pump_module.fluid=Fluid: +space_pump.name=Space Pumping + + +gcyl.machine.pump_module_1.name=Space Pumping Module MK-I +gcyl.machine.pump_module_2.name=Space Pumping Module MK-II +gcyl.machine.pump_module_3.name=Space Pumping Module MK-III + +gcyl.jei.space_pump_planet_name=Planet: %s +gcyl.jei.space_pump_planet_number=Planet #: %s +gcyl.jei.space_pump_fluid_number=Fluid #: %s +gcyl.jei.space_pump_fluid_amount=Amount: %s + +gcyl.machine.pump_module_1.display_count= Space Pumping Module MK-I x%s +gcyl.machine.pump_module_2.display_count= Space Pumping Module MK-II x%s +gcyl.machine.pump_module_3.display_count= Space Pumping Module MK-III x%s + +gcyl.machine.mining_module_1.name=Space Mining Module MK-I +gcyl.machine.mining_module_2.name=Space Mining Module MK-II +gcyl.machine.mining_module_3.name=Space Mining Module MK-III + +space_mining.name=Space Mining +gcyl.jei.space_miner.total_eu=Total: %s +gcyl.jei.space_miner.eut=Usage: %s EU/t (%s) +gcyl.jei.space_miner.duration=Duration: %s secs +gcyl.jei.space_miner.tier=Needs MK-%s Module +gcyl.jei.space_miner.distance=Distance: %s-%s +gcyl.jei.space_miner.size=Size: %s-%s +gcyl.jei.space_miner.cwut=Min. Computation: %s CWU/t +gcyl.jei.space_miner.weight=Weight: %s + +gcyl.gui.mining_module.distance=Distance: +gcyl.gui.mining_module.range=Range: +gcyl.gui.mining_module.step=Step: +gcyl.gui.mining_module.cycle=Steps Through Distance per Operation by set Step +gcyl.gui.mining_module.parallel=Parallel: +gcyl.gui.mining_module.blank_name= +gcyl.gui.mining_module.blank_name_remove= +gcyl.gui.mining_module.whitelist=Whitelist: +gcyl.gui.mining_module.blacklist=Blacklist: +gcyl.gui.mining_module.remove=Remove: +gcyl.gui.mining_module.whitelist_empty=Whitelist Empty! +gcyl.gui.mining_module.blacklist_empty=Blacklist Empty! +gcyl.gui.mining_module.whitelist_cleared=Whitelist Cleared! +gcyl.gui.mining_module.blacklist_cleared=Blacklist Cleared! +gcyl.gui.mining_module.print_whitelist_or_clear=Shows Current Whitelist/Blacklist, Shift-Click to Clear the List +gcyl.gui.mining_module.change_whitelist_mode=Changes Between Whitelist/Blacklist Modes + +gcyl.gui.mining_module.min_distance=Min Distance: %s +gcyl.gui.mining_module.max_distance=Max Distance: %s + +metaitem.mining_drone.1.name=Mining Drone MK-I +metaitem.mining_drone.2.name=Mining Drone MK-II +metaitem.mining_drone.3.name=Mining Drone MK-III +metaitem.mining_drone.4.name=Mining Drone MK-IV +metaitem.mining_drone.5.name=Mining Drone MK-V +metaitem.mining_drone.6.name=Mining Drone MK-VI +metaitem.mining_drone.7.name=Mining Drone MK-VII +metaitem.mining_drone.8.name=Mining Drone MK-VIII +metaitem.mining_drone.9.name=Mining Drone MK-IX +metaitem.mining_drone.10.name=Mining Drone MK-X +metaitem.mining_drone.11.name=Mining Drone MK-XI +metaitem.mining_drone.12.name=Mining Drone MK-XII +metaitem.mining_drone.13.name=Mining Drone MK-XIII +metaitem.mining_drone.14.name=Mining Drone MK-XIV + + + + +gcyl.machine.mining_module_1.display_count= Space Mining Module MK-I x%s +gcyl.machine.mining_module_2.display_count= Space Mining Module MK-II x%s +gcyl.machine.mining_module_3.display_count= Space Mining Module MK-III x%s + +gcyl.machine.assembler_module_1.name=Space Assembler Module MK-I +gcyl.machine.assembler_module_2.name=Space Assembler Module MK-II +gcyl.machine.assembler_module_3.name=Space Assembler Module MK-III + +gcyl.machine.assembler_module_1.display_count= Space Assembler Module MK-I x%s +gcyl.machine.assembler_module_2.display_count= Space Assembler Module MK-II x%s +gcyl.machine.assembler_module_3.display_count= Space Assembler Module MK-III x%s + +tile.gcyl_elevator_casing.concrete_strong.name=Ultra High Strength Concrete Floor +tile.gcyl_elevator_casing.elevator_base.name=Space Elevator Base Casing +tile.gcyl_elevator_casing.elevator_internal.name=Space Elevator Internal Structure +tile.gcyl_elevator_casing.elevator_support.name=Space Elevator Support Structure +tile.gcyl_elevator_casing.elevator_cable.name=Space Elevator Cable + +tile.gcyl_elevator_casing_tiered.elevator_motor_1.name=Space Elevator Motor MK-I +tile.gcyl_elevator_casing_tiered.elevator_motor_2.name=Space Elevator Motor MK-II +tile.gcyl_elevator_casing_tiered.elevator_motor_3.name=Space Elevator Motor MK-III +tile.gcyl_elevator_casing_tiered.elevator_motor_4.name=Space Elevator Motor MK-IV +tile.gcyl_elevator_casing_tiered.elevator_motor_5.name=Space Elevator Motor MK-V + +metaitem.generic_circuit.ulv.name=ULV Circuit +metaitem.generic_circuit.lv.name=LV Circuit +metaitem.generic_circuit.mv.name=MV Circuit +metaitem.generic_circuit.hv.name=HV Circuit +metaitem.generic_circuit.ev.name=EV Circuit +metaitem.generic_circuit.iv.name=IV Circuit +metaitem.generic_circuit.luv.name=LuV Circuit +metaitem.generic_circuit.zpm.name=ZPM Circuit +metaitem.generic_circuit.uv.name=UV Circuit +metaitem.generic_circuit.uhv.name=UHV Circuit +metaitem.generic_circuit.uev.name=UEV Circuit +metaitem.generic_circuit.uiv.name=UIV Circuit +metaitem.generic_circuit.uxv.name=UXV Circuit +metaitem.generic_circuit.opv.name=OpV Circuit +metaitem.generic_circuit.max.name=MAX Circuit + +gcyl.material.heavy_water=Heavy Water +gcyl.material.hp_heavy_steam=High Pressure Heavy Steam +gcyl.material.hot_hp_he_3=Hot High Pressure Helium-3 +gcyl.material.hot_hp_he_4=Hot High Pressure Helium-4 +gcyl.material.hot_sodium=Hot Liquid Sodium +gcyl.material.hot_mercury=Hot Mercury +gcyl.material.hot_tin=Hot Liquid Tin +gcyl.material.hot_lead=Hot Liquid Lead +gcyl.material.hot_boron_trioxide=Irradiated Hot Liquid Boron Trioxide + +gcyl.material.ductile_a_356=Ductile A356 + +gcyl.machine.advanced_assline.name=Advanced Assembly Line (AAL) +gcyl.machine.advanced_assline.tooltip.8=Base Recipe Duration is 20%% Longer. +gcyl.machine.advanced_assline.tooltip.1=Maximum Parallel is equal to the Length. +gcyl.machine.advanced_assline.tooltip.2=Ramps up its Parallel while Running. +gcyl.machine.advanced_assline.tooltip.6=Minimum length of recipe input count required to run! +gcyl.machine.advanced_assline.tooltip.3=Each Input Bus must be populated with items or the machine will Pause! +gcyl.machine.advanced_assline.tooltip.9=If Full Parallel cannot be done on next run, machine will Hang for a Time! +gcyl.machine.advanced_assline.tooltip.7=Uses Recipe EU/t * Current Parallel +gcyl.machine.advanced_assline.tooltip.4=Overclocks start at 4.3x EU/t and increase by .3 per additional overclock. +gcyl.machine.advanced_assline.tooltip.5=4.3 x 4.6 x 4.9 x . . . + +behavior.tricorder.virtual_ore.amount=Ore In Layer %s: %s %s - %s%% + +metaitem.prospector.mode.virtual_ores=§dVirtual Ore Prospection Mode + +terminal.prospector.virtual_ores=Virtual Ore Deposit Data +terminal.prospector.virtual_ores.info=L%s: %s %s - %s%% +gcyl.jei.virtual_layer=L%s: %s %s - %s +virtual_ores.name=Virtual Ores +behavior.tricorder.virtual_ore.amount_unknown=Ore In Layer %s: %s%% + +gcyl.material.irirutan=Irirutan + +gcyl.machine.diode.high.iv.name=Insane Voltage Hi-Amp Diode +gcyl.machine.diode.high.luv.name=Ludicrous Voltage Hi-Amp Diode +gcyl.machine.diode.high.zpm.name=Zero Point Module Hi-Amp Diode +gcyl.machine.diode.high.uv.name=Ultimate Voltage Hi-Amp Diode +gcyl.machine.diode.high.uhv.name=Ultra High Voltage Hi-Amp Diode +gcyl.machine.diode.high.uev.name=Ultra Excessive Voltage Hi-Amp Diode +gcyl.machine.diode.high.uiv.name=Ultra Immense Voltage Hi-Amp Diode +gcyl.machine.diode.high.uxv.name=Ultra Extreme Voltage Hi-Amp Diode +gcyl.machine.diode.high.opv.name=Overpowered Voltage Hi-Amp Diode +gcyl.machine.diode.high.max.name=Maximum Voltage Hi-Amp Diode \ No newline at end of file diff --git a/src/main/resources/assets/gcyl/models/item/elevator_casing.json b/src/main/resources/assets/gcyl/models/item/elevator_casing.json new file mode 100644 index 00000000..9c6213fe --- /dev/null +++ b/src/main/resources/assets/gcyl/models/item/elevator_casing.json @@ -0,0 +1,45 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/rendering_error" + } + }, + "variants": { + "variant": { + "concrete_strong": { + "model": "minecraft:cube_all", + "textures": { + "all": "gcyl:blocks/casings/elevator/concrete_strong" + } + }, + "elevator_base": { + "model": "minecraft:cube_all", + "textures": { + "all": "gcyl:blocks/casings/elevator/elevator_base" + } + }, + "elevator_internal": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/elevator_internal", + "side": "gcyl:blocks/casings/elevator/elevator_internal_side" + } + }, + "elevator_support": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/elevator_support", + "side": "gcyl:blocks/casings/elevator/elevator_support_side" + } + }, + "elevator_cable": { + "model": "minecraft:cube_all", + "textures": { + "all": "gcyl:blocks/casings/elevator/cable" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gcyl/models/item/elevator_casing_tiered.json b/src/main/resources/assets/gcyl/models/item/elevator_casing_tiered.json new file mode 100644 index 00000000..2abed5ed --- /dev/null +++ b/src/main/resources/assets/gcyl/models/item/elevator_casing_tiered.json @@ -0,0 +1,48 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/rendering_error" + } + }, + "variants": { + "variant": { + "elevator_motor_1": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/tiered/motor", + "side": "gcyl:blocks/casings/elevator/tiered/1" + } + }, + "elevator_motor_2": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/tiered/motor", + "side": "gcyl:blocks/casings/elevator/tiered/2" + } + }, + "elevator_motor_3": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/tiered/motor", + "side": "gcyl:blocks/casings/elevator/tiered/3" + } + }, + "elevator_motor_4": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/tiered/motor", + "side": "gcyl:blocks/casings/elevator/tiered/4" + } + }, + "elevator_motor_5": { + "model": "minecraft:cube_column", + "textures": { + "end": "gcyl:blocks/casings/elevator/tiered/motor", + "side": "gcyl:blocks/casings/elevator/tiered/5" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gcyl/models/item/gcyl_cleanroom_casing.json b/src/main/resources/assets/gcyl/models/item/gcyl_cleanroom_casing.json new file mode 100644 index 00000000..6193cd90 --- /dev/null +++ b/src/main/resources/assets/gcyl/models/item/gcyl_cleanroom_casing.json @@ -0,0 +1,30 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all" + }, + "variants": { + "variant": { + "filter_casing_iso_3": { + "textures": { + "all": "gregtech:blocks/casings/cleanroom/filter_casing_iso_3" + } + }, + "filter_casing_iso_2": { + "textures": { + "all": "gregtech:blocks/casings/cleanroom/filter_casing_iso_2" + } + }, + "filter_casing_iso_1": { + "textures": { + "all": "gregtech:blocks/casings/cleanroom/filter_casing_iso_1" + } + }, + "filter_casing_iso_0": { + "textures": { + "all": "gregtech:blocks/casings/cleanroom/filter_casing_iso_0" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gcyl/models/item/gcyl_component_al_casing.json b/src/main/resources/assets/gcyl/models/item/gcyl_component_al_casing.json new file mode 100644 index 00000000..61f73d19 --- /dev/null +++ b/src/main/resources/assets/gcyl/models/item/gcyl_component_al_casing.json @@ -0,0 +1,83 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/rendering_error" + } + }, + "variants": { + "variant": { + "lv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/lv" + } + }, + "mv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/mv" + } + }, + "hv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/hv" + } + }, + "ev": { + "textures": { + "all": "gcyl:blocks/casings/component_al/ev" + } + }, + "iv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/iv" + } + }, + "luv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/luv" + } + }, + "zpm": { + "textures": { + "all": "gcyl:blocks/casings/component_al/zpm" + } + }, + "uv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/uv" + } + }, + "uhv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/uhv" + } + }, + "uev": { + "textures": { + "all": "gcyl:blocks/casings/component_al/uev" + } + }, + "uiv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/uiv" + } + }, + "uxv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/uxv" + } + }, + "opv": { + "textures": { + "all": "gcyl:blocks/casings/component_al/opv" + } + }, + "max": { + "textures": { + "all": "gcyl:blocks/casings/component_al/max" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gcyl/models/item/gcyl_fusion_coil.json b/src/main/resources/assets/gcyl/models/item/gcyl_fusion_coil.json new file mode 100644 index 00000000..4364c28d --- /dev/null +++ b/src/main/resources/assets/gcyl/models/item/gcyl_fusion_coil.json @@ -0,0 +1,76 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/rendering_error" + } + }, + "variants": { + "active=false,variant=adv_fusion_coil_1": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uhv" + } + }, + "active=false,variant=adv_fusion_coil_2": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uev" + } + }, + "active=false,variant=adv_fusion_coil_3": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uiv" + } + }, + "active=false,variant=adv_fusion_coil_4": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/casings/solid/advanced_fusion_coil_umv" + } + }, + "active=false,variant=adv_fusion_coil_5": { + "model": "minecraft:cube_all", + "textures": { + "all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uxv" + } + }, + "active=true,variant=adv_fusion_coil_1": { + "model": "gregtech:cube_2_layer_all", + "textures": { + "bot_all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uhv", + "top_all": "gregtech:blocks/casings/fusion/machine_coil_fusion_uhv_bloom" + } + }, + "active=true,variant=adv_fusion_coil_2": { + "model": "gregtech:cube_2_layer_all", + "textures": { + "bot_all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uev", + "top_all": "gregtech:blocks/casings/fusion/machine_coil_fusion_uev_bloom" + } + }, + "active=true,variant=adv_fusion_coil_3": { + "model": "gregtech:cube_2_layer_all", + "textures": { + "bot_all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uiv", + "top_all": "gregtech:blocks/casings/fusion/machine_coil_fusion_uiv_bloom" + } + }, + "active=true,variant=adv_fusion_coil_4": { + "model": "gregtech:cube_2_layer_all", + "textures": { + "bot_all": "gregtech:blocks/casings/solid/advanced_fusion_coil_umv", + "top_all": "gregtech:blocks/casings/fusion/machine_coil_fusion_umv_bloom" + } + }, + "active=true,variant=adv_fusion_coil_5": { + "model": "gregtech:cube_2_layer_all", + "textures": { + "bot_all": "gregtech:blocks/casings/solid/advanced_fusion_coil_uxv", + "top_all": "gregtech:blocks/casings/fusion/machine_coil_fusion_uxv_bloom" + } + } + } +} diff --git a/src/main/resources/assets/gcyl/models/item/gcyl_metal_casing_1.json b/src/main/resources/assets/gcyl/models/item/gcyl_metal_casing_1.json index e29e55e3..51f56679 100644 --- a/src/main/resources/assets/gcyl/models/item/gcyl_metal_casing_1.json +++ b/src/main/resources/assets/gcyl/models/item/gcyl_metal_casing_1.json @@ -10,82 +10,82 @@ "variant": { "casing_hastelloy_x78": { "textures": { - "all": "tjfcore:blocks/casings/hastelloy_x78" + "all": "gcyl:blocks/casings/hastelloy_x78" } }, "casing_hastelloy_n": { "textures": { - "all": "tjfcore:blocks/casings/hastelloy_n" + "all": "gcyl:blocks/casings/hastelloy_n" } }, "casing_hastelloy_k243": { "textures": { - "all": "tjfcore:blocks/casings/hastelloy_k243" + "all": "gcyl:blocks/casings/hastelloy_k243" } }, "casing_incoloy_813": { "textures": { - "all": "tjfcore:blocks/casings/incoloy_813" + "all": "gcyl:blocks/casings/incoloy_813" } }, "casing_incoloy_ma956": { "textures": { - "all": "tjfcore:blocks/casings/incoloy_ma956" + "all": "gcyl:blocks/casings/incoloy_ma956" } }, "casing_maraging_steel_250": { "textures": { - "all": "tjfcore:blocks/casings/maraging_steel_250" + "all": "gcyl:blocks/casings/maraging_steel_250" } }, "casing_nitinol_60": { "textures": { - "all": "tjfcore:blocks/casings/nitinol_60" + "all": "gcyl:blocks/casings/nitinol_60" } }, "casing_inconel_625": { "textures": { - "all": "tjfcore:blocks/casings/inconel_625" + "all": "gcyl:blocks/casings/inconel_625" } }, "casing_grisium": { "textures": { - "all": "tjfcore:blocks/casings/grisium" + "all": "gcyl:blocks/casings/grisium" } }, "casing_eglin_steel": { "textures": { - "all": "tjfcore:blocks/casings/eglin_steel" + "all": "gcyl:blocks/casings/eglin_steel" } }, "casing_babbitt_alloy": { "textures": { - "all": "tjfcore:blocks/casings/babbitt_alloy" + "all": "gcyl:blocks/casings/babbitt_alloy" } }, "casing_hg_1223": { "textures": { - "all": "tjfcore:blocks/casings/hg_1223" + "all": "gcyl:blocks/casings/hg_1223" } }, "casing_tumbaga": { "textures": { - "all": "tjfcore:blocks/casings/tumbaga" + "all": "gcyl:blocks/casings/tumbaga" } }, "casing_talonite": { "textures": { - "all": "tjfcore:blocks/casings/talonite" + "all": "gcyl:blocks/casings/talonite" } }, "casing_zirconium_carbide": { "textures": { - "all": "tjfcore:blocks/casings/zirconium_carbide" + "all": "gcyl:blocks/casings/zirconium_carbide" } }, "casing_potin": { "textures": { - "all": "tjfcore:blocks/casings/potin" + "all": "gcyl:blocks/casings/potin" } } } diff --git a/src/main/resources/assets/gcyl/models/item/gcyl_metal_casing_2.json b/src/main/resources/assets/gcyl/models/item/gcyl_metal_casing_2.json index ff19a25b..eab3b27b 100644 --- a/src/main/resources/assets/gcyl/models/item/gcyl_metal_casing_2.json +++ b/src/main/resources/assets/gcyl/models/item/gcyl_metal_casing_2.json @@ -10,62 +10,62 @@ "variant": { "casing_staballoy": { "textures": { - "all": "tjfcore:blocks/casings/staballoy" + "all": "gcyl:blocks/casings/staballoy" } }, "casing_stellite": { "textures": { - "all": "tjfcore:blocks/casings/stellite" + "all": "gcyl:blocks/casings/stellite" } }, "casing_enriched_naquadah_alloy": { "textures": { - "all": "tjfcore:blocks/casings/enriched_naquadah_alloy" + "all": "gcyl:blocks/casings/enriched_naquadah_alloy" } }, "casing_quantum": { "textures": { - "all": "tjfcore:blocks/casings/quantum" + "all": "gcyl:blocks/casings/quantum" } }, "casing_tritanium": { "textures": { - "all": "tjfcore:blocks/casings/tritanium" + "all": "gcyl:blocks/casings/tritanium" } }, "casing_black_steel": { "textures": { - "all": "tjfcore:blocks/casings/black_steel" + "all": "gcyl:blocks/casings/black_steel" } }, "casing_red_steel": { "textures": { - "all": "tjfcore:blocks/casings/red_steel" + "all": "gcyl:blocks/casings/red_steel" } }, "casing_iron": { "textures": { - "all": "tjfcore:blocks/casings/iron" + "all": "gcyl:blocks/casings/iron" } }, "casing_hss_g": { "textures": { - "all": "tjfcore:blocks/casings/hss_g" + "all": "gcyl:blocks/casings/hss_g" } }, "casing_hss_s": { "textures": { - "all": "tjfcore:blocks/casings/hss_s" + "all": "gcyl:blocks/casings/hss_s" } }, "casing_lead": { "textures": { - "all": "tjfcore:blocks/casings/lead" + "all": "gcyl:blocks/casings/lead" } }, "casing_naquadria": { "textures": { - "all": "tjfcore:blocks/casings/naquadria" + "all": "gcyl:blocks/casings/naquadria" } } } diff --git a/src/main/resources/assets/gcyl/models/item/gcyl_multiblock_casing2.json b/src/main/resources/assets/gcyl/models/item/gcyl_multiblock_casing2.json index 6b95cdc1..d5af3e92 100644 --- a/src/main/resources/assets/gcyl/models/item/gcyl_multiblock_casing2.json +++ b/src/main/resources/assets/gcyl/models/item/gcyl_multiblock_casing2.json @@ -79,7 +79,14 @@ "bottom": "gregtech:blocks/casings/solid/laser_engraver_casing", "top": "gregtech:blocks/casings/solid/laser_engraver_casing" } - } + }, + "seaborgium_substation_casing": { + "textures": { + "side": "gregtech:blocks/casings/solid/seaborgium_substation_casing", + "bottom": "gregtech:blocks/casings/solid/seaborgium_substation_casing", + "top": "gregtech:blocks/casings/solid/seaborgium_substation_casing" + } + } } } } \ No newline at end of file diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/ev.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/ev.png new file mode 100644 index 00000000..697ccab9 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/ev.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/hv.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/hv.png new file mode 100644 index 00000000..9fe699a9 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/hv.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/iv.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/iv.png new file mode 100644 index 00000000..0188d0a1 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/iv.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/luv.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/luv.png new file mode 100644 index 00000000..26e287ac Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/luv.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/lv.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/lv.png new file mode 100644 index 00000000..c15b47ee Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/lv.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/max.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/max.png new file mode 100644 index 00000000..4dadd1bf Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/max.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/mv.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/mv.png new file mode 100644 index 00000000..e5c4d6f1 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/mv.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/opv.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/opv.png new file mode 100644 index 00000000..98be8db7 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/opv.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uev.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uev.png new file mode 100644 index 00000000..9cd17302 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uev.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uhv.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uhv.png new file mode 100644 index 00000000..980ff9d7 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uhv.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uiv.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uiv.png new file mode 100644 index 00000000..08c3225e Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uiv.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uv.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uv.png new file mode 100644 index 00000000..e3938429 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uv.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uxv.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uxv.png new file mode 100644 index 00000000..5958e64c Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/uxv.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/zpm.png b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/zpm.png new file mode 100644 index 00000000..0c82abcc Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/component_al/zpm.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/cable.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/cable.png new file mode 100644 index 00000000..d4044890 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/cable.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/concrete_strong.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/concrete_strong.png new file mode 100644 index 00000000..2df67c9e Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/concrete_strong.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_base.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_base.png new file mode 100644 index 00000000..931cbb12 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_base.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_internal.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_internal.png new file mode 100644 index 00000000..1c4b2e12 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_internal.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_internal_side.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_internal_side.png new file mode 100644 index 00000000..eb85f83a Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_internal_side.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_internal_side_bloom.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_internal_side_bloom.png new file mode 100644 index 00000000..eb85f83a Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_internal_side_bloom.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_support.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_support.png new file mode 100644 index 00000000..1c4b2e12 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_support.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_support_side.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_support_side.png new file mode 100644 index 00000000..58844647 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/elevator_support_side.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/1.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/1.png new file mode 100644 index 00000000..96847ab8 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/1.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/2.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/2.png new file mode 100644 index 00000000..0ae08ec3 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/2.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/3.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/3.png new file mode 100644 index 00000000..1783f7af Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/3.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/4.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/4.png new file mode 100644 index 00000000..c338f95c Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/4.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/5.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/5.png new file mode 100644 index 00000000..1c86433d Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/5.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/motor.png b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/motor.png new file mode 100644 index 00000000..bb3796b6 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/elevator/tiered/motor.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/iridium.png b/src/main/resources/assets/gcyl/textures/blocks/casings/iridium.png new file mode 100644 index 00000000..256b2e57 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/casings/iridium.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/casings/tritanium.png b/src/main/resources/assets/gcyl/textures/blocks/casings/tritanium.png index a1db3ea4..bebe07c4 100644 Binary files a/src/main/resources/assets/gcyl/textures/blocks/casings/tritanium.png and b/src/main/resources/assets/gcyl/textures/blocks/casings/tritanium.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/overlay/elevator/assembler.png b/src/main/resources/assets/gcyl/textures/blocks/overlay/elevator/assembler.png new file mode 100644 index 00000000..5fe24615 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/overlay/elevator/assembler.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/overlay/elevator/mining.png b/src/main/resources/assets/gcyl/textures/blocks/overlay/elevator/mining.png new file mode 100644 index 00000000..7ef9833f Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/overlay/elevator/mining.png differ diff --git a/src/main/resources/assets/gcyl/textures/blocks/overlay/elevator/pump.png b/src/main/resources/assets/gcyl/textures/blocks/overlay/elevator/pump.png new file mode 100644 index 00000000..5779d517 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/blocks/overlay/elevator/pump.png differ diff --git a/src/main/resources/assets/gcyl/textures/fx/laser/laser.png b/src/main/resources/assets/gcyl/textures/fx/laser/laser.png new file mode 100644 index 00000000..af04fe5b Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/fx/laser/laser.png differ diff --git a/src/main/resources/assets/gcyl/textures/fx/laser/laser_start.png b/src/main/resources/assets/gcyl/textures/fx/laser/laser_start.png new file mode 100644 index 00000000..0febae66 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/fx/laser/laser_start.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/ev.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/ev.png new file mode 100644 index 00000000..4fd6cfc6 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/ev.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/hv.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/hv.png new file mode 100644 index 00000000..712c58d2 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/hv.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/iv.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/iv.png new file mode 100644 index 00000000..4697c6b6 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/iv.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/luv.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/luv.png new file mode 100644 index 00000000..85d0f506 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/luv.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/lv.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/lv.png new file mode 100644 index 00000000..60087d65 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/lv.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/max.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/max.png new file mode 100644 index 00000000..28083f16 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/max.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/mv.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/mv.png new file mode 100644 index 00000000..b0b2856c Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/mv.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/opv.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/opv.png new file mode 100644 index 00000000..8f7523c6 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/opv.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uev.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uev.png new file mode 100644 index 00000000..eff86ba9 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uev.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uhv.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uhv.png new file mode 100644 index 00000000..a592671d Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uhv.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uiv.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uiv.png new file mode 100644 index 00000000..d0a2d474 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uiv.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/ulv.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/ulv.png new file mode 100644 index 00000000..5ac1abae Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/ulv.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uv.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uv.png new file mode 100644 index 00000000..46c63d23 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uv.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uxv.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uxv.png new file mode 100644 index 00000000..e97384b5 Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/uxv.png differ diff --git a/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/zpm.png b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/zpm.png new file mode 100644 index 00000000..f80bd6ac Binary files /dev/null and b/src/main/resources/assets/gcyl/textures/items/metaitems/generic_circuits/zpm.png differ diff --git a/src/main/resources/assets/gcyl/worldgen/vein/overworld/manganese_vein.json b/src/main/resources/assets/gcyl/worldgen/vein/overworld/manganese_vein.json index e7e56a2f..6c068d39 100644 --- a/src/main/resources/assets/gcyl/worldgen/vein/overworld/manganese_vein.json +++ b/src/main/resources/assets/gcyl/worldgen/vein/overworld/manganese_vein.json @@ -10,16 +10,20 @@ }, "generator": { "type": "ellipsoid", - "radius": [13, 13] + "radius": [ + 13, + 13 + ] }, "filler": { "type": "simple", "value": { "type": "weight_random", - "values": [{ - "weight": 30, - "value": "ore:grossular" - }, + "values": [ + { + "weight": 30, + "value": "ore:grossular" + }, { "weight": 30, "value": "ore:spessartine" diff --git a/src/main/resources/assets/gcyl/worldgen/worldgen_extracted_gcyl.json b/src/main/resources/assets/gcyl/worldgen/worldgen_extracted_gcyl.json index bcb8e7f2..d66402fd 100644 --- a/src/main/resources/assets/gcyl/worldgen/worldgen_extracted_gcyl.json +++ b/src/main/resources/assets/gcyl/worldgen/worldgen_extracted_gcyl.json @@ -3,6 +3,5 @@ "_comment1": "If this file is deleted, the oregen files will be regenerated from their defaults.", "_comment2": "Modpack authors make sure this file is included in your modpack if you have customized ore generation", "_comment3": "The below versions are used for when GT must forcefully override existing vein configurations, and should not be used by packs.", - "fluidVersion": 2, - "veinVersion": 1 + "virtualOreVersion": 2 } diff --git a/src/main/resources/assets/gregtech/models/item/material_sets/infinity/dust.json b/src/main/resources/assets/gregtech/models/item/material_sets/infinity/dust.json new file mode 100644 index 00000000..9953d84e --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/material_sets/infinity/dust.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/material_sets/infinity/dust" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/material_sets/infinity/dust_small.json b/src/main/resources/assets/gregtech/models/item/material_sets/infinity/dust_small.json new file mode 100644 index 00000000..444cfba6 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/material_sets/infinity/dust_small.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/material_sets/infinity/dustSmall" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/material_sets/infinity/dust_tiny.json b/src/main/resources/assets/gregtech/models/item/material_sets/infinity/dust_tiny.json new file mode 100644 index 00000000..1df4a662 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/material_sets/infinity/dust_tiny.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/material_sets/infinity/dustTiny" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/material_sets/infinity/ingot.json b/src/main/resources/assets/gregtech/models/item/material_sets/infinity/ingot.json new file mode 100644 index 00000000..f3697704 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/material_sets/infinity/ingot.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/material_sets/infinity/ingot" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/bio_cells.json b/src/main/resources/assets/gregtech/models/item/metaitems/bio_cells.json new file mode 100644 index 00000000..ad3ab512 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/bio_cells.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/bio_cells" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/board.bio.json b/src/main/resources/assets/gregtech/models/item/metaitems/board.bio.json new file mode 100644 index 00000000..ef7ea6f7 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/board.bio.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/board.bio" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/board_circuit.bio.json b/src/main/resources/assets/gregtech/models/item/metaitems/board_circuit.bio.json new file mode 100644 index 00000000..c7aa6e47 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/board_circuit.bio.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/board_circuit.bio" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/crystal.asoc.json b/src/main/resources/assets/gregtech/models/item/metaitems/crystal.asoc.json new file mode 100644 index 00000000..557058c0 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/crystal.asoc.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/crystal.asoc" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.ev.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.ev.json new file mode 100644 index 00000000..e8a2a895 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.ev.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/ev" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.hv.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.hv.json new file mode 100644 index 00000000..f71ae835 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.hv.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/hv" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.iv.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.iv.json new file mode 100644 index 00000000..1e7c7b1e --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.iv.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/iv" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.luv.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.luv.json new file mode 100644 index 00000000..46ba5395 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.luv.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/luv" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.lv.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.lv.json new file mode 100644 index 00000000..57f9eaa3 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.lv.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/lv" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.max.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.max.json new file mode 100644 index 00000000..40533ff0 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.max.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/max" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.mv.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.mv.json new file mode 100644 index 00000000..cdbe3ec2 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.mv.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/mv" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.opv.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.opv.json new file mode 100644 index 00000000..c419df98 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.opv.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/opv" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uev.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uev.json new file mode 100644 index 00000000..74bd8721 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uev.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/uev" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uhv.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uhv.json new file mode 100644 index 00000000..2b7d0129 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uhv.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/uhv" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uiv.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uiv.json new file mode 100644 index 00000000..f66ed020 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uiv.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/uiv" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.ulv.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.ulv.json new file mode 100644 index 00000000..7b72989a --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.ulv.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/ulv" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uv.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uv.json new file mode 100644 index 00000000..a1267e28 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uv.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/uv" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uxv.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uxv.json new file mode 100644 index 00000000..47181d4a --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.uxv.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/uxv" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.zpm.json b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.zpm.json new file mode 100644 index 00000000..6309f9f3 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/generic_circuit.zpm.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gcyl:items/metaitems/generic_circuits/zpm" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/living.soc.json b/src/main/resources/assets/gregtech/models/item/metaitems/living.soc.json new file mode 100644 index 00000000..5fcf4926 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/living.soc.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/living.soc" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/living_bio.soc.json b/src/main/resources/assets/gregtech/models/item/metaitems/living_bio.soc.json new file mode 100644 index 00000000..761aaff9 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/living_bio.soc.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/living_bio.soc" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.1.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.1.json new file mode 100644 index 00000000..b9310c29 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.1.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.10.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.10.json new file mode 100644 index 00000000..fab0db83 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.10.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.11.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.11.json new file mode 100644 index 00000000..ee26b9cc --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.11.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.12.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.12.json new file mode 100644 index 00000000..83f5b29b --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.12.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.13.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.13.json new file mode 100644 index 00000000..c0805700 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.13.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.14.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.14.json new file mode 100644 index 00000000..e4dc8114 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.14.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.2.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.2.json new file mode 100644 index 00000000..2ba0677a --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.2.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.3.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.3.json new file mode 100644 index 00000000..169faba7 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.3.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.4.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.4.json new file mode 100644 index 00000000..2880820d --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.4.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.5.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.5.json new file mode 100644 index 00000000..2863c1ae --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.5.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.6.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.6.json new file mode 100644 index 00000000..b2d4c1ee --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.6.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.7.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.7.json new file mode 100644 index 00000000..4573db5f --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.7.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.8.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.8.json new file mode 100644 index 00000000..67d73fdc --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.8.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.9.json b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.9.json new file mode 100644 index 00000000..e1cb91e7 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/mining_drone.9.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/mining_drone.9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/npic.json b/src/main/resources/assets/gregtech/models/item/metaitems/npic.json new file mode 100644 index 00000000..1c9fee68 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/npic.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/npic" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/nuclear.star.json b/src/main/resources/assets/gregtech/models/item/metaitems/nuclear.star.json new file mode 100644 index 00000000..fc72cace --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/nuclear.star.json @@ -0,0 +1,7 @@ + +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/nuclear.star" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/ppic.json b/src/main/resources/assets/gregtech/models/item/metaitems/ppic.json new file mode 100644 index 00000000..26568d7e --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/ppic.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/ppic" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/qpic.json b/src/main/resources/assets/gregtech/models/item/metaitems/qpic.json new file mode 100644 index 00000000..69e81196 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/qpic.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/qpic" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.max.json b/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.max.json new file mode 100644 index 00000000..6867195f --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.max.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/voltage_coil.max" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.opv.json b/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.opv.json new file mode 100644 index 00000000..895b42f6 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.opv.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/voltage_coil.opv" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.uev.json b/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.uev.json new file mode 100644 index 00000000..ace3fa72 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.uev.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/voltage_coil.uev" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.uhv.json b/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.uhv.json new file mode 100644 index 00000000..6c77890a --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.uhv.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/voltage_coil.uhv" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.uiv.json b/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.uiv.json new file mode 100644 index 00000000..32e0cea9 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.uiv.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/voltage_coil.uiv" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.uxv.json b/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.uxv.json new file mode 100644 index 00000000..c136b31c --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/voltage_coil.uxv.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/voltage_coil.uxv" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/wafer.bio.json b/src/main/resources/assets/gregtech/models/item/metaitems/wafer.bio.json new file mode 100644 index 00000000..4f7cd860 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/wafer.bio.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/wafer.bio" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/wafer.npic.json b/src/main/resources/assets/gregtech/models/item/metaitems/wafer.npic.json new file mode 100644 index 00000000..460df02b --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/wafer.npic.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/wafer.npic" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/wafer.ppic.json b/src/main/resources/assets/gregtech/models/item/metaitems/wafer.ppic.json new file mode 100644 index 00000000..6ab35642 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/wafer.ppic.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/wafer.ppic" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/wafer.qpic.json b/src/main/resources/assets/gregtech/models/item/metaitems/wafer.qpic.json new file mode 100644 index 00000000..2ab6f754 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/wafer.qpic.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/wafer.qpic" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/1.json b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/1.json new file mode 100644 index 00000000..247d7814 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/1.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/energy.module/1" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/2.json b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/2.json new file mode 100644 index 00000000..91948546 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/2.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/energy.module/2" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/3.json b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/3.json new file mode 100644 index 00000000..11702f62 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/3.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/energy.module/3" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/4.json b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/4.json new file mode 100644 index 00000000..74be7e9f --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/4.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/energy.module/4" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/5.json b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/5.json new file mode 100644 index 00000000..1c7cfaf7 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/5.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/energy.module/5" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/6.json b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/6.json new file mode 100644 index 00000000..83f4955d --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/6.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/energy.module/6" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/7.json b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/7.json new file mode 100644 index 00000000..993c20fd --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/7.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/energy.module/7" + } +} diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/8.json b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/8.json new file mode 100644 index 00000000..b9f6b493 --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/wireless_battery_uv/8.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "gregtech:items/metaitems/energy.module/8" + } +} diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_0.png b/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_0.png new file mode 100644 index 00000000..2f4fa05b Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_0.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_0.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_0.png.mcmeta new file mode 100644 index 00000000..15ec9b57 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_0.png.mcmeta @@ -0,0 +1,7 @@ +{ + "animation": { + "interpolate": true, + "frametime": 10, + "frames":[0,5,1,2,3,4,5] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_1.png b/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_1.png new file mode 100644 index 00000000..c616e881 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_1.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_2.png b/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_2.png new file mode 100644 index 00000000..5ed63bec Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_2.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_3.png b/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_3.png new file mode 100644 index 00000000..05895982 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/casings/cleanroom/filter_casing_iso_3.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_uev_bloom.png b/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_uev_bloom.png new file mode 100644 index 00000000..7830ab97 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_uev_bloom.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_uhv_bloom.png b/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_uhv_bloom.png new file mode 100644 index 00000000..432f27d5 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_uhv_bloom.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_uiv_bloom.png b/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_uiv_bloom.png new file mode 100644 index 00000000..f1785a91 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_uiv_bloom.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_umv_bloom.png b/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_umv_bloom.png new file mode 100644 index 00000000..8866e4d2 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_umv_bloom.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_uxv_bloom.png b/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_uxv_bloom.png new file mode 100644 index 00000000..8e46e7db Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/casings/fusion/machine_coil_fusion_uxv_bloom.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/metal_casings/iridium.png b/src/main/resources/assets/gregtech/textures/blocks/casings/metal_casings/iridium.png new file mode 100644 index 00000000..256b2e57 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/casings/metal_casings/iridium.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/metal_casings/tritanium.png b/src/main/resources/assets/gregtech/textures/blocks/casings/metal_casings/tritanium.png index a1db3ea4..bebe07c4 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/casings/metal_casings/tritanium.png and b/src/main/resources/assets/gregtech/textures/blocks/casings/metal_casings/tritanium.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/casings/solid/seaborgium_substation_casing.png b/src/main/resources/assets/gregtech/textures/blocks/casings/solid/seaborgium_substation_casing.png new file mode 100644 index 00000000..622ecc99 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/casings/solid/seaborgium_substation_casing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_1_cleaning.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_1_cleaning.png new file mode 100644 index 00000000..71eccf62 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_1_cleaning.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_1_cleaning_emissive.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_1_cleaning_emissive.png new file mode 100644 index 00000000..e239ac62 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_1_cleaning_emissive.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_1_cleaning_emissive.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_1_cleaning_emissive.png.mcmeta new file mode 100644 index 00000000..c74f41dc --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_1_cleaning_emissive.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "interpolate": true, + "frametime": 10 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_2_cleaning.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_2_cleaning.png new file mode 100644 index 00000000..5b88c9b1 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_2_cleaning.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_2_cleaning_emissive.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_2_cleaning_emissive.png new file mode 100644 index 00000000..53d94dee Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_2_cleaning_emissive.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_2_cleaning_emissive.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_2_cleaning_emissive.png.mcmeta new file mode 100644 index 00000000..c74f41dc --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_2_cleaning_emissive.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "interpolate": true, + "frametime": 10 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_3_cleaning.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_3_cleaning.png new file mode 100644 index 00000000..ded28f41 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_3_cleaning.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_3_cleaning_emissive.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_3_cleaning_emissive.png new file mode 100644 index 00000000..760cedc9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_3_cleaning_emissive.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_3_cleaning_emissive.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_3_cleaning_emissive.png.mcmeta new file mode 100644 index 00000000..c74f41dc --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_iso_3_cleaning_emissive.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "interpolate": true, + "frametime": 10 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_data.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_data.png new file mode 100644 index 00000000..aef6a37f Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_data.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_data.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_data.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_data.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_data_emissive.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_data_emissive.png new file mode 100644 index 00000000..aef6a37f Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_data_emissive.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_data_emissive.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_data_emissive.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_data_emissive.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy.png new file mode 100644 index 00000000..d17f3f62 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_16a.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_16a.png new file mode 100644 index 00000000..7db32095 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_16a.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_16a.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_16a.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_16a.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_16a_emissive.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_16a_emissive.png new file mode 100644 index 00000000..7db32095 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_16a_emissive.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_16a_emissive.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_16a_emissive.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_16a_emissive.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_4a.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_4a.png new file mode 100644 index 00000000..531db420 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_4a.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_4a.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_4a.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_4a.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_4a_emissive.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_4a_emissive.png new file mode 100644 index 00000000..531db420 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_4a_emissive.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_4a_emissive.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_4a_emissive.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_4a_emissive.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_emissive.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_emissive.png new file mode 100644 index 00000000..d17f3f62 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_emissive.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_emissive.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_emissive.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_emissive.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_off.png b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_off.png new file mode 100644 index 00000000..af85482d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/overlay/machine/overlay_wireless_energy_off.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/progress_bar/progress_bar_component_al.png b/src/main/resources/assets/gregtech/textures/gui/progress_bar/progress_bar_component_al.png new file mode 100644 index 00000000..1500d428 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/progress_bar/progress_bar_component_al.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/progress_bar/progress_bar_mining_module.png b/src/main/resources/assets/gregtech/textures/gui/progress_bar/progress_bar_mining_module.png new file mode 100644 index 00000000..0a40cb81 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/progress_bar/progress_bar_mining_module.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dust.png b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dust.png new file mode 100644 index 00000000..86fd0d3c Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dust.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dust.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dust.png.mcmeta new file mode 100644 index 00000000..cc8a1f3c --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dust.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 1}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dustSmall.png b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dustSmall.png new file mode 100644 index 00000000..144b7c8b Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dustSmall.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dustSmall.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dustSmall.png.mcmeta new file mode 100644 index 00000000..cc8a1f3c --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dustSmall.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 1}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dustTiny.png b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dustTiny.png new file mode 100644 index 00000000..d092b0fc Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dustTiny.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dustTiny.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dustTiny.png.mcmeta new file mode 100644 index 00000000..cc8a1f3c --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/dustTiny.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 1}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/ingot.png b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/ingot.png new file mode 100644 index 00000000..b5ce7727 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/ingot.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/ingot.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/ingot.png.mcmeta new file mode 100644 index 00000000..cc8a1f3c --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/material_sets/infinity/ingot.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 1}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/bio_cells.png b/src/main/resources/assets/gregtech/textures/items/metaitems/bio_cells.png new file mode 100644 index 00000000..86692228 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/bio_cells.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/board.bio.png b/src/main/resources/assets/gregtech/textures/items/metaitems/board.bio.png new file mode 100644 index 00000000..7c9dadcd Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/board.bio.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/board_circuit.bio.png b/src/main/resources/assets/gregtech/textures/items/metaitems/board_circuit.bio.png new file mode 100644 index 00000000..09b8dd99 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/board_circuit.bio.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/conveyor.module.max.png b/src/main/resources/assets/gregtech/textures/items/metaitems/conveyor.module.max.png index 7cbf7340..bad8169f 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/metaitems/conveyor.module.max.png and b/src/main/resources/assets/gregtech/textures/items/metaitems/conveyor.module.max.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/conveyor.module.max.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/conveyor.module.max.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/conveyor.module.max.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/crystal.asoc.png b/src/main/resources/assets/gregtech/textures/items/metaitems/crystal.asoc.png new file mode 100644 index 00000000..7df30e61 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/crystal.asoc.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/electric.motor.max.png b/src/main/resources/assets/gregtech/textures/items/metaitems/electric.motor.max.png index 273c9e2b..0c5ff087 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/metaitems/electric.motor.max.png and b/src/main/resources/assets/gregtech/textures/items/metaitems/electric.motor.max.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/electric.motor.max.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/electric.motor.max.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/electric.motor.max.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/electric.piston.max.png b/src/main/resources/assets/gregtech/textures/items/metaitems/electric.piston.max.png index 774dae30..99d0d099 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/metaitems/electric.piston.max.png and b/src/main/resources/assets/gregtech/textures/items/metaitems/electric.piston.max.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/electric.piston.max.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/electric.piston.max.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/electric.piston.max.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/electric.pump.max.png b/src/main/resources/assets/gregtech/textures/items/metaitems/electric.pump.max.png index d8594ef9..d1ae36f3 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/metaitems/electric.pump.max.png and b/src/main/resources/assets/gregtech/textures/items/metaitems/electric.pump.max.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/electric.pump.max.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/electric.pump.max.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/electric.pump.max.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/emitter.max.png b/src/main/resources/assets/gregtech/textures/items/metaitems/emitter.max.png index cafd56ae..5442027c 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/metaitems/emitter.max.png and b/src/main/resources/assets/gregtech/textures/items/metaitems/emitter.max.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/emitter.max.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/emitter.max.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/emitter.max.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/field.generator.max.png b/src/main/resources/assets/gregtech/textures/items/metaitems/field.generator.max.png index 8931de77..e33469f8 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/metaitems/field.generator.max.png and b/src/main/resources/assets/gregtech/textures/items/metaitems/field.generator.max.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/field.generator.max.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/field.generator.max.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/field.generator.max.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/living.soc.png b/src/main/resources/assets/gregtech/textures/items/metaitems/living.soc.png new file mode 100644 index 00000000..c6ec444d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/living.soc.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/living.soc.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/living.soc.png.mcmeta new file mode 100644 index 00000000..287c39f0 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/living.soc.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 8}} diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/living_bio.soc.png b/src/main/resources/assets/gregtech/textures/items/metaitems/living_bio.soc.png new file mode 100644 index 00000000..083b921c Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/living_bio.soc.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/living_bio.soc.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/living_bio.soc.png.mcmeta new file mode 100644 index 00000000..40a63200 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/living_bio.soc.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 4}} diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.1.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.1.png new file mode 100644 index 00000000..1e7e8e46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.1.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.10.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.10.png new file mode 100644 index 00000000..d8587425 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.10.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.11.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.11.png new file mode 100644 index 00000000..d4f46015 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.11.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.12.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.12.png new file mode 100644 index 00000000..53b5cb5f Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.12.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.12.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.12.png.mcmeta new file mode 100644 index 00000000..6575dfcc --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.12.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.13.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.13.png new file mode 100644 index 00000000..c745fdb9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.13.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.13.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.13.png.mcmeta new file mode 100644 index 00000000..cc8a1f3c --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.13.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 1}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.14.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.14.png new file mode 100644 index 00000000..79efd9ce Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.14.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.14.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.14.png.mcmeta new file mode 100644 index 00000000..6575dfcc --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.14.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.2.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.2.png new file mode 100644 index 00000000..3143383c Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.2.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.3.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.3.png new file mode 100644 index 00000000..5c1b83d4 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.3.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.4.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.4.png new file mode 100644 index 00000000..20c32e90 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.4.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.5.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.5.png new file mode 100644 index 00000000..fc0ef993 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.5.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.6.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.6.png new file mode 100644 index 00000000..fc68c9b5 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.6.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.7.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.7.png new file mode 100644 index 00000000..d7b4a36c Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.7.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.8.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.8.png new file mode 100644 index 00000000..fb105412 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.8.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.9.png b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.9.png new file mode 100644 index 00000000..2fe272ea Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/mining_drone.9.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/neuro.support.unit.png b/src/main/resources/assets/gregtech/textures/items/metaitems/neuro.support.unit.png index e5726989..285f4e7e 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/metaitems/neuro.support.unit.png and b/src/main/resources/assets/gregtech/textures/items/metaitems/neuro.support.unit.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/npic.png b/src/main/resources/assets/gregtech/textures/items/metaitems/npic.png new file mode 100644 index 00000000..de2f85b1 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/npic.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/nuclear.star.png b/src/main/resources/assets/gregtech/textures/items/metaitems/nuclear.star.png new file mode 100644 index 00000000..80ae4244 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/nuclear.star.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/nuclear.star.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/nuclear.star.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/nuclear.star.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/ppic.png b/src/main/resources/assets/gregtech/textures/items/metaitems/ppic.png new file mode 100644 index 00000000..3ebfcd76 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/ppic.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/qpic.png b/src/main/resources/assets/gregtech/textures/items/metaitems/qpic.png new file mode 100644 index 00000000..0d1d65a9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/qpic.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/robot.arm.max.png b/src/main/resources/assets/gregtech/textures/items/metaitems/robot.arm.max.png index 1acc2e21..49aae186 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/metaitems/robot.arm.max.png and b/src/main/resources/assets/gregtech/textures/items/metaitems/robot.arm.max.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/robot.arm.max.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/robot.arm.max.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/robot.arm.max.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/sensor.max.png b/src/main/resources/assets/gregtech/textures/items/metaitems/sensor.max.png index c4c3833f..88052715 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/metaitems/sensor.max.png and b/src/main/resources/assets/gregtech/textures/items/metaitems/sensor.max.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/sensor.max.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/sensor.max.png.mcmeta new file mode 100644 index 00000000..0dab8107 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/sensor.max.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 3}} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.max.png b/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.max.png new file mode 100644 index 00000000..38f01e96 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.max.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.opv.png b/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.opv.png new file mode 100644 index 00000000..ad93be97 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.opv.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.uev.png b/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.uev.png new file mode 100644 index 00000000..d048a073 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.uev.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.uhv.png b/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.uhv.png new file mode 100644 index 00000000..4a55e873 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.uhv.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.uiv.png b/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.uiv.png new file mode 100644 index 00000000..e478c0ba Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.uiv.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.uxv.png b/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.uxv.png new file mode 100644 index 00000000..92af60ef Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/voltage_coil.uxv.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.bio.png b/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.bio.png new file mode 100644 index 00000000..8acb8f05 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.bio.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.bio.png.mcmeta b/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.bio.png.mcmeta new file mode 100644 index 00000000..a668e18a --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.bio.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 2}} diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.npic.png b/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.npic.png new file mode 100644 index 00000000..b83181d4 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.npic.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.ppic.png b/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.ppic.png new file mode 100644 index 00000000..42d620ef Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.ppic.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.qpic.png b/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.qpic.png new file mode 100644 index 00000000..c2df2969 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/wafer.qpic.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/widget/button_cycle.png b/src/main/resources/assets/minecraft/textures/gui/widget/button_cycle.png new file mode 100644 index 00000000..58428d21 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/widget/button_cycle.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/widget/button_power_disable_static.png b/src/main/resources/assets/minecraft/textures/gui/widget/button_power_disable_static.png new file mode 100644 index 00000000..1696c47d Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/widget/button_power_disable_static.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/widget/button_power_enable_static.png b/src/main/resources/assets/minecraft/textures/gui/widget/button_power_enable_static.png new file mode 100644 index 00000000..591af93a Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/widget/button_power_enable_static.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/widget/button_white_black_list.png b/src/main/resources/assets/minecraft/textures/gui/widget/button_white_black_list.png new file mode 100644 index 00000000..1510be05 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/widget/button_white_black_list.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/widget/planet_teleport.png b/src/main/resources/assets/minecraft/textures/gui/widget/planet_teleport.png new file mode 100644 index 00000000..317ce79c Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/widget/planet_teleport.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/widget/space_elevator_extension.png b/src/main/resources/assets/minecraft/textures/gui/widget/space_elevator_extension.png new file mode 100644 index 00000000..1d6bb0ef Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/widget/space_elevator_extension.png differ diff --git a/src/main/resources/gcyl_at.cfg b/src/main/resources/gcyl_at.cfg new file mode 100644 index 00000000..9b0289b4 --- /dev/null +++ b/src/main/resources/gcyl_at.cfg @@ -0,0 +1,2 @@ +#SoundManager +public net.minecraft.client.audio.SoundManager$SoundSystemStarterThread #SoundSystemStarterThread \ No newline at end of file diff --git a/src/main/resources/mixins.gcyl.json b/src/main/resources/mixins.gcyl.json new file mode 100644 index 00000000..30ca72a5 --- /dev/null +++ b/src/main/resources/mixins.gcyl.json @@ -0,0 +1,14 @@ +{ + "package": "com.fulltrix.gcyl.mixin", + "refmap": "mixins.gcyl.refmap.json", + "target": "@env(DEFAULT)", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "mixins": [ + "MetaTileEntityHolderMixin", + "MixinProspectorScannerBehavior", + "MixinTricorderBehavior" + ], + "client": [], + "server": [] +}