From f1ccbce48dd46c40dc6b0e1f44f23e38458a603d Mon Sep 17 00:00:00 2001 From: LRW-Calen Date: Sat, 13 Apr 2024 17:28:07 +0800 Subject: [PATCH 01/15] Compat module for 1.18.2 --- .gitignore | 38 +- .gitmodules | 1 + build.gradle | 606 ++++++++++++------ build.properties | 15 +- common/buildcraft/compat/BCCompat.java | 141 ++-- .../buildcraft/compat/CompatModuleBase.java | 6 +- common/buildcraft/compat/CompatUtils.java | 39 +- .../module/crafttweaker/AssemblyTable.java | 206 ++++-- .../module/crafttweaker/CombustionEngine.java | 324 ++++++---- .../CompatModuleCraftTweaker.java | 15 +- .../compat/module/crafttweaker/Coolant.java | 166 +++++ .../module/forestry/CompatModuleForestry.java | 39 -- .../module/forestry/list/ListMatchGenome.java | 93 --- .../forestry/pipe/ContainerPropolisPipe.java | 22 - .../module/forestry/pipe/ForestryPipes.java | 86 --- .../forestry/pipe/PipeBehaviourPropolis.java | 196 ------ .../ic2/CompatModuleIndustrialCraft2.java | 43 +- .../compat/module/jei/BCPluginJEI.java | 306 +++++---- .../CategoryCombustionEngine.java | 197 ++++-- .../HandlerCombustionEngine.java | 19 - .../WrapperCombustionEngine.java | 110 ---- .../energy/combustionengine/package-info.java | 5 +- .../module/jei/factory/CategoryCoolable.java | 157 ++++- .../module/jei/factory/CategoryDistiller.java | 166 +++-- .../module/jei/factory/CategoryHeatable.java | 146 ++++- .../module/jei/factory/HandlerCoolable.java | 15 - .../module/jei/factory/HandlerDistiller.java | 15 - .../module/jei/factory/HandlerHeatable.java | 15 - .../module/jei/factory/WrapperCoolable.java | 86 --- .../module/jei/factory/WrapperDistiller.java | 84 --- .../module/jei/factory/WrapperHeatable.java | 84 --- .../module/jei/factory/package-info.java | 5 +- .../module/jei/gui/GuiHandlerBuildCraft.java | 60 ++ .../module/jei/recipe/GateGuiHandler.java | 37 -- .../jei/recipe/GuiHandlerBuildCraft.java | 51 -- .../jei/recipe/HandlerFlexibleRecipe.java | 15 - .../module/jei/recipe/LedgerGuiHandler.java | 35 - .../jei/silicon/CategoryAssemblyTable.java | 194 ++++-- .../jei/silicon/CategoryIntegrationTable.java | 166 +++-- .../jei/silicon/HandlerIntegrationTable.java | 38 -- .../compat/module/jei/silicon/Utils.java | 23 +- .../jei/silicon/WrapperAssemblyTable.java | 83 --- .../jei/silicon/WrapperIntegrationTable.java | 93 --- .../module/jei/silicon/package-info.java | 5 +- .../AdvancedCraftingItemsTransferHandler.java | 54 +- .../AssemblyTableTransferHandler.java | 23 +- .../AutoCraftItemsTransferHandler.java | 81 ++- .../jei/transferhandlers/package-info.java | 5 +- .../module/theoneprobe/BCPluginTOP.java | 163 +++-- .../theoneprobe/CompatModuleTheOneProbe.java | 25 +- .../waila/AssemblyCraftDataProvider.java | 63 ++ .../module/waila/AutoCraftDataProvider.java | 135 ++-- .../compat/module/waila/BCPluginJade.java | 166 +++++ .../module/waila/BaseWailaDataProvider.java | 83 +-- .../compat/module/waila/HWYLAPlugin.java | 49 -- .../module/waila/LaserTargetDataProvider.java | 83 ++- .../buildcraft/compat/network/CompatGui.java | 304 ++++----- .../compat/network/IGuiCreator.java | 24 +- gradle/wrapper/gradle-wrapper.jar | Bin 53556 -> 59821 bytes gradle/wrapper/gradle-wrapper.properties | 11 +- gradlew | 282 +++++--- gradlew.bat | 49 +- resources/META-INF/mods.toml_ | 32 + .../assets/buildcraftcompat/lang/de_DE.lang | 20 - .../assets/buildcraftcompat/lang/de_de.json | 24 + .../assets/buildcraftcompat/lang/en_US.lang | 25 - .../assets/buildcraftcompat/lang/en_us.json | 45 ++ .../assets/buildcraftcompat/lang/fr_FR.lang | 20 - .../assets/buildcraftcompat/lang/fr_fr.json | 24 + .../assets/buildcraftcompat/lang/ko_KR.lang | 20 - .../assets/buildcraftcompat/lang/ko_kr.json | 24 + .../assets/buildcraftcompat/lang/pt_BR.lang | 20 - .../assets/buildcraftcompat/lang/pt_br.json | 24 + .../assets/buildcraftcompat/lang/ru_RU.lang | 25 - .../assets/buildcraftcompat/lang/ru_ru.json | 29 + .../assets/buildcraftcompat/lang/uk_UA.lang | 20 - .../assets/buildcraftcompat/lang/uk_ua.json | 24 + .../assets/buildcraftcompat/lang/zh_CN.lang | 20 - .../assets/buildcraftcompat/lang/zh_cn.json | 40 ++ resources/mcmod.info | 16 - 80 files changed, 3363 insertions(+), 2935 deletions(-) create mode 100644 common/buildcraft/compat/module/crafttweaker/Coolant.java delete mode 100644 common/buildcraft/compat/module/forestry/CompatModuleForestry.java delete mode 100644 common/buildcraft/compat/module/forestry/list/ListMatchGenome.java delete mode 100644 common/buildcraft/compat/module/forestry/pipe/ContainerPropolisPipe.java delete mode 100644 common/buildcraft/compat/module/forestry/pipe/ForestryPipes.java delete mode 100644 common/buildcraft/compat/module/forestry/pipe/PipeBehaviourPropolis.java delete mode 100644 common/buildcraft/compat/module/jei/energy/combustionengine/HandlerCombustionEngine.java delete mode 100644 common/buildcraft/compat/module/jei/energy/combustionengine/WrapperCombustionEngine.java delete mode 100644 common/buildcraft/compat/module/jei/factory/HandlerCoolable.java delete mode 100644 common/buildcraft/compat/module/jei/factory/HandlerDistiller.java delete mode 100644 common/buildcraft/compat/module/jei/factory/HandlerHeatable.java delete mode 100644 common/buildcraft/compat/module/jei/factory/WrapperCoolable.java delete mode 100644 common/buildcraft/compat/module/jei/factory/WrapperDistiller.java delete mode 100644 common/buildcraft/compat/module/jei/factory/WrapperHeatable.java create mode 100644 common/buildcraft/compat/module/jei/gui/GuiHandlerBuildCraft.java delete mode 100644 common/buildcraft/compat/module/jei/recipe/GateGuiHandler.java delete mode 100644 common/buildcraft/compat/module/jei/recipe/GuiHandlerBuildCraft.java delete mode 100644 common/buildcraft/compat/module/jei/recipe/HandlerFlexibleRecipe.java delete mode 100644 common/buildcraft/compat/module/jei/recipe/LedgerGuiHandler.java delete mode 100644 common/buildcraft/compat/module/jei/silicon/HandlerIntegrationTable.java delete mode 100644 common/buildcraft/compat/module/jei/silicon/WrapperAssemblyTable.java delete mode 100644 common/buildcraft/compat/module/jei/silicon/WrapperIntegrationTable.java create mode 100644 common/buildcraft/compat/module/waila/AssemblyCraftDataProvider.java create mode 100644 common/buildcraft/compat/module/waila/BCPluginJade.java delete mode 100644 common/buildcraft/compat/module/waila/HWYLAPlugin.java create mode 100644 resources/META-INF/mods.toml_ delete mode 100644 resources/assets/buildcraftcompat/lang/de_DE.lang create mode 100644 resources/assets/buildcraftcompat/lang/de_de.json delete mode 100644 resources/assets/buildcraftcompat/lang/en_US.lang create mode 100644 resources/assets/buildcraftcompat/lang/en_us.json delete mode 100644 resources/assets/buildcraftcompat/lang/fr_FR.lang create mode 100644 resources/assets/buildcraftcompat/lang/fr_fr.json delete mode 100644 resources/assets/buildcraftcompat/lang/ko_KR.lang create mode 100644 resources/assets/buildcraftcompat/lang/ko_kr.json delete mode 100644 resources/assets/buildcraftcompat/lang/pt_BR.lang create mode 100644 resources/assets/buildcraftcompat/lang/pt_br.json delete mode 100644 resources/assets/buildcraftcompat/lang/ru_RU.lang create mode 100644 resources/assets/buildcraftcompat/lang/ru_ru.json delete mode 100644 resources/assets/buildcraftcompat/lang/uk_UA.lang create mode 100644 resources/assets/buildcraftcompat/lang/uk_ua.json delete mode 100644 resources/assets/buildcraftcompat/lang/zh_CN.lang create mode 100644 resources/assets/buildcraftcompat/lang/zh_cn.json delete mode 100644 resources/mcmod.info diff --git a/.gitignore b/.gitignore index 5e19125..f73156f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,26 +1,44 @@ -#eclipse -.project -.classpath -.metadata -org.* +# eclipse bin *.launch +.settings +.metadata +.classpath +.project +eclipse -#idea -*.iml +# idea +out *.ipr *.iws +*.iml .idea -out -#gradle +# gradle build .gradle +modules libs #runtime run -classes +run_server #mac .DS_Store + +#Custom code to inject the the dev environment +custom +test-results + +#licnse_checker +# Not in git because it contains names + emails. +license_checker/agreed.txt +license_checker/unused_code.txt +license_checker/out/** + +# Files from Forge MDK +forge*changelog.txt + +# For some annoying reason the tests creates a log file in "/logs/latest.txt" +logs diff --git a/.gitmodules b/.gitmodules index 3602e61..1664b23 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "BuildCraft"] path = BuildCraft url = https://github.com/BuildCraft/BuildCraft.git + branch = 8.0.x-1.18.2 diff --git a/build.gradle b/build.gradle index 95cf589..957f5cc 100755 --- a/build.gradle +++ b/build.gradle @@ -1,31 +1,31 @@ -// DON'T TOUCH THE BUILDSCRIPT[] BLOCK -// its special, and it is only there to make ForgeGradle work correctly. - buildscript { repositories { + // These repositories are only for Gradle plugins, put any other repositories in the repository core further below + maven { url = 'https://maven.minecraftforge.net' } +// maven { url = 'https://maven.parchmentmc.org' } mavenCentral() - maven { - name = "forge" - url = "http://files.minecraftforge.net/maven" - } - maven { - name = "sonatype" - url = "https://oss.sonatype.org/content/repositories/snapshots/" - } - maven { - url "https://plugins.gradle.org/m2/" - } } dependencies { - classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT" - classpath "org.ajoberstar:grgit:2.2.1" + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true + // Mixin + //classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT' + classpath 'org.spongepowered:mixingradle:0.7.+' + classpath 'javax.vecmath:vecmath:1.5.2' } } - -apply plugin: "net.minecraftforge.gradle.forge" // adds the forge dependency -apply plugin: "maven" // for uploading to a maven repo -apply plugin: 'maven-publish' // for uploading to a maven repo -apply plugin: "org.ajoberstar.grgit" +// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. +plugins { + id 'eclipse' + id 'maven-publish' +// id 'net.minecraftforge.gradle' version '5.+' +// id 'org.parchmentmc.librarian.forgegradle' version '1.+' +} +apply plugin: 'net.minecraftforge.gradle' +// +////apply plugin: 'org.parchmentmc.librarian.forgegradle' version '1.+' +// +// Mixin +apply plugin: 'org.spongepowered.mixin' ext.configFile = file "build.properties" configFile.withReader { @@ -40,101 +40,180 @@ configFile.withReader { } version = config.compat_version +//version = mod_version + "-" + new Date().format("yyyy-MM-dd'T'HH-mm-ssZ") group = "com.mod-buildcraft-compat" archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension] -ext { - compatModInfo = new groovy.json.JsonSlurper().parse(file("resources/mcmod.info")) - mainModInfo = new groovy.json.JsonSlurper().parse(file("BuildCraft/buildcraft_resources/mcmod.info")) -} +// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. +java.toolchain.languageVersion = JavaLanguageVersion.of(17) -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" +minecraft { + // The mappings can be changed at any time and must be in the following format. + // Channel: Version: + // official MCVersion Official field/method names from Mojang mapping files + // parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official + // + // You must be aware of the Mojang license when using the 'official' or 'parchment' mappings. + // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md + // + // Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge + // Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started + // + // Use non-default mappings at your own risk. They may not always work. + // Simply re-run your setup task after changing the mappings to update your workspace. + + mappings channel: 'official', version: '1.18.2' +// mappings channel: 'parchment', version: '2022.08.07-1.18.2' + +// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') +// accessTransformer = file('buildcraft_resources/META-INF/accesstransformer.cfg') + accessTransformer = file('BuildCraft/buildcraft_resources/META-INF/accesstransformer.cfg') + // Currently, this location cannot be changed from the default. + + // Default run configurations. + // These can be tweaked, removed, or duplicated as needed. + runs { + client { + workingDirectory project.file('run') + + // Recommended logging data for a userdev environment + // The markers can be added/remove as needed separated by commas. + // "SCAN": For mods scan. + // "REGISTRIES": For firing of registry events. + // "REGISTRYDUMP": For getting the contents of all registries. + property 'forge.logging.markers', 'REGISTRIES' + + // Recommended logging level for the console + // You can set various levels here. + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels + property 'forge.logging.console.level', 'debug' + + // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. + property 'forge.enabledGameTestNamespaces', 'buildcraftcore,buildcraftenergy,buildcraftfactory,buildcraftlib' + + // Mixin + arg "-mixin.config=mixins.buildcraft.json" + + mods { + buildcraftcore { + source sourceSets.main + } + } + } -repositories { - maven { name="JEI"; url="http://dvs1.progwml6.com/files/maven" } - maven { name="TOP"; url="http://maven.tterrag.com/" } - maven { name="hwyla"; url="http://tehnut.info/maven" } - // The One probe depends on the RF API -- we don't use it ourselves, nor will we ever add compat for it... - maven { name="cofh"; url="http://maven.covers1624.net" } - maven { name="forestry"; url = "http://maven.ic2.player.to/" } - maven { name "CraftTweaker"; url "http://maven.blamejared.com/" } -} + server { + workingDirectory project.file('run_server') -dependencies { - // JEI Stuff - // Versions from http://minecraft.curseforge.com/projects/just-enough-items-jei/files - compileOnly "mezz.jei:jei_${config.mc_version}:${config.jei_version}:api" - runtime "mezz.jei:jei_${config.mc_version}:${config.jei_version}" + property 'forge.logging.markers', 'REGISTRIES' - // The One Probe Stuff - compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${config.top_version}:api" - runtime "mcjty.theoneprobe:TheOneProbe-1.12:${config.top_version}" - // The One Probe depends on the RF api for some odd reason... we never intend to add support for RF ourselves though. + property 'forge.logging.console.level', 'debug' - // HWYLA - compileOnly "mcp.mobius.waila:Hwyla:${config.hwyla_version}:api" - runtime "mcp.mobius.waila:Hwyla:${config.hwyla_version}" + // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. + property 'forge.enabledGameTestNamespaces', 'buildcraftcore' - // Forestry - deobfCompile "net.sengir.forestry:forestry_${config.mc_version}:${config.forestry_version}" + // Mixin + arg "-mixin.config=mixins.buildcraft.json" - deobfCompile "net.industrial-craft:industrialcraft-2:${config.ic2_version}" + mods { + buildcraftcore { + source sourceSets.main + } + } + } - // CraftTweaker - deobfCompile "CraftTweaker2:CraftTweaker2-API:${config.crafttweaker_version}" - deobfCompile "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-${config.crafttweaker_version}" -} + // This run config launches GameTestServer and runs all registered gametests, then exits. + // By default, the server will crash when no gametests are provided. + // The gametest system is also enabled by default for other run configs under the /test command. + gameTestServer { + workingDirectory project.file('run') + + // Recommended logging data for a userdev environment + // The markers can be added/remove as needed separated by commas. + // "SCAN": For mods scan. + // "REGISTRIES": For firing of registry events. + // "REGISTRYDUMP": For getting the contents of all registries. + property 'forge.logging.markers', 'REGISTRIES' + + // Recommended logging level for the console + // You can set various levels here. + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels + property 'forge.logging.console.level', 'debug' + + // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. + property 'forge.enabledGameTestNamespaces', 'buildcraftcore' + + mods { + buildcraftcore { + source sourceSets.main + } + } + } -minecraft { - version = config.mc_version + "-" + config.forge_version - runDir = "run" - - // the mappings can be changed at any time, and must be in the following format. - // snapshot_YYYYMMDD snapshot are built nightly. - // stable_# stables are built at the discretion of the MCP team. - // Use non-default mappings at your own risk. they may not allways work. - // simply re-run your setup task after changing the mappings to update your workspace. - mappings = config.mappings_version - - useDepAts = true - - def separate = Boolean.getBoolean("build_compat_only") - if (separate) { - project.version = config.compat_version - } else { - project.version = config.mod_version; + data { + workingDirectory project.file('run') + + property 'forge.logging.markers', 'REGISTRIES' + + property 'forge.logging.console.level', 'debug' + +// property 'forge.enabledGameTestNamespaces', 'buildcraftcore,buildcraftenergy,buildcraftfactory,buildcraftlib' + + // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. +// args '--mod', 'buildcraftcore', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') + args '--mod', 'buildcraftcore', '--all', '--output', file('buildcraft_resources_generated/'), '--existing', file('buildcraft_resources/') + + + mods { + buildcraftcore { + source sourceSets.main + } + } + } } +} - def addVersionDetails = !Boolean.getBoolean("release") - - // Git versioning stuffs - if (grgit != null) { - def repo = grgit.open(dir: project.rootDir) - replace "\${git_commit_hash}", repo.head().id - replace "\${git_commit_msg}", repo.head().fullMessage.replace("\"", "\\\\\\\"").split("\n")[0] - replace "\${git_commit_author}", repo.head().author.name - replace "\${git_branch}", repo.branch.current().getName() - if (addVersionDetails) { - project.version += "-" + repo.head().id.toString().substring(0, 12) +// Include resources generated by data generators. +sourceSets { + main { + java { + srcDir "common" + srcDir "BuildCraft/BuildCraftAPI/api" + srcDir "BuildCraft/common" + srcDir "BuildCraft/sub_projects/expression/src/main/java" + srcDir "BuildCraft/sub_projects/expression/src/autogen/java" } - } else { - if (addVersionDetails) { - project.version += "-SNAPSHOT" + resources { + srcDir "resources" + srcDir "BuildCraft/buildcraft_resources" + srcDir 'BuildCraft/buildcraft_resources_generated' + srcDir "BuildCraft/BuildCraft-Localization" + srcDir "BuildCraft/BuildCraftGuide/guide_resources" + exclude "**/.md" // exclude readme from localization repo + exclude "pack.png" // exclude from the guide repo + // Calen: we should not exclude the pack.mcmeta file in buildcraft_resources, or all the resources will be lost +// exclude "pack.mcmeta" // exclude from the guide repo } } + api { + java { + srcDir "BuildCraft/BuildCraftAPI/api" + srcDir "BuildCraft/common" + srcDir "BuildCraft/sub_projects/expression/src/main/java" + srcDir "BuildCraft/sub_projects/expression/src/autogen/java" + } + resources { + srcDir "BuildCraft/buildcraft_resources" + srcDir "BuildCraft/BuildCraftGuide/guide_resources" + exclude "pack.png" // exclude from the guide repo + // exclude "pack.mcmeta" // exclude from the guide repo + } + } +} - // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. - - // replacing stuff in the source - replace "\$version", project.version - replace "\${mcversion}", version - // Replace @Mod.acceptedMinecraftVersions specially as it has to be a valid version in a dev environment :/ - replace "(gradle_replace_mcversion,)", "[" + version + "]" - replace "(gradle_replace_forgeversion,)", "[" + config.forge_version + ",)" - replace "\$bc_version", config.mod_version - useDepAts = true +task setupSubProjects(dependsOn: "sub_projects:expression:generateSources") { + // Just an inter-dependency task } compileJava { @@ -153,155 +232,256 @@ javadoc { options.setEncoding("UTF-8") } -task setupSubProjects(dependsOn: "BuildCraft:sub_projects:expression:generateSources") { - // Just an inter-dependency task +def unzippedSourceJar = new File("$projectDir/build/processing/tasks/unzipped_src_jar/unzip") +def libsDir = new File(System.getenv("LIBS_DIR") ?: "$projectDir/build/libs/", version) +def modulesDir = new File(libsDir, "modules") +def modulesDirSrc = new File(modulesDir, "src") + +//// forge (or gradle?) creates a special sourceJar which has been processed +//// This task unzips that created jar, so that partial source jars can be created. +//task unzipSourceJar(type: Copy, dependsOn: sourceJar) { +// from (zipTree(sourceJar.archivePath)) { +// include "**" +// } +// into unzippedSourceJar +//} + +// add api classes to javadoc +javadoc { + source += sourceSets.api.allSource +} + +// add a javadoc jar +task javadocJar(type: Jar, dependsOn: javadoc) { + destinationDir = libsDir + appendix = "main" + classifier = 'javadoc' + from '$projectDir/build/docs/javadoc' } -eclipseClasspath.dependsOn setupSubProjects -ideaModule.dependsOn setupSubProjects -compileApiJava.dependsOn setupSubProjects +// because the normal output has been made to be obfuscated +task deobfJar(type: Jar) { + destinationDir = libsDir + appendix = "main" + from sourceSets.main.output + from sourceSets.api.output + classifier = 'dev' +} -// configure the source folders -sourceSets { - api { - java { - srcDir "BuildCraft/BuildCraftAPI/api" - srcDir "BuildCraft/common" - srcDir "BuildCraft/sub_projects/expression/src/main/java" - srcDir "BuildCraft/sub_projects/expression/src/autogen/java" - } - resources { - srcDir "BuildCraft/buildcraft_resources" - srcDir "BuildCraft/BuildCraftGuide/guide_resources" - exclude "pack.png" // exclude from the guide repo - exclude "pack.mcmeta" // exclude from the guide repo +//task apiSrcJar(type: Jar, dependsOn: [build, unzipSourceJar]) { +// destinationDir = modulesDirSrc +// appendix = "api" +// classifier = 'sources' +// from sourceSets.api.allSource +//} +// specify artifacts to be uploaded +//artifacts { +// // the default jar is already here by default +// archives sourceJar +// archives javadocJar +// +// // Modules +// archives apiJar +// archives libJar +// archives coreJar +// archives buildersJar +// archives energyJar +// archives factoryJar +// archives siliconJar +// archives transportJar +// archives roboticsJar +// archives mainJar +//} + +//eclipseClasspath.dependsOn setupSubProjects +//ideaModule.dependsOn setupSubProjects +//compileJava.dependsOn setupSubProjects + +//runClient.jvmArgs += "-Dbuildcraft.dev=true" +//runData.jvmArgs += "-Dbuildcraft.dev=true" +//runServer.jvmArgs += "-Dbuildcraft.dev=true" + +//// Add API dir to the IDEA module +//idea.module.sourceDirs += sourceSets.api.java.srcDirs + +repositories { + // Put repositories for dependencies here + // ForgeGradle automatically adds the Forge maven and Maven Central for you + + // If you have mod jar dependencies in ./libs, you can declare them as a repository like so: + flatDir { + dir 'libs' + } + +// maven { url = 'https://mvnrepository.com/artifact/net.sf.trove4j/trove4j' } + + maven { + name 'prog' + url 'https://dvs1.progwml6.com/files/maven' + content { + includeGroup 'mezz.jei' } } - main { - java { - srcDir "common" + maven { + name 'CurseMaven' + url 'https://www.cursemaven.com' + content { + includeGroup 'curse.maven' } - resources { - srcDir "resources" + } + // JEI + maven { + // location of the maven that hosts JEI files before January 2023 + name = "Progwml6's maven" + url = "https://dvs1.progwml6.com/files/maven/" + } + maven { + // location of the maven that hosts JEI files since January 2023 + name = "Jared's maven" + url = "https://maven.blamejared.com/" + } + maven { + // location of a maven mirror for JEI files, as a fallback + name = "ModMaven" + url = "https://modmaven.dev" + } + // crafttweaker + maven { + url = 'https://maven.blamejared.com' + name = 'BlameJared Maven' + } + // TOP + maven { + url "https://maven.k-4u.nl/" + content { + includeGroup "mcjty" } } } -// Obfuscated Jar location -ext.jarFile = zipTree(jar.archivePath) +//processResources { +// // replace stuff in mcmod.info, nothing else +// from(sourceSets.main.resources.srcDirs) { +//// include 'mcmod.info' +// include 'mods.toml' +// +// // replace version and mcversion +// // ${version} and ${mcversion} are the exact strings being replaced +//// expand 'version': project.version, 'mcversion': project.minecraft.version, 'modid': config.modid +// expand 'version': project.version, 'mcversion': config.mc_version, 'modid': config.modid +// } +// +// // copy everything else, that's not the mcmod.info +// from(sourceSets.main.resources.srcDirs) { +// exclude 'mods.toml' +// exclude 'pack.mcmeta' +// exclude 'pack.png' +// } +//} + +// Mixin +mixin { + add sourceSets.main, "refmap.buildcraft.json" + config 'mixins.buildcraft.json' + mixin.env.remapRefMap = true + debug = true + debug.verbose = true + debug.export = true +} -processResources { - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' +dependencies { + // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed + // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied. + // The userdev artifact is a special name and will get all sorts of transformations applied to it. - // replace version and mcversion - // ${version} and ${mcversion} are the exact strings being replaced - expand 'version': project.version, 'mcversion': project.minecraft.version, 'modid': config.modid - } +// minecraft 'net.minecraftforge:forge:1.18.2-40.1.0' + minecraft 'net.minecraftforge:forge:1.18.2-40.2.14' - // copy everything else, that's not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' - exclude 'pack.mcmeta' - exclude 'pack.png' - } -} + // Examples using mod jars from ./libs -def createAllModInfo() { - return new File("$projectDir/build/processing/compat-all/mcmod.info") -} + compileOnly fg.deobf("javax.vecmath:vecmath:1.5.2") + runtimeOnly fg.deobf("javax.vecmath:vecmath:1.5.2") + compileOnly fg.deobf("net.sf.trove4j:trove4j:3.0.3") + runtimeOnly fg.deobf("net.sf.trove4j:trove4j:3.0.3") -task writeAllModInfo() { - outputs.upToDateWhen { false } - doLast { - File temp = createAllModInfo() - temp.parentFile.mkdirs() - if (temp.exists()) - temp.delete() - temp.createNewFile() - def elements = []; - for (int i = 0; i < mainModInfo.size(); i++) { - elements += mainModInfo[i]; - } - elements += compatModInfo[0]; - String prettyPrinted = groovy.json.JsonOutput.prettyPrint(groovy.json.JsonOutput.toJson(elements)) - prettyPrinted = prettyPrinted.replace("\$version", project.version) - prettyPrinted = prettyPrinted.replace("\${mcversion}", project.minecraft.version) - temp.write(prettyPrinted) - return temp - } -} + compileOnly fg.deobf("mezz.jei:jei-" + config.mc_version + ":" + config.jei_version + ":api") + runtimeOnly fg.deobf("mezz.jei:jei-" + config.mc_version + ":" + config.jei_version + ":api") -def unzippedSourceJar = new File("$projectDir/build/processing/tasks/unzipped_src_jar/unzip") -def libsDir = new File(System.getenv("LIBS_DIR") ?: "build/libs/", project.version) -def modulesDir = new File(libsDir, "modules") + compileOnly fg.deobf("curse.maven:jade-324717:" + config.jade_id) + runtimeOnly fg.deobf("curse.maven:jade-324717:" + config.jade_id) -// forge (or gradle?) creates a special sourceJar which has been processed -// This task unzips that created jar, so that partial source jars can be created. -task unzipSourceJar(type: Copy, dependsOn: sourceJar) { - from (zipTree(sourceJar.archivePath)) { - include "**" - } - into unzippedSourceJar -} +// compileOnly fg.deobf("blank:ae2-${mc_version}:11.7.6") +// runtimeOnly fg.deobf("blank:ae2-${mc_version}:11.7.6") + + compileOnly(fg.deobf("com.blamejared.crafttweaker:CraftTweaker-forge-" + config.mc_version + ":" + config.crafttweaker_version)) + runtimeOnly(fg.deobf("com.blamejared.crafttweaker:CraftTweaker-forge-" + config.mc_version + ":" + config.crafttweaker_version)) -task compatJar(type: Jar, dependsOn:reobfJar) { - destinationDir = modulesDir - appendix = "compat" - version = project.version + compileOnly(fg.deobf("curse.maven:the-one-probe-245211:3965688")) + runtimeOnly(fg.deobf("curse.maven:the-one-probe-245211:3965688")) - from(project.ext.jarFile) { - includes.addAll("**") + jarJar(group: 'net.sf.trove4j', name: 'trove4j', version: '[3.0.3,)') { + jarJar.pin(it, '3.0.3') + } + jarJar(group: 'javax.vecmath', name: 'vecmath', version: '[1.5.2,)') { + jarJar.pin(it, '1.5.2') } -} -task allJar(type: Jar, dependsOn: [reobfJar, writeAllModInfo]) { - destinationDir = libsDir - appendix = "all" - version = project.version + // Testing + testImplementation "junit:junit:4.12" + testImplementation 'org.hamcrest:hamcrest:2.2' +// compileOnly "junit:junit:4.12" - from(createAllModInfo().parentFile) - from(project.ext.jarFile) { - includes.addAll("**") - exclude("mcmod.info") - } + annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' + // For more info... + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html + // http://www.gradle.org/docs/current/userguide/dependency_management.html } -task allSrcJar(type: Jar, dependsOn:[reobfJar, writeAllModInfo, unzipSourceJar]) { - destinationDir = libsDir - appendix = "all" - classifier = "sources" - - from(createAllModInfo().parentFile) - from(unzippedSourceJar) { - includes.add("**") - exclude("mcmod.info") +// Example for how to get properties into the manifest for reading at runtime. +jar { + manifest { + attributes([ + "Specification-Title" : "BuildCraft", + "Specification-Vendor" : "BuildCraft Team", + "Specification-Version" : project.version, + "Implementation-Title" : project.name, + "Implementation-Version" : project.jar.archiveVersion, + "Implementation-Vendor" : "BuildCraft Team", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), + "MixinConfigs" : "mixins.buildcraft.json" + ]) } + include '**/**/**/libs/*' } -build.dependsOn compatJar, allJar, allSrcJar +// Example configuration to allow publishing using the maven-publish plugin +// This is the preferred method to reobfuscate your jar file +jar.finalizedBy('reobfJar') +// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing +// publish.dependsOn('reobfJar') publishing { + publications { + mavenJava(MavenPublication) { + artifact jar + } + } repositories { maven { - url System.getenv("MAVEN_DIR") ?: "$projectDir/build/maven" + url "file://${project.projectDir}/mcmodsrepo" } } - publications { - pub_allJar(MavenPublication) { - groupId "com.mod-buildcraft" - artifactId "buildcraft-all" - version project.version +} - artifact allJar - } - pub_apiSrcJar(MavenPublication) { - groupId "com.mod-buildcraft" - artifactId "buildcraft-all" - version project.version +tasks.withType(JavaCompile).configureEach { + options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation +} - artifact allSrcJar - } - } +jar.enabled = true + +// enable Jar-in-Jar +jarJar.enable() + +tasks.named('jarJar') { + // ... } diff --git a/build.properties b/build.properties index 66c247b..45feca5 100644 --- a/build.properties +++ b/build.properties @@ -1,8 +1,15 @@ compat_version=7.99.15 -jei_version=4.8.5.138 -top_version=1.12-1.4.19-11 -hwyla_version=1.8.22-B37_1.12 +#jei_version=4.8.5.138 +jei_version=9.7.1.255 +#top_version=1.12-1.4.19-11 +top_version=1.18-5.1.2 +#hwyla_version=1.8.22-B37_1.12 + +jade_api_id=3803228 +jade_id=3803226 + forestry_version=5.7.0.236 -crafttweaker_version=4.1.9.491 +#crafttweaker_version=4.1.9.491 +crafttweaker_version=9.1.211 ic2_version=2.8.221-ex112 diff --git a/common/buildcraft/compat/BCCompat.java b/common/buildcraft/compat/BCCompat.java index 72fdbaa..b3139e1 100644 --- a/common/buildcraft/compat/BCCompat.java +++ b/common/buildcraft/compat/BCCompat.java @@ -1,84 +1,78 @@ -/* - * Copyright (c) 2020 SpaceToad and the BuildCraft team - * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not - * distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/ - */ - package buildcraft.compat; -import java.util.HashMap; -import java.util.Map; - -import net.minecraftforge.common.config.Property; -import net.minecraftforge.fml.common.Mod; -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.network.NetworkRegistry; - import buildcraft.api.core.BCLog; - import buildcraft.compat.module.crafttweaker.CompatModuleCraftTweaker; -import buildcraft.compat.module.forestry.CompatModuleForestry; import buildcraft.compat.module.ic2.CompatModuleIndustrialCraft2; import buildcraft.compat.module.theoneprobe.CompatModuleTheOneProbe; -import buildcraft.compat.network.CompatGui; import buildcraft.core.BCCoreConfig; -//@formatter:off -@Mod( - modid = BCCompat.MODID, - name = "BuildCraft Compat", - version = BCCompat.VERSION, - updateJSON = "https://mod-buildcraft.com/version/versions-compat.json", - acceptedMinecraftVersions = "(gradle_replace_mcversion,)", - dependencies = BCCompat.DEPENDENCIES -) -//@formatter:on -public class BCCompat { +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.fml.event.lifecycle.FMLConstructModEvent; +import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; +import net.minecraftforge_1_12_2.common.config.Property; - static final String DEPENDENCIES = "required-after:forge@(gradle_replace_forgeversion,)"// - + ";required-after:buildcraftcore@[$bc_version,)"// - + ";after:buildcrafttransport"// - + ";after:buildcraftbuilders"// - + ";after:buildcraftsilicon"// - + ";after:theoneprobe"// - + ";after:forestry"// - + ";after:crafttweaker"// - + ";after:ic2"// - ; +import java.util.HashMap; +import java.util.Map; - public static final String MODID = "buildcraftcompat"; +//@Mod( +// modid = "buildcraftcompat", +// name = "BuildCraft Compat", +// version = "7.99.24.8", +// updateJSON = "https://mod-buildcraft.com/version/versions-compat.json", +// acceptedMinecraftVersions = "[1.12.2]", +// dependencies = "required-after:forge@[14.23.0.2544,);required-after:buildcraftcore@[7.99.24.8,);after:buildcrafttransport;after:buildcraftbuilders;after:buildcraftsilicon;after:theoneprobe;after:forestry;after:crafttweaker;after:ic2" +//) +@Mod(BCCompat.MOD_ID) +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) +public class BCCompat { + static final String DEPENDENCIES = "required-after:forge@(gradle_replace_forgeversion,)"// + + ";required-after:buildcraftcore@[$bc_version,)"// + + ";after:buildcrafttransport"// + + ";after:buildcraftbuilders"// + + ";after:buildcraftsilicon"// + + ";after:theoneprobe"// + + ";after:forestry"// + + ";after:crafttweaker"// + + ";after:ic2"// + ; + public static final String MOD_ID = "buildcraftcompat"; public static final String VERSION = "$version"; public static final String GIT_BRANCH = "${git_branch}"; public static final String GIT_COMMIT_HASH = "${git_commit_hash}"; public static final String GIT_COMMIT_MSG = "${git_commit_msg}"; public static final String GIT_COMMIT_AUTHOR = "${git_commit_author}"; - @Mod.Instance(MODID) + // @Instance(MOD_ID) public static BCCompat instance; - private static final Map modules = new HashMap<>(); - private static void offerAndPreInitModule(final CompatModuleBase module) { + public BCCompat() { + instance = this; + } + + + private static void offerAndPreInitModule(CompatModuleBase module) { String cModId = module.compatModId(); if (module.canLoad()) { - Property prop = BCCoreConfig.config.get("modules", cModId, true); + Property prop = BCCoreConfig.getConfig(true).get("modules", cModId, true); if (prop.getBoolean(true)) { modules.put(cModId, module); BCLog.logger.info("[compat] + " + cModId); module.preInit(); - } else { + } + else { BCLog.logger.info("[compat] x " + cModId + " (It has been disabled in the config)"); } - } else { + } + else { BCLog.logger.info("[compat] x " + cModId + " (It cannot load)"); } } - @Mod.EventHandler - public static void preInit(final FMLPreInitializationEvent evt) { - + @SubscribeEvent + public static void preInit(FMLConstructModEvent evt) { BCLog.logger.info(""); BCLog.logger.info("Starting BuildCraftCompat " + VERSION); BCLog.logger.info("Copyright (c) the BuildCraft team, 2011-2017"); @@ -94,54 +88,27 @@ public static void preInit(final FMLPreInitializationEvent evt) { BCLog.logger.info("[compat] Module list:"); // List of all modules - offerAndPreInitModule(new CompatModuleForestry()); + // TODO Calen Forestry? +// offerAndPreInitModule(new CompatModuleForestry()); offerAndPreInitModule(new CompatModuleTheOneProbe()); offerAndPreInitModule(new CompatModuleCraftTweaker()); offerAndPreInitModule(new CompatModuleIndustrialCraft2()); // End of module list } - @Mod.EventHandler - public static void init(final FMLInitializationEvent evt) { - NetworkRegistry.INSTANCE.registerGuiHandler(instance, CompatGui.guiHandlerProxy); - - // compatChannelHandler = new ChannelHandler(); - // MinecraftForge.EVENT_BUS.register(this); - - // compatChannelHandler.registerPacketType(PacketGenomeFilterChange.class); - // compatChannelHandler.registerPacketType(PacketTypeFilterChange.class); - // compatChannelHandler.registerPacketType(PacketRequestFilterSet.class); - - for (final CompatModuleBase m : modules.values()) { + @SubscribeEvent + public static void init(FMLCommonSetupEvent evt) { + // TODO Calen compat GUI??? +// NetworkRegistry.INSTANCE.registerGuiHandler(instance, CompatGui.guiHandlerProxy); + for (CompatModuleBase m : modules.values()) { m.init(); } } - @Mod.EventHandler - public static void postInit(final FMLPostInitializationEvent evt) { - for (final CompatModuleBase m : modules.values()) { + @SubscribeEvent + public static void postInit(FMLLoadCompleteEvent evt) { + for (CompatModuleBase m : modules.values()) { m.postInit(); } } - - // @Mod.EventHandler - // public void missingMapping(FMLMissingMappingsEvent event) { - // CompatModuleForestry.missingMapping(event); - // } - - // @SubscribeEvent - // @SideOnly(Side.CLIENT) - // public void handleTextureRemap(TextureStitchEvent.Pre event) { - // if (event.map.getTextureType() == 1) { - // TextureManager.getInstance().initIcons(event.map); - // } - // } - - // public static boolean isLoaded(String module) { - // return moduleNames.contains(module); - // } - - // public static boolean hasModule(final String module) { - // return BuildCraftCompat.moduleNames.contains(module); - // } } diff --git a/common/buildcraft/compat/CompatModuleBase.java b/common/buildcraft/compat/CompatModuleBase.java index 483f782..0238252 100644 --- a/common/buildcraft/compat/CompatModuleBase.java +++ b/common/buildcraft/compat/CompatModuleBase.java @@ -1,10 +1,12 @@ package buildcraft.compat; -import net.minecraftforge.fml.common.Loader; + +import net.minecraftforge.fml.ModList; public abstract class CompatModuleBase { public boolean canLoad() { - return Loader.isModLoaded(this.compatModId()); +// return Loader.isModLoaded(this.compatModId()); + return ModList.get().isLoaded(this.compatModId()); } public abstract String compatModId(); diff --git a/common/buildcraft/compat/CompatUtils.java b/common/buildcraft/compat/CompatUtils.java index 876fd34..4b74840 100644 --- a/common/buildcraft/compat/CompatUtils.java +++ b/common/buildcraft/compat/CompatUtils.java @@ -1,29 +1,30 @@ package buildcraft.compat; -import java.util.List; - +import buildcraft.compat.network.IGuiCreator; +import buildcraft.lib.tile.item.ItemHandlerSimple; import com.google.common.collect.Lists; - -import net.minecraft.item.ItemStack; - +import net.minecraft.world.item.ItemStack; import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.CapabilityManager; +import net.minecraftforge.common.capabilities.CapabilityToken; +import net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; -import buildcraft.api.core.CapabilitiesHelper; - -import buildcraft.lib.tile.item.ItemHandlerSimple; - -import buildcraft.compat.network.IGuiCreator; +import java.util.List; +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = BCCompat.MOD_ID) public class CompatUtils { + // public static final Capability CAP_GUI_CREATOR = CapabilitiesHelper.registerCapability(IGuiCreator.class); +// public static final Capability CAP_GUI_CREATOR = CapabilitiesHelper.registerCapability(IGuiCreator.class); + public static final Capability CAP_GUI_CREATOR = CapabilityManager.get(new CapabilityToken<>() { + }); - public static final Capability CAP_GUI_CREATOR = - CapabilitiesHelper.registerCapability(IGuiCreator.class); - - private CompatUtils() {} + private CompatUtils() { + } public static List compactInventory(ItemHandlerSimple inventory) { List stacks = Lists.newArrayList(); - for (int slot = 0; slot < inventory.getSlots(); slot++) { ItemStack stack = inventory.getStackInSlot(slot); if (stack.isEmpty()) { @@ -32,7 +33,7 @@ public static List compactInventory(ItemHandlerSimple inventory) { boolean handled = false; for (ItemStack existing : stacks) { - if (existing.isItemEqual(stack)) { + if (existing.sameItem(stack)) { existing.grow(stack.getCount()); handled = true; break; @@ -45,4 +46,10 @@ public static List compactInventory(ItemHandlerSimple inventory) { return stacks; } + + // Calen + @SubscribeEvent + public static void registerCapability(RegisterCapabilitiesEvent event) { + event.register(IGuiCreator.class); + } } diff --git a/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java b/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java index a06e22c..298c6fb 100644 --- a/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java +++ b/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java @@ -1,105 +1,175 @@ package buildcraft.compat.module.crafttweaker; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.ImmutableSet.Builder; - -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.Ingredient; -import net.minecraft.util.ResourceLocation; - import buildcraft.api.mj.MjAPI; +import buildcraft.api.recipes.AssemblyRecipe; import buildcraft.api.recipes.AssemblyRecipeBasic; import buildcraft.api.recipes.IngredientStack; - import buildcraft.lib.recipe.AssemblyRecipeRegistry; - -import crafttweaker.CraftTweakerAPI; -import crafttweaker.IAction; -import crafttweaker.annotations.ModOnly; -import crafttweaker.api.item.IIngredient; -import crafttweaker.api.item.IItemStack; -import crafttweaker.api.minecraft.CraftTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -@ZenClass("mods.buildcraft.AssemblyTable") -@ModOnly("buildcraftsilicon") -public class AssemblyTable { +import com.blamejared.crafttweaker.api.CraftTweakerAPI; +import com.blamejared.crafttweaker.api.action.base.IAction; +import com.blamejared.crafttweaker.api.action.recipe.ActionAddRecipe; +import com.blamejared.crafttweaker.api.action.recipe.ActionRecipeBase; +import com.blamejared.crafttweaker.api.action.recipe.ActionRemoveRecipeByName; +import com.blamejared.crafttweaker.api.annotation.ZenRegister; +import com.blamejared.crafttweaker.api.ingredient.IIngredient; +import com.blamejared.crafttweaker.api.ingredient.type.IIngredientList; +import com.blamejared.crafttweaker.api.item.IItemStack; +import com.blamejared.crafttweaker.api.recipe.handler.IRecipeHandler; +import com.blamejared.crafttweaker.api.recipe.manager.base.IRecipeManager; +import com.blamejared.crafttweaker.api.util.ItemStackUtil; +import com.blamejared.crafttweaker.api.util.StringUtil; +import com.google.common.collect.ImmutableSet; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.RecipeType; +import org.openzen.zencode.java.ZenCodeGlobals; +import org.openzen.zencode.java.ZenCodeType; + +//@ZenClass("mods.buildcraft.AssemblyTable") +//@ModOnly("buildcraftsilicon") +@ZenRegister +@ZenCodeType.Name("mods.buildcraft.AssemblyTable") +@IRecipeHandler.For(AssemblyRecipe.class) +//public class AssemblyTable +public enum AssemblyTable implements IRecipeManager, IRecipeHandler +{ + @ZenCodeGlobals.Global("assemblyTable") + INSTANCE; private static int ids; - @ZenMethod - public static void addRecipe(IItemStack output, int power, IIngredient[] ingredients) { + // @ZenMethod + @ZenCodeType.Method +// public static void addRecipe(IItemStack output, int power, IIngredient[] ingredients) + public void addRecipe(IItemStack output, int power, IIngredient[] ingredients) + { addRecipe0("auto_" + ids++, output, power, ingredients); } - @ZenMethod - public static void addRecipe(String name, IItemStack output, int power, IIngredient[] ingredients) { + // @ZenMethod + @ZenCodeType.Method +// public static void addRecipe(String name, IItemStack output, int power, IIngredient[] ingredients) + public void addRecipe(String name, IItemStack output, int power, IIngredient[] ingredients) + { addRecipe0("custom/" + name, output, power, ingredients); } - private static void addRecipe0(String name, IItemStack output, int power, IIngredient[] ingredients) { - CraftTweakerAPI.apply(new AddRecipeAction(name, output, power, ingredients)); + // private static void addRecipe0(String name, IItemStack output, int power, IIngredient[] ingredients) + private void addRecipe0(String name, IItemStack output, int power, IIngredient[] ingredients) + { +// CraftTweakerAPI.apply(new AddRecipeAction(name, output, power, ingredients)); + CraftTweakerAPI.apply(AddRecipeAction.create(this, name, output, power, ingredients)); } - @ZenMethod - public static void removeByName(String name) { - CraftTweakerAPI.apply(new RemoveRecipeByNameAction(new ResourceLocation(name))); + // @ZenMethod + @ZenCodeType.Method +// public static void removeByName(String name) + public void removeByName(String name) + { +// CraftTweakerAPI.apply(new RemoveRecipeByNameAction(new ResourceLocation(name))); + CraftTweakerAPI.apply(new RemoveRecipeByNameAction(this, new ResourceLocation(name))); } - // ###################### - // ### Action classes ### - // ###################### + @Override + public RecipeType getRecipeType() + { + return AssemblyRecipe.TYPE; + } - private static class AddRecipeAction implements IAction { + @Override + public String dumpToCommandString(IRecipeManager manager, AssemblyRecipe recipe) + { + return String.format( + "assemblyTable.addRecipe(%s, %s, %s);", + StringUtil.quoteAndEscape(recipe.getId()), + ItemStackUtil.getCommandString(recipe.getOutputPreviews().stream().toList().get(0)), + new IIngredientList(recipe.getRequiredIngredientStacksForSerialize().stream().map(i -> IIngredient.fromIngredient(i.ingredient)).toArray(IIngredient[]::new)).getCommandString() + ); + } - private final ItemStack output; + // private static class RemoveRecipeByNameAction implements IAction + private static class RemoveRecipeByNameAction extends ActionRemoveRecipeByName + { private final ResourceLocation name; - private final long requiredMj; - private final ImmutableSet requiredStacks; - - public AddRecipeAction(String name, IItemStack output, int power, IIngredient[] ingredients) { - this.output = CraftTweakerMC.getItemStack(output); - - Builder stacks = ImmutableSet.builder(); - for (int i = 0; i < ingredients.length; i++) { - IIngredient ctIng = ingredients[i]; - Ingredient ingredient = CraftTweakerMC.getIngredient(ctIng); - stacks.add(new IngredientStack(ingredient, Math.max(1, ctIng.getAmount()))); - } - requiredStacks = stacks.build(); - this.requiredMj = power * MjAPI.MJ; - this.name = new ResourceLocation("crafttweaker", name); + // RemoveRecipeByNameAction(ResourceLocation name) + RemoveRecipeByNameAction(IRecipeManager manager, ResourceLocation name) + { + super(manager); + this.name = name; } - @Override - public void apply() { - AssemblyRecipeRegistry.REGISTRY.put(name, - new AssemblyRecipeBasic(name, requiredMj, requiredStacks, output)); + public void apply() + { +// AssemblyRecipeRegistry.REGISTRY.remove(this.name); + getManager().removeByName(this.name.toString()); } - @Override - public String describe() { - return "Adding assembly table recipe for " + output; + public String describe() + { + return "Removing assembly table recipe " + this.name; } } - private static class RemoveRecipeByNameAction implements IAction { - private final ResourceLocation name; - - RemoveRecipeByNameAction(ResourceLocation name) { - this.name = name; + // private static class AddRecipeAction implements IAction + private static class AddRecipeAction extends ActionAddRecipe + { +// private final ItemStack output; +// private final ResourceLocation name; +// private final long requiredMj; +// private final ImmutableSet requiredStacks; + + // public AddRecipeAction(IRecipeManager manager, String name, IItemStack output, int power, IIngredient[] ingredients) + private AddRecipeAction(IRecipeManager manager, AssemblyRecipe recipe) + { + super(manager, recipe); +// this.output = CraftTweakerMC.getItemStack(output); +// ImmutableSet.Builder stacks = ImmutableSet.builder(); +// +// for (int i = 0; i < ingredients.length; ++i) +// { +// IIngredient ctIng = ingredients[i]; +// Ingredient ingredient = CraftTweakerMC.getIngredient(ctIng); +// stacks.add(new IngredientStack(ingredient, Math.max(1, ctIng.getAmount()))); +// } +// +// this.requiredStacks = stacks.build(); +// this.requiredMj = (long) power * MjAPI.MJ; +// this.name = new ResourceLocation("crafttweaker", name); } - @Override - public void apply() { - AssemblyRecipeRegistry.REGISTRY.remove(name); + public static AddRecipeAction create(IRecipeManager manager, String name, IItemStack output, int power, IIngredient[] ingredients) + { +// ItemStack output = CraftTweakerMC.getItemStack(output); + ItemStack _output = output.getImmutableInternal(); + ImmutableSet.Builder stacks = ImmutableSet.builder(); + + for (int i = 0; i < ingredients.length; ++i) + { + IIngredient ctIng = ingredients[i]; +// Ingredient ingredient = CraftTweakerMC.getIngredient(ctIng); + Ingredient ingredient = ctIng.asVanillaIngredient(); +// stacks.add(new IngredientStack(ingredient, Math.max(1, ctIng.getAmount()))); + stacks.add(new IngredientStack(ingredient, Math.max(1, ctIng.asIIngredientWithAmount().getAmount()))); + } + + ImmutableSet requiredStacks = stacks.build(); + long requiredMj = (long) power * MjAPI.MJ; + ResourceLocation _name = new ResourceLocation("crafttweaker", name); + AssemblyRecipeBasic recipe = new AssemblyRecipeBasic(_name, requiredMj, requiredStacks, _output); + return new AddRecipeAction(manager, recipe); } - @Override - public String describe() { - return "Removing assembly table recipe " + name; +// public void apply() +// { +// AssemblyRecipeRegistry.REGISTRY.put(this.name, new AssemblyRecipeBasic(this.name, this.requiredMj, this.requiredStacks, this.output)); +// } + + public String describe() + { +// return "Adding assembly table recipe for " + this.output; + return "Adding assembly table recipe for " + this.recipe.getOutputPreviews().stream().toList().get(0); } } } diff --git a/common/buildcraft/compat/module/crafttweaker/CombustionEngine.java b/common/buildcraft/compat/module/crafttweaker/CombustionEngine.java index f1cb66a..77bb4ce 100644 --- a/common/buildcraft/compat/module/crafttweaker/CombustionEngine.java +++ b/common/buildcraft/compat/module/crafttweaker/CombustionEngine.java @@ -1,153 +1,241 @@ package buildcraft.compat.module.crafttweaker; -import net.minecraftforge.fluids.FluidStack; - -import buildcraft.api.fuels.BuildcraftFuelRegistry; +import buildcraft.api.fuels.IFluidCoolant; +import buildcraft.api.fuels.IFuel; +import buildcraft.api.fuels.IFuelManager; import buildcraft.api.mj.MjAPI; +import buildcraft.api.recipes.AssemblyRecipe; +import buildcraft.lib.fluid.FuelRegistry; +import com.blamejared.crafttweaker.api.CraftTweakerAPI; +import com.blamejared.crafttweaker.api.action.recipe.ActionAddRecipe; +import com.blamejared.crafttweaker.api.annotation.ZenRegister; +import com.blamejared.crafttweaker.api.fluid.IFluidStack; +import com.blamejared.crafttweaker.api.ingredient.IIngredient; +import com.blamejared.crafttweaker.api.ingredient.type.IIngredientList; +import com.blamejared.crafttweaker.api.recipe.handler.IRecipeHandler; +import com.blamejared.crafttweaker.api.recipe.manager.base.IRecipeManager; +import com.blamejared.crafttweaker.api.util.ItemStackUtil; +import com.blamejared.crafttweaker.api.util.StringUtil; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.level.material.EmptyFluid; +import net.minecraftforge.fluids.FluidStack; +import org.openzen.zencode.java.ZenCodeGlobals; +import org.openzen.zencode.java.ZenCodeType; + +//@ZenClass("mods.buildcraft.CombustionEngine") +//@ModOnly("buildcraftenergy") +@ZenRegister +@ZenCodeType.Name("mods.buildcraft.CombustionEngine") +@IRecipeHandler.For(IFuel.class) +//public class CombustionEngine +public enum CombustionEngine implements IRecipeManager, IRecipeHandler +{ + @ZenCodeGlobals.Global("combustionEngine") + INSTANCE; + + private static final double MAX_POWER = 100000.0; + + // @ZenMethod + @ZenCodeType.Method + public void addCleanFuel(String name, IFluidStack liquid, double powerPerTick, int timePerBucket) + { + addCleanFuel0("custom/" + name, liquid, powerPerTick, timePerBucket); + } -import buildcraft.lib.engine.TileEngineBase_BC8; - -import crafttweaker.CraftTweakerAPI; -import crafttweaker.IAction; -import crafttweaker.annotations.ModOnly; -import crafttweaker.api.liquid.ILiquidStack; -import crafttweaker.api.minecraft.CraftTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -@ZenClass("mods.buildcraft.CombustionEngine") -@ModOnly("buildcraftenergy") -public class CombustionEngine { - - private static final double MAX_POWER - = (TileEngineBase_BC8.MAX_HEAT - TileEngineBase_BC8.MIN_HEAT) / TileEngineBase_BC8.HEAT_PER_MJ; - - @ZenMethod - public static void addCleanFuel(ILiquidStack liquid, double powerPerTick, int timePerBucket) { - FluidStack fluid = CraftTweakerMC.getLiquidStack(liquid); - if (fluid == null) { - throw new IllegalArgumentException("Fluid was null!"); - } - if (BuildcraftFuelRegistry.fuel.getFuel(fluid) != null) { + // @ZenMethod +// @ZenCodeType.Method +// public static void addCleanFuel(ILiquidStack liquid, double powerPerTick, int timePerBucket) + private void addCleanFuel0(String name, IFluidStack liquid, double powerPerTick, int timePerBucket) + { +// FluidStack fluid = CraftTweakerMC.getLiquidStack(liquid); + FluidStack fluid = liquid.getImmutableInternal(); +// if (fluid == null) + if (fluid.getFluid() == null || fluid.getFluid() instanceof EmptyFluid) + { + throw new IllegalArgumentException("Fluid was null or empty!"); + } +// else if (BuildcraftFuelRegistry.fuel.getFuel(fluid) != null) + else if (getAllRecipes().stream().anyMatch(r -> r.getFluid().equals(fluid))) + { throw new IllegalArgumentException("The fluid " + fluid + " is already registered as a fuel!"); } - if (BuildcraftFuelRegistry.coolant.getCoolant(fluid) != null) { - throw new IllegalArgumentException( - "The fluid " + fluid - + " is already registered as a coolant - so it won't work very well if you add it as a fuel too!" - ); +// else if (BuildcraftFuelRegistry.coolant.getCoolant(fluid) != null) + else if (Coolant.INSTANCE.getAllRecipes().stream().anyMatch(r -> r instanceof IFluidCoolant fluidCoolant && fluidCoolant.getFluid().equals(fluid))) + { + throw new IllegalArgumentException("The fluid " + fluid + " is already registered as a coolant - so it won't work very well if you add it as a fuel too!"); } - if (powerPerTick <= 0) { + else if (powerPerTick <= 0.0) + { throw new IllegalArgumentException("Power was less than or equal to 0!"); } - if (powerPerTick > MAX_POWER) { - throw new IllegalArgumentException( - "Maximum power is " + MAX_POWER - + ", as any values above this would instantly bring the engine to overheat." - ); + else if (powerPerTick > 100000.0) + { + throw new IllegalArgumentException("Maximum power is 100000.0, as any values above this would instantly bring the engine to overheat."); + } + else + { + long mj = (long) ((double) MjAPI.MJ * powerPerTick); +// CraftTweakerAPI.apply(new AddCleanFuel(fluid, mj, timePerBucket)); + CraftTweakerAPI.apply(AddCleanFuel.create(this, name, fluid, mj, timePerBucket)); } - long mj = (long) (MjAPI.MJ * powerPerTick); - CraftTweakerAPI.apply(new AddCleanFuel(fluid, mj, timePerBucket)); } - @ZenMethod - public static void addDirtyFuel(ILiquidStack lFuel, double powerPerTick, int timePerBucket, ILiquidStack lResidue) { - FluidStack fuel = CraftTweakerMC.getLiquidStack(lFuel); - FluidStack residue = CraftTweakerMC.getLiquidStack(lResidue); - if (fuel.getFluid() == null) { - throw new IllegalArgumentException("Fuel fluid was null!"); - } - if (residue.getFluid() == null) { - throw new IllegalArgumentException("Residue fluid was null!"); - } - if (BuildcraftFuelRegistry.fuel.getFuel(fuel) != null) { + // @ZenMethod + @ZenCodeType.Method + public void addDirtyFuel(String name, IFluidStack lFuel, double powerPerTick, int timePerBucket, IFluidStack lResidue) + { + addDirtyFuel0("custom/" + name, lFuel, powerPerTick, timePerBucket, lResidue); + } + + // @ZenMethod +// @ZenCodeType.Method +// public static void addDirtyFuel(ILiquidStack lFuel, double powerPerTick, int timePerBucket, ILiquidStack lResidue) + private void addDirtyFuel0(String name, IFluidStack lFuel, double powerPerTick, int timePerBucket, IFluidStack lResidue) + { +// FluidStack fuel = CraftTweakerMC.getLiquidStack(lFuel); + FluidStack fuel = lFuel.getImmutableInternal(); +// FluidStack residue = CraftTweakerMC.getLiquidStack(lResidue); + FluidStack residue = lResidue.getImmutableInternal(); +// if (fuel.getFluid() == null) + if (fuel.getFluid() == null || fuel.getFluid() instanceof EmptyFluid) + { +// throw new IllegalArgumentException("Fuel fluid was null!"); + throw new IllegalArgumentException("Fuel fluid was null or empty!"); + } +// else if (residue.getFluid() == null) + else if (residue.getFluid() == null || residue.getFluid() instanceof EmptyFluid) + { +// throw new IllegalArgumentException("Residue fluid was null!"); + throw new IllegalArgumentException("Residue fluid was null or empty!"); + } +// else if (BuildcraftFuelRegistry.fuel.getFuel(fuel) != null) + else if (getAllRecipes().stream().anyMatch(r -> r.getFluid().equals(fuel))) + { throw new IllegalArgumentException("The fluid " + fuel + " is already registered as a fuel!"); } - if (BuildcraftFuelRegistry.coolant.getCoolant(fuel) != null) { - throw new IllegalArgumentException( - "The fluid " + fuel - + " is already registered as a coolant - so it won't work very well if you add it as a fuel too!" - ); +// else if (BuildcraftFuelRegistry.coolant.getCoolant(fuel) != null) + else if (Coolant.INSTANCE.getAllRecipes().stream().anyMatch(r -> r instanceof IFluidCoolant fluidCoolant && fluidCoolant.getFluid().equals(fuel))) + { + throw new IllegalArgumentException("The fluid " + fuel + " is already registered as a coolant - so it won't work very well if you add it as a fuel too!"); } - if (powerPerTick <= 0) { + else if (powerPerTick <= 0.0) + { throw new IllegalArgumentException("Power was less than or equal to 0!"); } - if (powerPerTick > MAX_POWER) { - throw new IllegalArgumentException( - "Maximum power is " + MAX_POWER - + ", as any values above this would instantly bring the engine to overheat." - ); + else if (powerPerTick > 100000.0) + { + throw new IllegalArgumentException("Maximum power is 100000.0, as any values above this would instantly bring the engine to overheat."); + } + else + { + long mj = (long) ((double) MjAPI.MJ * powerPerTick); +// CraftTweakerAPI.apply(new AddDirtyFuel(fuel, mj, timePerBucket, residue)); + CraftTweakerAPI.apply(AddDirtyFuel.create(this, name, fuel, mj, timePerBucket, residue)); } - long mj = (long) (MjAPI.MJ * powerPerTick); - CraftTweakerAPI.apply(new AddDirtyFuel(fuel, mj, timePerBucket, residue)); } - // @ZenMethod - // public static void addLiquidCoolant(FluidStack coolant) { - // - // } - // - // @ZenMethod - // public static void addSolidCoolant(ItemStack stack, FluidStack coolant) { - // - // } - - // ###################### - // ### Action classes ### - // ###################### - - static final class AddCleanFuel implements IAction { - - private final FluidStack fluid; - private final long powerPerTick; - private final int totalBurningTime; + @Override + public RecipeType getRecipeType() + { + return IFuel.TYPE; + } - public AddCleanFuel(FluidStack fluid, long powerPerCycle, int totalBurningTime) { - this.fluid = fluid; - this.powerPerTick = powerPerCycle; - this.totalBurningTime = totalBurningTime; + @Override + public String dumpToCommandString(IRecipeManager manager, IFuel recipe) + { + if (recipe instanceof IFuelManager.IDirtyFuel dirtyFuel) + { + return String.format( + "combustionEngine.addDirtyFuel(%s, %s, %s, %s, %s);", + StringUtil.quoteAndEscape(recipe.getId()), + StringUtil.quoteAndEscape(recipe.getFluid().getFluid().getRegistryName()), + recipe.getPowerPerCycle(), + recipe.getTotalBurningTime(), + StringUtil.quoteAndEscape(dirtyFuel.getResidue().getFluid().getRegistryName()) + ); } - - @Override - public void apply() { - BuildcraftFuelRegistry.fuel.addFuel(fluid, powerPerTick, totalBurningTime); + else + { + return String.format( + "combustionEngine.addCleanFuel(%s, %s, %s, %s);", + StringUtil.quoteAndEscape(recipe.getId()), + StringUtil.quoteAndEscape(recipe.getFluid().getFluid().getRegistryName()), + recipe.getPowerPerCycle(), + recipe.getTotalBurningTime() + ); } + } - @Override - public String describe() { - return "Adding combustion engine fuel " + fluid; + // static final class AddDirtyFuel implements IAction + static final class AddDirtyFuel extends ActionAddRecipe + { +// private final FluidStack fuel; +// private final FluidStack residue; +// private final long powerPerTick; +// private final int totalBurningTime; + + // public AddDirtyFuel(FluidStack fuel, long powerPerCycle, int totalBurningTime, FluidStack residue) + private AddDirtyFuel(IRecipeManager manager, IFuel recipe) + { + super(manager, recipe); +// this.fuel = fuel; +// this.powerPerTick = powerPerCycle; +// this.totalBurningTime = totalBurningTime; +// this.residue = residue; + } + + // Calen + public static AddDirtyFuel create(IRecipeManager manager, String name, FluidStack fuel, long powerPerCycle, int totalBurningTime, FluidStack residue) + { + ResourceLocation _name = new ResourceLocation("crafttweaker", name); + return new AddDirtyFuel(manager, new FuelRegistry.DirtyFuel(_name, fuel, powerPerCycle, totalBurningTime, residue)); + } + +// public void apply() +// { +// BuildcraftFuelRegistry.fuel.addDirtyFuel(this.fuel, this.powerPerTick, this.totalBurningTime, this.residue); +// } + + public String describe() + { +// return "Adding combustion engine fuel " + this.fuel; + return "Adding combustion engine fuel " + this.recipe.getFluid(); } } - static final class AddDirtyFuel implements IAction { + // static final class AddCleanFuel implements IAction + static final class AddCleanFuel extends ActionAddRecipe + { +// private final FluidStack fluid; +// private final long powerPerTick; +// private final int totalBurningTime; - private final FluidStack fuel, residue; - private final long powerPerTick; - private final int totalBurningTime; - - public AddDirtyFuel(FluidStack fuel, long powerPerCycle, int totalBurningTime, FluidStack residue) { - this.fuel = fuel; - this.powerPerTick = powerPerCycle; - this.totalBurningTime = totalBurningTime; - this.residue = residue; + // public AddCleanFuel(FluidStack fluid, long powerPerCycle, int totalBurningTime) + public AddCleanFuel(IRecipeManager manager, IFuel recipe) + { + super(manager, recipe); +// this.fluid = fluid; +// this.powerPerTick = powerPerCycle; +// this.totalBurningTime = totalBurningTime; } - @Override - public void apply() { - BuildcraftFuelRegistry.fuel.addDirtyFuel(fuel, powerPerTick, totalBurningTime, residue); + // Calen + public static AddCleanFuel create(IRecipeManager manager, String name, FluidStack fluid, long powerPerCycle, int totalBurningTime) + { + ResourceLocation _name = new ResourceLocation("crafttweaker", name); + return new AddCleanFuel(manager, new FuelRegistry.Fuel(_name, fluid, powerPerCycle, totalBurningTime)); } - @Override - public String describe() { - return "Adding combustion engine fuel " + fuel; +// public void apply() +// { +// BuildcraftFuelRegistry.fuel.addFuel(this.fluid, this.powerPerTick, this.totalBurningTime); +// } + + public String describe() + { +// return "Adding combustion engine fuel " + this.fluid; + return "Adding combustion engine fuel " + this.recipe.getFluid(); } } - - // static final class AddLiquidCoolant implements IAction { - // - // } - // - // static final class AddSolidCoolant implements IAction { - // - // } } diff --git a/common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java b/common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java index 7e93009..dec9b9f 100644 --- a/common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java +++ b/common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java @@ -1,18 +1,21 @@ package buildcraft.compat.module.crafttweaker; import buildcraft.compat.CompatModuleBase; +import com.blamejared.crafttweaker.api.CraftTweakerAPI; -import crafttweaker.CraftTweakerAPI; +public class CompatModuleCraftTweaker extends CompatModuleBase +{ + // TODO Calen /ct recipes manager -> error + public CompatModuleCraftTweaker() { + } -public class CompatModuleCraftTweaker extends CompatModuleBase { - @Override public String compatModId() { return "crafttweaker"; } - @Override public void preInit() { - CraftTweakerAPI.registerClass(AssemblyTable.class); - CraftTweakerAPI.registerClass(CombustionEngine.class); +// CraftTweakerAPI.registerClass(AssemblyTable.class); +// CraftTweakerAPI.getRegistry()..registerClass(AssemblyTable.class); +// CraftTweakerAPI.registerClass(CombustionEngine.class); } } diff --git a/common/buildcraft/compat/module/crafttweaker/Coolant.java b/common/buildcraft/compat/module/crafttweaker/Coolant.java new file mode 100644 index 0000000..60d8f2f --- /dev/null +++ b/common/buildcraft/compat/module/crafttweaker/Coolant.java @@ -0,0 +1,166 @@ +package buildcraft.compat.module.crafttweaker; + +import buildcraft.api.fuels.ICoolant; +import buildcraft.api.fuels.IFluidCoolant; +import buildcraft.api.fuels.ISolidCoolant; +import buildcraft.lib.fluid.CoolantRegistry; +import com.blamejared.crafttweaker.api.CraftTweakerAPI; +import com.blamejared.crafttweaker.api.action.recipe.ActionAddRecipe; +import com.blamejared.crafttweaker.api.annotation.ZenRegister; +import com.blamejared.crafttweaker.api.fluid.IFluidStack; +import com.blamejared.crafttweaker.api.item.IItemStack; +import com.blamejared.crafttweaker.api.recipe.handler.IRecipeHandler; +import com.blamejared.crafttweaker.api.recipe.manager.base.IRecipeManager; +import com.blamejared.crafttweaker.api.util.ItemStackUtil; +import com.blamejared.crafttweaker.api.util.StringUtil; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.level.material.EmptyFluid; +import net.minecraftforge.fluids.FluidStack; +import org.openzen.zencode.java.ZenCodeGlobals; +import org.openzen.zencode.java.ZenCodeType; + +// Calen +@ZenRegister +@ZenCodeType.Name("mods.buildcraft.Coolant") +@IRecipeHandler.For(ICoolant.class) +public enum Coolant implements IRecipeManager, IRecipeHandler +{ + @ZenCodeGlobals.Global("coolant") + INSTANCE; + + @ZenCodeType.Method + public void addFluidCoolant(String name, IFluidStack liquid, float degreesCoolingPerMB) + { + addFluidCoolant0("custom/" + name, liquid, degreesCoolingPerMB); + } + + private void addFluidCoolant0(String name, IFluidStack liquid, float degreesCoolingPerMB) + { + FluidStack fluid = liquid.getImmutableInternal(); + if (fluid == null) + { + throw new IllegalArgumentException("Fluid was null!"); + } + else if (getAllRecipes().stream().anyMatch(r -> r instanceof IFluidCoolant fluidCoolant && fluidCoolant.getFluid().equals(fluid))) + { + throw new IllegalArgumentException("The fluid " + fluid + " is already registered as a coolant!"); + } + else if (CombustionEngine.INSTANCE.getAllRecipes().stream().anyMatch(r -> r.getFluid().equals(fluid))) + { + throw new IllegalArgumentException("The fluid " + fluid + " is already registered as a fuel - so it won't work very well if you add it as a coolant too!"); + } + else if (degreesCoolingPerMB <= 0.0) + { + throw new IllegalArgumentException("Degrees cooling per MB was less than or equal to 0!"); + } + else + { + CraftTweakerAPI.apply(AddFluidCoolant.create(this, name, fluid, degreesCoolingPerMB)); + } + } + + // @ZenMethod + @ZenCodeType.Method + public void addSolidCoolant(String name, IItemStack item, IFluidStack lFuel, float multiplier) + { + addSolidCoolant0("custom/" + name, item, lFuel, multiplier); + } + + private void addSolidCoolant0(String name, IItemStack itemIn, IFluidStack fluidIn, float multiplier) + { + ItemStack item = itemIn.getImmutableInternal(); + FluidStack fluid = fluidIn.getImmutableInternal(); + if (item.getItem() == Items.AIR) + { + throw new IllegalArgumentException("Coolant item was air!"); + } + else if (fluid.getFluid() == null || fluid.getFluid() instanceof EmptyFluid) + { + throw new IllegalArgumentException("Fluid was null or empty!"); + } + else if (getAllRecipes().stream().anyMatch(r -> r instanceof ISolidCoolant solidCoolant && solidCoolant.getSolid().equals(item))) + { + throw new IllegalArgumentException("The item " + item + " is already registered as a coolant!"); + } + else if (multiplier <= 0.0) + { + throw new IllegalArgumentException("Multiplier was less than or equal to 0!"); + } + else + { + CraftTweakerAPI.apply(AddSolidCoolant.create(this, name, item, fluid, multiplier)); + } + } + + @Override + public RecipeType getRecipeType() + { + return ICoolant.TYPE; + } + + @Override + public String dumpToCommandString(IRecipeManager manager, ICoolant recipe) + { + if (recipe instanceof IFluidCoolant fluidCoolant) + { + return String.format( + "assemblyTable.addFluidCoolant(%s, %s, %s);", + StringUtil.quoteAndEscape(recipe.getId()), + StringUtil.quoteAndEscape(recipe.getFluid().getFluid().getRegistryName()), + fluidCoolant.getDegreesCoolingPerMB() + ); + } + else if (recipe instanceof ISolidCoolant solidCoolant) + { + return String.format( + "assemblyTable.addSolidCoolant(%s, %s, %s, %s);", + StringUtil.quoteAndEscape(recipe.getId()), + ItemStackUtil.getCommandString(solidCoolant.getSolid()), + StringUtil.quoteAndEscape(recipe.getFluid().getFluid().getRegistryName()), + solidCoolant.getMultiplierForSerialize() + ); + } + return "This is not a fluid coolant or a solid coolant. What happened?"; + } + + static final class AddFluidCoolant extends ActionAddRecipe + { + private AddFluidCoolant(IRecipeManager manager, IFluidCoolant recipe) + { + super(manager, recipe); + } + + public static AddFluidCoolant create(IRecipeManager manager, String name, FluidStack fluid, float degreesCoolingPerMB) + { + ResourceLocation _name = new ResourceLocation("crafttweaker", name); + return new AddFluidCoolant(manager, new CoolantRegistry.FluidCoolant(_name, fluid, degreesCoolingPerMB)); + } + + public String describe() + { + return "Adding combustion engine coolant " + this.recipe.getFluid(); + } + } + + static final class AddSolidCoolant extends ActionAddRecipe + { + public AddSolidCoolant(IRecipeManager manager, ISolidCoolant recipe) + { + super(manager, recipe); + } + + public static AddSolidCoolant create(IRecipeManager manager, String name, ItemStack item, FluidStack fluid, float multiplier) + { + ResourceLocation _name = new ResourceLocation("crafttweaker", name); + return new AddSolidCoolant(manager, new CoolantRegistry.SolidCoolant(_name, item, fluid, multiplier)); + } + + public String describe() + { + return "Adding combustion engine coolant " + ((ISolidCoolant) this.recipe).getSolid(); + } + } +} diff --git a/common/buildcraft/compat/module/forestry/CompatModuleForestry.java b/common/buildcraft/compat/module/forestry/CompatModuleForestry.java deleted file mode 100644 index 622aca4..0000000 --- a/common/buildcraft/compat/module/forestry/CompatModuleForestry.java +++ /dev/null @@ -1,39 +0,0 @@ -package buildcraft.compat.module.forestry; - -import buildcraft.api.BCModules; -import buildcraft.api.core.BCLog; -import buildcraft.api.lists.ListRegistry; - -import buildcraft.compat.CompatModuleBase; -import buildcraft.compat.module.forestry.list.ListMatchGenome; -import buildcraft.compat.module.forestry.pipe.ForestryPipes; - -public class CompatModuleForestry extends CompatModuleBase { - @Override - public String compatModId() { - return "forestry"; - } - - @Override - public void preInit() { - ListRegistry.registerHandler(new ListMatchGenome()); - if (canLoadPropolisPipe()) { - ForestryPipes.preInit(); - } - } - - private static boolean canLoadPropolisPipe() { - if (!BCModules.TRANSPORT.isLoaded()) { - return false; - } - try { - // Ensure that forestry is up-to-date - Class.forName("forestry.sorting.tiles.IFilterContainer"); - return true; - } catch (ClassNotFoundException ignored) { - BCLog.logger.warn( - "[compat.forestry] IFilterContainer not found -- forestry must be updated to add the propolis pipe!"); - return false; - } - } -} diff --git a/common/buildcraft/compat/module/forestry/list/ListMatchGenome.java b/common/buildcraft/compat/module/forestry/list/ListMatchGenome.java deleted file mode 100644 index 7b9e247..0000000 --- a/common/buildcraft/compat/module/forestry/list/ListMatchGenome.java +++ /dev/null @@ -1,93 +0,0 @@ -package buildcraft.compat.module.forestry.list; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.NonNullList; - -import buildcraft.api.lists.ListMatchHandler; - -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.ISpeciesRoot; - -public class ListMatchGenome extends ListMatchHandler { - - @Override - public boolean matches(Type type, ItemStack compare, ItemStack target, boolean precise) { - IIndividual infoCompare = AlleleManager.alleleRegistry.getIndividual(compare); - IIndividual infoTarget = AlleleManager.alleleRegistry.getIndividual(target); - if (infoCompare == null || infoTarget == null) { - return false; - } - switch (type) { - case MATERIAL: { - return matchesMaterial(compare, target, infoCompare, infoTarget, precise); - } - case TYPE: { - return matchesType(compare, target, infoCompare, infoTarget, precise); - } - case CLASS: { - return matchesMaterial(compare, target, infoCompare, infoTarget, precise) - && matchesType(compare, target, infoCompare, infoTarget, precise); - } - default: { - throw new IllegalArgumentException("Unknown type " + type); - } - } - } - - private static boolean matchesMaterial(ItemStack compare, ItemStack target, IIndividual infoCompare, - IIndividual infoTarget, boolean precise) { - // Ensures that both individuals have the same species - // If precise is true then also ensure that the secondary species is the same - IAlleleSpecies speciesCompare = infoCompare.getGenome().getPrimary(); - IAlleleSpecies speciesTarget = infoTarget.getGenome().getPrimary(); - if (speciesCompare != speciesTarget) { - return false; - } - if (precise) { - IAlleleSpecies inactiveCompare = infoCompare.getGenome().getSecondary(); - IAlleleSpecies inactiveTarget = infoTarget.getGenome().getSecondary(); - if (inactiveCompare != inactiveTarget) { - return false; - } - } - return true; - } - - private static boolean matchesType(ItemStack compare, ItemStack target, IIndividual infoCompare, - IIndividual infoTarget, boolean precise) { - ISpeciesRoot speciesRootCompare = infoCompare.getGenome().getSpeciesRoot(); - ISpeciesRoot speciesRootTarget = infoTarget.getGenome().getSpeciesRoot(); - if (speciesRootCompare != speciesRootTarget) { - return false; - } - // Ensure that both fully match (both princesses or both drones etc) - if (speciesRootCompare.getType(compare) != speciesRootTarget.getType(target)) { - return false; - } - return true; - } - - @Override - public boolean isValidSource(Type type, @Nonnull ItemStack stack) { - return AlleleManager.alleleRegistry.getIndividual(stack) != null; - } - - @Override - @Nullable - public NonNullList getClientExamples(Type type, @Nonnull ItemStack stack) { - IIndividual individual = AlleleManager.alleleRegistry.getIndividual(stack); - if (individual == null) { - return null; - } - - NonNullList list = NonNullList.create(); - boolean isType = type != Type.MATERIAL; - boolean isMaterial = type != Type.TYPE; - return list; - } -} diff --git a/common/buildcraft/compat/module/forestry/pipe/ContainerPropolisPipe.java b/common/buildcraft/compat/module/forestry/pipe/ContainerPropolisPipe.java deleted file mode 100644 index 1460eff..0000000 --- a/common/buildcraft/compat/module/forestry/pipe/ContainerPropolisPipe.java +++ /dev/null @@ -1,22 +0,0 @@ -package buildcraft.compat.module.forestry.pipe; - -import net.minecraft.entity.player.EntityPlayer; - -import forestry.sorting.gui.ContainerGeneticFilter; - -public class ContainerPropolisPipe extends ContainerGeneticFilter { - - public final PipeBehaviourPropolis pipeBehaviour; - - public ContainerPropolisPipe(PipeBehaviourPropolis behaviour, EntityPlayer player) { - super(behaviour, player.inventory); - this.pipeBehaviour = behaviour; - behaviour.pipe.getHolder().onPlayerOpen(player); - } - - @Override - public void onContainerClosed(EntityPlayer player) { - super.onContainerClosed(player); - pipeBehaviour.pipe.getHolder().onPlayerClose(player); - } -} diff --git a/common/buildcraft/compat/module/forestry/pipe/ForestryPipes.java b/common/buildcraft/compat/module/forestry/pipe/ForestryPipes.java deleted file mode 100644 index cab9d26..0000000 --- a/common/buildcraft/compat/module/forestry/pipe/ForestryPipes.java +++ /dev/null @@ -1,86 +0,0 @@ -package buildcraft.compat.module.forestry.pipe; - -import net.minecraft.init.Items; -import net.minecraft.item.EnumDyeColor; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; - -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.RegistryEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.registry.ForgeRegistries; -import net.minecraftforge.oredict.ShapedOreRecipe; - -import buildcraft.api.transport.pipe.PipeApi; -import buildcraft.api.transport.pipe.PipeDefinition; -import buildcraft.api.transport.pipe.PipeDefinition.PipeDefinitionBuilder; - -import buildcraft.lib.misc.ColourUtil; -import buildcraft.lib.registry.CreativeTabManager; - -public class ForestryPipes { - - public static Item pipeItemPropolis; - public static PipeDefinition pipeDefinitionPropolis; - - public static void preInit() { - MinecraftForge.EVENT_BUS.register(ForestryPipes.class); - - String[] textureSuffixes = new String[8]; - textureSuffixes[0] = ""; - textureSuffixes[7] = "_itemstack"; - for (EnumFacing face : EnumFacing.VALUES) { - textureSuffixes[face.ordinal() + 1] = "_" + face.getName(); - } - - pipeDefinitionPropolis = new PipeDefinitionBuilder()// - .id("forestry_propolis")// Note: id() automatically sets the namespace to "buildcraftcompat" - .texPrefix("propolis")// - .texSuffixes(textureSuffixes)// - .logic(PipeBehaviourPropolis::new, PipeBehaviourPropolis::new)// - .flowItem()// - .define(); - - PipeApi.pipeRegistry.createUnnamedItemForPipe(pipeDefinitionPropolis, item -> { - pipeItemPropolis = item; - item.setRegistryName("pipe_item_propolis"); - item.setUnlocalizedName("buildcraftPipe.pipeitemspropolis"); - item.setCreativeTab(CreativeTabManager.getTab("buildcraft.pipes")); - }); - } - - @SubscribeEvent - public static void registerRecipes(RegistryEvent.Register event) { - Item propolis = ForgeRegistries.ITEMS.getValue(new ResourceLocation("forestry:propolis")); - if (propolis != null && propolis != Items.AIR) { - addPipeRecipe(pipeItemPropolis, propolis, Items.DIAMOND); - } - } - - private static void addPipeRecipe(Item pipe, Object surround) { - addPipeRecipe(pipe, surround, surround); - } - - private static void addPipeRecipe(Item pipe, Object left, Object right) { - // Copied directly from BCTransportRecipes - if (pipe == null) { - return; - } - ItemStack result = new ItemStack(pipe, 8); - IRecipe recipe = new ShapedOreRecipe(pipe.getRegistryName(), result, "lgr", 'l', left, 'r', right, 'g', - "blockGlassColorless"); - recipe.setRegistryName(new ResourceLocation(pipe.getRegistryName() + "_colorless")); - ForgeRegistries.RECIPES.register(recipe); - - for (EnumDyeColor colour : EnumDyeColor.values()) { - ItemStack resultStack = new ItemStack(pipe, 8, colour.getMetadata() + 1); - IRecipe colorRecipe = new ShapedOreRecipe(pipe.getRegistryName(), resultStack, "lgr", 'l', left, 'r', right, - 'g', "blockGlass" + ColourUtil.getName(colour)); - colorRecipe.setRegistryName(new ResourceLocation(pipe.getRegistryName() + "_" + colour)); - ForgeRegistries.RECIPES.register(colorRecipe); - } - } -} diff --git a/common/buildcraft/compat/module/forestry/pipe/PipeBehaviourPropolis.java b/common/buildcraft/compat/module/forestry/pipe/PipeBehaviourPropolis.java deleted file mode 100644 index def558a..0000000 --- a/common/buildcraft/compat/module/forestry/pipe/PipeBehaviourPropolis.java +++ /dev/null @@ -1,196 +0,0 @@ -package buildcraft.compat.module.forestry.pipe; - -import java.io.IOException; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.PacketBuffer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; - -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import buildcraft.api.core.EnumPipePart; -import buildcraft.api.transport.pipe.IPipe; -import buildcraft.api.transport.pipe.PipeBehaviour; -import buildcraft.api.transport.pipe.PipeEventHandler; -import buildcraft.api.transport.pipe.PipeEventItem; - -import buildcraft.lib.cap.CapabilityHelper; - -import buildcraft.compat.CompatUtils; -import buildcraft.compat.network.CompatGui; -import buildcraft.compat.network.IGuiCreator; - -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.GeneticCapabilities; -import forestry.api.genetics.IFilterLogic; -import forestry.api.genetics.IFilterLogic.INetworkHandler; -import forestry.sorting.DefaultFilterRuleType; -import forestry.sorting.gui.ContainerGeneticFilter; -import forestry.sorting.gui.GuiGeneticFilter; -import forestry.sorting.tiles.IFilterContainer; - -public class PipeBehaviourPropolis extends PipeBehaviour implements IFilterContainer, INetworkHandler, IGuiCreator { - - private final CapabilityHelper caps = new CapabilityHelper(); - private final IFilterLogic filter = AlleleManager.filterRegistry.createLogic(this, this); - - { - caps.addCapabilityInstance(GeneticCapabilities.FILTER_LOGIC, filter, EnumPipePart.VALUES); - caps.addCapabilityInstance(CompatUtils.CAP_GUI_CREATOR, this, EnumPipePart.CENTER); - } - - public PipeBehaviourPropolis(IPipe pipe) { - super(pipe); - } - - public PipeBehaviourPropolis(IPipe pipe, NBTTagCompound nbt) { - super(pipe, nbt); - filter.readFromNBT(nbt.getCompoundTag("filter")); - } - - @Override - public NBTTagCompound writeToNbt() { - NBTTagCompound nbt = super.writeToNbt(); - nbt.setTag("filter", filter.writeToNBT(new NBTTagCompound())); - return nbt; - } - - @Override - public void readPayload(PacketBuffer buffer, Side side, MessageContext ctx) throws IOException { - super.readPayload(buffer, side, ctx); - if (side == Side.CLIENT) { - filter.readGuiData(buffer); - } - } - - @Override - public void writePayload(PacketBuffer buffer, Side side) { - super.writePayload(buffer, side); - if (side == Side.SERVER) { - // FIXME: Inefficient to be sending gui updates all the time - // but fixing this requires proper fixes throughout the net code :/ - filter.writeGuiData(buffer); - } - } - - @Override - public T getCapability(@Nonnull Capability capability, EnumFacing facing) { - T value = caps.getCapability(capability, facing); - if (value != null) { - return value; - } - return super.getCapability(capability, facing); - } - - @Override - public int getTextureIndex(EnumFacing face) { - return face == null ? 0 : face.ordinal() + 1; - } - - @Override - public boolean onPipeActivate(EntityPlayer player, RayTraceResult trace, float hitX, float hitY, float hitZ, - EnumPipePart part) { - if (!getWorldObj().isRemote) { - // TODO: Properly abstract this in to make GUI's a bit more sane! - CompatGui.FORESTRY_PROPOLIS_PIPE.openGui(player, pipe.getHolder().getPipePos()); - // sendUpdatePacket(ImmutableList.of()); - } - return true; - } - - @PipeEventHandler - public void sideCheck(PipeEventItem.SideCheck event) { - ItemStack stack = event.stack; - for (EnumFacing face : EnumFacing.VALUES) { - if (!filter.isValid(stack, face)) { - event.disallow(face); - } else if (filter.getRule(face) == DefaultFilterRuleType.ANYTHING) { - event.decreasePriority(face); - } - } - } - - // IFilterContainer - - @Override - public BlockPos getCoordinates() { - return pipe.getHolder().getPipePos(); - } - - @Override - public World getWorldObj() { - return pipe.getHolder().getPipeWorld(); - } - - @Override - public String getUnlocalizedTitle() { - return ForestryPipes.pipeItemPropolis.getUnlocalizedName() + ".name"; - } - - @Override - @Nullable - public IInventory getBuffer() { - return null; - } - - @Override - public TileEntity getTileEntity() { - return pipe.getHolder().getPipeTile(); - } - - @Override - public IFilterLogic getLogic() { - return filter; - } - - // INetworkHandler - - @Override - public void sendToPlayers(IFilterLogic logic, WorldServer server, EntityPlayer currentPlayer) { - for (EntityPlayer player : server.playerEntities) { - if (player != currentPlayer && player.openContainer instanceof ContainerGeneticFilter) { - ContainerGeneticFilter currentContainer = (ContainerGeneticFilter) currentPlayer.openContainer; - ContainerGeneticFilter otherContainer = (ContainerGeneticFilter) player.openContainer; - if (otherContainer.hasSameTile(currentContainer)) { - otherContainer.setGuiNeedsUpdate(true); - } - } - } - } - - // IGuiCreator - - @Override - public Enum getGuiType() { - return CompatGui.FORESTRY_PROPOLIS_PIPE; - } - - @Override - @Nullable - public Container getServerGuiElement(int data, EntityPlayer player) { - return new ContainerPropolisPipe(this, player); - } - - @Override - @Nullable - @SideOnly(Side.CLIENT) - public GuiContainer getClientGuiElement(int data, EntityPlayer player) { - return new GuiGeneticFilter(this, player.inventory); - } -} diff --git a/common/buildcraft/compat/module/ic2/CompatModuleIndustrialCraft2.java b/common/buildcraft/compat/module/ic2/CompatModuleIndustrialCraft2.java index 01c782d..339e0f1 100644 --- a/common/buildcraft/compat/module/ic2/CompatModuleIndustrialCraft2.java +++ b/common/buildcraft/compat/module/ic2/CompatModuleIndustrialCraft2.java @@ -1,37 +1,38 @@ -/* - * Copyright (c) 2020 SpaceToad and the BuildCraft team - * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not - * distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/ - */ - package buildcraft.compat.module.ic2; -import net.minecraft.item.Item; - import buildcraft.compat.CompatModuleBase; - import buildcraft.lib.misc.StackMatchingPredicate; import buildcraft.lib.misc.StackNbtMatcher; import buildcraft.lib.misc.StackUtil; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraftforge.registries.ForgeRegistries; -public class CompatModuleIndustrialCraft2 extends CompatModuleBase { - @Override - public String compatModId() { +public class CompatModuleIndustrialCraft2 extends CompatModuleBase +{ + public CompatModuleIndustrialCraft2() + { + } + + public String compatModId() + { return "ic2"; } - @Override - public void preInit() { - registerCableMatchingPredicate(); + public void preInit() + { + this.registerCableMatchingPredicate(); } - private void registerCableMatchingPredicate() { - // Distinguish cables by type and insulation - // https://github.com/BuildCraft/BuildCraft/issues/4553 - Item cable = Item.getByNameOrId("ic2:cable"); - if (cable != null) { - StackMatchingPredicate predicate = new StackNbtMatcher("insulation", "type"); + private void registerCableMatchingPredicate() + { +// Item cable = Item.func_111206_d("ic2:cable"); + Item cable = ForgeRegistries.ITEMS.getValue(new ResourceLocation("ic2:cable")); + if (cable != null) + { + StackMatchingPredicate predicate = new StackNbtMatcher(new String[]{"insulation", "type"}); StackUtil.registerMatchingPredicate(cable, predicate); } + } } diff --git a/common/buildcraft/compat/module/jei/BCPluginJEI.java b/common/buildcraft/compat/module/jei/BCPluginJEI.java index f31d176..fd0e2e2 100644 --- a/common/buildcraft/compat/module/jei/BCPluginJEI.java +++ b/common/buildcraft/compat/module/jei/BCPluginJEI.java @@ -1,150 +1,240 @@ package buildcraft.compat.module.jei; -import java.util.Arrays; -import java.util.List; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.common.Loader; - -import buildcraft.api.BCBlocks; import buildcraft.api.BCModules; import buildcraft.api.core.BCLog; import buildcraft.api.enums.EnumEngineType; import buildcraft.api.fuels.IFuel; +import buildcraft.api.recipes.AssemblyRecipe; import buildcraft.api.recipes.AssemblyRecipeBasic; import buildcraft.api.recipes.BuildcraftRecipeRegistry; import buildcraft.api.recipes.IRefineryRecipeManager; - -import buildcraft.lib.fluid.FuelRegistry; -import buildcraft.lib.recipe.AssemblyRecipeRegistry; - import buildcraft.compat.module.jei.energy.combustionengine.CategoryCombustionEngine; -import buildcraft.compat.module.jei.energy.combustionengine.HandlerCombustionEngine; -import buildcraft.compat.module.jei.factory.CategoryCoolable; -import buildcraft.compat.module.jei.factory.CategoryDistiller; -import buildcraft.compat.module.jei.factory.CategoryHeatable; -import buildcraft.compat.module.jei.factory.HandlerCoolable; -import buildcraft.compat.module.jei.factory.HandlerDistiller; -import buildcraft.compat.module.jei.factory.HandlerHeatable; -import buildcraft.compat.module.jei.recipe.GuiHandlerBuildCraft; +import buildcraft.compat.module.jei.factory.*; +import buildcraft.compat.module.jei.gui.GuiHandlerBuildCraft; import buildcraft.compat.module.jei.silicon.CategoryAssemblyTable; -import buildcraft.compat.module.jei.silicon.WrapperAssemblyTable; import buildcraft.compat.module.jei.transferhandlers.AdvancedCraftingItemsTransferHandler; import buildcraft.compat.module.jei.transferhandlers.AutoCraftItemsTransferHandler; import buildcraft.core.BCCoreBlocks; +import buildcraft.factory.BCFactoryBlocks; +import buildcraft.lib.fluid.FuelRegistry; +import buildcraft.lib.gui.GuiBC8; +import buildcraft.lib.recipe.AssemblyRecipeRegistry; +import buildcraft.lib.recipe.RefineryRecipeRegistry; +import buildcraft.silicon.BCSiliconBlocks; import buildcraft.silicon.container.ContainerAssemblyTable; - -import mezz.jei.api.IGuiHelper; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; import mezz.jei.api.IModPlugin; -import mezz.jei.api.IModRegistry; -import mezz.jei.api.JEIPlugin; -import mezz.jei.api.recipe.IRecipeCategoryRegistration; -import mezz.jei.api.recipe.VanillaRecipeCategoryUid; +import mezz.jei.api.JeiPlugin; +import mezz.jei.api.constants.RecipeTypes; +import mezz.jei.api.helpers.IGuiHelper; +import mezz.jei.api.recipe.category.IRecipeCategory; +import mezz.jei.api.registration.*; +import mezz.jei.api.runtime.IJeiRuntime; +import net.minecraft.client.Minecraft; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraftforge.fml.ModList; -@JEIPlugin -public class BCPluginJEI implements IModPlugin { - // public static boolean disableFacadeJEI; - public static IModRegistry registry; +import java.util.Arrays; +import java.util.List; + +@JeiPlugin +public class BCPluginJEI implements IModPlugin +{ + // public static IModRegistry registry; + public static IRecipeRegistration registryRecipe; + public static IGuiHandlerRegistration registryGui; + public static IRecipeTransferRegistration registryRecipeTransfer; + public static IRecipeCatalystRegistration registryRecipeCatalyst; + public static IJeiRuntime jeiRuntime; + + private static final ResourceLocation UID = new ResourceLocation("buildcraft:jei_plugin"); @Override - public void register(IModRegistry registry) { - BCPluginJEI.registry = registry; - registry.addAdvancedGuiHandlers(new GuiHandlerBuildCraft()); -// boolean transport = BCModules.TRANSPORT.isLoaded(); + public ResourceLocation getPluginUid() + { + return UID; + } + + + @Override + public void registerGuiHandlers(IGuiHandlerRegistration registry) + { + BCPluginJEI.registryGui = registry; + registry.addGenericGuiContainerHandler(GuiBC8.class, new GuiHandlerBuildCraft()); + + } + + // Calen: IRecipeWrapper combined into IRecipeCategory + @Override + public void registerRecipes(IRecipeRegistration registry) + { + BCPluginJEI.registryRecipe = registry; boolean factory = BCModules.FACTORY.isLoaded(); boolean energy = BCModules.ENERGY.isLoaded(); boolean silicon = BCModules.SILICON.isLoaded(); -// boolean robotics = BCModules.ROBOTICS.isLoaded(); - - if (factory) { - registry.handleRecipes(IRefineryRecipeManager.ICoolableRecipe.class, new HandlerCoolable(), CategoryCoolable.UID); - registry.handleRecipes(IRefineryRecipeManager.IDistillationRecipe.class, new HandlerDistiller(), CategoryDistiller.UID); - registry.handleRecipes(IRefineryRecipeManager.IHeatableRecipe.class, new HandlerHeatable(), CategoryHeatable.UID); - - registry.addRecipes(ImmutableList.copyOf(BuildcraftRecipeRegistry.refineryRecipes.getCoolableRegistry().getAllRecipes()), CategoryCoolable.UID); - registry.addRecipes(ImmutableList.copyOf(BuildcraftRecipeRegistry.refineryRecipes.getDistillationRegistry().getAllRecipes()), CategoryDistiller.UID); - registry.addRecipes(ImmutableList.copyOf(BuildcraftRecipeRegistry.refineryRecipes.getHeatableRegistry().getAllRecipes()), CategoryHeatable.UID); - if (BCBlocks.Factory.DISTILLER != null) { - registry.addRecipeCatalyst(new ItemStack(BCBlocks.Factory.DISTILLER), CategoryDistiller.UID); - } - if (BCBlocks.Factory.HEAT_EXCHANGE != null) { - registry.addRecipeCatalyst(new ItemStack(BCBlocks.Factory.HEAT_EXCHANGE), CategoryCoolable.UID); - registry.addRecipeCatalyst(new ItemStack(BCBlocks.Factory.HEAT_EXCHANGE), CategoryHeatable.UID); - } - } - if (energy) { - registry.handleRecipes(IFuel.class, new HandlerCombustionEngine(), CategoryCombustionEngine.UID); - registry.addRecipes(ImmutableList.copyOf(FuelRegistry.INSTANCE.getFuels()), CategoryCombustionEngine.UID); - if (BCCoreBlocks.engine != null){ - if (BCCoreBlocks.engine.isRegistered(EnumEngineType.STONE)) { - registry.addRecipeCatalyst(BCCoreBlocks.engine.getStack(EnumEngineType.STONE), VanillaRecipeCategoryUid.FUEL); - } - if (BCCoreBlocks.engine.isRegistered(EnumEngineType.IRON)) { - registry.addRecipeCatalyst(BCCoreBlocks.engine.getStack(EnumEngineType.IRON), CategoryCombustionEngine.UID); - } - } + if (factory) + { +// registry.handleRecipes(IRefineryRecipeManager.ICoolableRecipe.class, new HandlerCoolable(), "buildcraft:category_coolable"); +// registry.handleRecipes(IRefineryRecipeManager.IDistillationRecipe.class, new HandlerDistiller(), "buildcraft:category_distiller"); +// registry.handleRecipes(IRefineryRecipeManager.IHeatableRecipe.class, new HandlerHeatable(), "buildcraft:category_heatable"); +// registry.addRecipes(ImmutableList.copyOf(BuildcraftRecipeRegistry.refineryRecipes.getCoolableRegistry().getAllRecipes()), new ResourceLocation("buildcraft:category_coolable")); + registry.addRecipes(CategoryCoolable.RECIPE_TYPE, ImmutableList.copyOf(Minecraft.getInstance().level.getRecipeManager().getAllRecipesFor(IRefineryRecipeManager.ICoolableRecipe.TYPE))); +// registry.addRecipes(ImmutableList.copyOf(BuildcraftRecipeRegistry.refineryRecipes.getDistillationRegistry().getAllRecipes()), new ResourceLocation("buildcraft:category_distiller")); + registry.addRecipes(CategoryDistiller.RECIPE_TYPE, ImmutableList.copyOf(Minecraft.getInstance().level.getRecipeManager().getAllRecipesFor(IRefineryRecipeManager.IDistillationRecipe.TYPE))); +// registry.addRecipes(ImmutableList.copyOf(BuildcraftRecipeRegistry.refineryRecipes.getHeatableRegistry().getAllRecipes()), new ResourceLocation("buildcraft:category_heatable")); + registry.addRecipes(CategoryHeatable.RECIPE_TYPE, ImmutableList.copyOf(Minecraft.getInstance().level.getRecipeManager().getAllRecipesFor(IRefineryRecipeManager.IHeatableRecipe.TYPE))); } - if (silicon) { - registry.handleRecipes(AssemblyRecipeBasic.class, WrapperAssemblyTable::new, CategoryAssemblyTable.UID); -// registry.handleRecipes(IntegrationRecipe.class, new HandlerIntegrationTable(), CategoryIntegrationTable.UID); - - registry.addRecipes(ImmutableList.copyOf(AssemblyRecipeRegistry.REGISTRY.values()), CategoryAssemblyTable.UID); -// registry.addRecipes(ImmutableList.copyOf(IntegrationRecipeRegistry.INSTANCE.getAllRecipes()), CategoryIntegrationTable.UID); - if (BCBlocks.Silicon.ASSEMBLY_TABLE != null) { - registry.addRecipeCatalyst(new ItemStack(BCBlocks.Silicon.ASSEMBLY_TABLE), CategoryAssemblyTable.UID); - } - if (BCBlocks.Silicon.ADVANCED_CRAFTING_TABLE != null) { - registry.addRecipeCatalyst(new ItemStack(BCBlocks.Silicon.ADVANCED_CRAFTING_TABLE), VanillaRecipeCategoryUid.CRAFTING); - } + + if (energy) + { +// registry.handleRecipes(IFuel.class, new HandlerCombustionEngine(), "buildcraft-compat:engine.combustion"); +// registry.addRecipes(ImmutableList.copyOf(FuelRegistry.INSTANCE.getFuels()), new ResourceLocation("buildcraft-compat:engine.combustion")); + registry.addRecipes(CategoryCombustionEngine.RECIPE_TYPE, ImmutableList.copyOf(Minecraft.getInstance().level.getRecipeManager().getAllRecipesFor(IFuel.TYPE))); } - registry.getRecipeTransferRegistry().addRecipeTransferHandler(new AutoCraftItemsTransferHandler(), VanillaRecipeCategoryUid.CRAFTING); - registry.getRecipeTransferRegistry().addRecipeTransferHandler(new AdvancedCraftingItemsTransferHandler(), VanillaRecipeCategoryUid.CRAFTING); - // registry.getRecipeTransferRegistry().addRecipeTransferHandler(new AssemblyTableTransferHandler(), CategoryAssemblyTable.UID); - registry.getRecipeTransferRegistry().addRecipeTransferHandler(ContainerAssemblyTable.class, CategoryAssemblyTable.UID, - 36, 12, 0, 36); + if (silicon) + { +// registry.handleRecipes(AssemblyRecipeBasic.class, WrapperAssemblyTable::new, "buildcraft-compat:silicon.assembly"); +// registry.addRecipes(ImmutableList.copyOf(AssemblyRecipeRegistry.REGISTRY.values()), new ResourceLocation("buildcraft-compat:silicon.assembly")); + registry.addRecipes(CategoryAssemblyTable.RECIPE_TYPE, ImmutableList.copyOf(Minecraft.getInstance().level.getRecipeManager().getAllRecipesFor(AssemblyRecipe.TYPE))); + } } @Override - public void registerCategories(IRecipeCategoryRegistration registry) { -// boolean transport = Loader.isModLoaded(BCModules.TRANSPORT.getModId()); - boolean factory = Loader.isModLoaded(BCModules.FACTORY.getModId()); - boolean energy = Loader.isModLoaded(BCModules.ENERGY.getModId()); - boolean silicon = Loader.isModLoaded(BCModules.SILICON.getModId()); -// boolean robotics = Loader.isModLoaded(BCModules.ROBOTICS.getModId()); + public void registerRecipeTransferHandlers(IRecipeTransferRegistration registry) + { + BCPluginJEI.registryRecipeTransfer = registry; + +// registry.addRecipeTransferHandler(new AutoCraftItemsTransferHandler(), "minecraft.crafting"); + registry.addRecipeTransferHandler(new AutoCraftItemsTransferHandler(), RecipeTypes.CRAFTING); +// registry.addRecipeTransferHandler(new AdvancedCraftingItemsTransferHandler(), "minecraft.crafting"); + registry.addRecipeTransferHandler(new AdvancedCraftingItemsTransferHandler(), RecipeTypes.CRAFTING); +// registry.addRecipeTransferHandler(ContainerAssemblyTable.class, "buildcraft-compat:silicon.assembly", 36, 12, 0, 36); + registry.addRecipeTransferHandler(ContainerAssemblyTable.class, CategoryAssemblyTable.RECIPE_TYPE, 36, 12, 0, 36); + } + @Override + public void registerCategories(IRecipeCategoryRegistration registry) + { +// boolean factory = Loader.isModLoaded(BCModules.FACTORY.getModId()); + boolean factory = ModList.get().isLoaded(BCModules.FACTORY.getModId()); +// boolean energy = Loader.isModLoaded(BCModules.ENERGY.getModId()); + boolean energy = ModList.get().isLoaded(BCModules.ENERGY.getModId()); +// boolean silicon = Loader.isModLoaded(BCModules.SILICON.getModId()); + boolean silicon = ModList.get().isLoaded(BCModules.SILICON.getModId()); List lst = Lists.newArrayList(); IGuiHelper helper = registry.getJeiHelpers().getGuiHelper(); - -// jeiRegistry.addAdvancedGuiHandlers(new LedgerGuiHandler()); -// if (transport) { -// lst.add("transport"); -// loadTransport(jeiRegistry); -// } - if (factory) { + if (factory) + { lst.add("factory"); - registry.addRecipeCategories(new CategoryHeatable(helper)); - registry.addRecipeCategories(new CategoryDistiller(helper)); - registry.addRecipeCategories(new CategoryCoolable(helper)); + registry.addRecipeCategories(new IRecipeCategory[]{new CategoryHeatable(helper)}); + registry.addRecipeCategories(new IRecipeCategory[]{new CategoryDistiller(helper)}); + registry.addRecipeCategories(new IRecipeCategory[]{new CategoryCoolable(helper)}); } - if (energy) { + + if (energy) + { lst.add("energy"); - registry.addRecipeCategories(new CategoryCombustionEngine(helper)); +// registry.addRecipeCategories(new IRecipeCategory[]{new CategoryCombustionEngine(helper)}); + registry.addRecipeCategories(new IRecipeCategory[]{new CategoryCombustionEngine(helper, FuelRegistry.INSTANCE.getFuels(Minecraft.getInstance().level))}); + // Calen: cannot reg duplicated +// registry.addRecipeCategories( +// FuelRegistry.INSTANCE.getFuels().stream() +// .map(fuel -> new CategoryCombustionEngine(helper, fuel)) +// .toArray(CategoryCombustionEngine[]::new) +// ); } - if (silicon) { + + if (silicon) + { lst.add("silicon"); - registry.addRecipeCategories(new CategoryAssemblyTable(helper)); -// registry.addRecipeCategories(new CategoryIntegrationTable(helper)); +// registry.addRecipeCategories(new IRecipeCategory[]{new CategoryAssemblyTable(helper)}); + registry.addRecipeCategories(new IRecipeCategory[]{new CategoryAssemblyTable(helper, AssemblyRecipeRegistry.getAll(Minecraft.getInstance().level))}); +// registry.addRecipeCategories( +// AssemblyRecipeRegistry.REGISTRY.values().stream() +// .filter(recipe -> recipe instanceof AssemblyRecipeBasic) +// .map(recipe -> new CategoryAssemblyTable(helper, (AssemblyRecipeBasic) recipe)) +// .toArray(CategoryAssemblyTable[]::new) +// ); } BCLog.logger.info("Loaded JEI mods: " + Arrays.toString(lst.toArray())); } -// private static void loadTransport(IModRegistry jeiRegistry) { -// jeiRegistry.addAdvancedGuiHandlers(new GateGuiHandler()); -// } + @Override + public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) + { + BCPluginJEI.registryRecipeCatalyst = registry; + + boolean factory = BCModules.FACTORY.isLoaded(); + boolean energy = BCModules.ENERGY.isLoaded(); + boolean silicon = BCModules.SILICON.isLoaded(); + if (factory) + { + if (BCFactoryBlocks.distiller != null) + { +// registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.distiller.get()), new String[]{"buildcraft:category_distiller"}); + registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.distiller.get()), CategoryDistiller.RECIPE_TYPE); + } + + if (BCFactoryBlocks.heatExchange != null) + { +// registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.heatExchange.get()), new String[]{"buildcraft:category_coolable"}); + registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.heatExchange.get()), CategoryCoolable.RECIPE_TYPE); +// registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.heatExchange.get()), new String[]{"buildcraft:category_heatable"}); + registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.heatExchange.get()), CategoryHeatable.RECIPE_TYPE); + } + + if (BCFactoryBlocks.autoWorkbenchItems != null) + { + registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.autoWorkbenchItems.get()), RecipeTypes.CRAFTING); + } + } + + if (energy) + { +// if (BCCoreBlocks.engine != null) + if (!BCCoreBlocks.engineBlockMap.isEmpty()) + { +// if (BCCoreBlocks.engine.isRegistered(EnumEngineType.STONE)) + if (BCCoreBlocks.engineBlockMap.containsKey(EnumEngineType.STONE)) + { +// registry.addRecipeCatalyst(BCCoreBlocks.engine.getStack(EnumEngineType.STONE), new String[]{"minecraft.fuel"}); + registry.addRecipeCatalyst(new ItemStack(BCCoreBlocks.engineBlockMap.get(EnumEngineType.STONE).get()), RecipeTypes.FUELING); + } + +// if (BCCoreBlocks.engine.isRegistered(EnumEngineType.IRON)) + if (BCCoreBlocks.engineBlockMap.containsKey(EnumEngineType.IRON)) + { +//// registry.addRecipeCatalyst(BCCoreBlocks.engine.getStack(EnumEngineType.IRON), new String[]{"buildcraft-compat:engine.combustion"}); +// registry.addRecipeCatalyst(new ItemStack(BCCoreBlocks.engineBlockMap.get(EnumEngineType.IRON).get()), new String[]{"buildcraft-compat:engine.combustion"}); + registry.addRecipeCatalyst(new ItemStack(BCCoreBlocks.engineBlockMap.get(EnumEngineType.IRON).get()), CategoryCombustionEngine.RECIPE_TYPE); + } + } + } + + if (silicon) + { + if (BCSiliconBlocks.assemblyTable != null) + { +// registry.addRecipeCatalyst(new ItemStack(BCSiliconBlocks.assemblyTable.get()), new String[]{"buildcraft-compat:silicon.assembly"}); + registry.addRecipeCatalyst(new ItemStack(BCSiliconBlocks.assemblyTable.get()), CategoryAssemblyTable.RECIPE_TYPE); + } + + if (BCSiliconBlocks.advancedCraftingTable != null) + { +// registry.addRecipeCatalyst(new ItemStack(BCSiliconBlocks.advancedCraftingTable.get()), new String[]{"minecraft.crafting"}); + registry.addRecipeCatalyst(new ItemStack(BCSiliconBlocks.advancedCraftingTable.get()), RecipeTypes.CRAFTING); + } + } + } + + @Override + public void onRuntimeAvailable(IJeiRuntime jeiRuntime) + { + BCPluginJEI.jeiRuntime = jeiRuntime; + } } diff --git a/common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java b/common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java index 323ec89..950f58c 100644 --- a/common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java +++ b/common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java @@ -1,71 +1,190 @@ package buildcraft.compat.module.jei.energy.combustionengine; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; import buildcraft.api.BCModules; -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.BlankRecipeCategory; -public class CategoryCombustionEngine extends BlankRecipeCategory { - public static final String UID = "buildcraft-compat:engine.combustion"; +import java.awt.*; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import buildcraft.api.fuels.IFuel; +import buildcraft.api.fuels.IFuelManager; +import buildcraft.api.mj.MjAPI; +import buildcraft.energy.BCEnergyBlocks; +import com.google.common.collect.Lists; +import com.mojang.blaze3d.platform.InputConstants; +import com.mojang.blaze3d.vertex.PoseStack; +import mezz.jei.api.constants.VanillaTypes; +import mezz.jei.api.forge.ForgeTypes; +import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; +import mezz.jei.api.gui.drawable.IDrawable; +import mezz.jei.api.gui.drawable.IDrawableAnimated; +import mezz.jei.api.gui.drawable.IDrawableStatic; +import mezz.jei.api.gui.ingredient.IRecipeSlotsView; +import mezz.jei.api.helpers.IGuiHelper; +import mezz.jei.api.recipe.IFocusGroup; +import mezz.jei.api.recipe.RecipeIngredientRole; +import mezz.jei.api.recipe.RecipeType; +import mezz.jei.api.recipe.category.IRecipeCategory; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Font; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.fluids.FluidStack; +//public class CategoryCombustionEngine extends BlankRecipeCategory +public class CategoryCombustionEngine implements IRecipeCategory +{ + // Calen + public static final RecipeType RECIPE_TYPE = + RecipeType.create(BCModules.ENERGY.getModId(), "engine_combustion", IFuel.class); + // public static final ResourceLocation UID = new ResourceLocation("buildcraft-compat:engine.combustion"); + public static final ResourceLocation UID = new ResourceLocation(BCModules.ENERGY.getModId(), "engine_combustion"); + public static final ResourceLocation FURNACE = new ResourceLocation("minecraft", "textures/gui/container/furnace.png"); private final IDrawable background; -// private WrapperCombustionEngine wrapper = null; - public CategoryCombustionEngine(IGuiHelper guiHelper) { - super(); - this.background = guiHelper.createDrawable( - new ResourceLocation("minecraft", "textures/gui/container/furnace.png"), - 55, 38, 18, 32, 0, 0, 0, 80); + private final IDrawable icon; + + // private final IDrawableAnimated flame; +// private IDrawableAnimated flame; + + @OnlyIn(Dist.CLIENT) + private Font font = Minecraft.getInstance().font; + // private final IGuiHelper guiHelper; +// private final IDrawableStatic flameDrawable; + private final Map burnTimeDrabableMap = new HashMap<>(); + + // public CategoryCombustionEngine(IGuiHelper guiHelper) +// public CategoryCombustionEngine(IGuiHelper guiHelper,IFuel fuel) + public CategoryCombustionEngine(IGuiHelper guiHelper, Collection fuels) + { + // Calen: 80->100 +// this.background = guiHelper.createDrawable(new ResourceLocation("minecraft", "textures/gui/container/furnace.png"), 55, 38, 18, 32, 0, 0, 0, 80); +// this.background = guiHelper.drawableBuilder(FURNACE, 55, 38, 18, 32).addPadding(0, 0, 0, 80).build(); + this.background = guiHelper.drawableBuilder(FURNACE, 55, 38, 18, 32).addPadding(0, 0, 0, 120).build(); + // Calen: from 1.12.2 what is this doing??? guiHelper.createDrawable(new ResourceLocation(BCModules.ENERGY.getModId(), ""), 0, 0, 16, 16); + + this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(BCEnergyBlocks.engineIron.get())); + +// ResourceLocation furnaceBackgroundLocation = new ResourceLocation("minecraft", "textures/gui/container/furnace.png"); + IDrawableStatic flameDrawable = guiHelper.createDrawable(FURNACE, 176, 0, 14, 14); +// this.flame = guiHelper.createAnimatedDrawable(flameDrawable, fuel.getTotalBurningTime() / 10, IDrawableAnimated.StartDirection.TOP, true); + for (IFuel fuel : fuels) + { + if (!burnTimeDrabableMap.containsKey(fuel.getTotalBurningTime())) + { + burnTimeDrabableMap.put(fuel.getTotalBurningTime(), guiHelper.createAnimatedDrawable(flameDrawable, fuel.getTotalBurningTime() / 10, IDrawableAnimated.StartDirection.TOP, true)); + } + } } @Override - public String getUid() { + public ResourceLocation getUid() + { return UID; } @Override - public String getTitle() { - return "Combustion Engine Fuels"; + public Class getRecipeClass() + { + return IFuel.class; } @Override - public String getModName() { + public Component getTitle() + { +// return new TextComponent("Combustion Engine Fuels"); + return new TranslatableComponent("buildcraft.jei.title.combustion_engine_fuels"); + } + + public String getModName() + { return BCModules.ENERGY.name(); } @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return this.background; } @Override - public void setRecipe(IRecipeLayout recipeLayout, WrapperCombustionEngine recipeWrapper, IIngredients ingredients) { -// WrapperCombustionEngine wrapper = (WrapperCombustionEngine) recipeWrapper; - IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); + public IDrawable getIcon() + { + return this.icon; + } - guiFluidStacks.init(0, true, 1, 15, 16, 16, 1000, false, null); - guiFluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0)); + // Calen + private int lastBurnTime = -1; - if (recipeWrapper instanceof WrapperCombustionEngine.Dirty) { -// WrapperCombustionEngine.Dirty dirty = (WrapperCombustionEngine.Dirty)recipeWrapper; + @Override + public void draw(IFuel fuel, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) + { +// if (fuel.getTotalBurningTime() != lastBurnTime) +// { +// this.flame = guiHelper.createAnimatedDrawable(flameDrawable, fuel.getTotalBurningTime() / 10, IDrawableAnimated.StartDirection.TOP, true); +// } +// this.flame.draw(stack, 2, 0); + this.burnTimeDrabableMap.get(fuel.getTotalBurningTime()).draw(stack, 2, 0); +// GlStateManager.func_179094_E(); + stack.pushPose(); + // Calen: 8->6 +// GlStateManager.func_179109_b(24.0F, 8.0F, 0.0F); +// stack.translate(24.0F, 8.0F, 0.0F); + stack.translate(24.0F, 6.0F, 0.0F); +// this.font.draw(stack, "Burns for " + fuel.getTotalBurningTime() / 20 + "s", 0, 0, Color.darkGray.getRGB()); + this.font.draw(stack, new TranslatableComponent("buildcraft.jei.title.combustion_engine_fuels.burn_time", fuel.getTotalBurningTime() / 20).getString(), 0, 0, Color.darkGray.getRGB()); +// this.font.draw(stack, " at " + MjAPI.formatMj(fuel.getPowerPerCycle()) + " MJ/t", 0, font.lineHeight, Color.darkGray.getRGB()); + this.font.draw(stack, new TranslatableComponent("buildcraft.jei.title.combustion_engine_fuels.burn_speed", MjAPI.formatMj(fuel.getPowerPerCycle())).getString(), 0, font.lineHeight, Color.darkGray.getRGB()); +// GlStateManager.func_179109_b(0.0F, (float)(minecraft.field_71466_p.field_78288_b * 2), 0.0F); + stack.translate(0.0F, (float) (font.lineHeight * 2), 0.0F); +// GlStateManager.func_179139_a(0.7, 0.7, 1.0); + stack.scale(0.7F, 0.7F, 1.0F); +// this.font.draw(stack, " total " + MjAPI.formatMj(fuel.getPowerPerCycle() * (long) fuel.getTotalBurningTime()) + " MJ", 1, 2, Color.gray.getRGB()); + this.font.draw(stack, new TranslatableComponent("buildcraft.jei.title.combustion_engine_fuels.burn_total", MjAPI.formatMj(fuel.getPowerPerCycle() * (long) fuel.getTotalBurningTime())).getString(), 1, 2, Color.gray.getRGB()); +// GlStateManager.func_179121_F(); + stack.popPose(); + } - guiFluidStacks.init(1, false, 95, 15, 16, 16, 1000, false, null); - guiFluidStacks.set(1, ingredients.getOutputs(FluidStack.class).get(0)); + @Override + // public void setRecipe(IRecipeLayout recipeLayout, WrapperCombustionEngine recipeWrapper, IIngredients ingredients) + public void setRecipe(IRecipeLayoutBuilder builder, IFuel fuel, IFocusGroup focuses) + { +// IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); +// guiFluidStacks.init(0, true, 1, 15, 16, 16, 1000, false, (IDrawable) null); +// guiFluidStacks.set(0, (List) ingredients.getInputs(FluidStack.class).get(0)); + builder + .addSlot(RecipeIngredientRole.INPUT, 1, 15) + .setFluidRenderer(1000, false, 16, 16) + .addIngredient(ForgeTypes.FLUID_STACK, new FluidStack(fuel.getFluid(), 1000)); + if (fuel instanceof IFuelManager.IDirtyFuel dirtyFuel) + { + // Calen: move right 20 to not covered the text +// guiFluidStacks.init(1, false, 95, 15, 16, 16, 1000, false, (IDrawable) null); +// guiFluidStacks.set(1, (List) ingredients.getOutputs(FluidStack.class).get(0)); + builder +// .addSlot(RecipeIngredientRole.OUTPUT, 95, 15) + .addSlot(RecipeIngredientRole.OUTPUT, 115, 15) + .setFluidRenderer(1000, false, 16, 16) + .addIngredient(ForgeTypes.FLUID_STACK, dirtyFuel.getResidue()); } } -// -// @Override -// public void drawExtras(Minecraft minecraft) { -// super.drawExtras(minecraft); -// -// if (this.wrapper != null) { -// this.wrapper.flame.draw(minecraft, 2, 0); -// } -// } + + @Override + public List getTooltipStrings(IFuel recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) + { + return Lists.newArrayList(); + } + + @Override + public boolean handleInput(IFuel recipe, double mouseX, double mouseY, InputConstants.Key input) + { + return false; + } } diff --git a/common/buildcraft/compat/module/jei/energy/combustionengine/HandlerCombustionEngine.java b/common/buildcraft/compat/module/jei/energy/combustionengine/HandlerCombustionEngine.java deleted file mode 100644 index 7a4a0f0..0000000 --- a/common/buildcraft/compat/module/jei/energy/combustionengine/HandlerCombustionEngine.java +++ /dev/null @@ -1,19 +0,0 @@ -package buildcraft.compat.module.jei.energy.combustionengine; - -import buildcraft.api.fuels.IFuel; -import buildcraft.api.fuels.IFuelManager.IDirtyFuel; - -import buildcraft.compat.module.jei.BCPluginJEI; - -import mezz.jei.api.recipe.IRecipeWrapper; -import mezz.jei.api.recipe.IRecipeWrapperFactory; - -public class HandlerCombustionEngine implements IRecipeWrapperFactory { - @Override - public IRecipeWrapper getRecipeWrapper(IFuel recipe) { - if (recipe instanceof IDirtyFuel) { - return new WrapperCombustionEngine.Dirty(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), (IDirtyFuel) recipe); - } - return new WrapperCombustionEngine(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), recipe); - } -} diff --git a/common/buildcraft/compat/module/jei/energy/combustionengine/WrapperCombustionEngine.java b/common/buildcraft/compat/module/jei/energy/combustionengine/WrapperCombustionEngine.java deleted file mode 100644 index d50d9f0..0000000 --- a/common/buildcraft/compat/module/jei/energy/combustionengine/WrapperCombustionEngine.java +++ /dev/null @@ -1,110 +0,0 @@ -package buildcraft.compat.module.jei.energy.combustionengine; - -import java.awt.Color; -import java.util.List; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import buildcraft.api.fuels.IFuel; -import buildcraft.api.fuels.IFuelManager.IDirtyFuel; -import buildcraft.api.mj.MjAPI; -import mezz.jei.api.IGuiHelper; -import mezz.jei.api.gui.IDrawableAnimated; -import mezz.jei.api.gui.IDrawableStatic; -import mezz.jei.api.ingredients.IIngredients; -import mezz.jei.api.recipe.IRecipeWrapper; - -public class WrapperCombustionEngine implements IRecipeWrapper { - private final IFuel fuel; - private final ImmutableList in; - private final IDrawableAnimated flame; - - WrapperCombustionEngine(IGuiHelper guiHelper, IFuel fuel) { - this.fuel = fuel; - in = ImmutableList.of(new FluidStack(fuel.getFluid(), Fluid.BUCKET_VOLUME)); - - ResourceLocation furnaceBackgroundLocation = new ResourceLocation("minecraft", "textures/gui/container/furnace.png"); - IDrawableStatic flameDrawable = guiHelper.createDrawable(furnaceBackgroundLocation, 176, 0, 14, 14); - this.flame = guiHelper.createAnimatedDrawable(flameDrawable, fuel.getTotalBurningTime() / 10, IDrawableAnimated.StartDirection.TOP, true); - } - -// @Override -// public List getInputs() { -// return Collections.emptyList(); -// } -// -// @Override -// public List getOutputs() { -// return Collections.emptyList(); -// } -// -// @Override -// public List getFluidInputs() { -// return in; -// } -// -// @Override -// public List getFluidOutputs() { -// return null; -// } -// -// @Override -// public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight) {} - - @Override - public void getIngredients(IIngredients ingredients) { - ingredients.setInputs(FluidStack.class, this.in); - } - - @Override - @SideOnly(Side.CLIENT) - public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { - this.flame.draw(minecraft, 2, 0); - - GlStateManager.pushMatrix(); - GlStateManager.translate(24, 8, 0); - // GlStateManager.scale(.7, .7, 1.0); - minecraft.fontRenderer.drawString("Burns for " + (fuel.getTotalBurningTime() / 20) + "s", 0, 0, Color.darkGray.getRGB()); - minecraft.fontRenderer.drawString(" at " + MjAPI.formatMj(fuel.getPowerPerCycle()) + " MJ/t", 0, minecraft.fontRenderer.FONT_HEIGHT, Color.darkGray.getRGB()); - GlStateManager.translate(0, minecraft.fontRenderer.FONT_HEIGHT * 2, 0); - GlStateManager.scale(.7, .7, 1.0); - minecraft.fontRenderer.drawString(" total " + MjAPI.formatMj(fuel.getPowerPerCycle() * fuel.getTotalBurningTime()) + " MJ", 1, 2, Color.gray.getRGB()); - GlStateManager.popMatrix(); - } - -// @Override -// public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight) { -// flame.draw(minecraft, 2, 0); -// } - - @Override - public List getTooltipStrings(int mouseX, int mouseY) { - return Lists.newArrayList(); - } - - @Override - public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { - return false; - } - - public static class Dirty extends WrapperCombustionEngine { - final IDirtyFuel dirty; - - Dirty(IGuiHelper guiHelper, IDirtyFuel fuel) { - super(guiHelper, fuel); - this.dirty = fuel; - } - - @Override - public void getIngredients(IIngredients ingredients) { - super.getIngredients(ingredients); - ingredients.setOutput(FluidStack.class, this.dirty.getResidue()); - } - } -} diff --git a/common/buildcraft/compat/module/jei/energy/combustionengine/package-info.java b/common/buildcraft/compat/module/jei/energy/combustionengine/package-info.java index 1cad84d..3d25469 100644 --- a/common/buildcraft/compat/module/jei/energy/combustionengine/package-info.java +++ b/common/buildcraft/compat/module/jei/energy/combustionengine/package-info.java @@ -2,5 +2,6 @@ @MethodsReturnNonnullByDefault package buildcraft.compat.module.jei.energy.combustionengine; -import javax.annotation.ParametersAreNonnullByDefault; -import mcp.MethodsReturnNonnullByDefault; +import net.minecraft.MethodsReturnNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/common/buildcraft/compat/module/jei/factory/CategoryCoolable.java b/common/buildcraft/compat/module/jei/factory/CategoryCoolable.java index 426d952..2304852 100644 --- a/common/buildcraft/compat/module/jei/factory/CategoryCoolable.java +++ b/common/buildcraft/compat/module/jei/factory/CategoryCoolable.java @@ -1,64 +1,151 @@ package buildcraft.compat.module.jei.factory; -import net.minecraft.client.Minecraft; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; import buildcraft.api.BCModules; -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.BlankRecipeCategory; - -public class CategoryCoolable extends BlankRecipeCategory { - public static final String UID = "buildcraft:category_coolable"; + +import java.util.List; + +import buildcraft.api.recipes.IRefineryRecipeManager; +import buildcraft.factory.BCFactoryBlocks; +import buildcraft.lib.misc.StackUtil; +import com.google.common.collect.Lists; +import com.mojang.blaze3d.platform.InputConstants; +import com.mojang.blaze3d.vertex.PoseStack; +import mezz.jei.api.constants.VanillaTypes; +import mezz.jei.api.forge.ForgeTypes; +import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; +import mezz.jei.api.gui.drawable.IDrawable; +import mezz.jei.api.gui.drawable.IDrawableAnimated; +import mezz.jei.api.gui.drawable.IDrawableStatic; +import mezz.jei.api.gui.ingredient.IRecipeSlotsView; +import mezz.jei.api.helpers.IGuiHelper; +import mezz.jei.api.recipe.IFocusGroup; +import mezz.jei.api.recipe.RecipeIngredientRole; +import mezz.jei.api.recipe.RecipeType; +import mezz.jei.api.recipe.category.IRecipeCategory; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; + +//public class CategoryCoolable extends BlankRecipeCategory +public class CategoryCoolable implements IRecipeCategory +{ + // Calen + public static final RecipeType RECIPE_TYPE = + RecipeType.create(BCModules.FACTORY.getModId(), "category_coolable", IRefineryRecipeManager.ICoolableRecipe.class); + public static final ResourceLocation UID = new ResourceLocation(BCModules.FACTORY.getModId(), "category_coolable"); public static final ResourceLocation heatExchangerBackground = new ResourceLocation("buildcraftfactory:textures/gui/heat_exchanger.png"); + private final IDrawable background; + private final IDrawable slot; + + private final IDrawable icon; + + private final IDrawableAnimated animatedCooling; + private final IDrawableAnimated animatedHeating; - private final IDrawable background, slot; + public CategoryCoolable(IGuiHelper guiHelper) + { + // Calen: top padding add 2 to be same height as heatable +// this.background = helper.createDrawable(heatExchangerBackground, 61, 38, 54, 17, 0, 0, 18, 80); +// this.background = guiHelper.drawableBuilder(heatExchangerBackground, 61, 38, 54, 17).addPadding(0, 0, 18, 80).build(); + this.background = guiHelper.drawableBuilder(heatExchangerBackground, 61, 38, 54, 17).addPadding(2, 0, 18, 80).build(); + this.slot = guiHelper.createDrawable(heatExchangerBackground, 7, 22, 18, 18); - public CategoryCoolable(IGuiHelper helper) { - this.background = helper.createDrawable(heatExchangerBackground, 61, 38, 54, 17, 0, 0, 18, 80); - this.slot = helper.createDrawable(heatExchangerBackground, 7, 22, 18, 18); + this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(BCFactoryBlocks.heatExchange.get())); + + IDrawableStatic overComplete = guiHelper.createDrawable(CategoryCoolable.heatExchangerBackground, 52, 171, 54, 17); + this.animatedCooling = guiHelper.createAnimatedDrawable(overComplete, 40, IDrawableAnimated.StartDirection.LEFT, false); + overComplete = guiHelper.createDrawable(CategoryCoolable.heatExchangerBackground, 52, 188, 54, 17); + this.animatedHeating = guiHelper.createAnimatedDrawable(overComplete, 40, IDrawableAnimated.StartDirection.RIGHT, false); } - @Override - public String getUid() { + public ResourceLocation getUid() + { return UID; } @Override - public String getTitle() { - return "Coolable Fluids"; + public Class getRecipeClass() + { + return IRefineryRecipeManager.ICoolableRecipe.class; } @Override - public String getModName() { + public RecipeType getRecipeType() + { + return RECIPE_TYPE; + } + + public Component getTitle() + { +// return new TextComponent("Coolable Fluids"); + return new TranslatableComponent("buildcraft.jei.title.coolable_fluids"); + } + + public String getModName() + { return BCModules.FACTORY.name(); } - @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return this.background; } @Override - public void drawExtras(Minecraft minecraft) { - slot.draw(minecraft, 0, 0); - slot.draw(minecraft, 72, 0); + public IDrawable getIcon() + { + return this.icon; + } + + @Override +// public void drawExtras(Minecraft minecraft) + public void draw(IRefineryRecipeManager.ICoolableRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) + { + // Calen: y+1 to be at the same height as tubes of background + // in 1.18.2 additionally +1 +// this.slot.draw(stack, 0, 0); + this.slot.draw(stack, 0, 1); +// this.slot.draw(stack, 72, 0); + this.slot.draw(stack, 72, 1); + + // Calen: top padding add 2 to be same height as heatable +// this.animatedCooling.draw(stack, 18, 0); + this.animatedCooling.draw(stack, 18, 2); +// this.animatedHeating.draw(stack, 18, 0); + this.animatedHeating.draw(stack, 18, 2); } -// -// @Override -// public void drawAnimations(Minecraft minecraft) {} @Override - public void setRecipe(IRecipeLayout recipeLayout, WrapperCoolable recipeWrapper, IIngredients ingredients) { - IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); +// public void setRecipe(IRecipeLayout recipeLayout, WrapperCoolable recipeWrapper, IIngredients ingredients) + public void setRecipe(IRecipeLayoutBuilder builder, IRefineryRecipeManager.ICoolableRecipe recipe, IFocusGroup focuses) + { +// IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); +// guiFluidStacks.init(0, true, 1, 1, 16, 16, 10, false, (IDrawable) null); +// guiFluidStacks.set(0, (List) ingredients.getInputs(FluidStack.class).get(0)); + builder +// .addSlot(RecipeIngredientRole.INPUT, 1, 1) + .addSlot(RecipeIngredientRole.INPUT, 1, 2) + .setFluidRenderer(10, false, 16, 16) + .addIngredient(ForgeTypes.FLUID_STACK, recipe.in()); +// guiFluidStacks.init(1, false, 73, 1, 16, 16, 10, false, (IDrawable) null); +// guiFluidStacks.set(1, (List) ingredients.getOutputs(FluidStack.class).get(0)); + builder +// .addSlot(RecipeIngredientRole.OUTPUT, 73, 1) + .addSlot(RecipeIngredientRole.OUTPUT, 73, 2) + .setFluidRenderer(10, false, 16, 16) + .addIngredient(ForgeTypes.FLUID_STACK, recipe.out() == null ? StackUtil.EMPTY_FLUID : recipe.out()); + } - guiFluidStacks.init(0, true, 1, 1, 16, 16, 10, false, null); - guiFluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0)); + @Override + public List getTooltipStrings(IRefineryRecipeManager.ICoolableRecipe recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) + { + return Lists.newArrayList(); + } - guiFluidStacks.init(1, false, 73, 1, 16, 16, 10, false, null); - guiFluidStacks.set(1, ingredients.getOutputs(FluidStack.class).get(0)); + @Override + public boolean handleInput(IRefineryRecipeManager.ICoolableRecipe recipe, double mouseX, double mouseY, InputConstants.Key input) + { + return false; } } diff --git a/common/buildcraft/compat/module/jei/factory/CategoryDistiller.java b/common/buildcraft/compat/module/jei/factory/CategoryDistiller.java index 64f4501..510f9fe 100644 --- a/common/buildcraft/compat/module/jei/factory/CategoryDistiller.java +++ b/common/buildcraft/compat/module/jei/factory/CategoryDistiller.java @@ -1,70 +1,158 @@ package buildcraft.compat.module.jei.factory; -import net.minecraft.client.Minecraft; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; import buildcraft.api.BCModules; -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.BlankRecipeCategory; - -public class CategoryDistiller extends BlankRecipeCategory { - public static final String UID = "buildcraft:category_distiller"; + +import java.awt.*; +import java.util.List; + +import buildcraft.api.mj.MjAPI; +import buildcraft.api.recipes.IRefineryRecipeManager; +import buildcraft.factory.BCFactoryBlocks; +import com.google.common.collect.Lists; +import com.mojang.blaze3d.platform.InputConstants; +import com.mojang.blaze3d.vertex.PoseStack; +import mezz.jei.api.constants.VanillaTypes; +import mezz.jei.api.forge.ForgeTypes; +import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; +import mezz.jei.api.gui.drawable.IDrawable; +import mezz.jei.api.gui.drawable.IDrawableAnimated; +import mezz.jei.api.gui.drawable.IDrawableStatic; +import mezz.jei.api.gui.ingredient.IRecipeSlotsView; +import mezz.jei.api.helpers.IGuiHelper; +import mezz.jei.api.recipe.IFocusGroup; +import mezz.jei.api.recipe.RecipeIngredientRole; +import mezz.jei.api.recipe.RecipeType; +import mezz.jei.api.recipe.category.IRecipeCategory; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Font; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +//public class CategoryDistiller extends BlankRecipeCategory +public class CategoryDistiller implements IRecipeCategory +{ + // Calen + public static final RecipeType RECIPE_TYPE = + RecipeType.create(BCModules.FACTORY.getModId(), "category_distiller", IRefineryRecipeManager.IDistillationRecipe.class); + public static final ResourceLocation UID = new ResourceLocation(BCModules.FACTORY.getModId(), "category_distiller"); public static final ResourceLocation distillerBackground = new ResourceLocation("buildcraftfactory:textures/gui/distiller.png"); + private final IDrawable background; + private final IDrawable slot; + private final IDrawable fakeBackground; + + private final IDrawable icon; - private final IDrawable background, slot, fakeBackground; + private final IDrawableAnimated animated; - public CategoryDistiller(IGuiHelper helper) { - this.fakeBackground = helper.createBlankDrawable(76, 65); - this.background = helper.createDrawable(distillerBackground, 61, 12, 36, 57); - this.slot = helper.createDrawable(distillerBackground, 7, 34, 18, 18); + @OnlyIn(Dist.CLIENT) + private Font font = Minecraft.getInstance().font; + + public CategoryDistiller(IGuiHelper guiHelper) + { +// this.fakeBackground = guiHelper.createBlankDrawable(76, 65); + this.fakeBackground = guiHelper.createBlankDrawable(90, 65); + this.background = guiHelper.createDrawable(distillerBackground, 61, 12, 36, 57); + this.slot = guiHelper.createDrawable(distillerBackground, 7, 34, 18, 18); + + this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(BCFactoryBlocks.distiller.get())); + + IDrawableStatic overComplete = guiHelper.createDrawable(CategoryDistiller.distillerBackground, 212, 0, 36, 57); + this.animated = guiHelper.createAnimatedDrawable(overComplete, 40, IDrawableAnimated.StartDirection.LEFT, false); } @Override - public String getUid() { + public ResourceLocation getUid() + { return UID; } @Override - public String getTitle() { - return "Distillable Fluids"; + public Class getRecipeClass() + { + return IRefineryRecipeManager.IDistillationRecipe.class; } @Override - public String getModName() { - return BCModules.FACTORY.name(); + public RecipeType getRecipeType() + { + return RECIPE_TYPE; } @Override - public IDrawable getBackground() { - return fakeBackground; + public Component getTitle() + { +// return new TextComponent("Distillable Fluids"); + return new TranslatableComponent("buildcraft.jei.title.distillable_fluids"); + } + + public String getModName() + { + return BCModules.FACTORY.name(); } @Override - public void drawExtras(Minecraft minecraft) { - this.background.draw(minecraft, 20, 4); - this.slot.draw(minecraft, 0, 25); // -20, 21); - this.slot.draw(minecraft, 56, 0); // 36, -4); - this.slot.draw(minecraft, 56, 45); // 36, 41); + public IDrawable getBackground() + { + return this.fakeBackground; } -// @Override -// public void drawAnimations(Minecraft minecraft) {} + @Override + public IDrawable getIcon() + { + return this.icon; + } @Override - public void setRecipe(IRecipeLayout recipeLayout, WrapperDistiller recipeWrapper, IIngredients ingredients) { - IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); +// public void drawExtras(Minecraft minecraft) + public void draw(IRefineryRecipeManager.IDistillationRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) + { + this.background.draw(stack, 20, 4); + this.slot.draw(stack, 0, 25); + this.slot.draw(stack, 56, 0); + this.slot.draw(stack, 56, 45); - guiFluidStacks.init(0, true, /*-19, 22*/ 1, 26, 16, 16, 10, false, null); - guiFluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0)); + this.animated.draw(stack, 20, 4); + this.font.draw(stack, MjAPI.formatMj(recipe.powerRequired()) + " MJ", 58, 28, Color.CYAN.getRGB()); + } - guiFluidStacks.init(1, false, /*37, -3*/ 57, 1, 16, 16, 10, false, null); - guiFluidStacks.set(1, ingredients.getOutputs(FluidStack.class).get(0)); + @Override +// public void setRecipe(IRecipeLayout recipeLayout, WrapperDistiller recipeWrapper, IIngredients ingredients) + public void setRecipe(IRecipeLayoutBuilder builder, IRefineryRecipeManager.IDistillationRecipe recipe, IFocusGroup focuses) + { +// IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); +// guiFluidStacks.init(0, true, 1, 26, 16, 16, 10, false, (IDrawable) null); +// guiFluidStacks.set(0, (List) ingredients.getInputs(FluidStack.class).get(0)); + builder + .addSlot(RecipeIngredientRole.INPUT, 1, 26) + .setFluidRenderer(10, false, 16, 16) + .addIngredient(ForgeTypes.FLUID_STACK, recipe.in()); +// guiFluidStacks.init(1, false, 57, 1, 16, 16, 10, false, (IDrawable) null); +// guiFluidStacks.set(1, (List) ingredients.getOutputs(FluidStack.class).get(0)); + builder + .addSlot(RecipeIngredientRole.OUTPUT, 57, 1) + .setFluidRenderer(10, false, 16, 16) + .addIngredient(ForgeTypes.FLUID_STACK, recipe.outGas()); +// guiFluidStacks.init(2, false, 57, 46, 16, 16, 10, false, (IDrawable) null); +// guiFluidStacks.set(2, (List) ingredients.getOutputs(FluidStack.class).get(1)); + builder + .addSlot(RecipeIngredientRole.OUTPUT, 57, 46) + .setFluidRenderer(10, false, 16, 16) + .addIngredient(ForgeTypes.FLUID_STACK, recipe.outLiquid()); + } - guiFluidStacks.init(2, false, /*37, 42*/ 57, 46, 16, 16, 10, false, null); - guiFluidStacks.set(2, ingredients.getOutputs(FluidStack.class).get(1)); + @Override + public List getTooltipStrings(IRefineryRecipeManager.IDistillationRecipe recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) + { + return Lists.newArrayList(); + } + + @Override + public boolean handleInput(IRefineryRecipeManager.IDistillationRecipe recipe, double mouseX, double mouseY, InputConstants.Key input) + { + return false; } } diff --git a/common/buildcraft/compat/module/jei/factory/CategoryHeatable.java b/common/buildcraft/compat/module/jei/factory/CategoryHeatable.java index 75300fb..7ffdb0a 100644 --- a/common/buildcraft/compat/module/jei/factory/CategoryHeatable.java +++ b/common/buildcraft/compat/module/jei/factory/CategoryHeatable.java @@ -1,65 +1,145 @@ package buildcraft.compat.module.jei.factory; -import net.minecraft.client.Minecraft; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; import buildcraft.api.BCModules; -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.BlankRecipeCategory; - -public class CategoryHeatable extends BlankRecipeCategory { - public static final String UID = "buildcraft:category_heatable"; +import buildcraft.api.recipes.IRefineryRecipeManager; +import buildcraft.factory.BCFactoryBlocks; +import buildcraft.lib.misc.StackUtil; +import com.google.common.collect.Lists; +import com.mojang.blaze3d.platform.InputConstants; +import com.mojang.blaze3d.vertex.PoseStack; +import mezz.jei.api.constants.VanillaTypes; +import mezz.jei.api.forge.ForgeTypes; +import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; +import mezz.jei.api.gui.drawable.IDrawable; +import mezz.jei.api.gui.drawable.IDrawableAnimated; +import mezz.jei.api.gui.drawable.IDrawableStatic; +import mezz.jei.api.gui.ingredient.IRecipeSlotsView; +import mezz.jei.api.helpers.IGuiHelper; +import mezz.jei.api.recipe.IFocusGroup; +import mezz.jei.api.recipe.RecipeIngredientRole; +import mezz.jei.api.recipe.RecipeType; +import mezz.jei.api.recipe.category.IRecipeCategory; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +import java.util.List; + +//public class CategoryHeatable extends BlankRecipeCategory +public class CategoryHeatable implements IRecipeCategory +{ + // Calen + public static final RecipeType RECIPE_TYPE = + RecipeType.create(BCModules.FACTORY.getModId(), "category_heatable", IRefineryRecipeManager.IHeatableRecipe.class); + public static final ResourceLocation UID = new ResourceLocation(BCModules.FACTORY.getModId(), "category_heatable"); public static final ResourceLocation energyHeaterBackground = new ResourceLocation("buildcraftfactory:textures/gui/energy_heater.png"); + private final IDrawable background; + private final IDrawable slotIn; + private final IDrawable slotOut; + + private final IDrawable icon; + + private final IDrawableAnimated animated; - private final IDrawable background, slotIn, slotOut; - public CategoryHeatable(IGuiHelper helper) { - this.background = helper.createDrawable(energyHeaterBackground, 176, 19, 54, 19, 0, 0, 18, 80); - this.slotIn = helper.createDrawable(energyHeaterBackground, 7, 22, 18, 18, 0, 0, 0, 0); - this.slotOut = helper.createDrawable(energyHeaterBackground, 7, 22, 18, 18, 0, 0, 72, 0); + public CategoryHeatable(IGuiHelper guiHelper) + { +// this.background = helper.createDrawable(energyHeaterBackground, 176, 19, 54, 19, 0, 0, 18, 80); + this.background = guiHelper.drawableBuilder(energyHeaterBackground, 176, 19, 54, 19).addPadding(0, 0, 18, 80).build(); + // Calen: top+1 to be at the same height as tubes of background +// this.slotIn = helper.createDrawable(energyHeaterBackground, 7, 22, 18, 18, 0, 0, 0, 0); +// this.slotIn = guiHelper.drawableBuilder(energyHeaterBackground, 7, 22, 18, 18).addPadding(0, 0, 0, 0).build(); + this.slotIn = guiHelper.drawableBuilder(energyHeaterBackground, 7, 22, 18, 18).addPadding(1, 0, 0, 0).build(); +// this.slotOut = helper.createDrawable(energyHeaterBackground, 7, 22, 18, 18, 0, 0, 72, 0); +// this.slotOut = guiHelper.drawableBuilder(energyHeaterBackground, 7, 22, 18, 18).addPadding(0, 0, 72, 0).build(); + this.slotOut = guiHelper.drawableBuilder(energyHeaterBackground, 7, 22, 18, 18).addPadding(1, 0, 72, 0).build(); + + this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(BCFactoryBlocks.heatExchange.get())); + + IDrawableStatic overComplete = guiHelper.createDrawable(CategoryHeatable.energyHeaterBackground, 176, 152, 54, 19); + this.animated = guiHelper.createAnimatedDrawable(overComplete, 40, IDrawableAnimated.StartDirection.LEFT, false); } @Override - public String getUid() { + public ResourceLocation getUid() + { return UID; } @Override - public String getTitle() { - return "Heatable Fluids"; + public Class getRecipeClass() + { + return IRefineryRecipeManager.IHeatableRecipe.class; } @Override - public String getModName() { + public Component getTitle() + { +// return new TextComponent("Heatable Fluids"); + return new TranslatableComponent("buildcraft.jei.title.heatable_fluids"); + } + + public String getModName() + { return BCModules.FACTORY.name(); } @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return this.background; } @Override - public void drawExtras(Minecraft minecraft) { - slotIn.draw(minecraft); - slotOut.draw(minecraft); + public IDrawable getIcon() + { + return this.icon; } -// @Override -// public void drawAnimations(Minecraft minecraft) {} + @OnlyIn(Dist.CLIENT) + @Override +// public void drawExtras(Minecraft minecraft) + public void draw(IRefineryRecipeManager.IHeatableRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) + { + this.slotIn.draw(stack); + this.slotOut.draw(stack); + + this.animated.draw(stack, 18, 0); + } @Override - public void setRecipe(IRecipeLayout recipeLayout, WrapperHeatable recipeWrapper, IIngredients ingredients) { - IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); +// public void setRecipe(IRecipeLayout recipeLayout, WrapperHeatable recipeWrapper, IIngredients ingredients) + public void setRecipe(IRecipeLayoutBuilder builder, IRefineryRecipeManager.IHeatableRecipe recipe, IFocusGroup focuses) + { +// IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); +// guiFluidStacks.init(0, true, 1, 1, 16, 16, 10, false, (IDrawable) null); +// guiFluidStacks.set(0, (List) ingredients.getInputs(FluidStack.class).get(0)); + builder +// .addSlot(RecipeIngredientRole.INPUT, 1, 1) + .addSlot(RecipeIngredientRole.INPUT, 1, 2) + .setFluidRenderer(10, false, 16, 16) + .addIngredient(ForgeTypes.FLUID_STACK, recipe.in()); +// guiFluidStacks.init(1, false, 73, 1, 16, 16, 10, false, (IDrawable) null); +// guiFluidStacks.set(1, (List) ingredients.getOutputs(FluidStack.class).get(0)); + builder +// .addSlot(RecipeIngredientRole.OUTPUT, 73, 1) + .addSlot(RecipeIngredientRole.OUTPUT, 73, 2) + .setFluidRenderer(10, false, 16, 16) + .addIngredient(ForgeTypes.FLUID_STACK, recipe.out() == null ? StackUtil.EMPTY_FLUID : recipe.out()); + } - guiFluidStacks.init(0, true, 1, 1, 16, 16, 10, false, null); - guiFluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0)); + @Override + public List getTooltipStrings(IRefineryRecipeManager.IHeatableRecipe recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) + { + return Lists.newArrayList(); + } - guiFluidStacks.init(1, false, 73, 1, 16, 16, 10, false, null); - guiFluidStacks.set(1, ingredients.getOutputs(FluidStack.class).get(0)); + @Override + public boolean handleInput(IRefineryRecipeManager.IHeatableRecipe recipe, double mouseX, double mouseY, InputConstants.Key input) + { + return false; } } diff --git a/common/buildcraft/compat/module/jei/factory/HandlerCoolable.java b/common/buildcraft/compat/module/jei/factory/HandlerCoolable.java deleted file mode 100644 index a2fa129..0000000 --- a/common/buildcraft/compat/module/jei/factory/HandlerCoolable.java +++ /dev/null @@ -1,15 +0,0 @@ -package buildcraft.compat.module.jei.factory; - -import buildcraft.api.recipes.IRefineryRecipeManager; - -import buildcraft.compat.module.jei.BCPluginJEI; - -import mezz.jei.api.recipe.IRecipeWrapper; -import mezz.jei.api.recipe.IRecipeWrapperFactory; - -public class HandlerCoolable implements IRecipeWrapperFactory { - @Override - public IRecipeWrapper getRecipeWrapper(IRefineryRecipeManager.ICoolableRecipe recipe) { - return new WrapperCoolable(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), recipe); - } -} diff --git a/common/buildcraft/compat/module/jei/factory/HandlerDistiller.java b/common/buildcraft/compat/module/jei/factory/HandlerDistiller.java deleted file mode 100644 index a510139..0000000 --- a/common/buildcraft/compat/module/jei/factory/HandlerDistiller.java +++ /dev/null @@ -1,15 +0,0 @@ -package buildcraft.compat.module.jei.factory; - -import buildcraft.api.recipes.IRefineryRecipeManager; - -import buildcraft.compat.module.jei.BCPluginJEI; - -import mezz.jei.api.recipe.IRecipeWrapper; -import mezz.jei.api.recipe.IRecipeWrapperFactory; - -public class HandlerDistiller implements IRecipeWrapperFactory { - @Override - public IRecipeWrapper getRecipeWrapper(IRefineryRecipeManager.IDistillationRecipe recipe) { - return new WrapperDistiller(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), recipe); - } -} diff --git a/common/buildcraft/compat/module/jei/factory/HandlerHeatable.java b/common/buildcraft/compat/module/jei/factory/HandlerHeatable.java deleted file mode 100644 index 0fbb251..0000000 --- a/common/buildcraft/compat/module/jei/factory/HandlerHeatable.java +++ /dev/null @@ -1,15 +0,0 @@ -package buildcraft.compat.module.jei.factory; - -import buildcraft.api.recipes.IRefineryRecipeManager; - -import buildcraft.compat.module.jei.BCPluginJEI; - -import mezz.jei.api.recipe.IRecipeWrapper; -import mezz.jei.api.recipe.IRecipeWrapperFactory; - -public class HandlerHeatable implements IRecipeWrapperFactory { - @Override - public IRecipeWrapper getRecipeWrapper(IRefineryRecipeManager.IHeatableRecipe recipe) { - return new WrapperHeatable(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), recipe); - } -} diff --git a/common/buildcraft/compat/module/jei/factory/WrapperCoolable.java b/common/buildcraft/compat/module/jei/factory/WrapperCoolable.java deleted file mode 100644 index 518ae0d..0000000 --- a/common/buildcraft/compat/module/jei/factory/WrapperCoolable.java +++ /dev/null @@ -1,86 +0,0 @@ -package buildcraft.compat.module.jei.factory; - -import java.util.List; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import net.minecraft.client.Minecraft; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import buildcraft.api.recipes.IRefineryRecipeManager; -import mezz.jei.api.IGuiHelper; -import mezz.jei.api.gui.IDrawableAnimated; -import mezz.jei.api.gui.IDrawableStatic; -import mezz.jei.api.ingredients.IIngredients; -import mezz.jei.api.recipe.IRecipeWrapper; - -public class WrapperCoolable implements IRecipeWrapper { - private final IRefineryRecipeManager.ICoolableRecipe recipe; - private final ImmutableList in, out; - private final IDrawableAnimated animatedCooling, animatedHeating; - - WrapperCoolable(IGuiHelper guiHelper, IRefineryRecipeManager.ICoolableRecipe recipe) { - this.recipe = recipe; - this.in = ImmutableList.of(recipe.in()); - //noinspection ConstantConditions - this.out = (recipe.out() != null) ? ImmutableList.of(recipe.out()) : ImmutableList.of(); - - IDrawableStatic overComplete = guiHelper.createDrawable(CategoryCoolable.heatExchangerBackground, 52, 171, 54, 17); - this.animatedCooling = guiHelper.createAnimatedDrawable(overComplete, /*recipe.ticks() * 20*/ 40, IDrawableAnimated.StartDirection.LEFT, false); - overComplete = guiHelper.createDrawable(CategoryCoolable.heatExchangerBackground, 52, 188, 54, 17); - this.animatedHeating = guiHelper.createAnimatedDrawable(overComplete, /*recipe.ticks() * 20*/ 40, IDrawableAnimated.StartDirection.RIGHT, false); - } - -// @Override -// public List getInputs() { -// return Collections.emptyList(); -// } -// -// @Override -// public List getOutputs() { -// return Collections.emptyList(); -// } -// -// @Override -// public List getFluidInputs() { -// return in; -// } -// -// @Override -// public List getFluidOutputs() { -// return out; -// } -// -// @Override -// public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight) {} - - @Override - public void getIngredients(IIngredients ingredients) { - ingredients.setInputs(FluidStack.class, this.in); - ingredients.setOutputs(FluidStack.class, this.out); - } - - @Override - @SideOnly(Side.CLIENT) - public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { - this.animatedCooling.draw(minecraft, 18, 0); - this.animatedHeating.draw(minecraft, 18, 0); - // minecraft.fontRenderer.drawString("Takes " + (recipe.ticks() / 20.0) + "s", 93, 0, Color.gray.getRGB()); - } - -// @Override -// public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight) { -// animatedCooling.draw(minecraft, 18, 0); -// animatedHeating.draw(minecraft, 18, 0); -// } - - @Override - public List getTooltipStrings(int mouseX, int mouseY) { - return Lists.newArrayList(); - } - - @Override - public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { - return false; - } -} diff --git a/common/buildcraft/compat/module/jei/factory/WrapperDistiller.java b/common/buildcraft/compat/module/jei/factory/WrapperDistiller.java deleted file mode 100644 index 0c4b316..0000000 --- a/common/buildcraft/compat/module/jei/factory/WrapperDistiller.java +++ /dev/null @@ -1,84 +0,0 @@ -package buildcraft.compat.module.jei.factory; - -import java.awt.Color; -import java.util.List; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import net.minecraft.client.Minecraft; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import buildcraft.api.mj.MjAPI; -import buildcraft.api.recipes.IRefineryRecipeManager; -import mezz.jei.api.IGuiHelper; -import mezz.jei.api.gui.IDrawableAnimated; -import mezz.jei.api.gui.IDrawableStatic; -import mezz.jei.api.ingredients.IIngredients; -import mezz.jei.api.recipe.IRecipeWrapper; - -public class WrapperDistiller implements IRecipeWrapper { - public final IRefineryRecipeManager.IDistillationRecipe recipe; - private final ImmutableList in, out; - private final IDrawableAnimated animated; - - WrapperDistiller(IGuiHelper guiHelper, IRefineryRecipeManager.IDistillationRecipe recipe) { - this.recipe = recipe; - this.in = ImmutableList.of(recipe.in()); - this.out = ImmutableList.of(recipe.outGas(), recipe.outLiquid()); - - IDrawableStatic overComplete = guiHelper.createDrawable(CategoryDistiller.distillerBackground, 212, 0, 36, 57); - this.animated = guiHelper.createAnimatedDrawable(overComplete, /*recipe.ticks() * 20*/ 40, IDrawableAnimated.StartDirection.LEFT, false); - } - -// @Override -// public List getInputs() { -// return Collections.emptyList(); -// } -// -// @Override -// public List getOutputs() { -// return Collections.emptyList(); -// } -// -// @Override -// public List getFluidInputs() { -// return in; -// } -// -// @Override -// public List getFluidOutputs() { -// return out; -// } -// -// @Override -// public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight) {} - - - @Override - public void getIngredients(IIngredients ingredients) { - ingredients.setInputs(FluidStack.class, this.in); - ingredients.setOutputs(FluidStack.class, this.out); - } - - @Override - @SideOnly(Side.CLIENT) - public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { - this.animated.draw(minecraft, 20, 4); - minecraft.fontRenderer.drawString(MjAPI.formatMj(recipe.powerRequired()) + " MJ", 58, 28, Color.CYAN.getRGB()); - } - -// @Override -// public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight) { -// animated.draw(minecraft, 0, 0); -// } - - @Override - public List getTooltipStrings(int mouseX, int mouseY) { - return Lists.newArrayList(); - } - - @Override - public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { - return false; - } -} diff --git a/common/buildcraft/compat/module/jei/factory/WrapperHeatable.java b/common/buildcraft/compat/module/jei/factory/WrapperHeatable.java deleted file mode 100644 index 593aed0..0000000 --- a/common/buildcraft/compat/module/jei/factory/WrapperHeatable.java +++ /dev/null @@ -1,84 +0,0 @@ -package buildcraft.compat.module.jei.factory; - -import java.util.List; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import net.minecraft.client.Minecraft; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import buildcraft.api.recipes.IRefineryRecipeManager; -import mezz.jei.api.IGuiHelper; -import mezz.jei.api.gui.IDrawableAnimated; -import mezz.jei.api.gui.IDrawableStatic; -import mezz.jei.api.ingredients.IIngredients; -import mezz.jei.api.recipe.IRecipeWrapper; - -public class WrapperHeatable implements IRecipeWrapper { - private final IRefineryRecipeManager.IHeatableRecipe heatable; - private final ImmutableList in, out; - private final IDrawableAnimated animated; - - public WrapperHeatable(IGuiHelper guiHelper, IRefineryRecipeManager.IHeatableRecipe recipe) { - this.heatable = recipe; - this.in = ImmutableList.of(recipe.in()); - //noinspection ConstantConditions - this.out = (recipe.out() != null) ? ImmutableList.of(recipe.out()) : ImmutableList.of(); - - IDrawableStatic overComplete = guiHelper.createDrawable(CategoryHeatable.energyHeaterBackground, 176, 152, 54, 19); - animated = guiHelper.createAnimatedDrawable(overComplete, /*recipe.ticks() * 20*/ 40, IDrawableAnimated.StartDirection.LEFT, false); - } - -// @Override -// public List getInputs() { -// return Collections.emptyList(); -// } -// -// @Override -// public List getOutputs() { -// return Collections.emptyList(); -// } -// -// @Override -// public List getFluidInputs() { -// return in; -// } -// -// @Override -// public List getFluidOutputs() { -// return out; -// } -// -// @Override -// public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight) {} - - @Override - public void getIngredients(IIngredients ingredients) { - ingredients.setInputs(FluidStack.class, this.in); - ingredients.setOutputs(FluidStack.class, this.out); - } - - @Override - @SideOnly(Side.CLIENT) - public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { - this.animated.draw(minecraft, 18, 0); -// minecraft.fontRenderer.drawString("Takes " + (heatable.ticks() / 20.0) + "s", 93, 0, Color.gray.getRGB()); -// int rftick = Math.abs(heatable.heatFrom() - heatable.heatTo()) * BuildCraftFactory.rfPerHeatPerMB * heatable.in().amount; -// minecraft.fontRenderer.drawString(" at " + rftick + "RF/t", 93, 11, Color.gray.getRGB()); - } - -// @Override -// public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight) { -// animated.draw(minecraft, 18, 0); -// } - - @Override - public List getTooltipStrings(int mouseX, int mouseY) { - return Lists.newArrayList(); - } - - @Override - public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { - return false; - } -} diff --git a/common/buildcraft/compat/module/jei/factory/package-info.java b/common/buildcraft/compat/module/jei/factory/package-info.java index 04b20ee..3153dd2 100644 --- a/common/buildcraft/compat/module/jei/factory/package-info.java +++ b/common/buildcraft/compat/module/jei/factory/package-info.java @@ -2,5 +2,6 @@ @MethodsReturnNonnullByDefault package buildcraft.compat.module.jei.factory; -import javax.annotation.ParametersAreNonnullByDefault; -import mcp.MethodsReturnNonnullByDefault; +import net.minecraft.MethodsReturnNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/common/buildcraft/compat/module/jei/gui/GuiHandlerBuildCraft.java b/common/buildcraft/compat/module/jei/gui/GuiHandlerBuildCraft.java new file mode 100644 index 0000000..fc5eccc --- /dev/null +++ b/common/buildcraft/compat/module/jei/gui/GuiHandlerBuildCraft.java @@ -0,0 +1,60 @@ +package buildcraft.compat.module.jei.gui; + +import buildcraft.lib.gui.GuiBC8; +import buildcraft.lib.gui.IGuiElement; +import buildcraft.lib.gui.pos.GuiRectangle; +import mezz.jei.api.gui.handlers.IGuiContainerHandler; +import net.minecraft.client.renderer.Rect2i; +import net.minecraft.util.Mth; +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.List; + +public class GuiHandlerBuildCraft implements IGuiContainerHandler> +{ + @NotNull + @Override + public List getGuiExtraAreas(GuiBC8 guiDirty) + { +// return screen.getGuiExtraAreas(); + List list = new ArrayList(); + + for (IGuiElement element : guiDirty.mainGui.shownElements) + { + GuiRectangle rect = element.asImmutable(); + int x = (int) rect.x; + int y = (int) rect.y; +// int endX = MathHelper.ceil(rect.getEndX()); + int endX = Mth.ceil(rect.getEndX()); +// int endY = MathHelper.ceil(rect.getEndY()); + int endY = Mth.ceil(rect.getEndY()); + int width = endX - x; + int height = endY - y; + list.add(new Rect2i(x, y, width, height)); + } + + return list; + } + + +// @Nullable +// @Override +// public Object getIngredientUnderMouse(GuiBC8 screen, double mouseX, double mouseY) +// { +// return screen.getIngredientUnderMouse(mouseX, mouseY); +// } + +// @NotNull +// @Override +// public Collection getGuiClickableAreas(GuiBC8 screen, double mouseX, +// double mouseY) +// { +//// if (screen instanceof InscriberScreen) { +//// return Collections.singletonList( +//// IGuiClickableArea.createBasic(82, 39, 26, 16, InscriberRecipeCategory.RECIPE_TYPE)); +//// } +// +// return Collections.emptyList(); +// } +} diff --git a/common/buildcraft/compat/module/jei/recipe/GateGuiHandler.java b/common/buildcraft/compat/module/jei/recipe/GateGuiHandler.java deleted file mode 100644 index bb27224..0000000 --- a/common/buildcraft/compat/module/jei/recipe/GateGuiHandler.java +++ /dev/null @@ -1,37 +0,0 @@ -package buildcraft.compat.module.jei.recipe; -//package buildcraft.compat.module.jei; -// -//import java.awt.Rectangle; -//import java.util.ArrayList; -//import java.util.List; -// -//import buildcraft.transport.gui.GuiGateInterface; -// -//import mezz.jei.api.gui.IAdvancedGuiHandler; -// -//public class GateGuiHandler implements IAdvancedGuiHandler { -// @Override -// public Class getGuiContainerClass() { -// return GuiGateInterface.class; -// } -// -// @Override -// public List getGuiExtraAreas(GuiGateInterface gate) { -// List rectangles = new ArrayList<>(); -// int guiLeft = (gate.width - gate.xSize()) / 2; -// int guiTop = (gate.height - gate.ySize()) / 2; -// -// // Actions -// int actionStartX = guiLeft + gate.xSize(); -// int actionStartY = guiTop + 6; -// -// if (gate.actionRows > 1) { -// int endRow = gate.actionRows * 18; -// rectangles.add(new Rectangle(actionStartX, actionStartY, 6 * 18, endRow)); -// rectangles.add(new Rectangle(actionStartX, actionStartY + endRow, gate.lastActionRowSize, 18)); -// } else if (gate.actionRows == 1) { -// rectangles.add(new Rectangle(actionStartX, actionStartY, gate.lastActionRowSize, 18)); -// } -// return rectangles; -// } -//} diff --git a/common/buildcraft/compat/module/jei/recipe/GuiHandlerBuildCraft.java b/common/buildcraft/compat/module/jei/recipe/GuiHandlerBuildCraft.java deleted file mode 100644 index f6a434d..0000000 --- a/common/buildcraft/compat/module/jei/recipe/GuiHandlerBuildCraft.java +++ /dev/null @@ -1,51 +0,0 @@ -package buildcraft.compat.module.jei.recipe; - -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Nullable; - -import net.minecraft.util.math.MathHelper; - -import buildcraft.lib.gui.GuiBC8; -import buildcraft.lib.gui.IGuiElement; -import buildcraft.lib.gui.pos.GuiRectangle; - -import mezz.jei.api.gui.IAdvancedGuiHandler; - -public class GuiHandlerBuildCraft implements IAdvancedGuiHandler { - - @Override - public Class getGuiContainerClass() { - return GuiBC8.class; - } - - @Override - @Nullable - public List getGuiExtraAreas(GuiBC8 guiDirty) { - GuiBC8 gui = guiDirty; - // Get the rectangles of everything that is *outside* the main gui area - List list = new ArrayList<>(); - for (IGuiElement element : gui.mainGui.shownElements) { - // Ignore children: all ledger style elements are top level - GuiRectangle rect = element.asImmutable(); -// if (!gui.rootElement.contains(rect)) { - // Round down x and y - int x = (int) rect.x; - int y = (int) rect.y; - // Round up width and height - int endX = MathHelper.ceil(rect.getEndX()); - int endY = MathHelper.ceil(rect.getEndY()); - int width = endX - x; - int height = endY - y; - list.add(new Rectangle(x, y, width, height)); -// } - } - if (list.isEmpty()) { - // Cheapen JEI checks a tiny bit. Possibly. - return null; - } - return list; - } -} diff --git a/common/buildcraft/compat/module/jei/recipe/HandlerFlexibleRecipe.java b/common/buildcraft/compat/module/jei/recipe/HandlerFlexibleRecipe.java deleted file mode 100644 index 1454d01..0000000 --- a/common/buildcraft/compat/module/jei/recipe/HandlerFlexibleRecipe.java +++ /dev/null @@ -1,15 +0,0 @@ -package buildcraft.compat.module.jei.recipe; -//package buildcraft.compat.module.jei.recipe; -// -//import buildcraft.api.recipes.IFlexibleRecipe; -// -//import javax.annotation.Nonnull; -//import mezz.jei.api.recipe.IRecipeHandler; -// -//public abstract class HandlerFlexibleRecipe implements IRecipeHandler { -// @Nonnull -// @Override -// public Class getRecipeClass() { -// return IFlexibleRecipe.class; -// } -//} diff --git a/common/buildcraft/compat/module/jei/recipe/LedgerGuiHandler.java b/common/buildcraft/compat/module/jei/recipe/LedgerGuiHandler.java deleted file mode 100644 index 7624e92..0000000 --- a/common/buildcraft/compat/module/jei/recipe/LedgerGuiHandler.java +++ /dev/null @@ -1,35 +0,0 @@ -package buildcraft.compat.module.jei.recipe; -//package buildcraft.compat.module.jei; -// -//import java.awt.Rectangle; -//import java.util.ArrayList; -//import java.util.List; -// -//import buildcraft.core.lib.gui.GuiBuildCraft; -//import buildcraft.core.lib.gui.Ledger; -// -//import mezz.jei.api.gui.IAdvancedGuiHandler; -// -//public class LedgerGuiHandler implements IAdvancedGuiHandler { -// @Override -// public Class getGuiContainerClass() { -// return GuiBuildCraft.class; -// } -// -// @Override -// public List getGuiExtraAreas(GuiBuildCraft gui) { -// List rectangles = new ArrayList<>(); -// int guiLeft = (gui.width - gui.xSize()) / 2; -// int guiTop = (gui.height - gui.ySize()) / 2; -// -// int yPos = 8; -// for (Ledger l : gui.ledgerManager.getAll()) { -// if (l.isVisible()) { -// rectangles.add(new Rectangle(guiLeft + gui.xSize(), guiTop + yPos, l.getWidth(), l.getHeight())); -// yPos += l.getHeight(); -// } -// } -// -// return rectangles; -// } -//} diff --git a/common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java b/common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java index 701b365..3921048 100644 --- a/common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java +++ b/common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java @@ -1,68 +1,186 @@ package buildcraft.compat.module.jei.silicon; +import buildcraft.api.BCModules; + +import java.awt.*; +import java.util.*; import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; +import buildcraft.api.mj.MjAPI; +import buildcraft.api.recipes.AssemblyRecipe; +import buildcraft.api.recipes.IngredientStack; +import buildcraft.silicon.BCSiliconBlocks; +import com.google.common.collect.Lists; +import com.mojang.blaze3d.vertex.PoseStack; +import mezz.jei.api.constants.VanillaTypes; +import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; +import mezz.jei.api.gui.drawable.IDrawable; +import mezz.jei.api.gui.drawable.IDrawableAnimated; +import mezz.jei.api.gui.drawable.IDrawableStatic; +import mezz.jei.api.gui.ingredient.IRecipeSlotsView; +import mezz.jei.api.helpers.IGuiHelper; +import mezz.jei.api.recipe.IFocusGroup; +import mezz.jei.api.recipe.RecipeIngredientRole; +import mezz.jei.api.recipe.RecipeType; +import mezz.jei.api.recipe.category.IRecipeCategory; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Font; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; -import buildcraft.api.BCModules; +public class CategoryAssemblyTable implements IRecipeCategory +{ + // Calen + public static final RecipeType RECIPE_TYPE = + RecipeType.create(BCModules.SILICON.getModId(), "assembly", AssemblyRecipe.class); + // public static final ResourceLocation UID = new ResourceLocation("buildcraft-compat:silicon.assembly"); + public static final ResourceLocation UID = new ResourceLocation(BCModules.SILICON.getModId(), "assembly"); + protected final ResourceLocation backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/assembly_table.png"); + private final IDrawable background; -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.IRecipeCategory; + private final IDrawable icon; -public class CategoryAssemblyTable implements IRecipeCategory { - public static final String UID = "buildcraft-compat:silicon.assembly"; + // private final AssemblyRecipeBasic recipe; +// private final IDrawableAnimated progressBar; + private final Map progressBarMap = new HashMap<>(); + // private final List> inputs; +// private final List inputs; + private final Map> inputsMap = new HashMap<>(); + // private final List outputs; +// private final Ingredient outputs; + private final Map outputsMap = new HashMap<>(); - protected final ResourceLocation backgroundLocation; - private final IDrawable background; + @OnlyIn(Dist.CLIENT) + private Font font = Minecraft.getInstance().font; + + // public CategoryAssemblyTable(IGuiHelper guiHelper, AssemblyRecipeBasic recipe) + public CategoryAssemblyTable(IGuiHelper guiHelper, Collection recipes) + { +// this.background = guiHelper.createDrawable(this.backgroundLocation, 5, 34, 166, 76, 10, 0, 0, 0); + this.background = guiHelper.drawableBuilder(this.backgroundLocation, 5, 34, 166, 76).addPadding(10, 0, 0, 0).build(); + + this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(BCSiliconBlocks.assemblyTable.get())); + + ResourceLocation backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/assembly_table.png"); +// IDrawableStatic progressDrawable = guiHelper.createDrawable(backgroundLocation, 176, 48, 4, 71, 10, 0, 0, 0); + IDrawableStatic progressDrawable = guiHelper.drawableBuilder(backgroundLocation, 176, 48, 4, 71).addPadding(10, 0, 0, 0).build(); + + for (AssemblyRecipe recipe : recipes) + { +// this.recipe = recipe; +// List> _inputs = Lists.newArrayList(); +// List _inputs = Lists.newArrayList(); + List _inputs = Lists.newArrayList(); + + for (IngredientStack in : recipe.getInputsFor(ItemStack.EMPTY)) + { + List inner = new ArrayList(); + + for (ItemStack matching : in.ingredient.getItems()) + { + matching = matching.copy(); + matching.setCount(in.count); + inner.add(matching); +// _inputs.add(matching); + } + +// _inputs.add(inner); + _inputs.add(Ingredient.of(inner.stream())); + } - public CategoryAssemblyTable(IGuiHelper guiHelper) { - this.backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/assembly_table.png"); - this.background = guiHelper.createDrawable(backgroundLocation, 5, 34, 166, 76, 10, 0, 0, 0); +// this.inputs = ImmutableList.copyOf(_inputs); +// this.inputs = Ingredient.of(_inputs.stream()); +// this.inputs = _inputs; + this.inputsMap.put(recipe, _inputs); +// this.outputs = ImmutableList.copyOf(recipe.getOutputPreviews()); +// this.outputs = Ingredient.of(recipe.getOutputPreviews().stream()); + this.outputsMap.put(recipe, Ingredient.of(recipe.getOutputPreviews().stream())); + +// long mj = this.recipe.getRequiredMicroJoulesFor(ItemStack.EMPTY); + long mj = recipe.getRequiredMicroJoulesFor(ItemStack.EMPTY); +// this.progressBar = guiHelper.createAnimatedDrawable(progressDrawable, (int) Math.max(10L, mj / MjAPI.MJ / 50L), IDrawableAnimated.StartDirection.BOTTOM, false); + progressBarMap.put(recipe, guiHelper.createAnimatedDrawable(progressDrawable, (int) Math.max(10L, mj / MjAPI.MJ / 50L), IDrawableAnimated.StartDirection.BOTTOM, false)); + } } @Override - public String getUid() { + public ResourceLocation getUid() + { return UID; } @Override - public String getTitle() { - return "Assembly Table"; + public Class getRecipeClass() + { + return AssemblyRecipe.class; } @Override - public String getModName() { + public Component getTitle() + { +// return new TextComponent("Assembly Table"); + return new TranslatableComponent("tile.assemblyTableBlock.name"); + } + + public String getModName() + { return BCModules.SILICON.name(); } @Override - public IDrawable getBackground() { - return background; + public IDrawable getBackground() + { + return this.background; } @Override - public void setRecipe(IRecipeLayout recipeLayout, WrapperAssemblyTable recipeWrapper, IIngredients ingredients) { - IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); - - List> inputs = ingredients.getInputs(ItemStack.class); - for (int i = 0; i < inputs.size(); i++) { - guiItemStacks.init(i, true, 2 + (i % 3) * 18, 11 + (i / 3) * 18); - - guiItemStacks.set(i, inputs.get(i)); -// Object o = recipeWrapper.getInputs().get(i); -// if (o instanceof ItemStack) { -// guiItemStacks.set(i, (ItemStack) o); -// } else if (o instanceof List) { -// guiItemStacks.set(i, (List) o); -// } + public IDrawable getIcon() + { + return this.icon; + } + + @OnlyIn(Dist.CLIENT) + @Override + public void draw(AssemblyRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) + { +// this.progressBar.draw(stack, 81, 2); + this.progressBarMap.get(recipe).draw(stack, 81, 2); +// long mj = this.recipe.getRequiredMicroJoulesFor(ItemStack.EMPTY); + long mj = recipe.getRequiredMicroJoulesFor(ItemStack.EMPTY); + this.font.draw(stack, MjAPI.formatMj(mj) + " MJ", 4, 0, Color.gray.getRGB()); + } + + @Override +// public void setRecipe(IRecipeLayout recipeLayout, WrapperAssemblyTable recipeWrapper, IIngredients ingredients) + public void setRecipe(IRecipeLayoutBuilder builder, AssemblyRecipe recipe, IFocusGroup focuses) + { +// IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); +// List> inputs = ingredients.getInputs(ItemStack.class); +// List> inputs = this.inputs; + + // Calen: the looks moved x-1 y-1 off the slot in 1.18.2 with the position used in 1.12.2 +// for (int i = 0; i < inputs.size(); ++i) + List inputs = inputsMap.get(recipe); + for (int i = 0; i < inputs.size(); ++i) + { +// guiItemStacks.init(i, true, 2 + i % 3 * 18, 11 + i / 3 * 18); +// guiItemStacks.set(i, (List) inputs.get(i)); + builder +// .addSlot(RecipeIngredientRole.INPUT, 2 + i % 3 * 18, 11 + i / 3 * 18) + .addSlot(RecipeIngredientRole.INPUT, 3 + i % 3 * 18, 12 + i / 3 * 18) + .addIngredients(inputs.get(i)); } - guiItemStacks.init(12, false, 110, 11); - guiItemStacks.set(12, ingredients.getOutputs(ItemStack.class).get(0)); +// guiItemStacks.init(12, false, 110, 11); +// guiItemStacks.set(12, (List) ingredients.getOutputs(ItemStack.class).get(0)); + builder +// .addSlot(RecipeIngredientRole.OUTPUT, 110, 11) + .addSlot(RecipeIngredientRole.OUTPUT, 111, 12) + .addIngredients(this.outputsMap.get(recipe)); } } diff --git a/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java b/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java index ffe1d16..8dea97d 100644 --- a/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java +++ b/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java @@ -1,77 +1,149 @@ package buildcraft.compat.module.jei.silicon; +import buildcraft.api.BCModules; + +import java.awt.*; import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; +import buildcraft.api.mj.MjAPI; +import buildcraft.api.recipes.IntegrationRecipe; +import buildcraft.silicon.BCSiliconBlocks; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.mojang.blaze3d.vertex.PoseStack; +import mezz.jei.api.constants.VanillaTypes; +import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; +import mezz.jei.api.gui.drawable.IDrawable; +import mezz.jei.api.gui.drawable.IDrawableAnimated; +import mezz.jei.api.gui.drawable.IDrawableStatic; +import mezz.jei.api.gui.ingredient.IRecipeSlotsView; +import mezz.jei.api.helpers.IGuiHelper; +import mezz.jei.api.recipe.IFocusGroup; +import mezz.jei.api.recipe.RecipeIngredientRole; +import mezz.jei.api.recipe.RecipeType; +import mezz.jei.api.recipe.category.IRecipeCategory; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Font; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.level.block.Blocks; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; -import buildcraft.api.BCModules; +//public class CategoryIntegrationTable implements IRecipeCategory +public class CategoryIntegrationTable implements IRecipeCategory +{ + // Calen + public static final RecipeType RECIPE_TYPE = + RecipeType.create(BCModules.SILICON.getModId(), "integration", IntegrationRecipe.class); + // public static final ResourceLocation UID = new ResourceLocation("buildcraft-compat:silicon.integration"); + public static final ResourceLocation UID = new ResourceLocation(BCModules.SILICON.getModId(), "integration"); + protected final ResourceLocation backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/integration_table.png"); + private final IDrawable background; -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.IRecipeCategory; + private final IDrawable icon; -public class CategoryIntegrationTable implements IRecipeCategory { - public static final String UID = "buildcraft-compat:silicon.integration"; + private final IntegrationRecipe recipe; + private final IDrawableAnimated progressBar; + private final List inputs; + private final List outputs; - protected final ResourceLocation backgroundLocation; - private final IDrawable background; - private WrapperIntegrationTable wrapper = null; + @OnlyIn(Dist.CLIENT) + private Font font = Minecraft.getInstance().font; - public CategoryIntegrationTable(IGuiHelper guiHelper) { - backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/integration_table.png"); - background = guiHelper.createDrawable(backgroundLocation, 17, 22, 153, 71, 0, 0, 9, 0); + public CategoryIntegrationTable(IGuiHelper guiHelper, IntegrationRecipe recipe) + { +// this.background = guiHelper.createDrawable(this.backgroundLocation, 17, 22, 153, 71, 0, 0, 9, 0); + this.background = guiHelper.drawableBuilder(this.backgroundLocation, 17, 22, 153, 71).addPadding(0, 0, 9, 0).build(); + + this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(BCSiliconBlocks.integrationTable.get())); + + this.recipe = recipe; + // Calen: not impl in 1.12.2 + List inputs = Lists.newArrayList(); + this.inputs = ImmutableList.copyOf(inputs); + this.outputs = ImmutableList.of(new ItemStack(Blocks.COBBLESTONE)); + ResourceLocation backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/integration_table.png"); +// IDrawableStatic progressDrawable = guiHelper.createDrawable(backgroundLocation, 176, 17, 4, 69, 0, 0, 0, 0); + IDrawableStatic progressDrawable = guiHelper.drawableBuilder(this.backgroundLocation, 176, 17, 4, 69).addPadding(0, 0, 0, 0).build(); + this.progressBar = guiHelper.createAnimatedDrawable(progressDrawable, 720, IDrawableAnimated.StartDirection.BOTTOM, false); } - @Override - public String getUid() { + public ResourceLocation getUid() + { return UID; } @Override - public String getTitle() { - return "Integration Table"; + public Class getRecipeClass() + { + return IntegrationRecipe.class; } - @Override - public String getModName() { + public Component getTitle() + { +// return new TextComponent("Integration Table"); + return new TranslatableComponent("tile.integrationTableBlock.name"); + } + + public String getModName() + { return BCModules.SILICON.name(); } + public IDrawable getBackground() + { + return this.background; + } + @Override - public IDrawable getBackground() { - return background; + public IDrawable getIcon() + { + return this.icon; } + + @OnlyIn(Dist.CLIENT) @Override - public void setRecipe(IRecipeLayout recipeLayout, WrapperIntegrationTable recipeWrapper, IIngredients ingredients) { - IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); - - List> inputs = ingredients.getInputs(ItemStack.class); - int inventoryIndex = 0; - for (int y = 0; y < 3; ++y) { - for (int x = 0; x < 3; ++x) { - int slotIndex = ((x == 1) && (y == 1)) ? 0 : (x + y * 3 + 1); - if (inputs.size() > slotIndex) { - guiItemStacks.init(inventoryIndex, true, 19 + x * 25, 24 + y * 25); - guiItemStacks.set(inventoryIndex, inputs.get(slotIndex)); - inventoryIndex++; + public void draw(IntegrationRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) + { + this.progressBar.draw(stack, 156, 1); + this.font.draw(stack, MjAPI.formatMj(0L) + " MJ", 80, 52, Color.gray.getRGB()); + + } + + // public void setRecipe(IRecipeLayout recipeLayout, WrapperIntegrationTable recipeWrapper, IIngredients ingredients) + public void setRecipe(IRecipeLayoutBuilder builder, IntegrationRecipe recipe, IFocusGroup focuses) + { +// IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); +// List> inputs = ingredients.getInputs(ItemStack.class); +// int inventoryIndex = 0; + + for (int y = 0; y < 3; ++y) + { + for (int x = 0; x < 3; ++x) + { + int slotIndex = x == 1 && y == 1 ? 0 : x + y * 3 + 1; + if (inputs.size() > slotIndex) + { +// guiItemStacks.init(inventoryIndex, true, 19 + x * 25, 24 + y * 25); +// guiItemStacks.set(inventoryIndex, (List) inputs.get(slotIndex)); + builder + .addSlot(RecipeIngredientRole.INPUT, 19 + x * 25, 24 + y * 25) + .addIngredient(VanillaTypes.ITEM_STACK, this.inputs.get(slotIndex)); +// ++inventoryIndex; } - // this.addSlotToContainer(new SlotBase(x == 1 && y == 1 ? tile.invTarget : tile.invToIntegrate, indexes[x + y * 3], 19 + x * 25, 24 + y * 25)); } } -// for (int i = 0; i < wrapper.getInputs().size(); i++) { -// int x = ContainerIntegrationTable.SLOT_X[i] - 9; -// int y = ContainerIntegrationTable.SLOT_Y[i] - 23; -// guiItemStacks.init(i, true, x, y); -// guiItemStacks.set(i, (List) wrapper.getInputs().get(i)); -// } - - guiItemStacks.init(inventoryIndex, false, 129, 26); - guiItemStacks.set(inventoryIndex, ingredients.getOutputs(ItemStack.class).get(0)); +// guiItemStacks.init(inventoryIndex, false, 129, 26); +// guiItemStacks.set(inventoryIndex, (List) ingredients.getOutputs(ItemStack.class).get(0)); + builder + .addSlot(RecipeIngredientRole.INPUT, 129, 26) + .addIngredients(Ingredient.of(this.outputs.stream())); +// ++inventoryIndex; } } diff --git a/common/buildcraft/compat/module/jei/silicon/HandlerIntegrationTable.java b/common/buildcraft/compat/module/jei/silicon/HandlerIntegrationTable.java deleted file mode 100644 index dfefe11..0000000 --- a/common/buildcraft/compat/module/jei/silicon/HandlerIntegrationTable.java +++ /dev/null @@ -1,38 +0,0 @@ -package buildcraft.compat.module.jei.silicon; - -import buildcraft.api.recipes.IntegrationRecipe; - -import buildcraft.compat.module.jei.BCPluginJEI; - -import mezz.jei.api.recipe.IRecipeWrapper; -import mezz.jei.api.recipe.IRecipeWrapperFactory; - -public class HandlerIntegrationTable implements IRecipeWrapperFactory { - @Override - public IRecipeWrapper getRecipeWrapper(IntegrationRecipe recipe) { - return new WrapperIntegrationTable(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), recipe); - } - - // -// @Nonnull -// @Override -// public Class getRecipeClass() { -// return IIntegrationRecipe.class; -// } -// -// @Override -// public String getRecipeCategoryUid() { -// return CategoryIntegrationTable.UID; -// } -// -// @Nonnull -// @Override -// public IRecipeWrapper getRecipeWrapper(@Nonnull IIntegrationRecipe recipe) { -// return new WrapperIntegrationTable(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), recipe); -// } -// -// @Override -// public boolean isRecipeValid(@Nonnull IIntegrationRecipe recipe) { -// return true; -// } -} diff --git a/common/buildcraft/compat/module/jei/silicon/Utils.java b/common/buildcraft/compat/module/jei/silicon/Utils.java index 197c28d..c4785bf 100644 --- a/common/buildcraft/compat/module/jei/silicon/Utils.java +++ b/common/buildcraft/compat/module/jei/silicon/Utils.java @@ -1,16 +1,25 @@ package buildcraft.compat.module.jei.silicon; -import java.util.List; -import com.google.common.collect.Lists; -import net.minecraft.item.ItemStack; import buildcraft.api.recipes.StackDefinition; +import com.google.common.collect.Lists; +import net.minecraft.world.item.ItemStack; + +import java.util.List; + +public final class Utils +{ + public Utils() + { + } -public final class Utils { - public static List getItemStacks(StackDefinition definition) { + public static List getItemStacks(StackDefinition definition) + { List list = Lists.newArrayList(); + if (definition.filter != null) + { - if (definition.filter != null) { - for (ItemStack stack : definition.filter.getExamples()) { + for (ItemStack stack : definition.filter.getExamples()) + { ItemStack sizedStack = stack.copy(); sizedStack.setCount(definition.count); list.add(sizedStack); diff --git a/common/buildcraft/compat/module/jei/silicon/WrapperAssemblyTable.java b/common/buildcraft/compat/module/jei/silicon/WrapperAssemblyTable.java deleted file mode 100644 index 0015916..0000000 --- a/common/buildcraft/compat/module/jei/silicon/WrapperAssemblyTable.java +++ /dev/null @@ -1,83 +0,0 @@ -package buildcraft.compat.module.jei.silicon; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - -import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import buildcraft.api.mj.MjAPI; -import buildcraft.api.recipes.AssemblyRecipeBasic; -import buildcraft.api.recipes.IngredientStack; - -import buildcraft.compat.module.jei.BCPluginJEI; - -import mezz.jei.api.IGuiHelper; -import mezz.jei.api.gui.IDrawableAnimated; -import mezz.jei.api.gui.IDrawableStatic; -import mezz.jei.api.ingredients.IIngredients; -import mezz.jei.api.recipe.IRecipeWrapper; - -public class WrapperAssemblyTable implements IRecipeWrapper { - private final AssemblyRecipeBasic recipe; - private final IDrawableAnimated progressBar; - private final List> inputs; - private final List outputs; - - public WrapperAssemblyTable(AssemblyRecipeBasic recipe) { - this.recipe = recipe; - List> _inputs = Lists.newArrayList(); - for (IngredientStack in : recipe.getInputsFor(ItemStack.EMPTY)) { - List inner = new ArrayList<>(); - for (ItemStack matching : in.ingredient.getMatchingStacks()) { - matching = matching.copy(); - matching.setCount(in.count); - inner.add(matching); - } - _inputs.add(inner); - } - this.inputs = ImmutableList.copyOf(_inputs); - this.outputs = ImmutableList.copyOf(recipe.getOutputPreviews()); - - IGuiHelper guiHelper = BCPluginJEI.registry.getJeiHelpers().getGuiHelper(); - - ResourceLocation backgroundLocation = - new ResourceLocation("buildcraftsilicon", "textures/gui/assembly_table.png"); - IDrawableStatic progressDrawable = guiHelper.createDrawable(backgroundLocation, 176, 48, 4, 71, 10, 0, 0, 0); - long mj = this.recipe.getRequiredMicroJoulesFor(ItemStack.EMPTY); - progressBar = guiHelper.createAnimatedDrawable(progressDrawable, (int) Math.max(10, mj / MjAPI.MJ / 50), - IDrawableAnimated.StartDirection.BOTTOM, false); - } - - @Override - public void getIngredients(IIngredients ingredients) { - ingredients.setInputLists(ItemStack.class, this.inputs); - ingredients.setOutputs(ItemStack.class, this.outputs); - } - - @Override - @SideOnly(Side.CLIENT) - public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { - this.progressBar.draw(minecraft, 81, 2); - long mj = this.recipe.getRequiredMicroJoulesFor(ItemStack.EMPTY); - minecraft.fontRenderer.drawString(MjAPI.formatMj(mj) + " MJ", 4, 0, Color.gray.getRGB()); - } - - @Override - public List getTooltipStrings(int mouseX, int mouseY) { - return Lists.newArrayList(); - } - - @Override - public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { - return false; - } -} diff --git a/common/buildcraft/compat/module/jei/silicon/WrapperIntegrationTable.java b/common/buildcraft/compat/module/jei/silicon/WrapperIntegrationTable.java deleted file mode 100644 index abe1a52..0000000 --- a/common/buildcraft/compat/module/jei/silicon/WrapperIntegrationTable.java +++ /dev/null @@ -1,93 +0,0 @@ -package buildcraft.compat.module.jei.silicon; - -import java.awt.Color; -import java.util.List; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import buildcraft.api.mj.MjAPI; -import buildcraft.api.recipes.IntegrationRecipe; -import buildcraft.api.recipes.StackDefinition; -import mezz.jei.api.IGuiHelper; -import mezz.jei.api.gui.IDrawableAnimated; -import mezz.jei.api.gui.IDrawableStatic; -import mezz.jei.api.ingredients.IIngredients; -import mezz.jei.api.recipe.IRecipeWrapper; - -public class WrapperIntegrationTable implements IRecipeWrapper { - private final IntegrationRecipe recipe; - private final IDrawableAnimated progressBar; - private final List inputs, outputs; - - public WrapperIntegrationTable(IGuiHelper guiHelper, IntegrationRecipe recipe) { - this.recipe = recipe; - - List inputs = Lists.newArrayList(); -// inputs.addAll(Utils.getItemStacks(recipe.target)); -// for (StackDefinition definition : recipe.toIntegrate) { -// inputs.addAll(Utils.getItemStacks(definition)); -// } - this.inputs = ImmutableList.copyOf(inputs); - this.outputs = ImmutableList.of(new ItemStack(Blocks.COBBLESTONE)); - - ResourceLocation backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/integration_table.png"); - IDrawableStatic progressDrawable = guiHelper.createDrawable(backgroundLocation, 176, 17, 4, 69, 0, 0, 0, 0); - this.progressBar = guiHelper.createAnimatedDrawable(progressDrawable, (int) (/*recipe.requiredMicroJoules / */ 720), IDrawableAnimated.StartDirection.BOTTOM, false); - } - -// @Override -// public List getInputs() { -// return inputs; -// } -// -// @Override -// public List getOutputs() { -// return outputs; -// } -// -// @Override -// public List getFluidInputs() { -// return null; -// } -// -// @Override -// public List getFluidOutputs() { -// return null; -// } -// -// @Override -// public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight) {} - - @Override - public void getIngredients(IIngredients ingredients) { - ingredients.setInputs(ItemStack.class, this.inputs); - ingredients.setOutputs(ItemStack.class, this.outputs); - } - - @Override - @SideOnly(Side.CLIENT) - public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { - this.progressBar.draw(minecraft, 156, 1); - minecraft.fontRenderer.drawString(MjAPI.formatMj(/*this.recipe.requiredMicroJoules*/0) + " MJ", 80, 52, Color.gray.getRGB()); - } -// -// @Override -// public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight) { -// progressBar.draw(minecraft, 156, 1); -// } - - @Override - public List getTooltipStrings(int mouseX, int mouseY) { - return Lists.newArrayList(); - } - - @Override - public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { - return false; - } -} diff --git a/common/buildcraft/compat/module/jei/silicon/package-info.java b/common/buildcraft/compat/module/jei/silicon/package-info.java index fce7fb1..f747716 100644 --- a/common/buildcraft/compat/module/jei/silicon/package-info.java +++ b/common/buildcraft/compat/module/jei/silicon/package-info.java @@ -2,5 +2,6 @@ @MethodsReturnNonnullByDefault package buildcraft.compat.module.jei.silicon; -import javax.annotation.ParametersAreNonnullByDefault; -import mcp.MethodsReturnNonnullByDefault; +import net.minecraft.MethodsReturnNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/common/buildcraft/compat/module/jei/transferhandlers/AdvancedCraftingItemsTransferHandler.java b/common/buildcraft/compat/module/jei/transferhandlers/AdvancedCraftingItemsTransferHandler.java index 02282e5..78407d0 100644 --- a/common/buildcraft/compat/module/jei/transferhandlers/AdvancedCraftingItemsTransferHandler.java +++ b/common/buildcraft/compat/module/jei/transferhandlers/AdvancedCraftingItemsTransferHandler.java @@ -1,34 +1,48 @@ package buildcraft.compat.module.jei.transferhandlers; -import javax.annotation.Nullable; -import net.minecraft.entity.player.EntityPlayer; import buildcraft.silicon.container.ContainerAdvancedCraftingTable; -import mezz.jei.api.gui.IRecipeLayout; + +import javax.annotation.Nullable; + +import mezz.jei.api.gui.ingredient.IRecipeSlotsView; import mezz.jei.api.recipe.transfer.IRecipeTransferError; import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.crafting.CraftingRecipe; + +public class AdvancedCraftingItemsTransferHandler implements IRecipeTransferHandler +{ + public AdvancedCraftingItemsTransferHandler() + { + } -public class AdvancedCraftingItemsTransferHandler implements IRecipeTransferHandler { @Override - public Class getContainerClass() { + public Class getContainerClass() + { return ContainerAdvancedCraftingTable.class; } - @Nullable @Override - public IRecipeTransferError transferRecipe(ContainerAdvancedCraftingTable container, IRecipeLayout recipeLayout, EntityPlayer player, boolean maxTransfer, boolean doTransfer) { - if (doTransfer) { -// Map> inputs = recipeLayout.getItemStacks().getGuiIngredients(); -// -// for (int slot = 0; slot < 9; slot++) { -// IGuiIngredient ingredient = inputs.getOrDefault(slot + 1, null); -// ItemStack stack = (ingredient == null) ? ItemStack.EMPTY : ingredient.getDisplayedIngredient(); -// -// container.sendSetPhantomSlot(container.tile.invBlueprint, slot, (stack == null) ? ItemStack.EMPTY : stack); -// } - - AutoCraftItemsTransferHandler.transferRecipe( - itemStacks -> container.sendSetPhantomSlots(container.tile.invBlueprint, itemStacks), - recipeLayout); + public Class getRecipeClass() + { + return CraftingRecipe.class; + } + + @Override + @Nullable +// public IRecipeTransferError transferRecipe(ContainerAdvancedCraftingTable container, IRecipeLayout recipeLayout, Player player, boolean maxTransfer, boolean doTransfer) + public IRecipeTransferError transferRecipe(ContainerAdvancedCraftingTable container, CraftingRecipe recipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) + { + if (doTransfer) + { + AutoCraftItemsTransferHandler.transferRecipe((itemStacks) -> + { + container.sendSetPhantomSlots(container.tile.invBlueprint, itemStacks); + }, +// recipeLayout + recipe, + recipeSlots + ); } return null; diff --git a/common/buildcraft/compat/module/jei/transferhandlers/AssemblyTableTransferHandler.java b/common/buildcraft/compat/module/jei/transferhandlers/AssemblyTableTransferHandler.java index e0ce8ee..63bc7d9 100644 --- a/common/buildcraft/compat/module/jei/transferhandlers/AssemblyTableTransferHandler.java +++ b/common/buildcraft/compat/module/jei/transferhandlers/AssemblyTableTransferHandler.java @@ -1,23 +1,32 @@ package buildcraft.compat.module.jei.transferhandlers; -import javax.annotation.Nullable; -import net.minecraft.entity.player.EntityPlayer; +import buildcraft.api.recipes.AssemblyRecipe; +import buildcraft.silicon.container.ContainerAdvancedCraftingTable; import buildcraft.silicon.container.ContainerAssemblyTable; -import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.gui.ingredient.IRecipeSlotsView; import mezz.jei.api.recipe.transfer.IRecipeTransferError; import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.crafting.CraftingRecipe; + +import javax.annotation.Nullable; + +// Calen: never used in 1.12.2? +public class AssemblyTableTransferHandler implements IRecipeTransferHandler { -public class AssemblyTableTransferHandler implements IRecipeTransferHandler { @Override public Class getContainerClass() { return ContainerAssemblyTable.class; } - @Nullable @Override - public IRecipeTransferError transferRecipe(ContainerAssemblyTable container, IRecipeLayout recipeLayout, EntityPlayer player, boolean maxTransfer, boolean doTransfer) { - + public Class getRecipeClass() { + return AssemblyRecipe.class; + } + @Nullable +// public IRecipeTransferError transferRecipe(ContainerAssemblyTable container, IRecipeLayout recipeLayout, Player player, boolean maxTransfer, boolean doTransfer) + public IRecipeTransferError transferRecipe(ContainerAdvancedCraftingTable container, CraftingRecipe recipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) { return null; } } diff --git a/common/buildcraft/compat/module/jei/transferhandlers/AutoCraftItemsTransferHandler.java b/common/buildcraft/compat/module/jei/transferhandlers/AutoCraftItemsTransferHandler.java index 5ab756e..af48ccf 100644 --- a/common/buildcraft/compat/module/jei/transferhandlers/AutoCraftItemsTransferHandler.java +++ b/common/buildcraft/compat/module/jei/transferhandlers/AutoCraftItemsTransferHandler.java @@ -1,53 +1,76 @@ package buildcraft.compat.module.jei.transferhandlers; +import buildcraft.factory.container.ContainerAutoCraftItems; +import buildcraft.factory.tile.TileAutoWorkbenchItems; +import com.google.common.collect.Lists; + import java.util.List; import java.util.Map; import java.util.function.Consumer; import javax.annotation.Nullable; -import com.google.common.collect.Lists; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import buildcraft.factory.container.ContainerAutoCraftItems; -import mezz.jei.api.gui.IGuiIngredient; -import mezz.jei.api.gui.IRecipeLayout; + +import mezz.jei.api.gui.ingredient.IRecipeSlotView; +import mezz.jei.api.gui.ingredient.IRecipeSlotsView; import mezz.jei.api.recipe.transfer.IRecipeTransferError; import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.CraftingRecipe; + +public class AutoCraftItemsTransferHandler implements IRecipeTransferHandler +{ + public AutoCraftItemsTransferHandler() + { + } -public class AutoCraftItemsTransferHandler implements IRecipeTransferHandler { @Override - public Class getContainerClass() { + public Class getContainerClass() + { return ContainerAutoCraftItems.class; } - @Nullable @Override - public IRecipeTransferError transferRecipe(ContainerAutoCraftItems container, IRecipeLayout recipeLayout, EntityPlayer player, boolean maxTransfer, boolean doTransfer) { - if (doTransfer) { -// Map> inputs = recipeLayout.getItemStacks().getGuiIngredients(); -// -// for (int slot = 0; slot < 9; slot++) { -// IGuiIngredient ingredient = inputs.getOrDefault(slot + 1, null); -// ItemStack stack = (ingredient == null) ? ItemStack.EMPTY : ingredient.getDisplayedIngredient(); -// -// container.sendSetPhantomSlot(container.tile.invBlueprint, slot, (stack == null) ? ItemStack.EMPTY : stack); -// } - - AutoCraftItemsTransferHandler.transferRecipe( - itemStacks -> container.sendSetPhantomSlots(container.tile.invBlueprint, itemStacks), - recipeLayout); + public Class getRecipeClass() + { + return CraftingRecipe.class; + } + + @Override + @Nullable +// public IRecipeTransferError transferRecipe(ContainerAutoCraftItems container, IRecipeLayout recipeLayout, Player player, boolean maxTransfer, boolean doTransfer) + public IRecipeTransferError transferRecipe(ContainerAutoCraftItems container, CraftingRecipe recipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) + { + if (doTransfer) + { + transferRecipe((itemStacks) -> + { + container.sendSetPhantomSlots((container.tile).invBlueprint, itemStacks); + }, +// recipeLayout + recipe, + recipeSlots + ); } return null; } - static void transferRecipe(Consumer> callback, IRecipeLayout recipeLayout) { - Map> inputs = recipeLayout.getItemStacks().getGuiIngredients(); + // static void transferRecipe(Consumer> callback, IRecipeLayout recipeLayout) + static void transferRecipe(Consumer> callback, CraftingRecipe recipe, IRecipeSlotsView recipeLayout) +// public IRecipeTransferError transferRecipe(ContainerAutoCraftItems container, CraftingRecipe recipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) + { +// Map> inputs = recipeLayout.getItemStacks().getGuiIngredients(); + List inputs = recipeLayout.getSlotViews(); List stacks = Lists.newArrayList(); - for (int slot = 0; slot < 9; slot++) { - IGuiIngredient ingredient = inputs.getOrDefault(slot + 1, null); - ItemStack stack = (ingredient == null) ? ItemStack.EMPTY : ingredient.getDisplayedIngredient(); - stacks.add((stack == null) ? ItemStack.EMPTY : stack); + + for (int slot = 0; slot < 9; ++slot) + { +// IGuiIngredient ingredient = (IGuiIngredient) inputs.getOrDefault(slot + 1, (Object) null); + IRecipeSlotView ingredient = inputs.get(slot + 1); +// ItemStack stack = ingredient == null ? ItemStack.EMPTY : (ItemStack) ingredient.getDisplayedIngredient(); + ItemStack stack = ingredient == null ? ItemStack.EMPTY : (ItemStack) ingredient.getDisplayedIngredient().get().getIngredient(); + stacks.add(stack == null ? ItemStack.EMPTY : stack); } callback.accept(stacks); diff --git a/common/buildcraft/compat/module/jei/transferhandlers/package-info.java b/common/buildcraft/compat/module/jei/transferhandlers/package-info.java index 546f6b9..107bd58 100644 --- a/common/buildcraft/compat/module/jei/transferhandlers/package-info.java +++ b/common/buildcraft/compat/module/jei/transferhandlers/package-info.java @@ -2,5 +2,6 @@ @MethodsReturnNonnullByDefault package buildcraft.compat.module.jei.transferhandlers; -import javax.annotation.ParametersAreNonnullByDefault; -import mcp.MethodsReturnNonnullByDefault; +import net.minecraft.MethodsReturnNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java b/common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java index 947e923..be17590 100644 --- a/common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java +++ b/common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java @@ -1,109 +1,134 @@ package buildcraft.compat.module.theoneprobe; -import static buildcraft.compat.module.theoneprobe.BCPluginTOP.TOP_MOD_ID; - -import java.util.List; - -import com.google.common.base.Function; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.TextFormatting; -import net.minecraft.world.World; - -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.Optional; -import net.minecraftforge.fml.common.event.FMLInterModComms; - import buildcraft.api.BCModules; import buildcraft.api.mj.ILaserTarget; import buildcraft.api.mj.MjAPI; - -import buildcraft.lib.tile.craft.IAutoCraft; - import buildcraft.compat.CompatUtils; +import buildcraft.lib.tile.craft.IAssemblyCraft; +import buildcraft.lib.tile.craft.IAutoCraft; +import com.google.common.base.Function; +import mcjty.theoneprobe.api.*; +import net.minecraft.ChatFormatting; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; + +import java.util.Iterator; +import java.util.List; -import mcjty.theoneprobe.api.ElementAlignment; -import mcjty.theoneprobe.api.IBlockDisplayOverride; -import mcjty.theoneprobe.api.IProbeHitData; -import mcjty.theoneprobe.api.IProbeInfo; -import mcjty.theoneprobe.api.IProbeInfoProvider; -import mcjty.theoneprobe.api.ITheOneProbe; -import mcjty.theoneprobe.api.ProbeMode; - -@Optional.InterfaceList({ - @Optional.Interface(modid = TOP_MOD_ID, iface = "mcjty.theoneprobe.api.IBlockDisplayOverride"), - @Optional.Interface(modid = TOP_MOD_ID, iface = "mcjty.theoneprobe.api.IProbeInfoProvider") -}) -public class BCPluginTOP implements Function, IBlockDisplayOverride, IProbeInfoProvider { +//@InterfaceList({@Interface( +// modid = "theoneprobe", +// iface = "mcjty.theoneprobe.api.IBlockDisplayOverride" +//), @Interface( +// modid = "theoneprobe", +// iface = "mcjty.theoneprobe.api.IProbeInfoProvider" +//)}) +//public class BCPluginTOP implements Function, IBlockDisplayOverride, IProbeInfoProvider +public enum BCPluginTOP implements Function, IBlockDisplayOverride, IProbeInfoProvider +{ + INSTANCE; static final String TOP_MOD_ID = "theoneprobe"; - @Override - @Optional.Method(modid = TOP_MOD_ID) - public Void apply(ITheOneProbe top) { + // @Method(modid = "theoneprobe") + public Void apply(ITheOneProbe top) + { top.registerBlockDisplayOverride(this); top.registerProvider(this); return null; } - @Override - @Optional.Method(modid = TOP_MOD_ID) - public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) { + // @Method(modid = "theoneprobe") +// public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) + public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo probeInfo, Player player, Level world, BlockState blockState, IProbeHitData data) + { return false; } - @Override - @Optional.Method(modid = TOP_MOD_ID) - public String getID() { - return "buildcraftcompat.top"; + // @Method(modid = "theoneprobe") +// public String getID() + public ResourceLocation getID() + { +// return "buildcraftcompat.top"; + return new ResourceLocation("buildcraftcompat.top"); } - @Override - @Optional.Method(modid = TOP_MOD_ID) - public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) { + // @Method(modid = "theoneprobe") +// public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) + public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, Player player, Level world, BlockState blockState, IProbeHitData data) + { ResourceLocation blockRegistryName = blockState.getBlock().getRegistryName(); - if ((blockRegistryName != null) && (BCModules.isBcMod(blockRegistryName.getResourceDomain()))) { - TileEntity entity = world.getTileEntity(data.getPos()); - if (entity instanceof IAutoCraft) { + if (blockRegistryName != null && BCModules.isBcMod(blockRegistryName.getNamespace())) + { + BlockEntity entity = world.getBlockEntity(data.getPos()); + if (entity instanceof IAutoCraft) + { this.addAutoCraftInfo(probeInfo, (IAutoCraft) entity); } - if (entity instanceof ILaserTarget) { + if (entity instanceof ILaserTarget) + { this.addLaserTargetInfo(probeInfo, (ILaserTarget) entity); } + + if (entity instanceof IAssemblyCraft) + { + this.addAssemblyInfo(probeInfo, (IAssemblyCraft) entity); + } } + } - @Optional.Method(modid = TOP_MOD_ID) - private void addAutoCraftInfo(IProbeInfo probeInfo, IAutoCraft crafter) { - if (!crafter.getCurrentRecipeOutput().isEmpty()) { + // @Method(modid = "theoneprobe") + private void addAutoCraftInfo(IProbeInfo probeInfo, IAutoCraft crafter) + { + if (!crafter.getCurrentRecipeOutput().isEmpty()) + { IProbeInfo mainInfo = probeInfo.vertical(); - mainInfo - .horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)) - .text("Making: ") - .item(crafter.getCurrentRecipeOutput()); - IProbeInfo info = mainInfo - .horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)) - .text("From: "); +// mainInfo.horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)).text("Making: ").item(crafter.getCurrentRecipeOutput()); + mainInfo.horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)).text(new TranslatableComponent("buildcraft.waila.crafting")).item(crafter.getCurrentRecipeOutput()); +// IProbeInfo info = mainInfo.horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)).text("From: "); + IProbeInfo info = mainInfo.horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)).text(new TranslatableComponent("buildcraft.waila.crafting_from")); List stacks = CompatUtils.compactInventory(crafter.getInvBlueprint()); for (ItemStack stack : stacks) + { info.item(stack); + } } + else + { + IProbeInfo mainInfo = probeInfo.vertical(); + mainInfo.horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)).text(new TranslatableComponent("buildcraft.waila.no_recipe")); + } + } - @Optional.Method(modid = TOP_MOD_ID) - private void addLaserTargetInfo(IProbeInfo probeInfo, ILaserTarget laserTarget) { + // @Method(modid = "theoneprobe") + private void addLaserTargetInfo(IProbeInfo probeInfo, ILaserTarget laserTarget) + { long power = laserTarget.getRequiredLaserPower(); - if (power > 0) { - probeInfo.horizontal() - .text(TextFormatting.WHITE + "Waiting from laser: ") - .text(TextFormatting.AQUA + MjAPI.formatMj(power)) - .text(TextFormatting.AQUA + "MJ"); + if (power > 0L) + { +// probeInfo.horizontal().text(TextFormatting.WHITE + "Waiting from laser: ").text(TextFormatting.AQUA + MjAPI.formatMj(power)).text(TextFormatting.AQUA + "MJ"); + probeInfo.horizontal().text(new TranslatableComponent("buildcraft.waila.waiting_for_laser", MjAPI.formatMj(power))); } } -} + private void addAssemblyInfo(IProbeInfo probeInfo, IAssemblyCraft assembly) + { + ItemStack result = assembly.getAssemblyResult(); + if (!result.isEmpty()) + { + probeInfo.horizontal().text(new TranslatableComponent("buildcraft.waila.crafting")).item(result); + } + else + { + IProbeInfo mainInfo = probeInfo.vertical(); + mainInfo.horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)).text(new TranslatableComponent("buildcraft.waila.no_recipe")); + } + } +} diff --git a/common/buildcraft/compat/module/theoneprobe/CompatModuleTheOneProbe.java b/common/buildcraft/compat/module/theoneprobe/CompatModuleTheOneProbe.java index 964bc69..cd32afe 100644 --- a/common/buildcraft/compat/module/theoneprobe/CompatModuleTheOneProbe.java +++ b/common/buildcraft/compat/module/theoneprobe/CompatModuleTheOneProbe.java @@ -1,19 +1,26 @@ package buildcraft.compat.module.theoneprobe; -import net.minecraftforge.fml.common.event.FMLInterModComms; - import buildcraft.compat.CompatModuleBase; +import mcjty.theoneprobe.api.ITheOneProbe; +import net.minecraftforge.fml.InterModComms; + +import java.util.function.Function; +import java.util.function.Supplier; -public class CompatModuleTheOneProbe extends CompatModuleBase { +public class CompatModuleTheOneProbe extends CompatModuleBase +{ + public CompatModuleTheOneProbe() + { + } - @Override - public String compatModId() { + public String compatModId() + { return "theoneprobe"; } - @Override - public void preInit() { - FMLInterModComms.sendFunctionMessage(compatModId(), "getTheOneProbe", - "buildcraft.compat.module.theoneprobe.BCPluginTOP"); + public void preInit() + { +// FMLInterModComms.sendFunctionMessage(this.compatModId(), "getTheOneProbe", "buildcraft.compat.module.theoneprobe.BCPluginTOP"); + InterModComms.sendTo(this.compatModId(), "getTheOneProbe", () -> BCPluginTOP.INSTANCE); } } diff --git a/common/buildcraft/compat/module/waila/AssemblyCraftDataProvider.java b/common/buildcraft/compat/module/waila/AssemblyCraftDataProvider.java new file mode 100644 index 0000000..dda7737 --- /dev/null +++ b/common/buildcraft/compat/module/waila/AssemblyCraftDataProvider.java @@ -0,0 +1,63 @@ +package buildcraft.compat.module.waila; + +import buildcraft.lib.tile.craft.IAssemblyCraft; +import mcp.mobius.waila.api.BlockAccessor; +import mcp.mobius.waila.api.ITooltip; +import mcp.mobius.waila.api.config.IPluginConfig; +import mcp.mobius.waila.impl.ui.ItemStackElement; +import mcp.mobius.waila.impl.ui.SpacerElement; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.phys.Vec2; + +public class AssemblyCraftDataProvider +{ + static class BodyProvider extends BaseWailaDataProvider.BodyProvider + { + @Override + public void getWailaBody(ITooltip currentTip, BlockAccessor accessor, IPluginConfig iPluginConfig) + { + BlockEntity tile = accessor.getBlockEntity(); + if (tile instanceof IAssemblyCraft) + { +// CompoundTag nbt = accessor.getNBTData(); + CompoundTag nbt = accessor.getServerData(); + if (nbt.contains("recipe_result", Tag.TAG_COMPOUND)) + { + ItemStack recipe_result = ItemStack.of(nbt.getCompound("recipe_result")); + if (!recipe_result.isEmpty()) + { + currentTip.add(new TranslatableComponent("buildcraft.waila.crafting")); + currentTip.append(ItemStackElement.of(recipe_result)); + // Calen: an empty line because the item icon is 2 lines height + // if ItemStackElement.of(result, 0.5F), the count text of the stack will not scale + currentTip.add(new SpacerElement(new Vec2(0, 5))); + return; + } + } + currentTip.add(new TranslatableComponent("buildcraft.waila.no_recipe")); + } +// else +// { +// currentTip.add(new TextComponent(ChatFormatting.RED + "{wrong tile entity}")); +// } + } + } + + static class NBTProvider extends BaseWailaDataProvider.NBTProvider + { + @Override + public void getNBTData(CompoundTag nbt, ServerPlayer player, Level world, BlockEntity tile, boolean showDetails) + { + if (tile instanceof IAssemblyCraft assembly) + { + nbt.put("recipe_result", assembly.getAssemblyResult().serializeNBT()); + } + } + } +} diff --git a/common/buildcraft/compat/module/waila/AutoCraftDataProvider.java b/common/buildcraft/compat/module/waila/AutoCraftDataProvider.java index df1f7c4..5c98863 100644 --- a/common/buildcraft/compat/module/waila/AutoCraftDataProvider.java +++ b/common/buildcraft/compat/module/waila/AutoCraftDataProvider.java @@ -1,83 +1,92 @@ package buildcraft.compat.module.waila; -import static buildcraft.compat.module.waila.HWYLAPlugin.WAILA_MOD_ID; - -import java.util.List; - -import javax.annotation.Nonnull; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.TextFormatting; -import net.minecraft.world.World; - -import net.minecraftforge.common.util.Constants; -import net.minecraftforge.fml.common.Optional; - +import buildcraft.compat.CompatUtils; import buildcraft.lib.tile.craft.IAutoCraft; +import mcp.mobius.waila.api.BlockAccessor; +import mcp.mobius.waila.api.ITooltip; +import mcp.mobius.waila.api.config.IPluginConfig; +import mcp.mobius.waila.impl.ui.ItemStackElement; +import mcp.mobius.waila.impl.ui.SpacerElement; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.phys.Vec2; -import buildcraft.compat.CompatUtils; +import java.util.List; -import mcp.mobius.waila.api.IWailaConfigHandler; -import mcp.mobius.waila.api.IWailaDataAccessor; -import mcp.mobius.waila.api.SpecialChars; +public class AutoCraftDataProvider +{ -class AutoCraftDataProvider extends BaseWailaDataProvider { - @Nonnull - @Override - @Optional.Method(modid = WAILA_MOD_ID) - public List getWailaBody(ItemStack itemStack, List currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - TileEntity tile = accessor.getTileEntity(); - if (tile instanceof IAutoCraft) { - NBTTagCompound nbt = accessor.getNBTData(); - if (nbt.hasKey("recipe_result", Constants.NBT.TAG_COMPOUND)) { - ItemStack result = new ItemStack(nbt.getCompoundTag("recipe_result")); - currentTip.add(TextFormatting.WHITE + "Making: " + SpecialChars.WailaSplitter + HWYLAPlugin.getItemStackString(result)); + static class BodyProvider extends BaseWailaDataProvider.BodyProvider + { + @Override + public void getWailaBody(ITooltip currentTip, BlockAccessor accessor, IPluginConfig iPluginConfig) + { + BlockEntity tile = accessor.getBlockEntity(); + if (tile instanceof IAutoCraft) + { + CompoundTag nbt = accessor.getServerData(); + if (nbt.contains("recipe_result", Tag.TAG_COMPOUND)) + { + // Calen: add -> create new line / append -> append at the last line + ItemStack result = ItemStack.of(nbt.getCompound("recipe_result")); + currentTip.add(new TranslatableComponent("buildcraft.waila.crafting")); + currentTip.append(ItemStackElement.of(result)); + // Calen: an empty line because the item icon is 2 lines height + // if ItemStackElement.of(result, 0.5F), the count text of the stack will not scale + currentTip.add(new SpacerElement(new Vec2(0, 5))); + if (nbt.contains("recipe_inputs", Tag.TAG_LIST)) + { + ListTag list = nbt.getList("recipe_inputs", Tag.TAG_COMPOUND); + currentTip.add(new TranslatableComponent("buildcraft.waila.crafting_from")); - if (nbt.hasKey("recipe_inputs", Constants.NBT.TAG_LIST)) { - NBTTagList list = nbt.getTagList("recipe_inputs", Constants.NBT.TAG_COMPOUND); - StringBuilder inputs = new StringBuilder(TextFormatting.WHITE + "From: " + SpecialChars.WailaSplitter); - for (int index = 0; index < list.tagCount(); index++) { - NBTTagCompound compound = NBTTagCompound.class.cast(list.get(index)); - inputs.append(HWYLAPlugin.getItemStackString(new ItemStack(compound))); + for (int index = 0; index < list.size(); ++index) + { + CompoundTag compound = list.getCompound(index); + currentTip.append(ItemStackElement.of(ItemStack.of(compound))); + } + currentTip.add(new SpacerElement(new Vec2(0, 5))); } - currentTip.add(inputs.toString()); } - } else { - currentTip.add(TextFormatting.GRAY + "No recipe"); + else + { + currentTip.add(new TranslatableComponent("buildcraft.waila.no_recipe")); + } } - } else { - currentTip.add(TextFormatting.RED + "{wrong tile entity}"); +// else +// { +// currentTip.add(new TextComponent(ChatFormatting.RED + "{wrong tile entity}")); +// } } - return currentTip; } - @Nonnull - @Override - @Optional.Method(modid = WAILA_MOD_ID) - public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) { - NBTTagCompound nbt = super.getNBTData(player, te, tag, world, pos); + static class NBTProvider extends BaseWailaDataProvider.NBTProvider + { + @Override + public void getNBTData(CompoundTag nbt, ServerPlayer player, Level world, BlockEntity tile, boolean showDetails) + { + if (tile instanceof IAutoCraft auto) + { + ItemStack output = auto.getCurrentRecipeOutput(); + if (!output.isEmpty()) + { + nbt.put("recipe_result", output.serializeNBT()); + List stacks = CompatUtils.compactInventory(auto.getInvBlueprint()); + ListTag list = new ListTag(); - TileEntity tile = world.getTileEntity(pos); - if (tile instanceof IAutoCraft) { - IAutoCraft auto = IAutoCraft.class.cast(tile); - ItemStack output = auto.getCurrentRecipeOutput(); - if (!output.isEmpty()) { - nbt.setTag("recipe_result", output.serializeNBT()); + for (int index = 0; index < stacks.size(); ++index) + { + list.add((stacks.get(index)).serializeNBT()); + } - List stacks = CompatUtils.compactInventory(auto.getInvBlueprint()); - NBTTagList list = new NBTTagList(); - for (int index = 0; index < stacks.size(); index++) { - list.appendTag(stacks.get(index).serializeNBT()); + nbt.put("recipe_inputs", list); } - nbt.setTag("recipe_inputs", list); } } - - return nbt; } } diff --git a/common/buildcraft/compat/module/waila/BCPluginJade.java b/common/buildcraft/compat/module/waila/BCPluginJade.java new file mode 100644 index 0000000..411e54e --- /dev/null +++ b/common/buildcraft/compat/module/waila/BCPluginJade.java @@ -0,0 +1,166 @@ +package buildcraft.compat.module.waila; + +import buildcraft.lib.block.BlockBCTile_Neptune; +import buildcraft.lib.tile.TileBC_Neptune; +import mcp.mobius.waila.api.*; + +@WailaPlugin +public class BCPluginJade implements IWailaPlugin +{ + // Calen: in 1.18.2 here should use Block or TE class instead of interface, it's too difficult to get all matched if allowing some BC modules absent, + // so just use TileBC_Neptune and BlockBCTile_Neptune + @Override + public void register(IWailaCommonRegistration registrar) + { + IServerDataProvider autoCraftNbtProvider = new AutoCraftDataProvider.NBTProvider(); + IServerDataProvider laserTargetNbtProvider = new LaserTargetDataProvider.NBTProvider(); + IServerDataProvider assemblyCraftNbtProvider = new AssemblyCraftDataProvider.NBTProvider(); + + registrar.registerBlockDataProvider(autoCraftNbtProvider, TileBC_Neptune.class); + registrar.registerBlockDataProvider(laserTargetNbtProvider, TileBC_Neptune.class); + registrar.registerBlockDataProvider(assemblyCraftNbtProvider, TileBC_Neptune.class); + +// for (Block b : ForgeRegistries.BLOCKS.getValues()) +// for (BlockEntityType tet : ForgeRegistries.BLOCK_ENTITIES.getValues()) +// { +// isTeClassOfTileEntityExtends(tet, IAutoCraft.class).ifPresent(c -> registrar.registerBlockDataProvider(autoCraftNbtProvider, c)); +// isTeClassOfTileEntityExtends(tet, ILaserTarget.class).ifPresent(c -> registrar.registerBlockDataProvider(laserTargetNbtProvider, c)); +// isTeClassOfTileEntityExtends(tet, IAssemblyCraft.class).ifPresent(c -> registrar.registerBlockDataProvider(assemblyCraftNbtProvider, c)); +// +//// isTeClassOfBlockExtends(b, IAutoCraft.class).ifPresent(c -> registrar.registerBlockDataProvider(autoCraftNbtProvider, c)); +//// isTeClassOfBlockExtends(b, ILaserTarget.class).ifPresent(c -> registrar.registerBlockDataProvider(laserTargetNbtProvider, c)); +//// isTeClassOfBlockExtends(b, IAssemblyCraft.class).ifPresent(c -> registrar.registerBlockDataProvider(assemblyCraftNbtProvider, c)); +// } + } + + @Override + public void registerClient(IWailaClientRegistration registrar) + { + IComponentProvider autoCraftBodyProvider = new AutoCraftDataProvider.BodyProvider(); + IComponentProvider laserTargetBodyProvider = new LaserTargetDataProvider.BodyProvider(); + IComponentProvider assemblyCraftBodyProvider = new AssemblyCraftDataProvider.BodyProvider(); + + registrar.registerComponentProvider(autoCraftBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); + registrar.registerComponentProvider(laserTargetBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); + registrar.registerComponentProvider(assemblyCraftBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); + +//// for (Block b : ForgeRegistries.BLOCKS.getValues()) +// for (BlockEntityType tet : ForgeRegistries.BLOCK_ENTITIES.getValues()) +// { +//// isTeClassOfBlockExtends(b, IAutoCraft.class).ifPresent(c -> registrar.registerComponentProvider(autoCraftBodyProvider, TooltipPosition.BODY, b.getClass())); +//// isTeClassOfBlockExtends(b, ILaserTarget.class).ifPresent(c -> registrar.registerComponentProvider(laserTargetBodyProvider, TooltipPosition.BODY, b.getClass())); +//// isTeClassOfBlockExtends(b, IAssemblyCraft.class).ifPresent(c -> registrar.registerComponentProvider(assemblyCraftBodyProvider, TooltipPosition.BODY, b.getClass())); +// +// isTeClassOfTileEntityExtends(tet, IAutoCraft.class).ifPresent(c -> +// tet.validBlocks.forEach(b -> +// registrar.registerComponentProvider(autoCraftBodyProvider, TooltipPosition.BODY, b.getClass()) +// ) +// ); +// isTeClassOfTileEntityExtends(tet, ILaserTarget.class).ifPresent(c -> +// tet.validBlocks.forEach(b -> +// registrar.registerComponentProvider(laserTargetBodyProvider, TooltipPosition.BODY, b.getClass()) +// ) +// ); +// isTeClassOfTileEntityExtends(tet, IAssemblyCraft.class).ifPresent(c -> +// tet.validBlocks.forEach(b -> +// registrar.registerComponentProvider(assemblyCraftBodyProvider, TooltipPosition.BODY, b.getClass()) +// ) +// ); +// +//// if (((ParameterizedType) tet.getClass().getGenericSuperclass()).getActualTypeArguments()[0] instanceof Class tec && IAutoCraft.class.isAssignableFrom(tec)) +//// { +//// tet.validBlocks.forEach(b -> registrar.registerComponentProvider(autoCraftBodyProvider, TooltipPosition.BODY, ((Block) b).getClass())); +//// } +//// if (((ParameterizedType) tet.getClass().getGenericSuperclass()).getActualTypeArguments()[0] instanceof Class tec && ILaserTarget.class.isAssignableFrom(tec)) +//// { +//// tet.validBlocks.forEach(b -> registrar.registerComponentProvider(laserTargetBodyProvider, TooltipPosition.BODY, ((Block) b).getClass())); +//// } +//// if (((ParameterizedType) tet.getClass().getGenericSuperclass()).getActualTypeArguments()[0] instanceof Class tec && IAssemblyCraft.class.isAssignableFrom(tec)) +//// { +//// tet.validBlocks.forEach(b -> registrar.registerComponentProvider(assemblyCraftBodyProvider, TooltipPosition.BODY, ((Block) b).getClass())); +//// } +// } + } + +// private List> getAllClassesHasAnnotation(Class annotation) +// { +// List classNames = (List) ModList.get().getAllScanData().stream().flatMap(($) -> +// { +// return $.getAnnotations().stream(); +// }).filter(($) -> +// { +// if ($.annotationType().getClassName().equals(annotation.getName())) +// { +// String required = (String) $.annotationData().getOrDefault("value", ""); +// if (required.isEmpty() || ModList.get().isLoaded(required)) +// { +// return true; +// } +// } +// +// return false; +// }).map(ModFileScanData.AnnotationData::memberName).collect(Collectors.toList()); +// +// for (String className : classNames) +// { +// BCLog.logger.info("Starting looking fo c"); +// +// try +// { +// Class clazz = Class.forName(className); +// if (IWailaPlugin.class.isAssignableFrom(clazz)) +// { +// IWailaPlugin plugin = (IWailaPlugin) clazz.getDeclaredConstructor().newInstance(); +// plugin.register(WailaRegistrar.INSTANCE); +// plugin.register(WailaCommonRegistration.INSTANCE); +// if (FMLEnvironment.dist.isClient()) +// { +// plugin.registerClient(WailaClientRegistration.INSTANCE); +// } +// } +// } +// catch (Throwable var7) +// { +// LOGGER.error("Error loading plugin at {}", className, var7); +// } +// } +// +// } + +// private LazyOptional isTeClassOfTileEntityExtends(BlockEntityType tet, Class typeToMatch) +// { +// +// Class tec = ((Class) ((ParameterizedType) tet.factory.getClass().getGenericSuperclass()).getActualTypeArguments()[0]); +// if (typeToMatch.isAssignableFrom(tec)) +// { +// return LazyOptional.of(() -> tec); +// } +// return LazyOptional.empty(); +// } + +// private LazyOptional isTeClassOfBlockExtends(Block b, Class typeToMatch) +// { +// if (b instanceof EntityBlock) +// { +// Class c = getTileEntityClassOfBlock(b); +// if (c != null && typeToMatch.isAssignableFrom(c)) +// { +// return LazyOptional.of(() -> c); +// } +// } +// return LazyOptional.empty(); +// } +// +// private Class getTileEntityClassOfBlock(Block b) +// { +// if (b.getClass().getGenericSuperclass() instanceof ParameterizedType parameterizedType) +// { +// Type[] types = parameterizedType.getActualTypeArguments(); +// if (types.length != 0 && types[0] instanceof Class tec) +// { +// return tec; +// } +// } +// return null; +// } +} diff --git a/common/buildcraft/compat/module/waila/BaseWailaDataProvider.java b/common/buildcraft/compat/module/waila/BaseWailaDataProvider.java index 630b8af..945d117 100644 --- a/common/buildcraft/compat/module/waila/BaseWailaDataProvider.java +++ b/common/buildcraft/compat/module/waila/BaseWailaDataProvider.java @@ -1,57 +1,38 @@ package buildcraft.compat.module.waila; -import static buildcraft.compat.module.waila.HWYLAPlugin.WAILA_MOD_ID; - -import java.util.List; -import javax.annotation.Nonnull; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.fml.common.Optional; - -import mcp.mobius.waila.api.IWailaConfigHandler; -import mcp.mobius.waila.api.IWailaDataAccessor; -import mcp.mobius.waila.api.IWailaDataProvider; - -@Optional.InterfaceList({ - @Optional.Interface(modid = WAILA_MOD_ID, iface = "mcp.mobius.waila.api.IWailaDataProvider") -}) -class BaseWailaDataProvider implements IWailaDataProvider { - @Nonnull - @Override - @Optional.Method(modid = WAILA_MOD_ID) - public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) { - return ItemStack.EMPTY; - } - - @Nonnull - @Override - @Optional.Method(modid = WAILA_MOD_ID) - public List getWailaHead(ItemStack itemStack, List currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - return currentTip; - } - - @Nonnull - @Override - @Optional.Method(modid = WAILA_MOD_ID) - public List getWailaBody(ItemStack itemStack, List currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - return currentTip; +import mcp.mobius.waila.api.BlockAccessor; +import mcp.mobius.waila.api.IComponentProvider; +import mcp.mobius.waila.api.IServerDataProvider; +import mcp.mobius.waila.api.ITooltip; +import mcp.mobius.waila.api.config.IPluginConfig; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; + +//class BaseWailaDataProvider implements IWailaDataProvider +interface BaseWailaDataProvider +{ + + static abstract class BodyProvider implements IComponentProvider + { + @Override + public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) + { + getWailaBody(iTooltip, blockAccessor, iPluginConfig); + } + + abstract void getWailaBody(ITooltip iTooltip, BlockAccessor accessor, IPluginConfig iPluginConfig); } - @Nonnull - @Override - @Optional.Method(modid = WAILA_MOD_ID) - public List getWailaTail(ItemStack itemStack, List currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - return currentTip; - } + static abstract class NBTProvider implements IServerDataProvider + { + @Override + public void appendServerData(CompoundTag tag, ServerPlayer player, Level blockAccessor, BlockEntity blockEntity, boolean showDetails) + { + getNBTData(tag, player, blockAccessor, blockEntity, showDetails); + } - @Nonnull - @Override - @Optional.Method(modid = WAILA_MOD_ID) - public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) { - return tag; + abstract void getNBTData(CompoundTag tag, ServerPlayer player, Level blockAccessor, BlockEntity blockEntity, boolean showDetails); } -} +} \ No newline at end of file diff --git a/common/buildcraft/compat/module/waila/HWYLAPlugin.java b/common/buildcraft/compat/module/waila/HWYLAPlugin.java deleted file mode 100644 index 2ddff63..0000000 --- a/common/buildcraft/compat/module/waila/HWYLAPlugin.java +++ /dev/null @@ -1,49 +0,0 @@ -package buildcraft.compat.module.waila; - -import static buildcraft.compat.module.waila.HWYLAPlugin.WAILA_MOD_ID; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.common.Optional; - -import buildcraft.api.mj.ILaserTarget; - -import buildcraft.lib.tile.craft.IAutoCraft; - -import mcp.mobius.waila.api.IWailaDataProvider; -import mcp.mobius.waila.api.IWailaPlugin; -import mcp.mobius.waila.api.IWailaRegistrar; -import mcp.mobius.waila.api.SpecialChars; -import mcp.mobius.waila.api.WailaPlugin; - -@WailaPlugin -@Optional.InterfaceList({ - @Optional.Interface(modid = WAILA_MOD_ID, iface = "mcp.mobius.waila.api.IWailaPlugin") -}) -public class HWYLAPlugin implements IWailaPlugin { - static final String WAILA_MOD_ID = "waila"; - - @Override - public void register(IWailaRegistrar registrar) { - IWailaDataProvider autoCraftProvider = new AutoCraftDataProvider(); - registrar.registerNBTProvider(autoCraftProvider, IAutoCraft.class); - registrar.registerBodyProvider(autoCraftProvider, IAutoCraft.class); - - IWailaDataProvider laserTargetProvider = new LaserTargetDataProvider(); - registrar.registerNBTProvider(laserTargetProvider, ILaserTarget.class); - registrar.registerBodyProvider(laserTargetProvider, ILaserTarget.class); - } - - static String getItemStackString(ItemStack stack) { - return getItemStackString(stack, "1"); - } - - private static String getItemStackString(ItemStack stack, String thing) { - // TODO: find out what that 'thing' really is - return SpecialChars.getRenderString("waila.stack", thing, - stack.getItem().getRegistryName().toString(), - String.valueOf(stack.getCount()), - String.valueOf(stack.getItemDamage()) - ); - } -} diff --git a/common/buildcraft/compat/module/waila/LaserTargetDataProvider.java b/common/buildcraft/compat/module/waila/LaserTargetDataProvider.java index 426e975..9706f19 100644 --- a/common/buildcraft/compat/module/waila/LaserTargetDataProvider.java +++ b/common/buildcraft/compat/module/waila/LaserTargetDataProvider.java @@ -1,56 +1,55 @@ package buildcraft.compat.module.waila; -import static buildcraft.compat.module.waila.HWYLAPlugin.WAILA_MOD_ID; - -import java.util.List; -import javax.annotation.Nonnull; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.TextFormatting; -import net.minecraft.world.World; -import net.minecraftforge.common.util.Constants; -import net.minecraftforge.fml.common.Optional; import buildcraft.api.mj.ILaserTarget; import buildcraft.api.mj.MjAPI; -import mcp.mobius.waila.api.IWailaConfigHandler; -import mcp.mobius.waila.api.IWailaDataAccessor; +import mcp.mobius.waila.api.BlockAccessor; +import mcp.mobius.waila.api.ITooltip; +import mcp.mobius.waila.api.config.IPluginConfig; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; + +abstract class LaserTargetDataProvider +{ -class LaserTargetDataProvider extends BaseWailaDataProvider { - @Nonnull - @Override - @Optional.Method(modid = WAILA_MOD_ID) - public List getWailaBody(ItemStack itemStack, List currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - TileEntity tile = accessor.getTileEntity(); - if (tile instanceof ILaserTarget) { - NBTTagCompound nbt = accessor.getNBTData(); - if (nbt.hasKey("required_power", Constants.NBT.TAG_LONG)) { - long power = nbt.getLong("required_power"); - if (power > 0) { - currentTip.add(TextFormatting.WHITE + "Waiting from laser: " + TextFormatting.AQUA + MjAPI.formatMj(power) + " MJ"); + static class BodyProvider extends BaseWailaDataProvider.BodyProvider + { + @Override + public void getWailaBody(ITooltip currentTip, BlockAccessor accessor, IPluginConfig iPluginConfig) + { + BlockEntity tile = accessor.getBlockEntity(); + if (tile instanceof ILaserTarget) + { + CompoundTag nbt = accessor.getServerData(); + if (nbt.contains("required_power", Tag.TAG_LONG)) + { + long power = nbt.getLong("required_power"); + if (power > 0L) + { + currentTip.add(new TranslatableComponent("buildcraft.waila.waiting_for_laser", MjAPI.formatMj(power))); + } } } - } else { - currentTip.add(TextFormatting.RED + "{wrong tile entity}"); +// else +// { +// currentTip.add(new TextComponent(ChatFormatting.RED + "{wrong tile entity}")); +// } } - return currentTip; } - @Nonnull - @Override - @Optional.Method(modid = WAILA_MOD_ID) - public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) { - NBTTagCompound nbt = super.getNBTData(player, te, tag, world, pos); - - TileEntity tile = world.getTileEntity(pos); - if (tile instanceof ILaserTarget) { - ILaserTarget target = ILaserTarget.class.cast(tile); - nbt.setLong("required_power", target.getRequiredLaserPower()); + static class NBTProvider extends BaseWailaDataProvider.NBTProvider + { + @Override + public void getNBTData(CompoundTag nbt, ServerPlayer player, Level world, BlockEntity tile, boolean showDetails) + { + if (tile instanceof ILaserTarget target) + { + nbt.putLong("required_power", target.getRequiredLaserPower()); + } } - - return nbt; } } diff --git a/common/buildcraft/compat/network/CompatGui.java b/common/buildcraft/compat/network/CompatGui.java index 3c5d599..75212fc 100644 --- a/common/buildcraft/compat/network/CompatGui.java +++ b/common/buildcraft/compat/network/CompatGui.java @@ -1,144 +1,160 @@ -package buildcraft.compat.network; - -import javax.annotation.Nullable; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import net.minecraftforge.fml.common.SidedProxy; -import net.minecraftforge.fml.common.network.IGuiHandler; - -import buildcraft.compat.BCCompat; -import buildcraft.compat.CompatUtils; - -// Half-decent class (inspired by how forestry does things) -// This really wants fleshing out and moving into mainline buildcraft though -// Along with a sensible way of dealing with pluggables etc -public enum CompatGui { - - FORESTRY_PROPOLIS_PIPE(IGuiTarget.TILE); - - static final CompatGui[] VALUES = values(); - - @SidedProxy(modId = BCCompat.MODID) - public static CommonProxy guiHandlerProxy; - - public final IGuiTarget target; - - private CompatGui(IGuiTarget target) { - this.target = target; - } - - public void openGui(EntityPlayer player) { - openGui(player, 0, 0, 0, 0); - } - - public void openGui(EntityPlayer player, BlockPos pos) { - openGui(player, pos.getX(), pos.getY(), pos.getZ(), 0); - } - - public void openGui(EntityPlayer player, int x, int y, int z) { - openGui(player, x, y, z, 0); - } - - public void openGui(EntityPlayer player, int data) { - openGui(player, 0, 0, 0, data); - } - - public void openGui(EntityPlayer player, BlockPos pos, int data) { - openGui(player, pos.getX(), pos.getY(), pos.getZ(), data); - } - - public void openGui(EntityPlayer player, int x, int y, int z, int data) { - player.openGui(BCCompat.instance, packGui(this, data), player.world, x, y, z); - } - - protected static int packGui(Enum gui, int data) { - if (data < 0 || data > 0xFF_FF_FF) { - throw new IllegalArgumentException("Data must be between 0 and 0xFF_FF_FF (inclusive)"); - } - return (data << 8) | gui.ordinal(); - } - - @Nullable - protected static CompatGui getGui(int id) { - id &= 0xFF; - if (id < 0 || id >= CompatGui.VALUES.length) { - return null; - } - return CompatGui.VALUES[id]; - } - - protected static int getData(int id) { - return id >>> 8; - } - - @FunctionalInterface - public interface IGuiTarget { - public static final IGuiTarget TILE = (player, world, x, y, z, data) -> { - TileEntity tile = world.getTileEntity(new BlockPos(x, y, z)); - if (tile instanceof IGuiCreator) { - return (IGuiCreator) tile; - } - if (tile != null) { - return tile.getCapability(CompatUtils.CAP_GUI_CREATOR, null); - } - return null; - }; - - @Nullable - IGuiCreator getCreator(EntityPlayer player, World world, int x, int y, int z, int data); - } - - public static abstract class CommonProxy implements IGuiHandler { - - @Nullable - protected static IGuiCreator getGuiCreator(int id, EntityPlayer player, World world, int x, int y, int z) { - CompatGui type = getGui(id); - int data = getData(id); - if (type == null) { - return null; - } - IGuiCreator creator = type.target.getCreator(player, world, x, y, z, data); - if (creator == null || creator.getGuiType() != type) { - return null; - } - return creator; - } - - @Override - @Nullable - public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { - IGuiCreator creator = getGuiCreator(id, player, world, x, y, z); - if (creator == null) { - return null; - } - return creator.getServerGuiElement(getData(id), player); - } - } - - public static class ServerProxy extends CommonProxy { - - @Override - @Nullable - public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { - return null; - } - } - - public static class ClientProxy extends CommonProxy { - - @Override - @Nullable - public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { - IGuiCreator creator = getGuiCreator(id, player, world, x, y, z); - if (creator == null) { - return null; - } - return creator.getClientGuiElement(getData(id), player); - } - } - -} +//package buildcraft.compat.network; +// +//import buildcraft.compat.BCCompat; +//import buildcraft.compat.CompatUtils; +//import net.minecraft.core.BlockPos; +//import net.minecraft.core.Direction; +//import net.minecraft.world.entity.player.Player; +//import net.minecraft.world.level.Level; +//import net.minecraft.world.level.block.entity.BlockEntity; +// +//import javax.annotation.Nullable; +// +//public enum CompatGui +//{ +// FORESTRY_PROPOLIS_PIPE(CompatGui.IGuiTarget.TILE); +// +// static final CompatGui[] VALUES = values(); +// // @SidedProxy( +//// modId = "buildcraftcompat" +//// ) +// public static CommonProxy guiHandlerProxy; +// public final IGuiTarget target; +// +// private CompatGui(IGuiTarget target) +// { +// this.target = target; +// } +// +// public void openGui(EntityPlayer player) +// { +// this.openGui(player, 0, 0, 0, 0); +// } +// +// public void openGui(EntityPlayer player, BlockPos pos) +// { +// this.openGui(player, pos.func_177958_n(), pos.func_177956_o(), pos.func_177952_p(), 0); +// } +// +// public void openGui(EntityPlayer player, int x, int y, int z) +// { +// this.openGui(player, x, y, z, 0); +// } +// +// public void openGui(EntityPlayer player, int data) +// { +// this.openGui(player, 0, 0, 0, data); +// } +// +// public void openGui(EntityPlayer player, BlockPos pos, int data) +// { +// this.openGui(player, pos.func_177958_n(), pos.func_177956_o(), pos.func_177952_p(), data); +// } +// +// public void openGui(EntityPlayer player, int x, int y, int z, int data) +// { +// player.openGui(BCCompat.instance, packGui(this, data), player.field_70170_p, x, y, z); +// } +// +// protected static int packGui(Enum gui, int data) +// { +// if (data >= 0 && data <= 16777215) +// { +// return data << 8 | gui.ordinal(); +// } +// else +// { +// throw new IllegalArgumentException("Data must be between 0 and 0xFF_FF_FF (inclusive)"); +// } +// } +// +// @Nullable +// protected static CompatGui getGui(int id) +// { +// id &= 255; +// return id >= 0 && id < VALUES.length ? VALUES[id] : null; +// } +// +// protected static int getData(int id) +// { +// return id >>> 8; +// } +// +// public static class ClientProxy extends CommonProxy +// { +// public ClientProxy() +// { +// } +// +// @Nullable +// public Object getClientGuiElement(int id, Player player, Level world, int x, int y, int z) +// { +// IGuiCreator creator = getGuiCreator(id, player, world, x, y, z); +// return creator == null ? null : creator.getClientGuiElement(CompatGui.getData(id), player); +// } +// } +// +// public static class ServerProxy extends CommonProxy +// { +// public ServerProxy() +// { +// } +// +// @Nullable +// public Object getClientGuiElement(int id, Player player, Level world, int x, int y, int z) +// { +// return null; +// } +// } +// +// // public abstract static class CommonProxy implements IGuiHandler +// public abstract static class CommonProxy +// { +// public CommonProxy() +// { +// } +// +// @Nullable +// protected static IGuiCreator getGuiCreator(int id, Player player, Level world, int x, int y, int z) +// { +// CompatGui type = CompatGui.getGui(id); +// int data = CompatGui.getData(id); +// if (type == null) +// { +// return null; +// } +// else +// { +// IGuiCreator creator = type.target.getCreator(player, world, x, y, z, data); +// return creator != null && creator.getGuiType() == type ? creator : null; +// } +// } +// +// @Nullable +// public Object getServerGuiElement(int id, Player player, Level world, int x, int y, int z) +// { +// IGuiCreator creator = getGuiCreator(id, player, world, x, y, z); +// return creator == null ? null : creator.getServerGuiElement(CompatGui.getData(id), player); +// } +// } +// +// @FunctionalInterface +// public interface IGuiTarget +// { +// IGuiTarget TILE = (player, world, x, y, z, data) -> +// { +// BlockEntity tile = world.getBlockEntity(new BlockPos(x, y, z)); +// if (tile instanceof IGuiCreator) +// { +// return (IGuiCreator) tile; +// } +// else +// { +// return tile != null ? (IGuiCreator) tile.getCapability(CompatUtils.CAP_GUI_CREATOR, null) : null; +// } +// }; +// +// @Nullable +// IGuiCreator getCreator(Player var1, Level var2, int var3, int var4, int var5, int var6); +// } +//} diff --git a/common/buildcraft/compat/network/IGuiCreator.java b/common/buildcraft/compat/network/IGuiCreator.java index c1d26fe..b01a674 100644 --- a/common/buildcraft/compat/network/IGuiCreator.java +++ b/common/buildcraft/compat/network/IGuiCreator.java @@ -1,25 +1,21 @@ package buildcraft.compat.network; import javax.annotation.Nullable; +import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -/** A creator that can */ -// TODO: Move this into bc lib and make it more useful! public interface IGuiCreator { Enum getGuiType(); - /** @param data The extra 24 bits that are unused by the byte ID. */ @Nullable - @SideOnly(Side.CLIENT) - GuiContainer getClientGuiElement(int data, EntityPlayer player); + @OnlyIn(Dist.CLIENT) +// GuiContainer getClientGuiElement(int var1, EntityPlayer var2); + AbstractContainerScreen getClientGuiElement(int var1, Player var2); - /** @param data The extra 24 bits that are unused by the byte ID. */ @Nullable - Container getServerGuiElement(int data, EntityPlayer player); +// Container getServerGuiElement(int var1, EntityPlayer var2); + AbstractContainerMenu getServerGuiElement(int var1, Player var2); } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ca78035ef0501d802d4fc55381ef2d5c3ce0ec6e..41d9927a4d4fb3f96a785543079b8df6723c946b 100644 GIT binary patch literal 59821 zcma&NV|1p`(k7gaZQHhOJ9%QKV?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?7m(jS zU;<7B+G(4a{TXe!Ln^o%P?_%lmHBHs;RE``AJ7CWE$zPPZdgfc8(RR3u0PZ^o^}DT znR=2*K>s2J6!n{C!rxbo_X~jN-yfjAcL8B1eO>$igin8p>W7tETm?WC0H9L+4GDPG zc#8`D5%sT^;yd=YO#iteo@(y?4PE2SFY`y-@74O>hM%Vzhd=NL0R#FUO8-mK|2M_M zr?v4^Kko+%welZX{&~cCDx32I&iBoKX3y^f@E>Q;pY!)^ck8L@%@07-xBp!O=PAm! zRNr37Z`U{7n7^)X^BAV~FQxnz!{%w?rz$dkC$I4q`#tgBegZ$O*PmElpTa*?2KfO$ zsry^reuDk}b;?Z^FOFcP5z1MzXYCt3jZ`_`VV+PvwwpB-V*;5LH#M!)8MN=sPygr1=U}b_P?s@ zY5d9`B!Q0qg5;m0Sw1b%({O)3$a-Ap#72PxsJ&ATyQ!hWvYH`V0EcJL*ph@pSL< z2NhY>KT-XUx%BCl-4ED+>VJa$K4ARA2Hw*GJT>h9U>dCdjp^z4!%ubhKMM5J*!+Vg zt?@USpJ2Zi==jD1h7jz91(n*Rm \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum -warn ( ) { +warn () { echo "$*" -} +} >&2 -die ( ) { +die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -81,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + 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. Please set the JAVA_HOME variable in your environment to match the @@ -89,76 +140,95 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +# 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 +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 832fdb6..107acd3 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -35,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -45,34 +64,14 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/resources/META-INF/mods.toml_ b/resources/META-INF/mods.toml_ new file mode 100644 index 0000000..9864995 --- /dev/null +++ b/resources/META-INF/mods.toml_ @@ -0,0 +1,32 @@ +modLoader="javafml" +loaderVersion="[32,)" +license="Minecraft Mod Public License" +issueTrackerURL="" +[[mods]] +modId="buildcraftlib" +displayName="BuildCraft Lib" +version="7.99.24.9" +description="Library mod used by buildcraft." +credits="Created by SpaceToad" +logoFile="logo.png" +displayURL="http://www.mod-buildcraft.com/" +updateJSONURL="" +authors="SpaceToad, BuildCraft Team" + +[[mods]] +modId="buildcraftcompat" +displayName="BuildCraft Compat" +version="7.99.24.9" +description="Compatibility add-on for BuildCraft" +credits="Created by asie" +logoFile="logo.png" +displayURL="http://www.mod-buildcraft.com/" +updateJSONURL="" +authors="BuildCraft Team" + +[[dependencies.buildcraftcompat]] + modId="buildcraftcore" + mandatory=true + versionRange="[0.0.0,)" + ordering="AFTER" + side="BOTH" diff --git a/resources/assets/buildcraftcompat/lang/de_DE.lang b/resources/assets/buildcraftcompat/lang/de_DE.lang deleted file mode 100644 index 03ffea5..0000000 --- a/resources/assets/buildcraftcompat/lang/de_DE.lang +++ /dev/null @@ -1,20 +0,0 @@ -#################### -# APIARIST'S PIPE -#################### - -item.buildcraftPipe.pipeitemspropolis.name=Bienenrohr - -for.gui.pipe.filter.anything=Alles -for.gui.pipe.filter.bee=Alle Bienen -for.gui.pipe.filter.cave=Höhlenbewohner -for.gui.pipe.filter.closed=Geschlossen -for.gui.pipe.filter.drone=Dronen -for.gui.pipe.filter.flyer=Starke Flieger -for.gui.pipe.filter.item=Gegenstände -for.gui.pipe.filter.nocturnal=Nachtaktive -for.gui.pipe.filter.princess=Prinzessinnen -for.gui.pipe.filter.pure_breed=Reinrassige -for.gui.pipe.filter.pure_cave=Reinrassige Höhlenbewohner -for.gui.pipe.filter.pure_flyer=Reinrassig starke Flieger -for.gui.pipe.filter.pure_nocturnal=Reinrassig nachtaktive -for.gui.pipe.filter.queen=Königinnen diff --git a/resources/assets/buildcraftcompat/lang/de_de.json b/resources/assets/buildcraftcompat/lang/de_de.json new file mode 100644 index 0000000..728942c --- /dev/null +++ b/resources/assets/buildcraftcompat/lang/de_de.json @@ -0,0 +1,24 @@ +{ + //################### + // APIARIST'S PIPE + //################### + + "item.buildcraftPipe.pipeitemspropolis.name": "Bienenrohr", + + "for.gui.pipe.filter.anything": "Alles", + "for.gui.pipe.filter.bee": "Alle Bienen", + "for.gui.pipe.filter.cave": "Höhlenbewohner", + "for.gui.pipe.filter.closed": "Geschlossen", + "for.gui.pipe.filter.drone": "Dronen", + "for.gui.pipe.filter.flyer": "Starke Flieger", + "for.gui.pipe.filter.item": "Gegenstände", + "for.gui.pipe.filter.nocturnal": "Nachtaktive", + "for.gui.pipe.filter.princess": "Prinzessinnen", + "for.gui.pipe.filter.pure_breed": "Reinrassige", + "for.gui.pipe.filter.pure_cave": "Reinrassige Höhlenbewohner", + "for.gui.pipe.filter.pure_flyer": "Reinrassig starke Flieger", + "for.gui.pipe.filter.pure_nocturnal": "Reinrassig nachtaktive", + "for.gui.pipe.filter.queen": "Königinnen", + + "null": "=w=" +} diff --git a/resources/assets/buildcraftcompat/lang/en_US.lang b/resources/assets/buildcraftcompat/lang/en_US.lang deleted file mode 100644 index 3975239..0000000 --- a/resources/assets/buildcraftcompat/lang/en_US.lang +++ /dev/null @@ -1,25 +0,0 @@ -#################### -# APIARIST'S PIPE -#################### - -item.buildcraftPipe.pipeitemspropolis.name=Apiarist's Pipe - -for.gui.pipe.filter.anything=Anything -for.gui.pipe.filter.bee=Any Bees -for.gui.pipe.filter.cave=Cave-Dwellers -for.gui.pipe.filter.closed=Closed -for.gui.pipe.filter.drone=Drones -for.gui.pipe.filter.flyer=Strong Flyers -for.gui.pipe.filter.item=Items -for.gui.pipe.filter.natural=Natural Origin -for.gui.pipe.filter.nocturnal=Nocturnal Bees -for.gui.pipe.filter.princess=Princesses -for.gui.pipe.filter.pure_breed=Pure-Bred Bees -for.gui.pipe.filter.pure_cave=Pure Cave-Dwellers -for.gui.pipe.filter.pure_flyer=Pure Flyers -for.gui.pipe.filter.pure_nocturnal=Pure Nocturnal Bees -for.gui.pipe.filter.queen=Queen - -gate.trigger.mfr.backstuffed=Has Drops -gate.trigger.mfr.conreversed=Conveyor Reversed -gate.trigger.mfr.conrunning=Conveyor Running \ No newline at end of file diff --git a/resources/assets/buildcraftcompat/lang/en_us.json b/resources/assets/buildcraftcompat/lang/en_us.json new file mode 100644 index 0000000..03be0b4 --- /dev/null +++ b/resources/assets/buildcraftcompat/lang/en_us.json @@ -0,0 +1,45 @@ +{ + //################### + // APIARIST'S PIPE + //################### + + "item.buildcraftPipe.pipeitemspropolis.name": "Apiarist's Pipe", + + "for.gui.pipe.filter.anything": "Anything", + "for.gui.pipe.filter.bee": "Any Bees", + "for.gui.pipe.filter.cave": "Cave-Dwellers", + "for.gui.pipe.filter.closed": "Closed", + "for.gui.pipe.filter.drone": "Drones", + "for.gui.pipe.filter.flyer": "Strong Flyers", + "for.gui.pipe.filter.item": "Items", + "for.gui.pipe.filter.natural": "Natural Origin", + "for.gui.pipe.filter.nocturnal": "Nocturnal Bees", + "for.gui.pipe.filter.princess": "Princesses", + "for.gui.pipe.filter.pure_breed": "Pure-Bred Bees", + "for.gui.pipe.filter.pure_cave": "Pure Cave-Dwellers", + "for.gui.pipe.filter.pure_flyer": "Pure Flyers", + "for.gui.pipe.filter.pure_nocturnal": "Pure Nocturnal Bees", + "for.gui.pipe.filter.queen": "Queen", + + "gate.trigger.mfr.backstuffed": "Has Drops", + "gate.trigger.mfr.conreversed": "Conveyor Reversed", + "gate.trigger.mfr.conrunning": "Conveyor Running", + + // Calen 1.18.2 + // JEI + "buildcraft.jei.title.heatable_fluids": "Heatable Fluids", + "buildcraft.jei.title.coolable_fluids": "Coolable Fluids", + "buildcraft.jei.title.distillable_fluids": "Distillable Fluids", + "buildcraft.jei.title.combustion_engine_fuels": "Combustion Engine Fuels", + "buildcraft.jei.title.combustion_engine_fuels.burn_time": "Burns for %ds", + "buildcraft.jei.title.combustion_engine_fuels.burn_speed": " at %s MJ/t", + "buildcraft.jei.title.combustion_engine_fuels.burn_total": " total %s MJ", + + // Waila + "buildcraft.waila.crafting": "§fMaking: ", + "buildcraft.waila.no_recipe": "§7No recipe", + "buildcraft.waila.crafting_from": "§fFrom: ", + "buildcraft.waila.waiting_for_laser": "§fWaiting from laser: §b%s MJ", + + "null": "=w=" +} diff --git a/resources/assets/buildcraftcompat/lang/fr_FR.lang b/resources/assets/buildcraftcompat/lang/fr_FR.lang deleted file mode 100644 index 02f01f3..0000000 --- a/resources/assets/buildcraftcompat/lang/fr_FR.lang +++ /dev/null @@ -1,20 +0,0 @@ -#################### -# APIARIST'S PIPE -#################### - -item.buildcraftPipe.pipeitemspropolis.name=Tuyau de transport d'apiculteur - -for.gui.pipe.filter.anything=Tout -for.gui.pipe.filter.bee=Toutes abeilles -for.gui.pipe.filter.cave=De cave -for.gui.pipe.filter.closed=Rien -for.gui.pipe.filter.drone=Ouvrières -for.gui.pipe.filter.flyer=Les volantes -for.gui.pipe.filter.item=Éléments -for.gui.pipe.filter.nocturnal=Les noctures -for.gui.pipe.filter.princess=Princesses -for.gui.pipe.filter.pure_breed=Pures races -for.gui.pipe.filter.pure_cave=De cave pures -for.gui.pipe.filter.pure_flyer=Volantes pures -for.gui.pipe.filter.pure_nocturnal=Nocturne pures -for.gui.pipe.filter.queen=Reines diff --git a/resources/assets/buildcraftcompat/lang/fr_fr.json b/resources/assets/buildcraftcompat/lang/fr_fr.json new file mode 100644 index 0000000..d35b127 --- /dev/null +++ b/resources/assets/buildcraftcompat/lang/fr_fr.json @@ -0,0 +1,24 @@ +{ + //################### + // APIARIST'S PIPE + //################### + + "item.buildcraftPipe.pipeitemspropolis.name": "Tuyau de transport d'apiculteur", + + "for.gui.pipe.filter.anything": "Tout", + "for.gui.pipe.filter.bee": "Toutes abeilles", + "for.gui.pipe.filter.cave": "De cave", + "for.gui.pipe.filter.closed": "Rien", + "for.gui.pipe.filter.drone": "Ouvrières", + "for.gui.pipe.filter.flyer": "Les volantes", + "for.gui.pipe.filter.item": "Éléments", + "for.gui.pipe.filter.nocturnal": "Les noctures", + "for.gui.pipe.filter.princess": "Princesses", + "for.gui.pipe.filter.pure_breed": "Pures races", + "for.gui.pipe.filter.pure_cave": "De cave pures", + "for.gui.pipe.filter.pure_flyer": "Volantes pures", + "for.gui.pipe.filter.pure_nocturnal": "Nocturne pures", + "for.gui.pipe.filter.queen": "Reines", + + "null": "=w=" +} diff --git a/resources/assets/buildcraftcompat/lang/ko_KR.lang b/resources/assets/buildcraftcompat/lang/ko_KR.lang deleted file mode 100644 index bdcfa70..0000000 --- a/resources/assets/buildcraftcompat/lang/ko_KR.lang +++ /dev/null @@ -1,20 +0,0 @@ -#################### -# APIARIST'S PIPE -#################### - -item.buildcraftPipe.pipeitemspropolis.name=양봉업자의 파이프 - -for.gui.pipe.filter.anything=모든 아이템과 벌을 통과 -for.gui.pipe.filter.bee=모든 벌들 -for.gui.pipe.filter.cave=동굴 속에서도 작업 가능 -for.gui.pipe.filter.closed=아이템을 받지 않음 -for.gui.pipe.filter.drone=일벌 -for.gui.pipe.filter.flyer=우천시에도 작업 가능 -for.gui.pipe.filter.item=아이템만 -for.gui.pipe.filter.nocturnal=야행성 벌 -for.gui.pipe.filter.princess=공주벌 -for.gui.pipe.filter.pure_breed=공주벌 -for.gui.pipe.filter.pure_cave=동굴 속에서도 작업 가능한 순종 벌 -for.gui.pipe.filter.pure_flyer=우천시에도 작업 가능한 순종 벌 -for.gui.pipe.filter.pure_nocturnal=순종 야행성 벌 -for.gui.pipe.filter.queen=여왕벌 diff --git a/resources/assets/buildcraftcompat/lang/ko_kr.json b/resources/assets/buildcraftcompat/lang/ko_kr.json new file mode 100644 index 0000000..aba0c09 --- /dev/null +++ b/resources/assets/buildcraftcompat/lang/ko_kr.json @@ -0,0 +1,24 @@ +{ + //################### + // APIARIST'S PIPE + //################### + + "item.buildcraftPipe.pipeitemspropolis.name": "양봉업자의 파이프", + + "for.gui.pipe.filter.anything": "모든 아이템과 벌을 통과", + "for.gui.pipe.filter.bee": "모든 벌들", + "for.gui.pipe.filter.cave": "동굴 속에서도 작업 가능", + "for.gui.pipe.filter.closed": "아이템을 받지 않음", + "for.gui.pipe.filter.drone": "일벌", + "for.gui.pipe.filter.flyer": "우천시에도 작업 가능", + "for.gui.pipe.filter.item": "아이템만", + "for.gui.pipe.filter.nocturnal": "야행성 벌", + "for.gui.pipe.filter.princess": "공주벌", + "for.gui.pipe.filter.pure_breed": "공주벌", + "for.gui.pipe.filter.pure_cave": "동굴 속에서도 작업 가능한 순종 벌", + "for.gui.pipe.filter.pure_flyer": "우천시에도 작업 가능한 순종 벌", + "for.gui.pipe.filter.pure_nocturnal": "순종 야행성 벌", + "for.gui.pipe.filter.queen": "여왕벌", + + "null": "=w=" +} diff --git a/resources/assets/buildcraftcompat/lang/pt_BR.lang b/resources/assets/buildcraftcompat/lang/pt_BR.lang deleted file mode 100644 index 35da29d..0000000 --- a/resources/assets/buildcraftcompat/lang/pt_BR.lang +++ /dev/null @@ -1,20 +0,0 @@ -#################### -# APIARIST'S PIPE -#################### - -item.buildcraftPipe.pipeitemspropolis.name=Tubo do Apicultor - -for.gui.pipe.filter.anything=Nada -for.gui.pipe.filter.bee=Quaisquer Abelhas -for.gui.pipe.filter.cave=Habitante de Cavernas -for.gui.pipe.filter.closed=Fechado -for.gui.pipe.filter.drone=Zangões -for.gui.pipe.filter.flyer=Insetos Fortes -for.gui.pipe.filter.item=Ítens -for.gui.pipe.filter.nocturnal=Abelhas Noturnas -for.gui.pipe.filter.princess=Princesas -for.gui.pipe.filter.pure_breed=Abelhas de Raça Pura -for.gui.pipe.filter.pure_cave=Puras Habitantes das Cavernas -for.gui.pipe.filter.pure_flyer=Insetos Puros -for.gui.pipe.filter.pure_nocturnal=Abelhas Noturnas Puras -for.gui.pipe.filter.queen=Rainha diff --git a/resources/assets/buildcraftcompat/lang/pt_br.json b/resources/assets/buildcraftcompat/lang/pt_br.json new file mode 100644 index 0000000..8a5185f --- /dev/null +++ b/resources/assets/buildcraftcompat/lang/pt_br.json @@ -0,0 +1,24 @@ +{ + //################### + // APIARIST'S PIPE + //################### + + "item.buildcraftPipe.pipeitemspropolis.name": "Tubo do Apicultor", + + "for.gui.pipe.filter.anything": "Nada", + "for.gui.pipe.filter.bee": "Quaisquer Abelhas", + "for.gui.pipe.filter.cave": "Habitante de Cavernas", + "for.gui.pipe.filter.closed": "Fechado", + "for.gui.pipe.filter.drone": "Zangões", + "for.gui.pipe.filter.flyer": "Insetos Fortes", + "for.gui.pipe.filter.item": "Ítens", + "for.gui.pipe.filter.nocturnal": "Abelhas Noturnas", + "for.gui.pipe.filter.princess": "Princesas", + "for.gui.pipe.filter.pure_breed": "Abelhas de Raça Pura", + "for.gui.pipe.filter.pure_cave": "Puras Habitantes das Cavernas", + "for.gui.pipe.filter.pure_flyer": "Insetos Puros", + "for.gui.pipe.filter.pure_nocturnal": "Abelhas Noturnas Puras", + "for.gui.pipe.filter.queen": "Rainha", + + "null": "=w=" +} diff --git a/resources/assets/buildcraftcompat/lang/ru_RU.lang b/resources/assets/buildcraftcompat/lang/ru_RU.lang deleted file mode 100644 index 4d41e5a..0000000 --- a/resources/assets/buildcraftcompat/lang/ru_RU.lang +++ /dev/null @@ -1,25 +0,0 @@ -#################### -# APIARIST'S PIPE -#################### - -item.buildcraftPipe.pipeitemspropolis.name=Труба пчеловода - -for.gui.pipe.filter.anything=Всё -for.gui.pipe.filter.bee=Любые пчелы -for.gui.pipe.filter.cave=Пещерные -for.gui.pipe.filter.closed=Закрыт -for.gui.pipe.filter.drone=Трутни -for.gui.pipe.filter.flyer=Летуны -for.gui.pipe.filter.item=Предметы -for.gui.pipe.filter.natural=Естественного происх. -for.gui.pipe.filter.nocturnal=Ночные -for.gui.pipe.filter.princess=Принцессы -for.gui.pipe.filter.pure_breed=Чистопородные -for.gui.pipe.filter.pure_cave=Породистые пещерные -for.gui.pipe.filter.pure_flyer=Породистые летуны -for.gui.pipe.filter.pure_nocturnal=Породистые ночные -for.gui.pipe.filter.queen=Матки - -gate.trigger.mfr.backstuffed=Есть предметы -gate.trigger.mfr.conreversed=Конвейер реверсирован -gate.trigger.mfr.conrunning=Конвейер работает \ No newline at end of file diff --git a/resources/assets/buildcraftcompat/lang/ru_ru.json b/resources/assets/buildcraftcompat/lang/ru_ru.json new file mode 100644 index 0000000..1be6465 --- /dev/null +++ b/resources/assets/buildcraftcompat/lang/ru_ru.json @@ -0,0 +1,29 @@ +{ + //################### + // APIARIST'S PIPE + //################### + + "item.buildcraftPipe.pipeitemspropolis.name": "Труба пчеловода", + + "for.gui.pipe.filter.anything": "Всё", + "for.gui.pipe.filter.bee": "Любые пчелы", + "for.gui.pipe.filter.cave": "Пещерные", + "for.gui.pipe.filter.closed": "Закрыт", + "for.gui.pipe.filter.drone": "Трутни", + "for.gui.pipe.filter.flyer": "Летуны", + "for.gui.pipe.filter.item": "Предметы", + "for.gui.pipe.filter.natural": "Естественного происх.", + "for.gui.pipe.filter.nocturnal": "Ночные", + "for.gui.pipe.filter.princess": "Принцессы", + "for.gui.pipe.filter.pure_breed": "Чистопородные", + "for.gui.pipe.filter.pure_cave": "Породистые пещерные", + "for.gui.pipe.filter.pure_flyer": "Породистые летуны", + "for.gui.pipe.filter.pure_nocturnal": "Породистые ночные", + "for.gui.pipe.filter.queen": "Матки", + + "gate.trigger.mfr.backstuffed": "Есть предметы", + "gate.trigger.mfr.conreversed": "Конвейер реверсирован", + "gate.trigger.mfr.conrunning": "Конвейер работает", + + "null": "=w=" +} diff --git a/resources/assets/buildcraftcompat/lang/uk_UA.lang b/resources/assets/buildcraftcompat/lang/uk_UA.lang deleted file mode 100644 index 711c823..0000000 --- a/resources/assets/buildcraftcompat/lang/uk_UA.lang +++ /dev/null @@ -1,20 +0,0 @@ -#################### -# APIARIST'S PIPE -#################### - -item.buildcraftPipe.pipeitemspropolis.name=Труба пчеловода - -for.gui.pipe.filter.anything=Всё -for.gui.pipe.filter.bee=Любые пчелы -for.gui.pipe.filter.cave=Пещерные -for.gui.pipe.filter.closed=Закрыт -for.gui.pipe.filter.drone=Трутни -for.gui.pipe.filter.flyer=Летуны -for.gui.pipe.filter.item=Предметы -for.gui.pipe.filter.nocturnal=Ночные -for.gui.pipe.filter.princess=Принцессы -for.gui.pipe.filter.pure_breed=Чистопородные -for.gui.pipe.filter.pure_cave=Породистые пещерные -for.gui.pipe.filter.pure_flyer=Породистые летуны -for.gui.pipe.filter.pure_nocturnal=Породистые ночные -for.gui.pipe.filter.queen=Королевы diff --git a/resources/assets/buildcraftcompat/lang/uk_ua.json b/resources/assets/buildcraftcompat/lang/uk_ua.json new file mode 100644 index 0000000..da44267 --- /dev/null +++ b/resources/assets/buildcraftcompat/lang/uk_ua.json @@ -0,0 +1,24 @@ +{ + //################### + // APIARIST'S PIPE + //################### + + "item.buildcraftPipe.pipeitemspropolis.name": "Труба пчеловода", + + "for.gui.pipe.filter.anything": "Всё", + "for.gui.pipe.filter.bee": "Любые пчелы", + "for.gui.pipe.filter.cave": "Пещерные", + "for.gui.pipe.filter.closed": "Закрыт", + "for.gui.pipe.filter.drone": "Трутни", + "for.gui.pipe.filter.flyer": "Летуны", + "for.gui.pipe.filter.item": "Предметы", + "for.gui.pipe.filter.nocturnal": "Ночные", + "for.gui.pipe.filter.princess": "Принцессы", + "for.gui.pipe.filter.pure_breed": "Чистопородные", + "for.gui.pipe.filter.pure_cave": "Породистые пещерные", + "for.gui.pipe.filter.pure_flyer": "Породистые летуны", + "for.gui.pipe.filter.pure_nocturnal": "Породистые ночные", + "for.gui.pipe.filter.queen": "Королевы", + + "null": "=w=" +} diff --git a/resources/assets/buildcraftcompat/lang/zh_CN.lang b/resources/assets/buildcraftcompat/lang/zh_CN.lang deleted file mode 100644 index e9f5aff..0000000 --- a/resources/assets/buildcraftcompat/lang/zh_CN.lang +++ /dev/null @@ -1,20 +0,0 @@ -#################### -# APIARIST'S PIPE -#################### - -item.buildcraftPipe.pipeitemspropolis.name=养蜂员管道 - -for.gui.pipe.filter.anything=任意物品 -for.gui.pipe.filter.bee=任意蜜蜂 -for.gui.pipe.filter.cave=穴居蜂 -for.gui.pipe.filter.closed=已关闭 -for.gui.pipe.filter.drone=雄蜂 -for.gui.pipe.filter.flyer=强壮飞蜂 -for.gui.pipe.filter.item=物品 -for.gui.pipe.filter.nocturnal=夜行蜜蜂 -for.gui.pipe.filter.princess=公主蜂 -for.gui.pipe.filter.pure_breed=纯种蜜蜂 -for.gui.pipe.filter.pure_cave=纯种穴居蜂 -for.gui.pipe.filter.pure_flyer=纯种飞蜂 -for.gui.pipe.filter.pure_nocturnal=纯种夜行蜜蜂 -for.gui.pipe.filter.queen=蜂后 diff --git a/resources/assets/buildcraftcompat/lang/zh_cn.json b/resources/assets/buildcraftcompat/lang/zh_cn.json new file mode 100644 index 0000000..9bf01fe --- /dev/null +++ b/resources/assets/buildcraftcompat/lang/zh_cn.json @@ -0,0 +1,40 @@ +{ + //################### + // APIARIST'S PIPE + //################### + + "item.buildcraftPipe.pipeitemspropolis.name": "养蜂员管道", + + "for.gui.pipe.filter.anything": "任意物品", + "for.gui.pipe.filter.bee": "任意蜜蜂", + "for.gui.pipe.filter.cave": "穴居蜂", + "for.gui.pipe.filter.closed": "已关闭", + "for.gui.pipe.filter.drone": "雄蜂", + "for.gui.pipe.filter.flyer": "强壮飞蜂", + "for.gui.pipe.filter.item": "物品", + "for.gui.pipe.filter.nocturnal": "夜行蜜蜂", + "for.gui.pipe.filter.princess": "公主蜂", + "for.gui.pipe.filter.pure_breed": "纯种蜜蜂", + "for.gui.pipe.filter.pure_cave": "纯种穴居蜂", + "for.gui.pipe.filter.pure_flyer": "纯种飞蜂", + "for.gui.pipe.filter.pure_nocturnal": "纯种夜行蜜蜂", + "for.gui.pipe.filter.queen": "蜂后", + + // Calen 1.18.2 + // JEI + "buildcraft.jei.title.heatable_fluids": "加热流体", + "buildcraft.jei.title.coolable_fluids": "冷却流体", + "buildcraft.jei.title.distillable_fluids": "蒸馏", + "buildcraft.jei.title.combustion_engine_fuels": "燃油引擎燃料", + "buildcraft.jei.title.combustion_engine_fuels.burn_time": "燃烧时间 %ds", + "buildcraft.jei.title.combustion_engine_fuels.burn_speed": " 产能速率 %s MJ/t", + "buildcraft.jei.title.combustion_engine_fuels.burn_total": " 产能总计 %s MJ", + + // Waila + "buildcraft.waila.crafting": "§f正在合成: ", + "buildcraft.waila.no_recipe": "§7当前没有配方正在合成", + "buildcraft.waila.crafting_from": "§f使用: ", + "buildcraft.waila.waiting_for_laser": "§f还需要能量: §b%s MJ", + + "null": "=w=" +} diff --git a/resources/mcmod.info b/resources/mcmod.info deleted file mode 100644 index 4b57663..0000000 --- a/resources/mcmod.info +++ /dev/null @@ -1,16 +0,0 @@ -[{ - "modid": "buildcraftcompat", - "name": "BuildCraft Compat", - "version": "$version", - "mcversion": "$mcversion", - "description": "Compatibility add-on for BuildCraft", - "credits": "Created by asie", - "url": "http://www.mod-buildcraft.com/", - "updateUrl": "", - "authorList": [ "BuildCraft Team" ], - "parent":"buildcraftcore", - "screenshots": [], - "dependencies": [ - "mod_MinecraftForge" - ] -}] From da1c0eef0686ffdf179651058b017753152177cd Mon Sep 17 00:00:00 2001 From: LRW-Calen Date: Sun, 21 Apr 2024 23:35:09 +0800 Subject: [PATCH 02/15] Simple Updates --- common/buildcraft/compat/BCCompat.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/buildcraft/compat/BCCompat.java b/common/buildcraft/compat/BCCompat.java index b3139e1..65b09a3 100644 --- a/common/buildcraft/compat/BCCompat.java +++ b/common/buildcraft/compat/BCCompat.java @@ -56,7 +56,7 @@ public BCCompat() { private static void offerAndPreInitModule(CompatModuleBase module) { String cModId = module.compatModId(); if (module.canLoad()) { - Property prop = BCCoreConfig.getConfig(true).get("modules", cModId, true); + Property prop = BCCoreConfig.getConfigAndEnsureCreated(true).get("modules", cModId, true); if (prop.getBoolean(true)) { modules.put(cModId, module); BCLog.logger.info("[compat] + " + cModId); From 47ed6ff6c3e61d98b503d89199ad7ef9b43e858c Mon Sep 17 00:00:00 2001 From: LRW-Calen Date: Sun, 21 Apr 2024 23:48:48 +0800 Subject: [PATCH 03/15] Simple Updates --- build.gradle | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 957f5cc..1305a0e 100755 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ configFile.withReader { } version = config.compat_version -//version = mod_version + "-" + new Date().format("yyyy-MM-dd'T'HH-mm-ssZ") +// version = config.compat_version + "-" + new Date().format("yyyy-MM-dd'T'HH-mm-ssZ") group = "com.mod-buildcraft-compat" archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension] @@ -161,8 +161,7 @@ minecraft { // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. // args '--mod', 'buildcraftcore', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') - args '--mod', 'buildcraftcore', '--all', '--output', file('buildcraft_resources_generated/'), '--existing', file('buildcraft_resources/') - + args '--mod', 'buildcraftcore', '--all', '--output', file('BuildCraft/buildcraft_resources_generated/'), '--existing', file('BuildCraft/buildcraft_resources/') mods { buildcraftcore { @@ -357,6 +356,10 @@ repositories { includeGroup "mcjty" } } +// // Calen test +// maven { +// url = "https://files.minecraftforge.net/maven" +// } } //processResources { @@ -405,11 +408,17 @@ dependencies { runtimeOnly fg.deobf("net.sf.trove4j:trove4j:3.0.3") compileOnly fg.deobf("mezz.jei:jei-" + config.mc_version + ":" + config.jei_version + ":api") - runtimeOnly fg.deobf("mezz.jei:jei-" + config.mc_version + ":" + config.jei_version + ":api") + runtimeOnly fg.deobf("mezz.jei:jei-" + config.mc_version + ":" + config.jei_version) compileOnly fg.deobf("curse.maven:jade-324717:" + config.jade_id) runtimeOnly fg.deobf("curse.maven:jade-324717:" + config.jade_id) +// compileOnly "blank:forge-1.12.2:14.23.5.2859" +// runtimeOnly "blank:forge-1.12.2:14.23.5.2859" + +// compileOnly "net.minecraftforge:forgeSrc:1.12.2-14.23.5.2768" +// runtimeOnly "net.minecraftforge:forgeSrc:1.12.2-14.23.5.2768" + // compileOnly fg.deobf("blank:ae2-${mc_version}:11.7.6") // runtimeOnly fg.deobf("blank:ae2-${mc_version}:11.7.6") From e27b1d407d6ba64d89a0b95905a3915963f840f1 Mon Sep 17 00:00:00 2001 From: LRW-Calen Date: Tue, 7 May 2024 18:47:17 +0800 Subject: [PATCH 04/15] A few updates --- common/buildcraft/compat/BCCompat.java | 21 ++-- .../module/crafttweaker/AssemblyTable.java | 73 +++++------- .../module/crafttweaker/CombustionEngine.java | 103 +++++------------ .../compat/module/crafttweaker/Coolant.java | 6 +- .../compat/module/jei/BCPluginJEI.java | 107 ++++++------------ .../CategoryCombustionEngine.java | 2 +- .../jei/silicon/CategoryAssemblyTable.java | 26 ++--- .../AssemblyTableTransferHandler.java | 2 +- .../compat/network/IGuiCreator.java | 2 +- 9 files changed, 122 insertions(+), 220 deletions(-) diff --git a/common/buildcraft/compat/BCCompat.java b/common/buildcraft/compat/BCCompat.java index 65b09a3..ef2707e 100644 --- a/common/buildcraft/compat/BCCompat.java +++ b/common/buildcraft/compat/BCCompat.java @@ -5,13 +5,13 @@ import buildcraft.compat.module.ic2.CompatModuleIndustrialCraft2; import buildcraft.compat.module.theoneprobe.CompatModuleTheOneProbe; import buildcraft.core.BCCoreConfig; - +import buildcraft.lib.config.EnumRestartRequirement; +import net.minecraftforge.common.ForgeConfigSpec.BooleanValue; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLConstructModEvent; import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; -import net.minecraftforge_1_12_2.common.config.Property; import java.util.HashMap; import java.util.Map; @@ -52,21 +52,24 @@ public BCCompat() { instance = this; } - private static void offerAndPreInitModule(CompatModuleBase module) { String cModId = module.compatModId(); if (module.canLoad()) { - Property prop = BCCoreConfig.getConfigAndEnsureCreated(true).get("modules", cModId, true); - if (prop.getBoolean(true)) { + String _modules = "modules"; + BooleanValue prop = BCCoreConfig.config + .define(_modules, + "", + EnumRestartRequirement.NONE, + cModId, true); + BCCoreConfig.config.build(); + if (prop.get()) { modules.put(cModId, module); BCLog.logger.info("[compat] + " + cModId); module.preInit(); - } - else { + } else { BCLog.logger.info("[compat] x " + cModId + " (It has been disabled in the config)"); } - } - else { + } else { BCLog.logger.info("[compat] x " + cModId + " (It cannot load)"); } } diff --git a/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java b/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java index 298c6fb..c9d1ee2 100644 --- a/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java +++ b/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java @@ -1,14 +1,12 @@ package buildcraft.compat.module.crafttweaker; import buildcraft.api.mj.MjAPI; -import buildcraft.api.recipes.AssemblyRecipe; -import buildcraft.api.recipes.AssemblyRecipeBasic; +import buildcraft.api.recipes.IAssemblyRecipe; +import buildcraft.lib.recipe.assembly.AssemblyRecipe; +import buildcraft.lib.recipe.assembly.AssemblyRecipeBasic; import buildcraft.api.recipes.IngredientStack; -import buildcraft.lib.recipe.AssemblyRecipeRegistry; import com.blamejared.crafttweaker.api.CraftTweakerAPI; -import com.blamejared.crafttweaker.api.action.base.IAction; import com.blamejared.crafttweaker.api.action.recipe.ActionAddRecipe; -import com.blamejared.crafttweaker.api.action.recipe.ActionRecipeBase; import com.blamejared.crafttweaker.api.action.recipe.ActionRemoveRecipeByName; import com.blamejared.crafttweaker.api.annotation.ZenRegister; import com.blamejared.crafttweaker.api.ingredient.IIngredient; @@ -30,10 +28,9 @@ //@ModOnly("buildcraftsilicon") @ZenRegister @ZenCodeType.Name("mods.buildcraft.AssemblyTable") -@IRecipeHandler.For(AssemblyRecipe.class) +@IRecipeHandler.For(IAssemblyRecipe.class) //public class AssemblyTable -public enum AssemblyTable implements IRecipeManager, IRecipeHandler -{ +public enum AssemblyTable implements IRecipeManager, IRecipeHandler { @ZenCodeGlobals.Global("assemblyTable") INSTANCE; @@ -42,22 +39,19 @@ public enum AssemblyTable implements IRecipeManager, IRecipeHand // @ZenMethod @ZenCodeType.Method // public static void addRecipe(IItemStack output, int power, IIngredient[] ingredients) - public void addRecipe(IItemStack output, int power, IIngredient[] ingredients) - { + public void addRecipe(IItemStack output, int power, IIngredient[] ingredients) { addRecipe0("auto_" + ids++, output, power, ingredients); } // @ZenMethod @ZenCodeType.Method // public static void addRecipe(String name, IItemStack output, int power, IIngredient[] ingredients) - public void addRecipe(String name, IItemStack output, int power, IIngredient[] ingredients) - { + public void addRecipe(String name, IItemStack output, int power, IIngredient[] ingredients) { addRecipe0("custom/" + name, output, power, ingredients); } // private static void addRecipe0(String name, IItemStack output, int power, IIngredient[] ingredients) - private void addRecipe0(String name, IItemStack output, int power, IIngredient[] ingredients) - { + private void addRecipe0(String name, IItemStack output, int power, IIngredient[] ingredients) { // CraftTweakerAPI.apply(new AddRecipeAction(name, output, power, ingredients)); CraftTweakerAPI.apply(AddRecipeAction.create(this, name, output, power, ingredients)); } @@ -65,64 +59,55 @@ private void addRecipe0(String name, IItemStack output, int power, IIngredient[] // @ZenMethod @ZenCodeType.Method // public static void removeByName(String name) - public void removeByName(String name) - { + public void removeByName(String name) { // CraftTweakerAPI.apply(new RemoveRecipeByNameAction(new ResourceLocation(name))); CraftTweakerAPI.apply(new RemoveRecipeByNameAction(this, new ResourceLocation(name))); } @Override - public RecipeType getRecipeType() - { - return AssemblyRecipe.TYPE; + public RecipeType getRecipeType() { + return IAssemblyRecipe.TYPE; } @Override - public String dumpToCommandString(IRecipeManager manager, AssemblyRecipe recipe) - { + public String dumpToCommandString(final IRecipeManager manager, IAssemblyRecipe recipe) { return String.format( "assemblyTable.addRecipe(%s, %s, %s);", StringUtil.quoteAndEscape(recipe.getId()), ItemStackUtil.getCommandString(recipe.getOutputPreviews().stream().toList().get(0)), - new IIngredientList(recipe.getRequiredIngredientStacksForSerialize().stream().map(i -> IIngredient.fromIngredient(i.ingredient)).toArray(IIngredient[]::new)).getCommandString() + new IIngredientList(recipe.getRequiredIngredientStacks().stream().map(i -> IIngredient.fromIngredient(i.ingredient)).toArray(IIngredient[]::new)).getCommandString() ); } - // private static class RemoveRecipeByNameAction implements IAction - private static class RemoveRecipeByNameAction extends ActionRemoveRecipeByName - { + // private static class RemoveRecipeByNameAction implements IAction + private static class RemoveRecipeByNameAction extends ActionRemoveRecipeByName { private final ResourceLocation name; - // RemoveRecipeByNameAction(ResourceLocation name) - RemoveRecipeByNameAction(IRecipeManager manager, ResourceLocation name) - { + // RemoveRecipeByNameAction(ResourceLocation name) + RemoveRecipeByNameAction(IRecipeManager manager, ResourceLocation name) { super(manager); this.name = name; } - public void apply() - { + public void apply() { // AssemblyRecipeRegistry.REGISTRY.remove(this.name); getManager().removeByName(this.name.toString()); } - public String describe() - { + public String describe() { return "Removing assembly table recipe " + this.name; } } - // private static class AddRecipeAction implements IAction - private static class AddRecipeAction extends ActionAddRecipe - { + // private static class AddRecipeAction implements IAction + private static class AddRecipeAction extends ActionAddRecipe { // private final ItemStack output; // private final ResourceLocation name; // private final long requiredMj; // private final ImmutableSet requiredStacks; - // public AddRecipeAction(IRecipeManager manager, String name, IItemStack output, int power, IIngredient[] ingredients) - private AddRecipeAction(IRecipeManager manager, AssemblyRecipe recipe) - { + // public AddRecipeAction(IRecipeManager manager, String name, IItemStack output, int power, IIngredient[] ingredients) + private AddRecipeAction(IRecipeManager manager, AssemblyRecipe recipe) { super(manager, recipe); // this.output = CraftTweakerMC.getItemStack(output); // ImmutableSet.Builder stacks = ImmutableSet.builder(); @@ -139,14 +124,12 @@ private AddRecipeAction(IRecipeManager manager, AssemblyRecipe r // this.name = new ResourceLocation("crafttweaker", name); } - public static AddRecipeAction create(IRecipeManager manager, String name, IItemStack output, int power, IIngredient[] ingredients) - { + public static AddRecipeAction create(IRecipeManager manager, String name, IItemStack output, int power, IIngredient[] ingredients) { // ItemStack output = CraftTweakerMC.getItemStack(output); ItemStack _output = output.getImmutableInternal(); ImmutableSet.Builder stacks = ImmutableSet.builder(); - for (int i = 0; i < ingredients.length; ++i) - { + for (int i = 0; i < ingredients.length; ++i) { IIngredient ctIng = ingredients[i]; // Ingredient ingredient = CraftTweakerMC.getIngredient(ctIng); Ingredient ingredient = ctIng.asVanillaIngredient(); @@ -161,13 +144,11 @@ public static AddRecipeAction create(IRecipeManager manager, Str return new AddRecipeAction(manager, recipe); } -// public void apply() -// { +// public void apply() { // AssemblyRecipeRegistry.REGISTRY.put(this.name, new AssemblyRecipeBasic(this.name, this.requiredMj, this.requiredStacks, this.output)); // } - public String describe() - { + public String describe() { // return "Adding assembly table recipe for " + this.output; return "Adding assembly table recipe for " + this.recipe.getOutputPreviews().stream().toList().get(0); } diff --git a/common/buildcraft/compat/module/crafttweaker/CombustionEngine.java b/common/buildcraft/compat/module/crafttweaker/CombustionEngine.java index 77bb4ce..6e1cd54 100644 --- a/common/buildcraft/compat/module/crafttweaker/CombustionEngine.java +++ b/common/buildcraft/compat/module/crafttweaker/CombustionEngine.java @@ -4,17 +4,13 @@ import buildcraft.api.fuels.IFuel; import buildcraft.api.fuels.IFuelManager; import buildcraft.api.mj.MjAPI; -import buildcraft.api.recipes.AssemblyRecipe; -import buildcraft.lib.fluid.FuelRegistry; +import buildcraft.lib.recipe.fuel.FuelRegistry; import com.blamejared.crafttweaker.api.CraftTweakerAPI; import com.blamejared.crafttweaker.api.action.recipe.ActionAddRecipe; import com.blamejared.crafttweaker.api.annotation.ZenRegister; import com.blamejared.crafttweaker.api.fluid.IFluidStack; -import com.blamejared.crafttweaker.api.ingredient.IIngredient; -import com.blamejared.crafttweaker.api.ingredient.type.IIngredientList; import com.blamejared.crafttweaker.api.recipe.handler.IRecipeHandler; import com.blamejared.crafttweaker.api.recipe.manager.base.IRecipeManager; -import com.blamejared.crafttweaker.api.util.ItemStackUtil; import com.blamejared.crafttweaker.api.util.StringUtil; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.crafting.RecipeType; @@ -29,8 +25,7 @@ @ZenCodeType.Name("mods.buildcraft.CombustionEngine") @IRecipeHandler.For(IFuel.class) //public class CombustionEngine -public enum CombustionEngine implements IRecipeManager, IRecipeHandler -{ +public enum CombustionEngine implements IRecipeManager, IRecipeHandler { @ZenCodeGlobals.Global("combustionEngine") INSTANCE; @@ -38,43 +33,32 @@ public enum CombustionEngine implements IRecipeManager, IRecipeHandler r.getFluid().equals(fluid))) - { + else if (getAllRecipes().stream().anyMatch(r -> r.getFluid().equals(fluid))) { throw new IllegalArgumentException("The fluid " + fluid + " is already registered as a fuel!"); } // else if (BuildcraftFuelRegistry.coolant.getCoolant(fluid) != null) - else if (Coolant.INSTANCE.getAllRecipes().stream().anyMatch(r -> r instanceof IFluidCoolant fluidCoolant && fluidCoolant.getFluid().equals(fluid))) - { + else if (Coolant.INSTANCE.getAllRecipes().stream().anyMatch(r -> r instanceof IFluidCoolant fluidCoolant && fluidCoolant.getFluid().equals(fluid))) { throw new IllegalArgumentException("The fluid " + fluid + " is already registered as a coolant - so it won't work very well if you add it as a fuel too!"); - } - else if (powerPerTick <= 0.0) - { + } else if (powerPerTick <= 0.0) { throw new IllegalArgumentException("Power was less than or equal to 0!"); - } - else if (powerPerTick > 100000.0) - { + } else if (powerPerTick > 100000.0) { throw new IllegalArgumentException("Maximum power is 100000.0, as any values above this would instantly bring the engine to overheat."); - } - else - { + } else { long mj = (long) ((double) MjAPI.MJ * powerPerTick); // CraftTweakerAPI.apply(new AddCleanFuel(fluid, mj, timePerBucket)); CraftTweakerAPI.apply(AddCleanFuel.create(this, name, fluid, mj, timePerBucket)); @@ -83,52 +67,40 @@ else if (powerPerTick > 100000.0) // @ZenMethod @ZenCodeType.Method - public void addDirtyFuel(String name, IFluidStack lFuel, double powerPerTick, int timePerBucket, IFluidStack lResidue) - { + public void addDirtyFuel(String name, IFluidStack lFuel, double powerPerTick, int timePerBucket, IFluidStack lResidue) { addDirtyFuel0("custom/" + name, lFuel, powerPerTick, timePerBucket, lResidue); } // @ZenMethod // @ZenCodeType.Method // public static void addDirtyFuel(ILiquidStack lFuel, double powerPerTick, int timePerBucket, ILiquidStack lResidue) - private void addDirtyFuel0(String name, IFluidStack lFuel, double powerPerTick, int timePerBucket, IFluidStack lResidue) - { + private void addDirtyFuel0(String name, IFluidStack lFuel, double powerPerTick, int timePerBucket, IFluidStack lResidue) { // FluidStack fuel = CraftTweakerMC.getLiquidStack(lFuel); FluidStack fuel = lFuel.getImmutableInternal(); // FluidStack residue = CraftTweakerMC.getLiquidStack(lResidue); FluidStack residue = lResidue.getImmutableInternal(); // if (fuel.getFluid() == null) - if (fuel.getFluid() == null || fuel.getFluid() instanceof EmptyFluid) - { + if (fuel.getFluid() == null || fuel.getFluid() instanceof EmptyFluid) { // throw new IllegalArgumentException("Fuel fluid was null!"); throw new IllegalArgumentException("Fuel fluid was null or empty!"); } // else if (residue.getFluid() == null) - else if (residue.getFluid() == null || residue.getFluid() instanceof EmptyFluid) - { + else if (residue.getFluid() == null || residue.getFluid() instanceof EmptyFluid) { // throw new IllegalArgumentException("Residue fluid was null!"); throw new IllegalArgumentException("Residue fluid was null or empty!"); } // else if (BuildcraftFuelRegistry.fuel.getFuel(fuel) != null) - else if (getAllRecipes().stream().anyMatch(r -> r.getFluid().equals(fuel))) - { + else if (getAllRecipes().stream().anyMatch(r -> r.getFluid().equals(fuel))) { throw new IllegalArgumentException("The fluid " + fuel + " is already registered as a fuel!"); } // else if (BuildcraftFuelRegistry.coolant.getCoolant(fuel) != null) - else if (Coolant.INSTANCE.getAllRecipes().stream().anyMatch(r -> r instanceof IFluidCoolant fluidCoolant && fluidCoolant.getFluid().equals(fuel))) - { + else if (Coolant.INSTANCE.getAllRecipes().stream().anyMatch(r -> r instanceof IFluidCoolant fluidCoolant && fluidCoolant.getFluid().equals(fuel))) { throw new IllegalArgumentException("The fluid " + fuel + " is already registered as a coolant - so it won't work very well if you add it as a fuel too!"); - } - else if (powerPerTick <= 0.0) - { + } else if (powerPerTick <= 0.0) { throw new IllegalArgumentException("Power was less than or equal to 0!"); - } - else if (powerPerTick > 100000.0) - { + } else if (powerPerTick > 100000.0) { throw new IllegalArgumentException("Maximum power is 100000.0, as any values above this would instantly bring the engine to overheat."); - } - else - { + } else { long mj = (long) ((double) MjAPI.MJ * powerPerTick); // CraftTweakerAPI.apply(new AddDirtyFuel(fuel, mj, timePerBucket, residue)); CraftTweakerAPI.apply(AddDirtyFuel.create(this, name, fuel, mj, timePerBucket, residue)); @@ -136,16 +108,13 @@ else if (powerPerTick > 100000.0) } @Override - public RecipeType getRecipeType() - { + public RecipeType getRecipeType() { return IFuel.TYPE; } @Override - public String dumpToCommandString(IRecipeManager manager, IFuel recipe) - { - if (recipe instanceof IFuelManager.IDirtyFuel dirtyFuel) - { + public String dumpToCommandString(final IRecipeManager manager, IFuel recipe) { + if (recipe instanceof IFuelManager.IDirtyFuel dirtyFuel) { return String.format( "combustionEngine.addDirtyFuel(%s, %s, %s, %s, %s);", StringUtil.quoteAndEscape(recipe.getId()), @@ -154,9 +123,7 @@ public String dumpToCommandString(IRecipeManager manager, IFuel recipe) recipe.getTotalBurningTime(), StringUtil.quoteAndEscape(dirtyFuel.getResidue().getFluid().getRegistryName()) ); - } - else - { + } else { return String.format( "combustionEngine.addCleanFuel(%s, %s, %s, %s);", StringUtil.quoteAndEscape(recipe.getId()), @@ -168,16 +135,14 @@ public String dumpToCommandString(IRecipeManager manager, IFuel recipe) } // static final class AddDirtyFuel implements IAction - static final class AddDirtyFuel extends ActionAddRecipe - { + static final class AddDirtyFuel extends ActionAddRecipe { // private final FluidStack fuel; // private final FluidStack residue; // private final long powerPerTick; // private final int totalBurningTime; // public AddDirtyFuel(FluidStack fuel, long powerPerCycle, int totalBurningTime, FluidStack residue) - private AddDirtyFuel(IRecipeManager manager, IFuel recipe) - { + private AddDirtyFuel(IRecipeManager manager, IFuel recipe) { super(manager, recipe); // this.fuel = fuel; // this.powerPerTick = powerPerCycle; @@ -186,8 +151,7 @@ private AddDirtyFuel(IRecipeManager manager, IFuel recipe) } // Calen - public static AddDirtyFuel create(IRecipeManager manager, String name, FluidStack fuel, long powerPerCycle, int totalBurningTime, FluidStack residue) - { + public static AddDirtyFuel create(IRecipeManager manager, String name, FluidStack fuel, long powerPerCycle, int totalBurningTime, FluidStack residue) { ResourceLocation _name = new ResourceLocation("crafttweaker", name); return new AddDirtyFuel(manager, new FuelRegistry.DirtyFuel(_name, fuel, powerPerCycle, totalBurningTime, residue)); } @@ -197,23 +161,20 @@ public static AddDirtyFuel create(IRecipeManager manager, String name, Fl // BuildcraftFuelRegistry.fuel.addDirtyFuel(this.fuel, this.powerPerTick, this.totalBurningTime, this.residue); // } - public String describe() - { + public String describe() { // return "Adding combustion engine fuel " + this.fuel; return "Adding combustion engine fuel " + this.recipe.getFluid(); } } // static final class AddCleanFuel implements IAction - static final class AddCleanFuel extends ActionAddRecipe - { + static final class AddCleanFuel extends ActionAddRecipe { // private final FluidStack fluid; // private final long powerPerTick; // private final int totalBurningTime; // public AddCleanFuel(FluidStack fluid, long powerPerCycle, int totalBurningTime) - public AddCleanFuel(IRecipeManager manager, IFuel recipe) - { + public AddCleanFuel(IRecipeManager manager, IFuel recipe) { super(manager, recipe); // this.fluid = fluid; // this.powerPerTick = powerPerCycle; @@ -221,8 +182,7 @@ public AddCleanFuel(IRecipeManager manager, IFuel recipe) } // Calen - public static AddCleanFuel create(IRecipeManager manager, String name, FluidStack fluid, long powerPerCycle, int totalBurningTime) - { + public static AddCleanFuel create(IRecipeManager manager, String name, FluidStack fluid, long powerPerCycle, int totalBurningTime) { ResourceLocation _name = new ResourceLocation("crafttweaker", name); return new AddCleanFuel(manager, new FuelRegistry.Fuel(_name, fluid, powerPerCycle, totalBurningTime)); } @@ -232,8 +192,7 @@ public static AddCleanFuel create(IRecipeManager manager, String name, Fl // BuildcraftFuelRegistry.fuel.addFuel(this.fluid, this.powerPerTick, this.totalBurningTime); // } - public String describe() - { + public String describe() { // return "Adding combustion engine fuel " + this.fluid; return "Adding combustion engine fuel " + this.recipe.getFluid(); } diff --git a/common/buildcraft/compat/module/crafttweaker/Coolant.java b/common/buildcraft/compat/module/crafttweaker/Coolant.java index 60d8f2f..45b6e9a 100644 --- a/common/buildcraft/compat/module/crafttweaker/Coolant.java +++ b/common/buildcraft/compat/module/crafttweaker/Coolant.java @@ -3,7 +3,7 @@ import buildcraft.api.fuels.ICoolant; import buildcraft.api.fuels.IFluidCoolant; import buildcraft.api.fuels.ISolidCoolant; -import buildcraft.lib.fluid.CoolantRegistry; +import buildcraft.lib.recipe.coolant.CoolantRegistry; import com.blamejared.crafttweaker.api.CraftTweakerAPI; import com.blamejared.crafttweaker.api.action.recipe.ActionAddRecipe; import com.blamejared.crafttweaker.api.annotation.ZenRegister; @@ -102,7 +102,7 @@ public RecipeType getRecipeType() } @Override - public String dumpToCommandString(IRecipeManager manager, ICoolant recipe) + public String dumpToCommandString(final IRecipeManager manager, ICoolant recipe) { if (recipe instanceof IFluidCoolant fluidCoolant) { @@ -120,7 +120,7 @@ else if (recipe instanceof ISolidCoolant solidCoolant) StringUtil.quoteAndEscape(recipe.getId()), ItemStackUtil.getCommandString(solidCoolant.getSolid()), StringUtil.quoteAndEscape(recipe.getFluid().getFluid().getRegistryName()), - solidCoolant.getMultiplierForSerialize() + solidCoolant.getMultiplier() ); } return "This is not a fluid coolant or a solid coolant. What happened?"; diff --git a/common/buildcraft/compat/module/jei/BCPluginJEI.java b/common/buildcraft/compat/module/jei/BCPluginJEI.java index fd0e2e2..564973e 100644 --- a/common/buildcraft/compat/module/jei/BCPluginJEI.java +++ b/common/buildcraft/compat/module/jei/BCPluginJEI.java @@ -4,9 +4,7 @@ import buildcraft.api.core.BCLog; import buildcraft.api.enums.EnumEngineType; import buildcraft.api.fuels.IFuel; -import buildcraft.api.recipes.AssemblyRecipe; -import buildcraft.api.recipes.AssemblyRecipeBasic; -import buildcraft.api.recipes.BuildcraftRecipeRegistry; +import buildcraft.lib.recipe.assembly.AssemblyRecipe; import buildcraft.api.recipes.IRefineryRecipeManager; import buildcraft.compat.module.jei.energy.combustionengine.CategoryCombustionEngine; import buildcraft.compat.module.jei.factory.*; @@ -16,10 +14,9 @@ import buildcraft.compat.module.jei.transferhandlers.AutoCraftItemsTransferHandler; import buildcraft.core.BCCoreBlocks; import buildcraft.factory.BCFactoryBlocks; -import buildcraft.lib.fluid.FuelRegistry; +import buildcraft.lib.recipe.fuel.FuelRegistry; import buildcraft.lib.gui.GuiBC8; -import buildcraft.lib.recipe.AssemblyRecipeRegistry; -import buildcraft.lib.recipe.RefineryRecipeRegistry; +import buildcraft.lib.recipe.assembly.AssemblyRecipeRegistry; import buildcraft.silicon.BCSiliconBlocks; import buildcraft.silicon.container.ContainerAssemblyTable; import com.google.common.collect.ImmutableList; @@ -34,15 +31,13 @@ import net.minecraft.client.Minecraft; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.RecipeType; import net.minecraftforge.fml.ModList; import java.util.Arrays; import java.util.List; @JeiPlugin -public class BCPluginJEI implements IModPlugin -{ +public class BCPluginJEI implements IModPlugin { // public static IModRegistry registry; public static IRecipeRegistration registryRecipe; public static IGuiHandlerRegistration registryGui; @@ -53,15 +48,13 @@ public class BCPluginJEI implements IModPlugin private static final ResourceLocation UID = new ResourceLocation("buildcraft:jei_plugin"); @Override - public ResourceLocation getPluginUid() - { + public ResourceLocation getPluginUid() { return UID; } @Override - public void registerGuiHandlers(IGuiHandlerRegistration registry) - { + public void registerGuiHandlers(IGuiHandlerRegistration registry) { BCPluginJEI.registryGui = registry; registry.addGenericGuiContainerHandler(GuiBC8.class, new GuiHandlerBuildCraft()); @@ -69,14 +62,12 @@ public void registerGuiHandlers(IGuiHandlerRegistration registry) // Calen: IRecipeWrapper combined into IRecipeCategory @Override - public void registerRecipes(IRecipeRegistration registry) - { + public void registerRecipes(IRecipeRegistration registry) { BCPluginJEI.registryRecipe = registry; boolean factory = BCModules.FACTORY.isLoaded(); boolean energy = BCModules.ENERGY.isLoaded(); boolean silicon = BCModules.SILICON.isLoaded(); - if (factory) - { + if (factory) { // registry.handleRecipes(IRefineryRecipeManager.ICoolableRecipe.class, new HandlerCoolable(), "buildcraft:category_coolable"); // registry.handleRecipes(IRefineryRecipeManager.IDistillationRecipe.class, new HandlerDistiller(), "buildcraft:category_distiller"); // registry.handleRecipes(IRefineryRecipeManager.IHeatableRecipe.class, new HandlerHeatable(), "buildcraft:category_heatable"); @@ -88,15 +79,13 @@ public void registerRecipes(IRecipeRegistration registry) registry.addRecipes(CategoryHeatable.RECIPE_TYPE, ImmutableList.copyOf(Minecraft.getInstance().level.getRecipeManager().getAllRecipesFor(IRefineryRecipeManager.IHeatableRecipe.TYPE))); } - if (energy) - { + if (energy) { // registry.handleRecipes(IFuel.class, new HandlerCombustionEngine(), "buildcraft-compat:engine.combustion"); // registry.addRecipes(ImmutableList.copyOf(FuelRegistry.INSTANCE.getFuels()), new ResourceLocation("buildcraft-compat:engine.combustion")); registry.addRecipes(CategoryCombustionEngine.RECIPE_TYPE, ImmutableList.copyOf(Minecraft.getInstance().level.getRecipeManager().getAllRecipesFor(IFuel.TYPE))); } - if (silicon) - { + if (silicon) { // registry.handleRecipes(AssemblyRecipeBasic.class, WrapperAssemblyTable::new, "buildcraft-compat:silicon.assembly"); // registry.addRecipes(ImmutableList.copyOf(AssemblyRecipeRegistry.REGISTRY.values()), new ResourceLocation("buildcraft-compat:silicon.assembly")); registry.addRecipes(CategoryAssemblyTable.RECIPE_TYPE, ImmutableList.copyOf(Minecraft.getInstance().level.getRecipeManager().getAllRecipesFor(AssemblyRecipe.TYPE))); @@ -104,8 +93,7 @@ public void registerRecipes(IRecipeRegistration registry) } @Override - public void registerRecipeTransferHandlers(IRecipeTransferRegistration registry) - { + public void registerRecipeTransferHandlers(IRecipeTransferRegistration registry) { BCPluginJEI.registryRecipeTransfer = registry; // registry.addRecipeTransferHandler(new AutoCraftItemsTransferHandler(), "minecraft.crafting"); @@ -117,8 +105,7 @@ public void registerRecipeTransferHandlers(IRecipeTransferRegistration registry) } @Override - public void registerCategories(IRecipeCategoryRegistration registry) - { + public void registerCategories(IRecipeCategoryRegistration registry) { // boolean factory = Loader.isModLoaded(BCModules.FACTORY.getModId()); boolean factory = ModList.get().isLoaded(BCModules.FACTORY.getModId()); // boolean energy = Loader.isModLoaded(BCModules.ENERGY.getModId()); @@ -127,88 +114,64 @@ public void registerCategories(IRecipeCategoryRegistration registry) boolean silicon = ModList.get().isLoaded(BCModules.SILICON.getModId()); List lst = Lists.newArrayList(); IGuiHelper helper = registry.getJeiHelpers().getGuiHelper(); - if (factory) - { + if (factory) { lst.add("factory"); - registry.addRecipeCategories(new IRecipeCategory[]{new CategoryHeatable(helper)}); - registry.addRecipeCategories(new IRecipeCategory[]{new CategoryDistiller(helper)}); - registry.addRecipeCategories(new IRecipeCategory[]{new CategoryCoolable(helper)}); + registry.addRecipeCategories(new IRecipeCategory[] { new CategoryHeatable(helper) }); + registry.addRecipeCategories(new IRecipeCategory[] { new CategoryDistiller(helper) }); + registry.addRecipeCategories(new IRecipeCategory[] { new CategoryCoolable(helper) }); } - if (energy) - { + if (energy) { lst.add("energy"); // registry.addRecipeCategories(new IRecipeCategory[]{new CategoryCombustionEngine(helper)}); - registry.addRecipeCategories(new IRecipeCategory[]{new CategoryCombustionEngine(helper, FuelRegistry.INSTANCE.getFuels(Minecraft.getInstance().level))}); - // Calen: cannot reg duplicated -// registry.addRecipeCategories( -// FuelRegistry.INSTANCE.getFuels().stream() -// .map(fuel -> new CategoryCombustionEngine(helper, fuel)) -// .toArray(CategoryCombustionEngine[]::new) -// ); + registry.addRecipeCategories(new IRecipeCategory[] { new CategoryCombustionEngine(helper, FuelRegistry.INSTANCE.getFuels(Minecraft.getInstance().level)) }); } - if (silicon) - { + if (silicon) { lst.add("silicon"); // registry.addRecipeCategories(new IRecipeCategory[]{new CategoryAssemblyTable(helper)}); - registry.addRecipeCategories(new IRecipeCategory[]{new CategoryAssemblyTable(helper, AssemblyRecipeRegistry.getAll(Minecraft.getInstance().level))}); -// registry.addRecipeCategories( -// AssemblyRecipeRegistry.REGISTRY.values().stream() -// .filter(recipe -> recipe instanceof AssemblyRecipeBasic) -// .map(recipe -> new CategoryAssemblyTable(helper, (AssemblyRecipeBasic) recipe)) -// .toArray(CategoryAssemblyTable[]::new) -// ); + registry.addRecipeCategories(new IRecipeCategory[] { new CategoryAssemblyTable(helper, AssemblyRecipeRegistry.getAll(Minecraft.getInstance().level)) }); } BCLog.logger.info("Loaded JEI mods: " + Arrays.toString(lst.toArray())); } @Override - public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) - { + public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) { BCPluginJEI.registryRecipeCatalyst = registry; boolean factory = BCModules.FACTORY.isLoaded(); boolean energy = BCModules.ENERGY.isLoaded(); boolean silicon = BCModules.SILICON.isLoaded(); - if (factory) - { - if (BCFactoryBlocks.distiller != null) - { + if (factory) { + if (BCFactoryBlocks.distiller != null) { // registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.distiller.get()), new String[]{"buildcraft:category_distiller"}); registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.distiller.get()), CategoryDistiller.RECIPE_TYPE); } - if (BCFactoryBlocks.heatExchange != null) - { + if (BCFactoryBlocks.heatExchange != null) { // registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.heatExchange.get()), new String[]{"buildcraft:category_coolable"}); registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.heatExchange.get()), CategoryCoolable.RECIPE_TYPE); // registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.heatExchange.get()), new String[]{"buildcraft:category_heatable"}); registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.heatExchange.get()), CategoryHeatable.RECIPE_TYPE); } - if (BCFactoryBlocks.autoWorkbenchItems != null) - { + if (BCFactoryBlocks.autoWorkbenchItems != null) { registry.addRecipeCatalyst(new ItemStack(BCFactoryBlocks.autoWorkbenchItems.get()), RecipeTypes.CRAFTING); } } - if (energy) - { + if (energy) { // if (BCCoreBlocks.engine != null) - if (!BCCoreBlocks.engineBlockMap.isEmpty()) - { + if (!BCCoreBlocks.engineBlockMap.isEmpty()) { // if (BCCoreBlocks.engine.isRegistered(EnumEngineType.STONE)) - if (BCCoreBlocks.engineBlockMap.containsKey(EnumEngineType.STONE)) - { + if (BCCoreBlocks.engineBlockMap.containsKey(EnumEngineType.STONE)) { // registry.addRecipeCatalyst(BCCoreBlocks.engine.getStack(EnumEngineType.STONE), new String[]{"minecraft.fuel"}); registry.addRecipeCatalyst(new ItemStack(BCCoreBlocks.engineBlockMap.get(EnumEngineType.STONE).get()), RecipeTypes.FUELING); } // if (BCCoreBlocks.engine.isRegistered(EnumEngineType.IRON)) - if (BCCoreBlocks.engineBlockMap.containsKey(EnumEngineType.IRON)) - { + if (BCCoreBlocks.engineBlockMap.containsKey(EnumEngineType.IRON)) { //// registry.addRecipeCatalyst(BCCoreBlocks.engine.getStack(EnumEngineType.IRON), new String[]{"buildcraft-compat:engine.combustion"}); // registry.addRecipeCatalyst(new ItemStack(BCCoreBlocks.engineBlockMap.get(EnumEngineType.IRON).get()), new String[]{"buildcraft-compat:engine.combustion"}); registry.addRecipeCatalyst(new ItemStack(BCCoreBlocks.engineBlockMap.get(EnumEngineType.IRON).get()), CategoryCombustionEngine.RECIPE_TYPE); @@ -216,16 +179,13 @@ public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) } } - if (silicon) - { - if (BCSiliconBlocks.assemblyTable != null) - { + if (silicon) { + if (BCSiliconBlocks.assemblyTable != null) { // registry.addRecipeCatalyst(new ItemStack(BCSiliconBlocks.assemblyTable.get()), new String[]{"buildcraft-compat:silicon.assembly"}); registry.addRecipeCatalyst(new ItemStack(BCSiliconBlocks.assemblyTable.get()), CategoryAssemblyTable.RECIPE_TYPE); } - if (BCSiliconBlocks.advancedCraftingTable != null) - { + if (BCSiliconBlocks.advancedCraftingTable != null) { // registry.addRecipeCatalyst(new ItemStack(BCSiliconBlocks.advancedCraftingTable.get()), new String[]{"minecraft.crafting"}); registry.addRecipeCatalyst(new ItemStack(BCSiliconBlocks.advancedCraftingTable.get()), RecipeTypes.CRAFTING); } @@ -233,8 +193,7 @@ public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) } @Override - public void onRuntimeAvailable(IJeiRuntime jeiRuntime) - { + public void onRuntimeAvailable(IJeiRuntime jeiRuntime) { BCPluginJEI.jeiRuntime = jeiRuntime; } } diff --git a/common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java b/common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java index 950f58c..45f372c 100644 --- a/common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java +++ b/common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java @@ -43,7 +43,7 @@ public class CategoryCombustionEngine implements IRecipeCategory // Calen public static final RecipeType RECIPE_TYPE = RecipeType.create(BCModules.ENERGY.getModId(), "engine_combustion", IFuel.class); - // public static final ResourceLocation UID = new ResourceLocation("buildcraft-compat:engine.combustion"); + // public static final ResourceLocation UID = new ResourceLocation("buildcraft-compat:engine.combustion"); public static final ResourceLocation UID = new ResourceLocation(BCModules.ENERGY.getModId(), "engine_combustion"); public static final ResourceLocation FURNACE = new ResourceLocation("minecraft", "textures/gui/container/furnace.png"); private final IDrawable background; diff --git a/common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java b/common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java index 3921048..da66631 100644 --- a/common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java +++ b/common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java @@ -7,7 +7,7 @@ import java.util.List; import buildcraft.api.mj.MjAPI; -import buildcraft.api.recipes.AssemblyRecipe; +import buildcraft.api.recipes.IAssemblyRecipe; import buildcraft.api.recipes.IngredientStack; import buildcraft.silicon.BCSiliconBlocks; import com.google.common.collect.Lists; @@ -33,11 +33,11 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public class CategoryAssemblyTable implements IRecipeCategory +public class CategoryAssemblyTable implements IRecipeCategory { // Calen - public static final RecipeType RECIPE_TYPE = - RecipeType.create(BCModules.SILICON.getModId(), "assembly", AssemblyRecipe.class); + public static final RecipeType RECIPE_TYPE = + RecipeType.create(BCModules.SILICON.getModId(), "assembly", IAssemblyRecipe.class); // public static final ResourceLocation UID = new ResourceLocation("buildcraft-compat:silicon.assembly"); public static final ResourceLocation UID = new ResourceLocation(BCModules.SILICON.getModId(), "assembly"); protected final ResourceLocation backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/assembly_table.png"); @@ -47,19 +47,19 @@ public class CategoryAssemblyTable implements IRecipeCategory // private final AssemblyRecipeBasic recipe; // private final IDrawableAnimated progressBar; - private final Map progressBarMap = new HashMap<>(); + private final Map progressBarMap = new HashMap<>(); // private final List> inputs; // private final List inputs; - private final Map> inputsMap = new HashMap<>(); + private final Map> inputsMap = new HashMap<>(); // private final List outputs; // private final Ingredient outputs; - private final Map outputsMap = new HashMap<>(); + private final Map outputsMap = new HashMap<>(); @OnlyIn(Dist.CLIENT) private Font font = Minecraft.getInstance().font; // public CategoryAssemblyTable(IGuiHelper guiHelper, AssemblyRecipeBasic recipe) - public CategoryAssemblyTable(IGuiHelper guiHelper, Collection recipes) + public CategoryAssemblyTable(IGuiHelper guiHelper, Collection recipes) { // this.background = guiHelper.createDrawable(this.backgroundLocation, 5, 34, 166, 76, 10, 0, 0, 0); this.background = guiHelper.drawableBuilder(this.backgroundLocation, 5, 34, 166, 76).addPadding(10, 0, 0, 0).build(); @@ -70,7 +70,7 @@ public CategoryAssemblyTable(IGuiHelper guiHelper, Collection re // IDrawableStatic progressDrawable = guiHelper.createDrawable(backgroundLocation, 176, 48, 4, 71, 10, 0, 0, 0); IDrawableStatic progressDrawable = guiHelper.drawableBuilder(backgroundLocation, 176, 48, 4, 71).addPadding(10, 0, 0, 0).build(); - for (AssemblyRecipe recipe : recipes) + for (IAssemblyRecipe recipe : recipes) { // this.recipe = recipe; // List> _inputs = Lists.newArrayList(); @@ -115,9 +115,9 @@ public ResourceLocation getUid() } @Override - public Class getRecipeClass() + public Class getRecipeClass() { - return AssemblyRecipe.class; + return IAssemblyRecipe.class; } @Override @@ -146,7 +146,7 @@ public IDrawable getIcon() @OnlyIn(Dist.CLIENT) @Override - public void draw(AssemblyRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) + public void draw(IAssemblyRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) { // this.progressBar.draw(stack, 81, 2); this.progressBarMap.get(recipe).draw(stack, 81, 2); @@ -157,7 +157,7 @@ public void draw(AssemblyRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseSt @Override // public void setRecipe(IRecipeLayout recipeLayout, WrapperAssemblyTable recipeWrapper, IIngredients ingredients) - public void setRecipe(IRecipeLayoutBuilder builder, AssemblyRecipe recipe, IFocusGroup focuses) + public void setRecipe(IRecipeLayoutBuilder builder, IAssemblyRecipe recipe, IFocusGroup focuses) { // IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); // List> inputs = ingredients.getInputs(ItemStack.class); diff --git a/common/buildcraft/compat/module/jei/transferhandlers/AssemblyTableTransferHandler.java b/common/buildcraft/compat/module/jei/transferhandlers/AssemblyTableTransferHandler.java index 63bc7d9..58f4260 100644 --- a/common/buildcraft/compat/module/jei/transferhandlers/AssemblyTableTransferHandler.java +++ b/common/buildcraft/compat/module/jei/transferhandlers/AssemblyTableTransferHandler.java @@ -1,6 +1,6 @@ package buildcraft.compat.module.jei.transferhandlers; -import buildcraft.api.recipes.AssemblyRecipe; +import buildcraft.lib.recipe.assembly.AssemblyRecipe; import buildcraft.silicon.container.ContainerAdvancedCraftingTable; import buildcraft.silicon.container.ContainerAssemblyTable; import mezz.jei.api.gui.ingredient.IRecipeSlotsView; diff --git a/common/buildcraft/compat/network/IGuiCreator.java b/common/buildcraft/compat/network/IGuiCreator.java index b01a674..5f8134e 100644 --- a/common/buildcraft/compat/network/IGuiCreator.java +++ b/common/buildcraft/compat/network/IGuiCreator.java @@ -13,7 +13,7 @@ public interface IGuiCreator { @Nullable @OnlyIn(Dist.CLIENT) // GuiContainer getClientGuiElement(int var1, EntityPlayer var2); - AbstractContainerScreen getClientGuiElement(int var1, Player var2); + AbstractContainerScreen getClientGuiElement(int var1, Player var2); @Nullable // Container getServerGuiElement(int var1, EntityPlayer var2); From 5a4e1f49ec73f8067e64d55aa3277a1fa5d054b9 Mon Sep 17 00:00:00 2001 From: LRW-Calen Date: Tue, 7 May 2024 20:08:25 +0800 Subject: [PATCH 05/15] Fixed: CraftTweaker compat assembly recipe command dump --- build.gradle | 28 ++-- common/buildcraft/compat/BCCompat.java | 8 +- .../buildcraft/compat/CompatModuleBase.java | 1 - common/buildcraft/compat/CompatUtils.java | 2 - .../module/crafttweaker/AssemblyTable.java | 68 ++++++--- .../module/crafttweaker/CombustionEngine.java | 30 ++-- .../CompatModuleCraftTweaker.java | 4 +- .../compat/module/crafttweaker/Coolant.java | 97 ++++-------- .../ic2/CompatModuleIndustrialCraft2.java | 20 +-- .../compat/module/jei/BCPluginJEI.java | 8 +- .../CategoryCombustionEngine.java | 71 +++------ .../module/jei/factory/CategoryCoolable.java | 44 ++---- .../module/jei/factory/CategoryDistiller.java | 46 ++---- .../module/jei/factory/CategoryHeatable.java | 36 ++--- .../module/jei/gui/GuiHandlerBuildCraft.java | 21 +-- .../jei/silicon/CategoryAssemblyTable.java | 75 +++------ .../jei/silicon/CategoryIntegrationTable.java | 50 +++--- .../compat/module/jei/silicon/Utils.java | 15 +- .../AdvancedCraftingItemsTransferHandler.java | 23 +-- .../AutoCraftItemsTransferHandler.java | 38 ++--- .../module/theoneprobe/BCPluginTOP.java | 74 ++++----- .../theoneprobe/CompatModuleTheOneProbe.java | 16 +- .../waila/AssemblyCraftDataProvider.java | 30 ++-- .../module/waila/AutoCraftDataProvider.java | 45 ++---- .../compat/module/waila/BCPluginJade.java | 142 +----------------- .../module/waila/BaseWailaDataProvider.java | 17 +-- .../module/waila/LaserTargetDataProvider.java | 31 ++-- .../compat/network/IGuiCreator.java | 3 +- 28 files changed, 335 insertions(+), 708 deletions(-) diff --git a/build.gradle b/build.gradle index 1305a0e..92092c8 100755 --- a/build.gradle +++ b/build.gradle @@ -208,12 +208,18 @@ sourceSets { // exclude "pack.mcmeta" // exclude from the guide repo } } + test { + java { + srcDir "BuildCraft/src/test/java" + srcDir "BuildCraft/sub_projects/expression/src/test/java" + } + } } -task setupSubProjects(dependsOn: "sub_projects:expression:generateSources") { - // Just an inter-dependency task -} +//task setupSubProjects(dependsOn: "sub_projects:expression:generateSources") { +// // Just an inter-dependency task +//} compileJava { options.compilerArgs << "-Xmaxerrs" << "2000" @@ -402,23 +408,12 @@ dependencies { // Examples using mod jars from ./libs - compileOnly fg.deobf("javax.vecmath:vecmath:1.5.2") - runtimeOnly fg.deobf("javax.vecmath:vecmath:1.5.2") - compileOnly fg.deobf("net.sf.trove4j:trove4j:3.0.3") - runtimeOnly fg.deobf("net.sf.trove4j:trove4j:3.0.3") - compileOnly fg.deobf("mezz.jei:jei-" + config.mc_version + ":" + config.jei_version + ":api") runtimeOnly fg.deobf("mezz.jei:jei-" + config.mc_version + ":" + config.jei_version) compileOnly fg.deobf("curse.maven:jade-324717:" + config.jade_id) runtimeOnly fg.deobf("curse.maven:jade-324717:" + config.jade_id) -// compileOnly "blank:forge-1.12.2:14.23.5.2859" -// runtimeOnly "blank:forge-1.12.2:14.23.5.2859" - -// compileOnly "net.minecraftforge:forgeSrc:1.12.2-14.23.5.2768" -// runtimeOnly "net.minecraftforge:forgeSrc:1.12.2-14.23.5.2768" - // compileOnly fg.deobf("blank:ae2-${mc_version}:11.7.6") // runtimeOnly fg.deobf("blank:ae2-${mc_version}:11.7.6") @@ -428,6 +423,11 @@ dependencies { compileOnly(fg.deobf("curse.maven:the-one-probe-245211:3965688")) runtimeOnly(fg.deobf("curse.maven:the-one-probe-245211:3965688")) + compileOnly fg.deobf("javax.vecmath:vecmath:1.5.2") + runtimeOnly fg.deobf("javax.vecmath:vecmath:1.5.2") + compileOnly fg.deobf("net.sf.trove4j:trove4j:3.0.3") + runtimeOnly fg.deobf("net.sf.trove4j:trove4j:3.0.3") + jarJar(group: 'net.sf.trove4j', name: 'trove4j', version: '[3.0.3,)') { jarJar.pin(it, '3.0.3') } diff --git a/common/buildcraft/compat/BCCompat.java b/common/buildcraft/compat/BCCompat.java index ef2707e..c1fd709 100644 --- a/common/buildcraft/compat/BCCompat.java +++ b/common/buildcraft/compat/BCCompat.java @@ -44,7 +44,7 @@ public class BCCompat { public static final String GIT_COMMIT_MSG = "${git_commit_msg}"; public static final String GIT_COMMIT_AUTHOR = "${git_commit_author}"; - // @Instance(MOD_ID) + // @Instance(MOD_ID) public static BCCompat instance; private static final Map modules = new HashMap<>(); @@ -58,9 +58,9 @@ private static void offerAndPreInitModule(CompatModuleBase module) { String _modules = "modules"; BooleanValue prop = BCCoreConfig.config .define(_modules, - "", - EnumRestartRequirement.NONE, - cModId, true); + "", + EnumRestartRequirement.NONE, + cModId, true); BCCoreConfig.config.build(); if (prop.get()) { modules.put(cModId, module); diff --git a/common/buildcraft/compat/CompatModuleBase.java b/common/buildcraft/compat/CompatModuleBase.java index 0238252..233b729 100644 --- a/common/buildcraft/compat/CompatModuleBase.java +++ b/common/buildcraft/compat/CompatModuleBase.java @@ -1,6 +1,5 @@ package buildcraft.compat; - import net.minecraftforge.fml.ModList; public abstract class CompatModuleBase { diff --git a/common/buildcraft/compat/CompatUtils.java b/common/buildcraft/compat/CompatUtils.java index 4b74840..091ac1a 100644 --- a/common/buildcraft/compat/CompatUtils.java +++ b/common/buildcraft/compat/CompatUtils.java @@ -15,8 +15,6 @@ @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = BCCompat.MOD_ID) public class CompatUtils { - // public static final Capability CAP_GUI_CREATOR = CapabilitiesHelper.registerCapability(IGuiCreator.class); -// public static final Capability CAP_GUI_CREATOR = CapabilitiesHelper.registerCapability(IGuiCreator.class); public static final Capability CAP_GUI_CREATOR = CapabilityManager.get(new CapabilityToken<>() { }); diff --git a/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java b/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java index c9d1ee2..27895ca 100644 --- a/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java +++ b/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java @@ -2,9 +2,11 @@ import buildcraft.api.mj.MjAPI; import buildcraft.api.recipes.IAssemblyRecipe; +import buildcraft.api.recipes.IngredientStack; import buildcraft.lib.recipe.assembly.AssemblyRecipe; import buildcraft.lib.recipe.assembly.AssemblyRecipeBasic; -import buildcraft.api.recipes.IngredientStack; +import buildcraft.lib.recipe.assembly.IFacadeAssemblyRecipes; +import buildcraft.silicon.recipe.FacadeAssemblyRecipes; import com.blamejared.crafttweaker.api.CraftTweakerAPI; import com.blamejared.crafttweaker.api.action.recipe.ActionAddRecipe; import com.blamejared.crafttweaker.api.action.recipe.ActionRemoveRecipeByName; @@ -24,6 +26,8 @@ import org.openzen.zencode.java.ZenCodeGlobals; import org.openzen.zencode.java.ZenCodeType; +import java.util.stream.Collectors; + //@ZenClass("mods.buildcraft.AssemblyTable") //@ModOnly("buildcraftsilicon") @ZenRegister @@ -36,29 +40,42 @@ public enum AssemblyTable implements IRecipeManager, IRecipeHan private static int ids; - // @ZenMethod - @ZenCodeType.Method -// public static void addRecipe(IItemStack output, int power, IIngredient[] ingredients) - public void addRecipe(IItemStack output, int power, IIngredient[] ingredients) { - addRecipe0("auto_" + ids++, output, power, ingredients); - } +// // @ZenMethod +// @ZenCodeType.Method +// // public static void addRecipe(IItemStack output, int power, IIngredient[] ingredients) +// public void addRecipe(IItemStack output, int power, IIngredient[] ingredients) { +// addRecipe0("auto_" + ids++, output, power, ingredients); +// } - // @ZenMethod + // @ZenMethod @ZenCodeType.Method // public static void addRecipe(String name, IItemStack output, int power, IIngredient[] ingredients) public void addRecipe(String name, IItemStack output, int power, IIngredient[] ingredients) { addRecipe0("custom/" + name, output, power, ingredients); } - // private static void addRecipe0(String name, IItemStack output, int power, IIngredient[] ingredients) + // @ZenMethod + @ZenCodeType.Method +// public static void addRecipe(String name, IItemStack output, int power, IIngredient[] ingredients) + public void enableFacadeAssembly() { + enableFacadeAssembly0(); + } + + // private static void addRecipe0(String name, IItemStack output, int power, IIngredient[] ingredients) private void addRecipe0(String name, IItemStack output, int power, IIngredient[] ingredients) { // CraftTweakerAPI.apply(new AddRecipeAction(name, output, power, ingredients)); CraftTweakerAPI.apply(AddRecipeAction.create(this, name, output, power, ingredients)); } - // @ZenMethod + // private static void addRecipe0(String name, IItemStack output, int power, IIngredient[] ingredients) + private void enableFacadeAssembly0() { +// CraftTweakerAPI.apply(new AddRecipeAction(name, output, power, ingredients)); + CraftTweakerAPI.apply(AddRecipeAction.createFacadeRecipe(this)); + } + + // @ZenMethod @ZenCodeType.Method -// public static void removeByName(String name) + // public static void removeByName(String name) public void removeByName(String name) { // CraftTweakerAPI.apply(new RemoveRecipeByNameAction(new ResourceLocation(name))); CraftTweakerAPI.apply(new RemoveRecipeByNameAction(this, new ResourceLocation(name))); @@ -71,12 +88,22 @@ public RecipeType getRecipeType() { @Override public String dumpToCommandString(final IRecipeManager manager, IAssemblyRecipe recipe) { - return String.format( - "assemblyTable.addRecipe(%s, %s, %s);", - StringUtil.quoteAndEscape(recipe.getId()), - ItemStackUtil.getCommandString(recipe.getOutputPreviews().stream().toList().get(0)), - new IIngredientList(recipe.getRequiredIngredientStacks().stream().map(i -> IIngredient.fromIngredient(i.ingredient)).toArray(IIngredient[]::new)).getCommandString() - ); + if (recipe instanceof IFacadeAssemblyRecipes) { + return String.format( + "assemblyTable.enableFacadeAssembly();" + ); + } else { + return String.format( + "assemblyTable.addRecipe(%s, %s, %s, %s);", + StringUtil.quoteAndEscape(recipe.getId()), + ItemStackUtil.getCommandString(recipe.getOutputPreviews().stream().toList().get(0)), + recipe.getRequiredMicroJoules(), + recipe.getRequiredIngredientStacks().stream() + .map(i -> IIngredient.fromIngredient(i.ingredient)) + .map(IIngredient::getCommandString) + .collect(Collectors.joining(", ", "[", "]")) + ); + } } // private static class RemoveRecipeByNameAction implements IAction @@ -112,8 +139,7 @@ private AddRecipeAction(IRecipeManager manager, AssemblyRecipe // this.output = CraftTweakerMC.getItemStack(output); // ImmutableSet.Builder stacks = ImmutableSet.builder(); // -// for (int i = 0; i < ingredients.length; ++i) -// { +// for (int i = 0; i < ingredients.length; ++i) { // IIngredient ctIng = ingredients[i]; // Ingredient ingredient = CraftTweakerMC.getIngredient(ctIng); // stacks.add(new IngredientStack(ingredient, Math.max(1, ctIng.getAmount()))); @@ -144,6 +170,10 @@ public static AddRecipeAction create(IRecipeManager manager, St return new AddRecipeAction(manager, recipe); } + public static AddRecipeAction createFacadeRecipe(IRecipeManager manager) { + return new AddRecipeAction(manager, FacadeAssemblyRecipes.INSTANCE); + } + // public void apply() { // AssemblyRecipeRegistry.REGISTRY.put(this.name, new AssemblyRecipeBasic(this.name, this.requiredMj, this.requiredStacks, this.output)); // } diff --git a/common/buildcraft/compat/module/crafttweaker/CombustionEngine.java b/common/buildcraft/compat/module/crafttweaker/CombustionEngine.java index 6e1cd54..30ecb90 100644 --- a/common/buildcraft/compat/module/crafttweaker/CombustionEngine.java +++ b/common/buildcraft/compat/module/crafttweaker/CombustionEngine.java @@ -31,15 +31,15 @@ public enum CombustionEngine implements IRecipeManager, IRecipeHandler r instanceof IF } } - // @ZenMethod + // @ZenMethod @ZenCodeType.Method public void addDirtyFuel(String name, IFluidStack lFuel, double powerPerTick, int timePerBucket, IFluidStack lResidue) { addDirtyFuel0("custom/" + name, lFuel, powerPerTick, timePerBucket, lResidue); } - // @ZenMethod -// @ZenCodeType.Method -// public static void addDirtyFuel(ILiquidStack lFuel, double powerPerTick, int timePerBucket, ILiquidStack lResidue) + // @ZenMethod + // @ZenCodeType.Method + // public static void addDirtyFuel(ILiquidStack lFuel, double powerPerTick, int timePerBucket, ILiquidStack lResidue) private void addDirtyFuel0(String name, IFluidStack lFuel, double powerPerTick, int timePerBucket, IFluidStack lResidue) { // FluidStack fuel = CraftTweakerMC.getLiquidStack(lFuel); FluidStack fuel = lFuel.getImmutableInternal(); @@ -134,14 +134,14 @@ public String dumpToCommandString(final IRecipeManager manager, IFuel recipe) { } } - // static final class AddDirtyFuel implements IAction + // static final class AddDirtyFuel implements IAction static final class AddDirtyFuel extends ActionAddRecipe { // private final FluidStack fuel; // private final FluidStack residue; // private final long powerPerTick; // private final int totalBurningTime; - // public AddDirtyFuel(FluidStack fuel, long powerPerCycle, int totalBurningTime, FluidStack residue) + // public AddDirtyFuel(FluidStack fuel, long powerPerCycle, int totalBurningTime, FluidStack residue) private AddDirtyFuel(IRecipeManager manager, IFuel recipe) { super(manager, recipe); // this.fuel = fuel; @@ -156,8 +156,7 @@ public static AddDirtyFuel create(IRecipeManager manager, String name, Fl return new AddDirtyFuel(manager, new FuelRegistry.DirtyFuel(_name, fuel, powerPerCycle, totalBurningTime, residue)); } -// public void apply() -// { +// public void apply() { // BuildcraftFuelRegistry.fuel.addDirtyFuel(this.fuel, this.powerPerTick, this.totalBurningTime, this.residue); // } @@ -167,13 +166,13 @@ public String describe() { } } - // static final class AddCleanFuel implements IAction + // static final class AddCleanFuel implements IAction static final class AddCleanFuel extends ActionAddRecipe { // private final FluidStack fluid; // private final long powerPerTick; // private final int totalBurningTime; - // public AddCleanFuel(FluidStack fluid, long powerPerCycle, int totalBurningTime) + // public AddCleanFuel(FluidStack fluid, long powerPerCycle, int totalBurningTime) public AddCleanFuel(IRecipeManager manager, IFuel recipe) { super(manager, recipe); // this.fluid = fluid; @@ -187,8 +186,7 @@ public static AddCleanFuel create(IRecipeManager manager, String name, Fl return new AddCleanFuel(manager, new FuelRegistry.Fuel(_name, fluid, powerPerCycle, totalBurningTime)); } -// public void apply() -// { +// public void apply() { // BuildcraftFuelRegistry.fuel.addFuel(this.fluid, this.powerPerTick, this.totalBurningTime); // } diff --git a/common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java b/common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java index dec9b9f..b5616bf 100644 --- a/common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java +++ b/common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java @@ -1,10 +1,8 @@ package buildcraft.compat.module.crafttweaker; import buildcraft.compat.CompatModuleBase; -import com.blamejared.crafttweaker.api.CraftTweakerAPI; -public class CompatModuleCraftTweaker extends CompatModuleBase -{ +public class CompatModuleCraftTweaker extends CompatModuleBase { // TODO Calen /ct recipes manager -> error public CompatModuleCraftTweaker() { } diff --git a/common/buildcraft/compat/module/crafttweaker/Coolant.java b/common/buildcraft/compat/module/crafttweaker/Coolant.java index 45b6e9a..397f3a6 100644 --- a/common/buildcraft/compat/module/crafttweaker/Coolant.java +++ b/common/buildcraft/compat/module/crafttweaker/Coolant.java @@ -22,101 +22,72 @@ import org.openzen.zencode.java.ZenCodeGlobals; import org.openzen.zencode.java.ZenCodeType; -// Calen @ZenRegister @ZenCodeType.Name("mods.buildcraft.Coolant") @IRecipeHandler.For(ICoolant.class) -public enum Coolant implements IRecipeManager, IRecipeHandler -{ +public enum Coolant implements IRecipeManager, IRecipeHandler { @ZenCodeGlobals.Global("coolant") INSTANCE; @ZenCodeType.Method - public void addFluidCoolant(String name, IFluidStack liquid, float degreesCoolingPerMB) - { + public void addFluidCoolant(String name, IFluidStack liquid, float degreesCoolingPerMB) { addFluidCoolant0("custom/" + name, liquid, degreesCoolingPerMB); } - private void addFluidCoolant0(String name, IFluidStack liquid, float degreesCoolingPerMB) - { + private void addFluidCoolant0(String name, IFluidStack liquid, float degreesCoolingPerMB) { FluidStack fluid = liquid.getImmutableInternal(); - if (fluid == null) - { + if (fluid == null) { throw new IllegalArgumentException("Fluid was null!"); - } - else if (getAllRecipes().stream().anyMatch(r -> r instanceof IFluidCoolant fluidCoolant && fluidCoolant.getFluid().equals(fluid))) - { + } else if (getAllRecipes().stream().anyMatch(r -> r instanceof IFluidCoolant fluidCoolant && fluidCoolant.getFluid().equals(fluid))) { throw new IllegalArgumentException("The fluid " + fluid + " is already registered as a coolant!"); - } - else if (CombustionEngine.INSTANCE.getAllRecipes().stream().anyMatch(r -> r.getFluid().equals(fluid))) - { + } else if (CombustionEngine.INSTANCE.getAllRecipes().stream().anyMatch(r -> r.getFluid().equals(fluid))) { throw new IllegalArgumentException("The fluid " + fluid + " is already registered as a fuel - so it won't work very well if you add it as a coolant too!"); - } - else if (degreesCoolingPerMB <= 0.0) - { + } else if (degreesCoolingPerMB <= 0.0) { throw new IllegalArgumentException("Degrees cooling per MB was less than or equal to 0!"); - } - else - { + } else { CraftTweakerAPI.apply(AddFluidCoolant.create(this, name, fluid, degreesCoolingPerMB)); } } - // @ZenMethod + // @ZenMethod @ZenCodeType.Method - public void addSolidCoolant(String name, IItemStack item, IFluidStack lFuel, float multiplier) - { + public void addSolidCoolant(String name, IItemStack item, IFluidStack lFuel, float multiplier) { addSolidCoolant0("custom/" + name, item, lFuel, multiplier); } - private void addSolidCoolant0(String name, IItemStack itemIn, IFluidStack fluidIn, float multiplier) - { + private void addSolidCoolant0(String name, IItemStack itemIn, IFluidStack fluidIn, float multiplier) { ItemStack item = itemIn.getImmutableInternal(); FluidStack fluid = fluidIn.getImmutableInternal(); - if (item.getItem() == Items.AIR) - { + if (item.getItem() == Items.AIR) { throw new IllegalArgumentException("Coolant item was air!"); - } - else if (fluid.getFluid() == null || fluid.getFluid() instanceof EmptyFluid) - { + } else if (fluid.getFluid() == null || fluid.getFluid() instanceof EmptyFluid) { throw new IllegalArgumentException("Fluid was null or empty!"); - } - else if (getAllRecipes().stream().anyMatch(r -> r instanceof ISolidCoolant solidCoolant && solidCoolant.getSolid().equals(item))) - { + } else if (getAllRecipes().stream().anyMatch(r -> r instanceof ISolidCoolant solidCoolant && solidCoolant.getSolid().equals(item))) { throw new IllegalArgumentException("The item " + item + " is already registered as a coolant!"); - } - else if (multiplier <= 0.0) - { + } else if (multiplier <= 0.0) { throw new IllegalArgumentException("Multiplier was less than or equal to 0!"); - } - else - { + } else { CraftTweakerAPI.apply(AddSolidCoolant.create(this, name, item, fluid, multiplier)); } } @Override - public RecipeType getRecipeType() - { + public RecipeType getRecipeType() { return ICoolant.TYPE; } @Override - public String dumpToCommandString(final IRecipeManager manager, ICoolant recipe) - { - if (recipe instanceof IFluidCoolant fluidCoolant) - { + public String dumpToCommandString(final IRecipeManager manager, ICoolant recipe) { + if (recipe instanceof IFluidCoolant fluidCoolant) { return String.format( - "assemblyTable.addFluidCoolant(%s, %s, %s);", + "coolant.addFluidCoolant(%s, %s, %s);", StringUtil.quoteAndEscape(recipe.getId()), StringUtil.quoteAndEscape(recipe.getFluid().getFluid().getRegistryName()), fluidCoolant.getDegreesCoolingPerMB() ); - } - else if (recipe instanceof ISolidCoolant solidCoolant) - { + } else if (recipe instanceof ISolidCoolant solidCoolant) { return String.format( - "assemblyTable.addSolidCoolant(%s, %s, %s, %s);", + "coolant.addSolidCoolant(%s, %s, %s, %s);", StringUtil.quoteAndEscape(recipe.getId()), ItemStackUtil.getCommandString(solidCoolant.getSolid()), StringUtil.quoteAndEscape(recipe.getFluid().getFluid().getRegistryName()), @@ -126,40 +97,32 @@ else if (recipe instanceof ISolidCoolant solidCoolant) return "This is not a fluid coolant or a solid coolant. What happened?"; } - static final class AddFluidCoolant extends ActionAddRecipe - { - private AddFluidCoolant(IRecipeManager manager, IFluidCoolant recipe) - { + static final class AddFluidCoolant extends ActionAddRecipe { + private AddFluidCoolant(IRecipeManager manager, IFluidCoolant recipe) { super(manager, recipe); } - public static AddFluidCoolant create(IRecipeManager manager, String name, FluidStack fluid, float degreesCoolingPerMB) - { + public static AddFluidCoolant create(IRecipeManager manager, String name, FluidStack fluid, float degreesCoolingPerMB) { ResourceLocation _name = new ResourceLocation("crafttweaker", name); return new AddFluidCoolant(manager, new CoolantRegistry.FluidCoolant(_name, fluid, degreesCoolingPerMB)); } - public String describe() - { + public String describe() { return "Adding combustion engine coolant " + this.recipe.getFluid(); } } - static final class AddSolidCoolant extends ActionAddRecipe - { - public AddSolidCoolant(IRecipeManager manager, ISolidCoolant recipe) - { + static final class AddSolidCoolant extends ActionAddRecipe { + public AddSolidCoolant(IRecipeManager manager, ISolidCoolant recipe) { super(manager, recipe); } - public static AddSolidCoolant create(IRecipeManager manager, String name, ItemStack item, FluidStack fluid, float multiplier) - { + public static AddSolidCoolant create(IRecipeManager manager, String name, ItemStack item, FluidStack fluid, float multiplier) { ResourceLocation _name = new ResourceLocation("crafttweaker", name); return new AddSolidCoolant(manager, new CoolantRegistry.SolidCoolant(_name, item, fluid, multiplier)); } - public String describe() - { + public String describe() { return "Adding combustion engine coolant " + ((ISolidCoolant) this.recipe).getSolid(); } } diff --git a/common/buildcraft/compat/module/ic2/CompatModuleIndustrialCraft2.java b/common/buildcraft/compat/module/ic2/CompatModuleIndustrialCraft2.java index 339e0f1..bd441c6 100644 --- a/common/buildcraft/compat/module/ic2/CompatModuleIndustrialCraft2.java +++ b/common/buildcraft/compat/module/ic2/CompatModuleIndustrialCraft2.java @@ -8,29 +8,23 @@ import net.minecraft.world.item.Item; import net.minecraftforge.registries.ForgeRegistries; -public class CompatModuleIndustrialCraft2 extends CompatModuleBase -{ - public CompatModuleIndustrialCraft2() - { +public class CompatModuleIndustrialCraft2 extends CompatModuleBase { + public CompatModuleIndustrialCraft2() { } - public String compatModId() - { + public String compatModId() { return "ic2"; } - public void preInit() - { + public void preInit() { this.registerCableMatchingPredicate(); } - private void registerCableMatchingPredicate() - { + private void registerCableMatchingPredicate() { // Item cable = Item.func_111206_d("ic2:cable"); Item cable = ForgeRegistries.ITEMS.getValue(new ResourceLocation("ic2:cable")); - if (cable != null) - { - StackMatchingPredicate predicate = new StackNbtMatcher(new String[]{"insulation", "type"}); + if (cable != null) { + StackMatchingPredicate predicate = new StackNbtMatcher(new String[] { "insulation", "type" }); StackUtil.registerMatchingPredicate(cable, predicate); } diff --git a/common/buildcraft/compat/module/jei/BCPluginJEI.java b/common/buildcraft/compat/module/jei/BCPluginJEI.java index 564973e..fd5c157 100644 --- a/common/buildcraft/compat/module/jei/BCPluginJEI.java +++ b/common/buildcraft/compat/module/jei/BCPluginJEI.java @@ -4,19 +4,21 @@ import buildcraft.api.core.BCLog; import buildcraft.api.enums.EnumEngineType; import buildcraft.api.fuels.IFuel; -import buildcraft.lib.recipe.assembly.AssemblyRecipe; import buildcraft.api.recipes.IRefineryRecipeManager; import buildcraft.compat.module.jei.energy.combustionengine.CategoryCombustionEngine; -import buildcraft.compat.module.jei.factory.*; +import buildcraft.compat.module.jei.factory.CategoryCoolable; +import buildcraft.compat.module.jei.factory.CategoryDistiller; +import buildcraft.compat.module.jei.factory.CategoryHeatable; import buildcraft.compat.module.jei.gui.GuiHandlerBuildCraft; import buildcraft.compat.module.jei.silicon.CategoryAssemblyTable; import buildcraft.compat.module.jei.transferhandlers.AdvancedCraftingItemsTransferHandler; import buildcraft.compat.module.jei.transferhandlers.AutoCraftItemsTransferHandler; import buildcraft.core.BCCoreBlocks; import buildcraft.factory.BCFactoryBlocks; -import buildcraft.lib.recipe.fuel.FuelRegistry; import buildcraft.lib.gui.GuiBC8; +import buildcraft.lib.recipe.assembly.AssemblyRecipe; import buildcraft.lib.recipe.assembly.AssemblyRecipeRegistry; +import buildcraft.lib.recipe.fuel.FuelRegistry; import buildcraft.silicon.BCSiliconBlocks; import buildcraft.silicon.container.ContainerAssemblyTable; import com.google.common.collect.ImmutableList; diff --git a/common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java b/common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java index 45f372c..cae0189 100644 --- a/common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java +++ b/common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java @@ -1,13 +1,6 @@ package buildcraft.compat.module.jei.energy.combustionengine; import buildcraft.api.BCModules; - -import java.awt.*; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import buildcraft.api.fuels.IFuel; import buildcraft.api.fuels.IFuelManager; import buildcraft.api.mj.MjAPI; @@ -37,9 +30,14 @@ import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fluids.FluidStack; +import java.awt.*; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + //public class CategoryCombustionEngine extends BlankRecipeCategory -public class CategoryCombustionEngine implements IRecipeCategory -{ +public class CategoryCombustionEngine implements IRecipeCategory { // Calen public static final RecipeType RECIPE_TYPE = RecipeType.create(BCModules.ENERGY.getModId(), "engine_combustion", IFuel.class); @@ -50,19 +48,11 @@ public class CategoryCombustionEngine implements IRecipeCategory private final IDrawable icon; - // private final IDrawableAnimated flame; -// private IDrawableAnimated flame; - @OnlyIn(Dist.CLIENT) private Font font = Minecraft.getInstance().font; - // private final IGuiHelper guiHelper; -// private final IDrawableStatic flameDrawable; private final Map burnTimeDrabableMap = new HashMap<>(); - // public CategoryCombustionEngine(IGuiHelper guiHelper) -// public CategoryCombustionEngine(IGuiHelper guiHelper,IFuel fuel) - public CategoryCombustionEngine(IGuiHelper guiHelper, Collection fuels) - { + public CategoryCombustionEngine(IGuiHelper guiHelper, Collection fuels) { // Calen: 80->100 // this.background = guiHelper.createDrawable(new ResourceLocation("minecraft", "textures/gui/container/furnace.png"), 55, 38, 18, 32, 0, 0, 0, 80); // this.background = guiHelper.drawableBuilder(FURNACE, 55, 38, 18, 32).addPadding(0, 0, 0, 80).build(); @@ -75,48 +65,40 @@ public CategoryCombustionEngine(IGuiHelper guiHelper, Collection fuels) // ResourceLocation furnaceBackgroundLocation = new ResourceLocation("minecraft", "textures/gui/container/furnace.png"); IDrawableStatic flameDrawable = guiHelper.createDrawable(FURNACE, 176, 0, 14, 14); // this.flame = guiHelper.createAnimatedDrawable(flameDrawable, fuel.getTotalBurningTime() / 10, IDrawableAnimated.StartDirection.TOP, true); - for (IFuel fuel : fuels) - { - if (!burnTimeDrabableMap.containsKey(fuel.getTotalBurningTime())) - { + for (IFuel fuel : fuels) { + if (!burnTimeDrabableMap.containsKey(fuel.getTotalBurningTime())) { burnTimeDrabableMap.put(fuel.getTotalBurningTime(), guiHelper.createAnimatedDrawable(flameDrawable, fuel.getTotalBurningTime() / 10, IDrawableAnimated.StartDirection.TOP, true)); } } } @Override - public ResourceLocation getUid() - { + public ResourceLocation getUid() { return UID; } @Override - public Class getRecipeClass() - { + public Class getRecipeClass() { return IFuel.class; } @Override - public Component getTitle() - { + public Component getTitle() { // return new TextComponent("Combustion Engine Fuels"); return new TranslatableComponent("buildcraft.jei.title.combustion_engine_fuels"); } - public String getModName() - { + public String getModName() { return BCModules.ENERGY.name(); } @Override - public IDrawable getBackground() - { + public IDrawable getBackground() { return this.background; } @Override - public IDrawable getIcon() - { + public IDrawable getIcon() { return this.icon; } @@ -124,12 +106,7 @@ public IDrawable getIcon() private int lastBurnTime = -1; @Override - public void draw(IFuel fuel, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) - { -// if (fuel.getTotalBurningTime() != lastBurnTime) -// { -// this.flame = guiHelper.createAnimatedDrawable(flameDrawable, fuel.getTotalBurningTime() / 10, IDrawableAnimated.StartDirection.TOP, true); -// } + public void draw(IFuel fuel, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) { // this.flame.draw(stack, 2, 0); this.burnTimeDrabableMap.get(fuel.getTotalBurningTime()).draw(stack, 2, 0); // GlStateManager.func_179094_E(); @@ -153,9 +130,8 @@ public void draw(IFuel fuel, IRecipeSlotsView recipeSlotsView, PoseStack stack, } @Override - // public void setRecipe(IRecipeLayout recipeLayout, WrapperCombustionEngine recipeWrapper, IIngredients ingredients) - public void setRecipe(IRecipeLayoutBuilder builder, IFuel fuel, IFocusGroup focuses) - { + // public void setRecipe(IRecipeLayout recipeLayout, WrapperCombustionEngine recipeWrapper, IIngredients ingredients) + public void setRecipe(IRecipeLayoutBuilder builder, IFuel fuel, IFocusGroup focuses) { // IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); // guiFluidStacks.init(0, true, 1, 15, 16, 16, 1000, false, (IDrawable) null); // guiFluidStacks.set(0, (List) ingredients.getInputs(FluidStack.class).get(0)); @@ -163,8 +139,7 @@ public void setRecipe(IRecipeLayoutBuilder builder, IFuel fuel, IFocusGroup focu .addSlot(RecipeIngredientRole.INPUT, 1, 15) .setFluidRenderer(1000, false, 16, 16) .addIngredient(ForgeTypes.FLUID_STACK, new FluidStack(fuel.getFluid(), 1000)); - if (fuel instanceof IFuelManager.IDirtyFuel dirtyFuel) - { + if (fuel instanceof IFuelManager.IDirtyFuel dirtyFuel) { // Calen: move right 20 to not covered the text // guiFluidStacks.init(1, false, 95, 15, 16, 16, 1000, false, (IDrawable) null); // guiFluidStacks.set(1, (List) ingredients.getOutputs(FluidStack.class).get(0)); @@ -177,14 +152,12 @@ public void setRecipe(IRecipeLayoutBuilder builder, IFuel fuel, IFocusGroup focu } @Override - public List getTooltipStrings(IFuel recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) - { + public List getTooltipStrings(IFuel recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) { return Lists.newArrayList(); } @Override - public boolean handleInput(IFuel recipe, double mouseX, double mouseY, InputConstants.Key input) - { + public boolean handleInput(IFuel recipe, double mouseX, double mouseY, InputConstants.Key input) { return false; } } diff --git a/common/buildcraft/compat/module/jei/factory/CategoryCoolable.java b/common/buildcraft/compat/module/jei/factory/CategoryCoolable.java index 2304852..7d368c3 100644 --- a/common/buildcraft/compat/module/jei/factory/CategoryCoolable.java +++ b/common/buildcraft/compat/module/jei/factory/CategoryCoolable.java @@ -1,9 +1,6 @@ package buildcraft.compat.module.jei.factory; import buildcraft.api.BCModules; - -import java.util.List; - import buildcraft.api.recipes.IRefineryRecipeManager; import buildcraft.factory.BCFactoryBlocks; import buildcraft.lib.misc.StackUtil; @@ -27,9 +24,10 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; +import java.util.List; + //public class CategoryCoolable extends BlankRecipeCategory -public class CategoryCoolable implements IRecipeCategory -{ +public class CategoryCoolable implements IRecipeCategory { // Calen public static final RecipeType RECIPE_TYPE = RecipeType.create(BCModules.FACTORY.getModId(), "category_coolable", IRefineryRecipeManager.ICoolableRecipe.class); @@ -43,8 +41,7 @@ public class CategoryCoolable implements IRecipeCategory getRecipeClass() - { + public Class getRecipeClass() { return IRefineryRecipeManager.ICoolableRecipe.class; } @Override - public RecipeType getRecipeType() - { + public RecipeType getRecipeType() { return RECIPE_TYPE; } - public Component getTitle() - { + public Component getTitle() { // return new TextComponent("Coolable Fluids"); return new TranslatableComponent("buildcraft.jei.title.coolable_fluids"); } - public String getModName() - { + public String getModName() { return BCModules.FACTORY.name(); } - public IDrawable getBackground() - { + public IDrawable getBackground() { return this.background; } @Override - public IDrawable getIcon() - { + public IDrawable getIcon() { return this.icon; } @Override // public void drawExtras(Minecraft minecraft) - public void draw(IRefineryRecipeManager.ICoolableRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) - { + public void draw(IRefineryRecipeManager.ICoolableRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) { // Calen: y+1 to be at the same height as tubes of background // in 1.18.2 additionally +1 // this.slot.draw(stack, 0, 0); @@ -118,8 +107,7 @@ public void draw(IRefineryRecipeManager.ICoolableRecipe recipe, IRecipeSlotsView @Override // public void setRecipe(IRecipeLayout recipeLayout, WrapperCoolable recipeWrapper, IIngredients ingredients) - public void setRecipe(IRecipeLayoutBuilder builder, IRefineryRecipeManager.ICoolableRecipe recipe, IFocusGroup focuses) - { + public void setRecipe(IRecipeLayoutBuilder builder, IRefineryRecipeManager.ICoolableRecipe recipe, IFocusGroup focuses) { // IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); // guiFluidStacks.init(0, true, 1, 1, 16, 16, 10, false, (IDrawable) null); // guiFluidStacks.set(0, (List) ingredients.getInputs(FluidStack.class).get(0)); @@ -138,14 +126,12 @@ public void setRecipe(IRecipeLayoutBuilder builder, IRefineryRecipeManager.ICool } @Override - public List getTooltipStrings(IRefineryRecipeManager.ICoolableRecipe recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) - { + public List getTooltipStrings(IRefineryRecipeManager.ICoolableRecipe recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) { return Lists.newArrayList(); } @Override - public boolean handleInput(IRefineryRecipeManager.ICoolableRecipe recipe, double mouseX, double mouseY, InputConstants.Key input) - { + public boolean handleInput(IRefineryRecipeManager.ICoolableRecipe recipe, double mouseX, double mouseY, InputConstants.Key input) { return false; } } diff --git a/common/buildcraft/compat/module/jei/factory/CategoryDistiller.java b/common/buildcraft/compat/module/jei/factory/CategoryDistiller.java index 510f9fe..b46cd66 100644 --- a/common/buildcraft/compat/module/jei/factory/CategoryDistiller.java +++ b/common/buildcraft/compat/module/jei/factory/CategoryDistiller.java @@ -1,10 +1,6 @@ package buildcraft.compat.module.jei.factory; import buildcraft.api.BCModules; - -import java.awt.*; -import java.util.List; - import buildcraft.api.mj.MjAPI; import buildcraft.api.recipes.IRefineryRecipeManager; import buildcraft.factory.BCFactoryBlocks; @@ -32,9 +28,11 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import java.awt.*; +import java.util.List; + //public class CategoryDistiller extends BlankRecipeCategory -public class CategoryDistiller implements IRecipeCategory -{ +public class CategoryDistiller implements IRecipeCategory { // Calen public static final RecipeType RECIPE_TYPE = RecipeType.create(BCModules.FACTORY.getModId(), "category_distiller", IRefineryRecipeManager.IDistillationRecipe.class); @@ -51,8 +49,7 @@ public class CategoryDistiller implements IRecipeCategory getRecipeClass() - { + public Class getRecipeClass() { return IRefineryRecipeManager.IDistillationRecipe.class; } @Override - public RecipeType getRecipeType() - { + public RecipeType getRecipeType() { return RECIPE_TYPE; } @Override - public Component getTitle() - { + public Component getTitle() { // return new TextComponent("Distillable Fluids"); return new TranslatableComponent("buildcraft.jei.title.distillable_fluids"); } - public String getModName() - { + public String getModName() { return BCModules.FACTORY.name(); } @Override - public IDrawable getBackground() - { + public IDrawable getBackground() { return this.fakeBackground; } @Override - public IDrawable getIcon() - { + public IDrawable getIcon() { return this.icon; } @Override // public void drawExtras(Minecraft minecraft) - public void draw(IRefineryRecipeManager.IDistillationRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) - { + public void draw(IRefineryRecipeManager.IDistillationRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) { this.background.draw(stack, 20, 4); this.slot.draw(stack, 0, 25); this.slot.draw(stack, 56, 0); @@ -121,8 +110,7 @@ public void draw(IRefineryRecipeManager.IDistillationRecipe recipe, IRecipeSlots @Override // public void setRecipe(IRecipeLayout recipeLayout, WrapperDistiller recipeWrapper, IIngredients ingredients) - public void setRecipe(IRecipeLayoutBuilder builder, IRefineryRecipeManager.IDistillationRecipe recipe, IFocusGroup focuses) - { + public void setRecipe(IRecipeLayoutBuilder builder, IRefineryRecipeManager.IDistillationRecipe recipe, IFocusGroup focuses) { // IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); // guiFluidStacks.init(0, true, 1, 26, 16, 16, 10, false, (IDrawable) null); // guiFluidStacks.set(0, (List) ingredients.getInputs(FluidStack.class).get(0)); @@ -145,14 +133,12 @@ public void setRecipe(IRecipeLayoutBuilder builder, IRefineryRecipeManager.IDist } @Override - public List getTooltipStrings(IRefineryRecipeManager.IDistillationRecipe recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) - { + public List getTooltipStrings(IRefineryRecipeManager.IDistillationRecipe recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) { return Lists.newArrayList(); } @Override - public boolean handleInput(IRefineryRecipeManager.IDistillationRecipe recipe, double mouseX, double mouseY, InputConstants.Key input) - { + public boolean handleInput(IRefineryRecipeManager.IDistillationRecipe recipe, double mouseX, double mouseY, InputConstants.Key input) { return false; } } diff --git a/common/buildcraft/compat/module/jei/factory/CategoryHeatable.java b/common/buildcraft/compat/module/jei/factory/CategoryHeatable.java index 7ffdb0a..0d3062f 100644 --- a/common/buildcraft/compat/module/jei/factory/CategoryHeatable.java +++ b/common/buildcraft/compat/module/jei/factory/CategoryHeatable.java @@ -29,8 +29,7 @@ import java.util.List; //public class CategoryHeatable extends BlankRecipeCategory -public class CategoryHeatable implements IRecipeCategory -{ +public class CategoryHeatable implements IRecipeCategory { // Calen public static final RecipeType RECIPE_TYPE = RecipeType.create(BCModules.FACTORY.getModId(), "category_heatable", IRefineryRecipeManager.IHeatableRecipe.class); @@ -45,8 +44,7 @@ public class CategoryHeatable implements IRecipeCategory getRecipeClass() - { + public Class getRecipeClass() { return IRefineryRecipeManager.IHeatableRecipe.class; } @Override - public Component getTitle() - { + public Component getTitle() { // return new TextComponent("Heatable Fluids"); return new TranslatableComponent("buildcraft.jei.title.heatable_fluids"); } - public String getModName() - { + public String getModName() { return BCModules.FACTORY.name(); } @Override - public IDrawable getBackground() - { + public IDrawable getBackground() { return this.background; } @Override - public IDrawable getIcon() - { + public IDrawable getIcon() { return this.icon; } @OnlyIn(Dist.CLIENT) @Override // public void drawExtras(Minecraft minecraft) - public void draw(IRefineryRecipeManager.IHeatableRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) - { + public void draw(IRefineryRecipeManager.IHeatableRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) { this.slotIn.draw(stack); this.slotOut.draw(stack); @@ -112,8 +103,7 @@ public void draw(IRefineryRecipeManager.IHeatableRecipe recipe, IRecipeSlotsView @Override // public void setRecipe(IRecipeLayout recipeLayout, WrapperHeatable recipeWrapper, IIngredients ingredients) - public void setRecipe(IRecipeLayoutBuilder builder, IRefineryRecipeManager.IHeatableRecipe recipe, IFocusGroup focuses) - { + public void setRecipe(IRecipeLayoutBuilder builder, IRefineryRecipeManager.IHeatableRecipe recipe, IFocusGroup focuses) { // IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); // guiFluidStacks.init(0, true, 1, 1, 16, 16, 10, false, (IDrawable) null); // guiFluidStacks.set(0, (List) ingredients.getInputs(FluidStack.class).get(0)); @@ -132,14 +122,12 @@ public void setRecipe(IRecipeLayoutBuilder builder, IRefineryRecipeManager.IHeat } @Override - public List getTooltipStrings(IRefineryRecipeManager.IHeatableRecipe recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) - { + public List getTooltipStrings(IRefineryRecipeManager.IHeatableRecipe recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) { return Lists.newArrayList(); } @Override - public boolean handleInput(IRefineryRecipeManager.IHeatableRecipe recipe, double mouseX, double mouseY, InputConstants.Key input) - { + public boolean handleInput(IRefineryRecipeManager.IHeatableRecipe recipe, double mouseX, double mouseY, InputConstants.Key input) { return false; } } diff --git a/common/buildcraft/compat/module/jei/gui/GuiHandlerBuildCraft.java b/common/buildcraft/compat/module/jei/gui/GuiHandlerBuildCraft.java index fc5eccc..6c5a688 100644 --- a/common/buildcraft/compat/module/jei/gui/GuiHandlerBuildCraft.java +++ b/common/buildcraft/compat/module/jei/gui/GuiHandlerBuildCraft.java @@ -11,17 +11,14 @@ import java.util.ArrayList; import java.util.List; -public class GuiHandlerBuildCraft implements IGuiContainerHandler> -{ +public class GuiHandlerBuildCraft implements IGuiContainerHandler> { @NotNull @Override - public List getGuiExtraAreas(GuiBC8 guiDirty) - { + public List getGuiExtraAreas(GuiBC8 guiDirty) { // return screen.getGuiExtraAreas(); List list = new ArrayList(); - for (IGuiElement element : guiDirty.mainGui.shownElements) - { + for (IGuiElement element : guiDirty.mainGui.shownElements) { GuiRectangle rect = element.asImmutable(); int x = (int) rect.x; int y = (int) rect.y; @@ -40,21 +37,13 @@ public List getGuiExtraAreas(GuiBC8 guiDirty) // @Nullable // @Override -// public Object getIngredientUnderMouse(GuiBC8 screen, double mouseX, double mouseY) -// { +// public Object getIngredientUnderMouse(GuiBC8 screen, double mouseX, double mouseY) { // return screen.getIngredientUnderMouse(mouseX, mouseY); // } // @NotNull // @Override -// public Collection getGuiClickableAreas(GuiBC8 screen, double mouseX, -// double mouseY) -// { -//// if (screen instanceof InscriberScreen) { -//// return Collections.singletonList( -//// IGuiClickableArea.createBasic(82, 39, 26, 16, InscriberRecipeCategory.RECIPE_TYPE)); -//// } -// +// public Collection getGuiClickableAreas(GuiBC8 screen, double mouseX, double mouseY) { // return Collections.emptyList(); // } } diff --git a/common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java b/common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java index da66631..952e4f1 100644 --- a/common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java +++ b/common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java @@ -1,11 +1,6 @@ package buildcraft.compat.module.jei.silicon; import buildcraft.api.BCModules; - -import java.awt.*; -import java.util.*; -import java.util.List; - import buildcraft.api.mj.MjAPI; import buildcraft.api.recipes.IAssemblyRecipe; import buildcraft.api.recipes.IngredientStack; @@ -33,34 +28,30 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public class CategoryAssemblyTable implements IRecipeCategory -{ +import java.awt.*; +import java.util.List; +import java.util.*; + +public class CategoryAssemblyTable implements IRecipeCategory { // Calen public static final RecipeType RECIPE_TYPE = RecipeType.create(BCModules.SILICON.getModId(), "assembly", IAssemblyRecipe.class); - // public static final ResourceLocation UID = new ResourceLocation("buildcraft-compat:silicon.assembly"); + // public static final ResourceLocation UID = new ResourceLocation("buildcraft-compat:silicon.assembly"); public static final ResourceLocation UID = new ResourceLocation(BCModules.SILICON.getModId(), "assembly"); protected final ResourceLocation backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/assembly_table.png"); private final IDrawable background; private final IDrawable icon; - // private final AssemblyRecipeBasic recipe; -// private final IDrawableAnimated progressBar; private final Map progressBarMap = new HashMap<>(); - // private final List> inputs; -// private final List inputs; private final Map> inputsMap = new HashMap<>(); - // private final List outputs; -// private final Ingredient outputs; private final Map outputsMap = new HashMap<>(); @OnlyIn(Dist.CLIENT) private Font font = Minecraft.getInstance().font; - // public CategoryAssemblyTable(IGuiHelper guiHelper, AssemblyRecipeBasic recipe) - public CategoryAssemblyTable(IGuiHelper guiHelper, Collection recipes) - { + // public CategoryAssemblyTable(IGuiHelper guiHelper, AssemblyRecipeBasic recipe) + public CategoryAssemblyTable(IGuiHelper guiHelper, Collection recipes) { // this.background = guiHelper.createDrawable(this.backgroundLocation, 5, 34, 166, 76, 10, 0, 0, 0); this.background = guiHelper.drawableBuilder(this.backgroundLocation, 5, 34, 166, 76).addPadding(10, 0, 0, 0).build(); @@ -70,38 +61,24 @@ public CategoryAssemblyTable(IGuiHelper guiHelper, Collection r // IDrawableStatic progressDrawable = guiHelper.createDrawable(backgroundLocation, 176, 48, 4, 71, 10, 0, 0, 0); IDrawableStatic progressDrawable = guiHelper.drawableBuilder(backgroundLocation, 176, 48, 4, 71).addPadding(10, 0, 0, 0).build(); - for (IAssemblyRecipe recipe : recipes) - { -// this.recipe = recipe; -// List> _inputs = Lists.newArrayList(); -// List _inputs = Lists.newArrayList(); + for (IAssemblyRecipe recipe : recipes) { List _inputs = Lists.newArrayList(); - for (IngredientStack in : recipe.getInputsFor(ItemStack.EMPTY)) - { + for (IngredientStack in : recipe.getInputsFor(ItemStack.EMPTY)) { List inner = new ArrayList(); - for (ItemStack matching : in.ingredient.getItems()) - { + for (ItemStack matching : in.ingredient.getItems()) { matching = matching.copy(); matching.setCount(in.count); inner.add(matching); -// _inputs.add(matching); } -// _inputs.add(inner); _inputs.add(Ingredient.of(inner.stream())); } -// this.inputs = ImmutableList.copyOf(_inputs); -// this.inputs = Ingredient.of(_inputs.stream()); -// this.inputs = _inputs; this.inputsMap.put(recipe, _inputs); -// this.outputs = ImmutableList.copyOf(recipe.getOutputPreviews()); -// this.outputs = Ingredient.of(recipe.getOutputPreviews().stream()); this.outputsMap.put(recipe, Ingredient.of(recipe.getOutputPreviews().stream())); -// long mj = this.recipe.getRequiredMicroJoulesFor(ItemStack.EMPTY); long mj = recipe.getRequiredMicroJoulesFor(ItemStack.EMPTY); // this.progressBar = guiHelper.createAnimatedDrawable(progressDrawable, (int) Math.max(10L, mj / MjAPI.MJ / 50L), IDrawableAnimated.StartDirection.BOTTOM, false); progressBarMap.put(recipe, guiHelper.createAnimatedDrawable(progressDrawable, (int) Math.max(10L, mj / MjAPI.MJ / 50L), IDrawableAnimated.StartDirection.BOTTOM, false)); @@ -109,65 +86,53 @@ public CategoryAssemblyTable(IGuiHelper guiHelper, Collection r } @Override - public ResourceLocation getUid() - { + public ResourceLocation getUid() { return UID; } @Override - public Class getRecipeClass() - { + public Class getRecipeClass() { return IAssemblyRecipe.class; } @Override - public Component getTitle() - { + public Component getTitle() { // return new TextComponent("Assembly Table"); return new TranslatableComponent("tile.assemblyTableBlock.name"); } - public String getModName() - { + public String getModName() { return BCModules.SILICON.name(); } @Override - public IDrawable getBackground() - { + public IDrawable getBackground() { return this.background; } @Override - public IDrawable getIcon() - { + public IDrawable getIcon() { return this.icon; } @OnlyIn(Dist.CLIENT) @Override - public void draw(IAssemblyRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) - { + public void draw(IAssemblyRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) { // this.progressBar.draw(stack, 81, 2); this.progressBarMap.get(recipe).draw(stack, 81, 2); -// long mj = this.recipe.getRequiredMicroJoulesFor(ItemStack.EMPTY); long mj = recipe.getRequiredMicroJoulesFor(ItemStack.EMPTY); this.font.draw(stack, MjAPI.formatMj(mj) + " MJ", 4, 0, Color.gray.getRGB()); } @Override // public void setRecipe(IRecipeLayout recipeLayout, WrapperAssemblyTable recipeWrapper, IIngredients ingredients) - public void setRecipe(IRecipeLayoutBuilder builder, IAssemblyRecipe recipe, IFocusGroup focuses) - { + public void setRecipe(IRecipeLayoutBuilder builder, IAssemblyRecipe recipe, IFocusGroup focuses) { // IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); -// List> inputs = ingredients.getInputs(ItemStack.class); -// List> inputs = this.inputs; // Calen: the looks moved x-1 y-1 off the slot in 1.18.2 with the position used in 1.12.2 // for (int i = 0; i < inputs.size(); ++i) List inputs = inputsMap.get(recipe); - for (int i = 0; i < inputs.size(); ++i) - { + for (int i = 0; i < inputs.size(); ++i) { // guiItemStacks.init(i, true, 2 + i % 3 * 18, 11 + i / 3 * 18); // guiItemStacks.set(i, (List) inputs.get(i)); builder diff --git a/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java b/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java index 8dea97d..090627f 100644 --- a/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java +++ b/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java @@ -1,10 +1,6 @@ package buildcraft.compat.module.jei.silicon; import buildcraft.api.BCModules; - -import java.awt.*; -import java.util.List; - import buildcraft.api.mj.MjAPI; import buildcraft.api.recipes.IntegrationRecipe; import buildcraft.silicon.BCSiliconBlocks; @@ -33,13 +29,15 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import java.awt.*; +import java.util.List; + //public class CategoryIntegrationTable implements IRecipeCategory -public class CategoryIntegrationTable implements IRecipeCategory -{ +public class CategoryIntegrationTable implements IRecipeCategory { // Calen public static final RecipeType RECIPE_TYPE = RecipeType.create(BCModules.SILICON.getModId(), "integration", IntegrationRecipe.class); - // public static final ResourceLocation UID = new ResourceLocation("buildcraft-compat:silicon.integration"); + // public static final ResourceLocation UID = new ResourceLocation("buildcraft-compat:silicon.integration"); public static final ResourceLocation UID = new ResourceLocation(BCModules.SILICON.getModId(), "integration"); protected final ResourceLocation backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/integration_table.png"); private final IDrawable background; @@ -54,8 +52,7 @@ public class CategoryIntegrationTable implements IRecipeCategory getRecipeClass() - { + public Class getRecipeClass() { return IntegrationRecipe.class; } - public Component getTitle() - { + public Component getTitle() { // return new TextComponent("Integration Table"); return new TranslatableComponent("tile.integrationTableBlock.name"); } - public String getModName() - { + public String getModName() { return BCModules.SILICON.name(); } - public IDrawable getBackground() - { + public IDrawable getBackground() { return this.background; } @Override - public IDrawable getIcon() - { + public IDrawable getIcon() { return this.icon; } @OnlyIn(Dist.CLIENT) @Override - public void draw(IntegrationRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) - { + public void draw(IntegrationRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) { this.progressBar.draw(stack, 156, 1); this.font.draw(stack, MjAPI.formatMj(0L) + " MJ", 80, 52, Color.gray.getRGB()); } - // public void setRecipe(IRecipeLayout recipeLayout, WrapperIntegrationTable recipeWrapper, IIngredients ingredients) - public void setRecipe(IRecipeLayoutBuilder builder, IntegrationRecipe recipe, IFocusGroup focuses) - { + // public void setRecipe(IRecipeLayout recipeLayout, WrapperIntegrationTable recipeWrapper, IIngredients ingredients) + public void setRecipe(IRecipeLayoutBuilder builder, IntegrationRecipe recipe, IFocusGroup focuses) { // IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); // List> inputs = ingredients.getInputs(ItemStack.class); // int inventoryIndex = 0; - for (int y = 0; y < 3; ++y) - { - for (int x = 0; x < 3; ++x) - { + for (int y = 0; y < 3; ++y) { + for (int x = 0; x < 3; ++x) { int slotIndex = x == 1 && y == 1 ? 0 : x + y * 3 + 1; - if (inputs.size() > slotIndex) - { + if (inputs.size() > slotIndex) { // guiItemStacks.init(inventoryIndex, true, 19 + x * 25, 24 + y * 25); // guiItemStacks.set(inventoryIndex, (List) inputs.get(slotIndex)); builder diff --git a/common/buildcraft/compat/module/jei/silicon/Utils.java b/common/buildcraft/compat/module/jei/silicon/Utils.java index c4785bf..b7fb4fa 100644 --- a/common/buildcraft/compat/module/jei/silicon/Utils.java +++ b/common/buildcraft/compat/module/jei/silicon/Utils.java @@ -6,20 +6,15 @@ import java.util.List; -public final class Utils -{ - public Utils() - { +public final class Utils { + public Utils() { } - public static List getItemStacks(StackDefinition definition) - { + public static List getItemStacks(StackDefinition definition) { List list = Lists.newArrayList(); - if (definition.filter != null) - { + if (definition.filter != null) { - for (ItemStack stack : definition.filter.getExamples()) - { + for (ItemStack stack : definition.filter.getExamples()) { ItemStack sizedStack = stack.copy(); sizedStack.setCount(definition.count); list.add(sizedStack); diff --git a/common/buildcraft/compat/module/jei/transferhandlers/AdvancedCraftingItemsTransferHandler.java b/common/buildcraft/compat/module/jei/transferhandlers/AdvancedCraftingItemsTransferHandler.java index 78407d0..b9f1615 100644 --- a/common/buildcraft/compat/module/jei/transferhandlers/AdvancedCraftingItemsTransferHandler.java +++ b/common/buildcraft/compat/module/jei/transferhandlers/AdvancedCraftingItemsTransferHandler.java @@ -1,40 +1,33 @@ package buildcraft.compat.module.jei.transferhandlers; import buildcraft.silicon.container.ContainerAdvancedCraftingTable; - -import javax.annotation.Nullable; - import mezz.jei.api.gui.ingredient.IRecipeSlotsView; import mezz.jei.api.recipe.transfer.IRecipeTransferError; import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.crafting.CraftingRecipe; -public class AdvancedCraftingItemsTransferHandler implements IRecipeTransferHandler -{ - public AdvancedCraftingItemsTransferHandler() - { +import javax.annotation.Nullable; + +public class AdvancedCraftingItemsTransferHandler implements IRecipeTransferHandler { + public AdvancedCraftingItemsTransferHandler() { } @Override - public Class getContainerClass() - { + public Class getContainerClass() { return ContainerAdvancedCraftingTable.class; } @Override - public Class getRecipeClass() - { + public Class getRecipeClass() { return CraftingRecipe.class; } @Override @Nullable // public IRecipeTransferError transferRecipe(ContainerAdvancedCraftingTable container, IRecipeLayout recipeLayout, Player player, boolean maxTransfer, boolean doTransfer) - public IRecipeTransferError transferRecipe(ContainerAdvancedCraftingTable container, CraftingRecipe recipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) - { - if (doTransfer) - { + public IRecipeTransferError transferRecipe(ContainerAdvancedCraftingTable container, CraftingRecipe recipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) { + if (doTransfer) { AutoCraftItemsTransferHandler.transferRecipe((itemStacks) -> { container.sendSetPhantomSlots(container.tile.invBlueprint, itemStacks); diff --git a/common/buildcraft/compat/module/jei/transferhandlers/AutoCraftItemsTransferHandler.java b/common/buildcraft/compat/module/jei/transferhandlers/AutoCraftItemsTransferHandler.java index af48ccf..c4c473d 100644 --- a/common/buildcraft/compat/module/jei/transferhandlers/AutoCraftItemsTransferHandler.java +++ b/common/buildcraft/compat/module/jei/transferhandlers/AutoCraftItemsTransferHandler.java @@ -1,14 +1,7 @@ package buildcraft.compat.module.jei.transferhandlers; import buildcraft.factory.container.ContainerAutoCraftItems; -import buildcraft.factory.tile.TileAutoWorkbenchItems; import com.google.common.collect.Lists; - -import java.util.List; -import java.util.Map; -import java.util.function.Consumer; -import javax.annotation.Nullable; - import mezz.jei.api.gui.ingredient.IRecipeSlotView; import mezz.jei.api.gui.ingredient.IRecipeSlotsView; import mezz.jei.api.recipe.transfer.IRecipeTransferError; @@ -17,31 +10,29 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingRecipe; -public class AutoCraftItemsTransferHandler implements IRecipeTransferHandler -{ - public AutoCraftItemsTransferHandler() - { +import javax.annotation.Nullable; +import java.util.List; +import java.util.function.Consumer; + +public class AutoCraftItemsTransferHandler implements IRecipeTransferHandler { + public AutoCraftItemsTransferHandler() { } @Override - public Class getContainerClass() - { + public Class getContainerClass() { return ContainerAutoCraftItems.class; } @Override - public Class getRecipeClass() - { + public Class getRecipeClass() { return CraftingRecipe.class; } @Override @Nullable // public IRecipeTransferError transferRecipe(ContainerAutoCraftItems container, IRecipeLayout recipeLayout, Player player, boolean maxTransfer, boolean doTransfer) - public IRecipeTransferError transferRecipe(ContainerAutoCraftItems container, CraftingRecipe recipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) - { - if (doTransfer) - { + public IRecipeTransferError transferRecipe(ContainerAutoCraftItems container, CraftingRecipe recipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) { + if (doTransfer) { transferRecipe((itemStacks) -> { container.sendSetPhantomSlots((container.tile).invBlueprint, itemStacks); @@ -55,17 +46,14 @@ public IRecipeTransferError transferRecipe(ContainerAutoCraftItems container, Cr return null; } - // static void transferRecipe(Consumer> callback, IRecipeLayout recipeLayout) - static void transferRecipe(Consumer> callback, CraftingRecipe recipe, IRecipeSlotsView recipeLayout) -// public IRecipeTransferError transferRecipe(ContainerAutoCraftItems container, CraftingRecipe recipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) - { + // static void transferRecipe(Consumer> callback, IRecipeLayout recipeLayout) + static void transferRecipe(Consumer> callback, CraftingRecipe recipe, IRecipeSlotsView recipeLayout) { // Map> inputs = recipeLayout.getItemStacks().getGuiIngredients(); List inputs = recipeLayout.getSlotViews(); List stacks = Lists.newArrayList(); - for (int slot = 0; slot < 9; ++slot) - { + for (int slot = 0; slot < 9; ++slot) { // IGuiIngredient ingredient = (IGuiIngredient) inputs.getOrDefault(slot + 1, (Object) null); IRecipeSlotView ingredient = inputs.get(slot + 1); // ItemStack stack = ingredient == null ? ItemStack.EMPTY : (ItemStack) ingredient.getDisplayedIngredient(); diff --git a/common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java b/common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java index be17590..122b09e 100644 --- a/common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java +++ b/common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java @@ -8,7 +8,6 @@ import buildcraft.lib.tile.craft.IAutoCraft; import com.google.common.base.Function; import mcjty.theoneprobe.api.*; -import net.minecraft.ChatFormatting; import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Player; @@ -17,7 +16,6 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import java.util.Iterator; import java.util.List; //@InterfaceList({@Interface( @@ -28,65 +26,54 @@ // iface = "mcjty.theoneprobe.api.IProbeInfoProvider" //)}) //public class BCPluginTOP implements Function, IBlockDisplayOverride, IProbeInfoProvider -public enum BCPluginTOP implements Function, IBlockDisplayOverride, IProbeInfoProvider -{ +public enum BCPluginTOP implements Function, IBlockDisplayOverride, IProbeInfoProvider { INSTANCE; static final String TOP_MOD_ID = "theoneprobe"; - // @Method(modid = "theoneprobe") - public Void apply(ITheOneProbe top) - { + // @Method(modid = "theoneprobe") + public Void apply(ITheOneProbe top) { top.registerBlockDisplayOverride(this); top.registerProvider(this); return null; } - // @Method(modid = "theoneprobe") -// public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) - public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo probeInfo, Player player, Level world, BlockState blockState, IProbeHitData data) - { + // @Method(modid = "theoneprobe") + // public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) + public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo probeInfo, Player player, Level world, BlockState blockState, IProbeHitData data) { return false; } - // @Method(modid = "theoneprobe") -// public String getID() - public ResourceLocation getID() - { + // @Method(modid = "theoneprobe") + // public String getID() + public ResourceLocation getID() { // return "buildcraftcompat.top"; return new ResourceLocation("buildcraftcompat.top"); } - // @Method(modid = "theoneprobe") + // @Method(modid = "theoneprobe") // public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) - public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, Player player, Level world, BlockState blockState, IProbeHitData data) - { + public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, Player player, Level world, BlockState blockState, IProbeHitData data) { ResourceLocation blockRegistryName = blockState.getBlock().getRegistryName(); - if (blockRegistryName != null && BCModules.isBcMod(blockRegistryName.getNamespace())) - { + if (blockRegistryName != null && BCModules.isBcMod(blockRegistryName.getNamespace())) { BlockEntity entity = world.getBlockEntity(data.getPos()); - if (entity instanceof IAutoCraft) - { + if (entity instanceof IAutoCraft) { this.addAutoCraftInfo(probeInfo, (IAutoCraft) entity); } - if (entity instanceof ILaserTarget) - { + if (entity instanceof ILaserTarget) { this.addLaserTargetInfo(probeInfo, (ILaserTarget) entity); } - if (entity instanceof IAssemblyCraft) - { + if (entity instanceof IAssemblyCraft) { this.addAssemblyInfo(probeInfo, (IAssemblyCraft) entity); } } } - // @Method(modid = "theoneprobe") - private void addAutoCraftInfo(IProbeInfo probeInfo, IAutoCraft crafter) - { - if (!crafter.getCurrentRecipeOutput().isEmpty()) - { + // @Method(modid = "theoneprobe") + private void addAutoCraftInfo(IProbeInfo probeInfo, IAutoCraft crafter) { + if (!crafter.getCurrentRecipeOutput().isEmpty()) { IProbeInfo mainInfo = probeInfo.vertical(); // mainInfo.horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)).text("Making: ").item(crafter.getCurrentRecipeOutput()); mainInfo.horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)).text(new TranslatableComponent("buildcraft.waila.crafting")).item(crafter.getCurrentRecipeOutput()); @@ -94,39 +81,30 @@ private void addAutoCraftInfo(IProbeInfo probeInfo, IAutoCraft crafter) IProbeInfo info = mainInfo.horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)).text(new TranslatableComponent("buildcraft.waila.crafting_from")); List stacks = CompatUtils.compactInventory(crafter.getInvBlueprint()); - for (ItemStack stack : stacks) - { + for (ItemStack stack : stacks) { info.item(stack); } - } - else - { + } else { IProbeInfo mainInfo = probeInfo.vertical(); mainInfo.horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)).text(new TranslatableComponent("buildcraft.waila.no_recipe")); } } - // @Method(modid = "theoneprobe") - private void addLaserTargetInfo(IProbeInfo probeInfo, ILaserTarget laserTarget) - { + // @Method(modid = "theoneprobe") + private void addLaserTargetInfo(IProbeInfo probeInfo, ILaserTarget laserTarget) { long power = laserTarget.getRequiredLaserPower(); - if (power > 0L) - { + if (power > 0L) { // probeInfo.horizontal().text(TextFormatting.WHITE + "Waiting from laser: ").text(TextFormatting.AQUA + MjAPI.formatMj(power)).text(TextFormatting.AQUA + "MJ"); probeInfo.horizontal().text(new TranslatableComponent("buildcraft.waila.waiting_for_laser", MjAPI.formatMj(power))); } } - private void addAssemblyInfo(IProbeInfo probeInfo, IAssemblyCraft assembly) - { + private void addAssemblyInfo(IProbeInfo probeInfo, IAssemblyCraft assembly) { ItemStack result = assembly.getAssemblyResult(); - if (!result.isEmpty()) - { + if (!result.isEmpty()) { probeInfo.horizontal().text(new TranslatableComponent("buildcraft.waila.crafting")).item(result); - } - else - { + } else { IProbeInfo mainInfo = probeInfo.vertical(); mainInfo.horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)).text(new TranslatableComponent("buildcraft.waila.no_recipe")); } diff --git a/common/buildcraft/compat/module/theoneprobe/CompatModuleTheOneProbe.java b/common/buildcraft/compat/module/theoneprobe/CompatModuleTheOneProbe.java index cd32afe..a6210ba 100644 --- a/common/buildcraft/compat/module/theoneprobe/CompatModuleTheOneProbe.java +++ b/common/buildcraft/compat/module/theoneprobe/CompatModuleTheOneProbe.java @@ -1,25 +1,17 @@ package buildcraft.compat.module.theoneprobe; import buildcraft.compat.CompatModuleBase; -import mcjty.theoneprobe.api.ITheOneProbe; import net.minecraftforge.fml.InterModComms; -import java.util.function.Function; -import java.util.function.Supplier; - -public class CompatModuleTheOneProbe extends CompatModuleBase -{ - public CompatModuleTheOneProbe() - { +public class CompatModuleTheOneProbe extends CompatModuleBase { + public CompatModuleTheOneProbe() { } - public String compatModId() - { + public String compatModId() { return "theoneprobe"; } - public void preInit() - { + public void preInit() { // FMLInterModComms.sendFunctionMessage(this.compatModId(), "getTheOneProbe", "buildcraft.compat.module.theoneprobe.BCPluginTOP"); InterModComms.sendTo(this.compatModId(), "getTheOneProbe", () -> BCPluginTOP.INSTANCE); } diff --git a/common/buildcraft/compat/module/waila/AssemblyCraftDataProvider.java b/common/buildcraft/compat/module/waila/AssemblyCraftDataProvider.java index dda7737..8aa2a95 100644 --- a/common/buildcraft/compat/module/waila/AssemblyCraftDataProvider.java +++ b/common/buildcraft/compat/module/waila/AssemblyCraftDataProvider.java @@ -15,23 +15,17 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.phys.Vec2; -public class AssemblyCraftDataProvider -{ - static class BodyProvider extends BaseWailaDataProvider.BodyProvider - { +public class AssemblyCraftDataProvider { + static class BodyProvider extends BaseWailaDataProvider.BodyProvider { @Override - public void getWailaBody(ITooltip currentTip, BlockAccessor accessor, IPluginConfig iPluginConfig) - { + public void getWailaBody(ITooltip currentTip, BlockAccessor accessor, IPluginConfig iPluginConfig) { BlockEntity tile = accessor.getBlockEntity(); - if (tile instanceof IAssemblyCraft) - { + if (tile instanceof IAssemblyCraft) { // CompoundTag nbt = accessor.getNBTData(); CompoundTag nbt = accessor.getServerData(); - if (nbt.contains("recipe_result", Tag.TAG_COMPOUND)) - { + if (nbt.contains("recipe_result", Tag.TAG_COMPOUND)) { ItemStack recipe_result = ItemStack.of(nbt.getCompound("recipe_result")); - if (!recipe_result.isEmpty()) - { + if (!recipe_result.isEmpty()) { currentTip.add(new TranslatableComponent("buildcraft.waila.crafting")); currentTip.append(ItemStackElement.of(recipe_result)); // Calen: an empty line because the item icon is 2 lines height @@ -42,20 +36,16 @@ public void getWailaBody(ITooltip currentTip, BlockAccessor accessor, IPluginCon } currentTip.add(new TranslatableComponent("buildcraft.waila.no_recipe")); } -// else -// { +// else { // currentTip.add(new TextComponent(ChatFormatting.RED + "{wrong tile entity}")); // } } } - static class NBTProvider extends BaseWailaDataProvider.NBTProvider - { + static class NBTProvider extends BaseWailaDataProvider.NBTProvider { @Override - public void getNBTData(CompoundTag nbt, ServerPlayer player, Level world, BlockEntity tile, boolean showDetails) - { - if (tile instanceof IAssemblyCraft assembly) - { + public void getNBTData(CompoundTag nbt, ServerPlayer player, Level world, BlockEntity tile, boolean showDetails) { + if (tile instanceof IAssemblyCraft assembly) { nbt.put("recipe_result", assembly.getAssemblyResult().serializeNBT()); } } diff --git a/common/buildcraft/compat/module/waila/AutoCraftDataProvider.java b/common/buildcraft/compat/module/waila/AutoCraftDataProvider.java index 5c98863..adb365e 100644 --- a/common/buildcraft/compat/module/waila/AutoCraftDataProvider.java +++ b/common/buildcraft/compat/module/waila/AutoCraftDataProvider.java @@ -19,68 +19,53 @@ import java.util.List; -public class AutoCraftDataProvider -{ +public class AutoCraftDataProvider { - static class BodyProvider extends BaseWailaDataProvider.BodyProvider - { + static class BodyProvider extends BaseWailaDataProvider.BodyProvider { @Override - public void getWailaBody(ITooltip currentTip, BlockAccessor accessor, IPluginConfig iPluginConfig) - { + public void getWailaBody(ITooltip currentTip, BlockAccessor accessor, IPluginConfig iPluginConfig) { BlockEntity tile = accessor.getBlockEntity(); - if (tile instanceof IAutoCraft) - { + if (tile instanceof IAutoCraft) { CompoundTag nbt = accessor.getServerData(); - if (nbt.contains("recipe_result", Tag.TAG_COMPOUND)) - { + if (nbt.contains("recipe_result", Tag.TAG_COMPOUND)) { // Calen: add -> create new line / append -> append at the last line ItemStack result = ItemStack.of(nbt.getCompound("recipe_result")); currentTip.add(new TranslatableComponent("buildcraft.waila.crafting")); currentTip.append(ItemStackElement.of(result)); - // Calen: an empty line because the item icon is 2 lines height + // Calen: an empty line, because the item icon is 2 lines height // if ItemStackElement.of(result, 0.5F), the count text of the stack will not scale currentTip.add(new SpacerElement(new Vec2(0, 5))); - if (nbt.contains("recipe_inputs", Tag.TAG_LIST)) - { + if (nbt.contains("recipe_inputs", Tag.TAG_LIST)) { ListTag list = nbt.getList("recipe_inputs", Tag.TAG_COMPOUND); currentTip.add(new TranslatableComponent("buildcraft.waila.crafting_from")); - for (int index = 0; index < list.size(); ++index) - { + for (int index = 0; index < list.size(); ++index) { CompoundTag compound = list.getCompound(index); currentTip.append(ItemStackElement.of(ItemStack.of(compound))); } currentTip.add(new SpacerElement(new Vec2(0, 5))); } - } - else - { + } else { currentTip.add(new TranslatableComponent("buildcraft.waila.no_recipe")); } } -// else -// { +// else { // currentTip.add(new TextComponent(ChatFormatting.RED + "{wrong tile entity}")); // } } } - static class NBTProvider extends BaseWailaDataProvider.NBTProvider - { + static class NBTProvider extends BaseWailaDataProvider.NBTProvider { @Override - public void getNBTData(CompoundTag nbt, ServerPlayer player, Level world, BlockEntity tile, boolean showDetails) - { - if (tile instanceof IAutoCraft auto) - { + public void getNBTData(CompoundTag nbt, ServerPlayer player, Level world, BlockEntity tile, boolean showDetails) { + if (tile instanceof IAutoCraft auto) { ItemStack output = auto.getCurrentRecipeOutput(); - if (!output.isEmpty()) - { + if (!output.isEmpty()) { nbt.put("recipe_result", output.serializeNBT()); List stacks = CompatUtils.compactInventory(auto.getInvBlueprint()); ListTag list = new ListTag(); - for (int index = 0; index < stacks.size(); ++index) - { + for (int index = 0; index < stacks.size(); ++index) { list.add((stacks.get(index)).serializeNBT()); } diff --git a/common/buildcraft/compat/module/waila/BCPluginJade.java b/common/buildcraft/compat/module/waila/BCPluginJade.java index 411e54e..e2febe8 100644 --- a/common/buildcraft/compat/module/waila/BCPluginJade.java +++ b/common/buildcraft/compat/module/waila/BCPluginJade.java @@ -5,13 +5,11 @@ import mcp.mobius.waila.api.*; @WailaPlugin -public class BCPluginJade implements IWailaPlugin -{ - // Calen: in 1.18.2 here should use Block or TE class instead of interface, it's too difficult to get all matched if allowing some BC modules absent, +public class BCPluginJade implements IWailaPlugin { + // Calen: in 1.18.2 we should use Block or TE class instead of interface here, it's too difficult to get all matched if allowing some BC modules absent, // so just use TileBC_Neptune and BlockBCTile_Neptune @Override - public void register(IWailaCommonRegistration registrar) - { + public void register(IWailaCommonRegistration registrar) { IServerDataProvider autoCraftNbtProvider = new AutoCraftDataProvider.NBTProvider(); IServerDataProvider laserTargetNbtProvider = new LaserTargetDataProvider.NBTProvider(); IServerDataProvider assemblyCraftNbtProvider = new AssemblyCraftDataProvider.NBTProvider(); @@ -19,23 +17,10 @@ public void register(IWailaCommonRegistration registrar) registrar.registerBlockDataProvider(autoCraftNbtProvider, TileBC_Neptune.class); registrar.registerBlockDataProvider(laserTargetNbtProvider, TileBC_Neptune.class); registrar.registerBlockDataProvider(assemblyCraftNbtProvider, TileBC_Neptune.class); - -// for (Block b : ForgeRegistries.BLOCKS.getValues()) -// for (BlockEntityType tet : ForgeRegistries.BLOCK_ENTITIES.getValues()) -// { -// isTeClassOfTileEntityExtends(tet, IAutoCraft.class).ifPresent(c -> registrar.registerBlockDataProvider(autoCraftNbtProvider, c)); -// isTeClassOfTileEntityExtends(tet, ILaserTarget.class).ifPresent(c -> registrar.registerBlockDataProvider(laserTargetNbtProvider, c)); -// isTeClassOfTileEntityExtends(tet, IAssemblyCraft.class).ifPresent(c -> registrar.registerBlockDataProvider(assemblyCraftNbtProvider, c)); -// -//// isTeClassOfBlockExtends(b, IAutoCraft.class).ifPresent(c -> registrar.registerBlockDataProvider(autoCraftNbtProvider, c)); -//// isTeClassOfBlockExtends(b, ILaserTarget.class).ifPresent(c -> registrar.registerBlockDataProvider(laserTargetNbtProvider, c)); -//// isTeClassOfBlockExtends(b, IAssemblyCraft.class).ifPresent(c -> registrar.registerBlockDataProvider(assemblyCraftNbtProvider, c)); -// } } @Override - public void registerClient(IWailaClientRegistration registrar) - { + public void registerClient(IWailaClientRegistration registrar) { IComponentProvider autoCraftBodyProvider = new AutoCraftDataProvider.BodyProvider(); IComponentProvider laserTargetBodyProvider = new LaserTargetDataProvider.BodyProvider(); IComponentProvider assemblyCraftBodyProvider = new AssemblyCraftDataProvider.BodyProvider(); @@ -43,124 +28,5 @@ public void registerClient(IWailaClientRegistration registrar) registrar.registerComponentProvider(autoCraftBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); registrar.registerComponentProvider(laserTargetBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); registrar.registerComponentProvider(assemblyCraftBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); - -//// for (Block b : ForgeRegistries.BLOCKS.getValues()) -// for (BlockEntityType tet : ForgeRegistries.BLOCK_ENTITIES.getValues()) -// { -//// isTeClassOfBlockExtends(b, IAutoCraft.class).ifPresent(c -> registrar.registerComponentProvider(autoCraftBodyProvider, TooltipPosition.BODY, b.getClass())); -//// isTeClassOfBlockExtends(b, ILaserTarget.class).ifPresent(c -> registrar.registerComponentProvider(laserTargetBodyProvider, TooltipPosition.BODY, b.getClass())); -//// isTeClassOfBlockExtends(b, IAssemblyCraft.class).ifPresent(c -> registrar.registerComponentProvider(assemblyCraftBodyProvider, TooltipPosition.BODY, b.getClass())); -// -// isTeClassOfTileEntityExtends(tet, IAutoCraft.class).ifPresent(c -> -// tet.validBlocks.forEach(b -> -// registrar.registerComponentProvider(autoCraftBodyProvider, TooltipPosition.BODY, b.getClass()) -// ) -// ); -// isTeClassOfTileEntityExtends(tet, ILaserTarget.class).ifPresent(c -> -// tet.validBlocks.forEach(b -> -// registrar.registerComponentProvider(laserTargetBodyProvider, TooltipPosition.BODY, b.getClass()) -// ) -// ); -// isTeClassOfTileEntityExtends(tet, IAssemblyCraft.class).ifPresent(c -> -// tet.validBlocks.forEach(b -> -// registrar.registerComponentProvider(assemblyCraftBodyProvider, TooltipPosition.BODY, b.getClass()) -// ) -// ); -// -//// if (((ParameterizedType) tet.getClass().getGenericSuperclass()).getActualTypeArguments()[0] instanceof Class tec && IAutoCraft.class.isAssignableFrom(tec)) -//// { -//// tet.validBlocks.forEach(b -> registrar.registerComponentProvider(autoCraftBodyProvider, TooltipPosition.BODY, ((Block) b).getClass())); -//// } -//// if (((ParameterizedType) tet.getClass().getGenericSuperclass()).getActualTypeArguments()[0] instanceof Class tec && ILaserTarget.class.isAssignableFrom(tec)) -//// { -//// tet.validBlocks.forEach(b -> registrar.registerComponentProvider(laserTargetBodyProvider, TooltipPosition.BODY, ((Block) b).getClass())); -//// } -//// if (((ParameterizedType) tet.getClass().getGenericSuperclass()).getActualTypeArguments()[0] instanceof Class tec && IAssemblyCraft.class.isAssignableFrom(tec)) -//// { -//// tet.validBlocks.forEach(b -> registrar.registerComponentProvider(assemblyCraftBodyProvider, TooltipPosition.BODY, ((Block) b).getClass())); -//// } -// } } - -// private List> getAllClassesHasAnnotation(Class annotation) -// { -// List classNames = (List) ModList.get().getAllScanData().stream().flatMap(($) -> -// { -// return $.getAnnotations().stream(); -// }).filter(($) -> -// { -// if ($.annotationType().getClassName().equals(annotation.getName())) -// { -// String required = (String) $.annotationData().getOrDefault("value", ""); -// if (required.isEmpty() || ModList.get().isLoaded(required)) -// { -// return true; -// } -// } -// -// return false; -// }).map(ModFileScanData.AnnotationData::memberName).collect(Collectors.toList()); -// -// for (String className : classNames) -// { -// BCLog.logger.info("Starting looking fo c"); -// -// try -// { -// Class clazz = Class.forName(className); -// if (IWailaPlugin.class.isAssignableFrom(clazz)) -// { -// IWailaPlugin plugin = (IWailaPlugin) clazz.getDeclaredConstructor().newInstance(); -// plugin.register(WailaRegistrar.INSTANCE); -// plugin.register(WailaCommonRegistration.INSTANCE); -// if (FMLEnvironment.dist.isClient()) -// { -// plugin.registerClient(WailaClientRegistration.INSTANCE); -// } -// } -// } -// catch (Throwable var7) -// { -// LOGGER.error("Error loading plugin at {}", className, var7); -// } -// } -// -// } - -// private LazyOptional isTeClassOfTileEntityExtends(BlockEntityType tet, Class typeToMatch) -// { -// -// Class tec = ((Class) ((ParameterizedType) tet.factory.getClass().getGenericSuperclass()).getActualTypeArguments()[0]); -// if (typeToMatch.isAssignableFrom(tec)) -// { -// return LazyOptional.of(() -> tec); -// } -// return LazyOptional.empty(); -// } - -// private LazyOptional isTeClassOfBlockExtends(Block b, Class typeToMatch) -// { -// if (b instanceof EntityBlock) -// { -// Class c = getTileEntityClassOfBlock(b); -// if (c != null && typeToMatch.isAssignableFrom(c)) -// { -// return LazyOptional.of(() -> c); -// } -// } -// return LazyOptional.empty(); -// } -// -// private Class getTileEntityClassOfBlock(Block b) -// { -// if (b.getClass().getGenericSuperclass() instanceof ParameterizedType parameterizedType) -// { -// Type[] types = parameterizedType.getActualTypeArguments(); -// if (types.length != 0 && types[0] instanceof Class tec) -// { -// return tec; -// } -// } -// return null; -// } } diff --git a/common/buildcraft/compat/module/waila/BaseWailaDataProvider.java b/common/buildcraft/compat/module/waila/BaseWailaDataProvider.java index 945d117..ebf7a6c 100644 --- a/common/buildcraft/compat/module/waila/BaseWailaDataProvider.java +++ b/common/buildcraft/compat/module/waila/BaseWailaDataProvider.java @@ -11,28 +11,23 @@ import net.minecraft.world.level.block.entity.BlockEntity; //class BaseWailaDataProvider implements IWailaDataProvider -interface BaseWailaDataProvider -{ +public interface BaseWailaDataProvider { - static abstract class BodyProvider implements IComponentProvider - { + static abstract class BodyProvider implements IComponentProvider { @Override - public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) - { + public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) { getWailaBody(iTooltip, blockAccessor, iPluginConfig); } abstract void getWailaBody(ITooltip iTooltip, BlockAccessor accessor, IPluginConfig iPluginConfig); } - static abstract class NBTProvider implements IServerDataProvider - { + static abstract class NBTProvider implements IServerDataProvider { @Override - public void appendServerData(CompoundTag tag, ServerPlayer player, Level blockAccessor, BlockEntity blockEntity, boolean showDetails) - { + public void appendServerData(CompoundTag tag, ServerPlayer player, Level blockAccessor, BlockEntity blockEntity, boolean showDetails) { getNBTData(tag, player, blockAccessor, blockEntity, showDetails); } abstract void getNBTData(CompoundTag tag, ServerPlayer player, Level blockAccessor, BlockEntity blockEntity, boolean showDetails); } -} \ No newline at end of file +} diff --git a/common/buildcraft/compat/module/waila/LaserTargetDataProvider.java b/common/buildcraft/compat/module/waila/LaserTargetDataProvider.java index 9706f19..4178106 100644 --- a/common/buildcraft/compat/module/waila/LaserTargetDataProvider.java +++ b/common/buildcraft/compat/module/waila/LaserTargetDataProvider.java @@ -2,7 +2,6 @@ import buildcraft.api.mj.ILaserTarget; import buildcraft.api.mj.MjAPI; - import mcp.mobius.waila.api.BlockAccessor; import mcp.mobius.waila.api.ITooltip; import mcp.mobius.waila.api.config.IPluginConfig; @@ -13,41 +12,31 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; -abstract class LaserTargetDataProvider -{ +abstract class LaserTargetDataProvider { - static class BodyProvider extends BaseWailaDataProvider.BodyProvider - { + static class BodyProvider extends BaseWailaDataProvider.BodyProvider { @Override - public void getWailaBody(ITooltip currentTip, BlockAccessor accessor, IPluginConfig iPluginConfig) - { + public void getWailaBody(ITooltip currentTip, BlockAccessor accessor, IPluginConfig iPluginConfig) { BlockEntity tile = accessor.getBlockEntity(); - if (tile instanceof ILaserTarget) - { + if (tile instanceof ILaserTarget) { CompoundTag nbt = accessor.getServerData(); - if (nbt.contains("required_power", Tag.TAG_LONG)) - { + if (nbt.contains("required_power", Tag.TAG_LONG)) { long power = nbt.getLong("required_power"); - if (power > 0L) - { + if (power > 0L) { currentTip.add(new TranslatableComponent("buildcraft.waila.waiting_for_laser", MjAPI.formatMj(power))); } } } -// else -// { +// else { // currentTip.add(new TextComponent(ChatFormatting.RED + "{wrong tile entity}")); // } } } - static class NBTProvider extends BaseWailaDataProvider.NBTProvider - { + static class NBTProvider extends BaseWailaDataProvider.NBTProvider { @Override - public void getNBTData(CompoundTag nbt, ServerPlayer player, Level world, BlockEntity tile, boolean showDetails) - { - if (tile instanceof ILaserTarget target) - { + public void getNBTData(CompoundTag nbt, ServerPlayer player, Level world, BlockEntity tile, boolean showDetails) { + if (tile instanceof ILaserTarget target) { nbt.putLong("required_power", target.getRequiredLaserPower()); } } diff --git a/common/buildcraft/compat/network/IGuiCreator.java b/common/buildcraft/compat/network/IGuiCreator.java index 5f8134e..7897365 100644 --- a/common/buildcraft/compat/network/IGuiCreator.java +++ b/common/buildcraft/compat/network/IGuiCreator.java @@ -1,12 +1,13 @@ package buildcraft.compat.network; -import javax.annotation.Nullable; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import javax.annotation.Nullable; + public interface IGuiCreator { Enum getGuiType(); From 60c5da6caaec9d022883946993b40a3230e0c080 Mon Sep 17 00:00:00 2001 From: LRW-Calen Date: Sat, 25 May 2024 16:19:46 +0800 Subject: [PATCH 06/15] Switched submodule links and updated mods.toml --- .gitmodules | 2 +- build.gradle | 1 + mod_info/META-INF/mods.toml | 151 ++++++++++++++++++++++++++++++++++++ 3 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 mod_info/META-INF/mods.toml diff --git a/.gitmodules b/.gitmodules index 1664b23..a0e241a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "BuildCraft"] path = BuildCraft - url = https://github.com/BuildCraft/BuildCraft.git + url = https://github.com/LRW-Calen/BuildCraft.git branch = 8.0.x-1.18.2 diff --git a/build.gradle b/build.gradle index 92092c8..904fd29 100755 --- a/build.gradle +++ b/build.gradle @@ -184,6 +184,7 @@ sourceSets { } resources { srcDir "resources" + srcDir "mod_info" srcDir "BuildCraft/buildcraft_resources" srcDir 'BuildCraft/buildcraft_resources_generated' srcDir "BuildCraft/BuildCraft-Localization" diff --git a/mod_info/META-INF/mods.toml b/mod_info/META-INF/mods.toml new file mode 100644 index 0000000..bbbd345 --- /dev/null +++ b/mod_info/META-INF/mods.toml @@ -0,0 +1,151 @@ +modLoader="javafml" +loaderVersion="[32,)" +license="Minecraft Mod Public License" +issueTrackerURL="" +[[mods]] +modId="buildcraftlib" +displayName="BuildCraft Lib" +version="7.99.24.9" +description="Library mod used by buildcraft." +credits="Created by SpaceToad" +logoFile="logo.png" +displayURL="http://www.mod-buildcraft.com/" +updateJSONURL="" +authors="SpaceToad, BuildCraft Team" + +[[mods]] +modId="buildcraftcore" +displayName="BuildCraft" +version="7.99.24.9" +description="Extending Minecraft with pipes, auto-crafting, quarries, engines and much more!" +credits="Created by SpaceToad" +logoFile="logo.png" +displayURL="http://www.mod-buildcraft.com/" +updateJSONURL="" +authors="SpaceToad, BuildCraft Team" + +[[mods]] +modId="buildcraftbuilders" +displayName="BuildCraft Builders" +version="7.99.24.9" +description="Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Builders Component)" +credits="Created by SpaceToad" +logoFile="logo.png" +displayURL="http://www.mod-buildcraft.com/" +updateJSONURL="" +authors="SpaceToad, BuildCraft Team" + +[[mods]] +modId="buildcraftenergy" +displayName="BuildCraft Energy" +version="7.99.24.9" +description="Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Energy Component)" +credits="Created by SpaceToad" +logoFile="logo.png" +displayURL="http://www.mod-buildcraft.com/" +updateJSONURL="" +authors="SpaceToad, BuildCraft Team" + +[[mods]] +modId="buildcraftfactory" +displayName="BuildCraft Factory" +version="7.99.24.9" +description="Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Factory Component)" +credits="Created by SpaceToad" +logoFile="logo.png" +displayURL="http://www.mod-buildcraft.com/" +updateJSONURL="" +authors="SpaceToad, BuildCraft Team" + +[[mods]] +modId="buildcraftsilicon" +displayName="BuildCraft Silicon" +version="7.99.24.9" +description="Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Silicon Component)" +credits="Created by SpaceToad" +logoFile="logo.png" +displayURL="http://www.mod-buildcraft.com/" +updateJSONURL="" +authors="SpaceToad, BuildCraft Team" + +[[mods]] +modId="buildcrafttransport" +displayName="BuildCraft Transport" +version="7.99.24.9" +description="Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Transport Component)" +credits="Created by SpaceToad" +logoFile="logo.png" +displayURL="http://www.mod-buildcraft.com/" +updateJSONURL="" +authors="SpaceToad, BuildCraft Team" + +[[mods]] +modId="buildcraftrobotics" +displayName="BuildCraft Robotics" +version="7.99.24.9" +description="Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Robotics Component)" +credits="Created by SpaceToad" +logoFile="logo.png" +displayURL="http://www.mod-buildcraft.com/" +updateJSONURL="" +authors="SpaceToad, BuildCraft Team" + +[[mods]] +modId="buildcraftcompat" +displayName="BuildCraft Compat" +version="7.99.24.9" +description="Compatibility add-on for BuildCraft" +credits="Created by asie" +logoFile="logo.png" +displayURL="http://www.mod-buildcraft.com/" +updateJSONURL="" +authors="BuildCraft Team" + +[[dependencies.buildcraftcore]] + modId="forge" + mandatory=true + versionRange="[40,)" + ordering="NONE" + side="BOTH" +[[dependencies.buildcraftcore]] + modId="minecraft" + mandatory=true + versionRange="[1.18,1.19)" + ordering="NONE" + side="BOTH" +[[dependencies.buildcraftcore]] + modId="buildcraftlib" + mandatory=true + versionRange="[0.0.0,)" + ordering="AFTER" + side="BOTH" +[[dependencies.buildcraftenergy]] + modId="buildcraftcore" + mandatory=true + versionRange="[0.0.0,)" + ordering="AFTER" + side="BOTH" +[[dependencies.buildcraftbuilders]] + modId="buildcraftcore" + mandatory=true + versionRange="[0.0.0,)" + ordering="AFTER" + side="BOTH" +[[dependencies.buildcrafttransport]] + modId="buildcraftcore" + mandatory=true + versionRange="[0.0.0,)" + ordering="AFTER" + side="BOTH" +[[dependencies.buildcraftrobotics]] + modId="buildcraftcore" + mandatory=true + versionRange="[0.0.0,)" + ordering="AFTER" + side="BOTH" +[[dependencies.buildcraftcompat]] + modId="buildcraftcore" + mandatory=true + versionRange="[0.0.0,)" + ordering="AFTER" + side="BOTH" From 6402d18e67f687e1337e28b70b609e1ccc21eb2b Mon Sep 17 00:00:00 2001 From: LRW-Calen Date: Sat, 25 May 2024 17:00:26 +0800 Subject: [PATCH 07/15] Updated submodule --- BuildCraft | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildCraft b/BuildCraft index 656b0a0..8912c22 160000 --- a/BuildCraft +++ b/BuildCraft @@ -1 +1 @@ -Subproject commit 656b0a00a04bf61ebd9f39f6c3e44eac2818b1ec +Subproject commit 8912c22dbbab8af5aad18931c649959cf3d88a67 From 8d88a903008425122ac18328b60d78e0b51ace2e Mon Sep 17 00:00:00 2001 From: LRW-Calen Date: Sat, 25 May 2024 17:33:19 +0800 Subject: [PATCH 08/15] Updated submodule --- BuildCraft | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildCraft b/BuildCraft index 8912c22..db6889b 160000 --- a/BuildCraft +++ b/BuildCraft @@ -1 +1 @@ -Subproject commit 8912c22dbbab8af5aad18931c649959cf3d88a67 +Subproject commit db6889b48c32def7b6aa180149746957726be2f9 From f8e5748f8127e9774b9e8706e806fadd19c506ee Mon Sep 17 00:00:00 2001 From: LRW-Calen Date: Sun, 2 Jun 2024 00:03:37 +0800 Subject: [PATCH 09/15] Updated submodule --- .gitmodules | 2 +- BuildCraft | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index a0e241a..fd83d87 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "BuildCraft"] path = BuildCraft - url = https://github.com/LRW-Calen/BuildCraft.git + url = https://github.com/CalenXwX/BuildCraft.git branch = 8.0.x-1.18.2 diff --git a/BuildCraft b/BuildCraft index db6889b..776118e 160000 --- a/BuildCraft +++ b/BuildCraft @@ -1 +1 @@ -Subproject commit db6889b48c32def7b6aa180149746957726be2f9 +Subproject commit 776118e4049aee30fa576e6604a889a33a81f977 From 619cab51c77edbbf0e13e2e37e49ac695f85630a Mon Sep 17 00:00:00 2001 From: CalenXwX Date: Tue, 17 Dec 2024 17:43:51 +0800 Subject: [PATCH 10/15] Added BlockPowerConvertor & updated gitsubmodule --- common/buildcraft/compat/BCCompat.java | 96 +++++- common/buildcraft/compat/BCCompatBlocks.java | 23 ++ common/buildcraft/compat/CompatUtils.java | 6 +- .../datagen/BCCompatDataGenerators.java | 23 ++ .../datagen/CompatBlockStateGenerator.java | 28 ++ .../datagen/CompatItemModelGenerator.java | 20 ++ .../module/crafttweaker/AssemblyTable.java | 2 +- .../CompatModuleCraftTweaker.java | 1 - .../module/forge/BlockPowerConvertor.java | 17 ++ .../module/forge/TilePowerConvertor.java | 276 ++++++++++++++++++ .../module/jei/factory/CategoryCoolable.java | 1 + .../module/jei/gui/GuiHandlerBuildCraft.java | 3 +- .../jei/silicon/CategoryIntegrationTable.java | 2 + .../{BCPluginJade.java => HWYLAPlugin.java} | 13 +- .../module/waila/MjStorageDataProvider.java | 58 ++++ .../assets/buildcraftcompat/lang/en_us.json | 3 + .../assets/buildcraftcompat/lang/zh_cn.json | 3 + 17 files changed, 553 insertions(+), 22 deletions(-) create mode 100644 common/buildcraft/compat/BCCompatBlocks.java create mode 100644 common/buildcraft/compat/datagen/BCCompatDataGenerators.java create mode 100644 common/buildcraft/compat/datagen/CompatBlockStateGenerator.java create mode 100644 common/buildcraft/compat/datagen/CompatItemModelGenerator.java create mode 100644 common/buildcraft/compat/module/forge/BlockPowerConvertor.java create mode 100644 common/buildcraft/compat/module/forge/TilePowerConvertor.java rename common/buildcraft/compat/module/waila/{BCPluginJade.java => HWYLAPlugin.java} (63%) create mode 100644 common/buildcraft/compat/module/waila/MjStorageDataProvider.java diff --git a/common/buildcraft/compat/BCCompat.java b/common/buildcraft/compat/BCCompat.java index c1fd709..21959fc 100644 --- a/common/buildcraft/compat/BCCompat.java +++ b/common/buildcraft/compat/BCCompat.java @@ -1,20 +1,30 @@ package buildcraft.compat; +import buildcraft.api.BCModules; import buildcraft.api.core.BCLog; import buildcraft.compat.module.crafttweaker.CompatModuleCraftTweaker; import buildcraft.compat.module.ic2.CompatModuleIndustrialCraft2; import buildcraft.compat.module.theoneprobe.CompatModuleTheOneProbe; -import buildcraft.core.BCCoreConfig; +import buildcraft.core.BCCore; +import buildcraft.lib.config.BCConfig; +import buildcraft.lib.config.Configuration; import buildcraft.lib.config.EnumRestartRequirement; +import buildcraft.lib.registry.RegistryConfig; +import buildcraft.lib.registry.TagManager; +import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.common.ForgeConfigSpec.BooleanValue; import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.ModContainer; +import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLConstructModEvent; import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import java.util.HashMap; import java.util.Map; +import java.util.function.Consumer; //@Mod( // modid = "buildcraftcompat", @@ -24,7 +34,7 @@ // acceptedMinecraftVersions = "[1.12.2]", // dependencies = "required-after:forge@[14.23.0.2544,);required-after:buildcraftcore@[7.99.24.8,);after:buildcrafttransport;after:buildcraftbuilders;after:buildcraftsilicon;after:theoneprobe;after:forestry;after:crafttweaker;after:ic2" //) -@Mod(BCCompat.MOD_ID) +@Mod(BCCompat.MODID) @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class BCCompat { static final String DEPENDENCIES = "required-after:forge@(gradle_replace_forgeversion,)"// @@ -37,7 +47,7 @@ public class BCCompat { + ";after:crafttweaker"// + ";after:ic2"// ; - public static final String MOD_ID = "buildcraftcompat"; + public static final String MODID = "buildcraftcompat"; public static final String VERSION = "$version"; public static final String GIT_BRANCH = "${git_branch}"; public static final String GIT_COMMIT_HASH = "${git_commit_hash}"; @@ -47,6 +57,9 @@ public class BCCompat { // @Instance(MOD_ID) public static BCCompat instance; private static final Map modules = new HashMap<>(); + private static final Map moduleConfigs = new HashMap<>(); + + public static Configuration config; public BCCompat() { instance = this; @@ -56,19 +69,20 @@ private static void offerAndPreInitModule(CompatModuleBase module) { String cModId = module.compatModId(); if (module.canLoad()) { String _modules = "modules"; - BooleanValue prop = BCCoreConfig.config + BooleanValue prop = config .define(_modules, "", EnumRestartRequirement.NONE, cModId, true); - BCCoreConfig.config.build(); - if (prop.get()) { - modules.put(cModId, module); - BCLog.logger.info("[compat] + " + cModId); - module.preInit(); - } else { - BCLog.logger.info("[compat] x " + cModId + " (It has been disabled in the config)"); - } + modules.put(cModId, module); + moduleConfigs.put(cModId, prop); +// if (prop.get()) { +// modules.put(cModId, module); +// BCLog.logger.info("[compat] + " + cModId); +// module.preInit(); +// } else { +// BCLog.logger.info("[compat] x " + cModId + " (It has been disabled in the config)"); +// } } else { BCLog.logger.info("[compat] x " + cModId + " (It cannot load)"); } @@ -76,6 +90,15 @@ private static void offerAndPreInitModule(CompatModuleBase module) { @SubscribeEvent public static void preInit(FMLConstructModEvent evt) { + // Calen for block and item register + RegistryConfig.useOtherModConfigFor(MODID, BCCore.MODID); + + // Start config + BCModules module = BCModules.COMPAT; + ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder(); + config = new Configuration(builder, module); + + // init BCLog.logger.info(""); BCLog.logger.info("Starting BuildCraftCompat " + VERSION); BCLog.logger.info("Copyright (c) the BuildCraft team, 2011-2017"); @@ -97,10 +120,34 @@ public static void preInit(FMLConstructModEvent evt) { offerAndPreInitModule(new CompatModuleCraftTweaker()); offerAndPreInitModule(new CompatModuleIndustrialCraft2()); // End of module list + + // Finalize config + ForgeConfigSpec spec = config.build(); + ModContainer container = ModList.get().getModContainerById(module.getModId()).get(); + container.addConfig(new ModConfig(ModConfig.Type.COMMON, spec, container, config.getFileName())); + + // Calen + BCCompatBlocks.fmlPreInit(); + } + + /** This is called after config loaded. */ + private static void loadModules() { + modules.entrySet().forEach(entry -> + { + String cModId = entry.getKey(); + CompatModuleBase module = entry.getValue(); + if (moduleConfigs.get(cModId).get()) { + BCLog.logger.info("[compat] + " + cModId); + module.preInit(); + } else { + BCLog.logger.info("[compat] x " + cModId + " (It has been disabled in the config)"); + } + }); } @SubscribeEvent public static void init(FMLCommonSetupEvent evt) { + loadModules(); // TODO Calen compat GUI??? // NetworkRegistry.INSTANCE.registerGuiHandler(instance, CompatGui.guiHandlerProxy); for (CompatModuleBase m : modules.values()) { @@ -114,4 +161,29 @@ public static void postInit(FMLLoadCompleteEvent evt) { m.postInit(); } } + + private static final TagManager tagManager = new TagManager(); + static { + startBatch(); + + registerTag("item.block.power_convertor").reg("power_convertor").locale("power_convertor"); + registerTag("block.power_convertor").reg("power_convertor").locale("power_convertor"); + registerTag("tile.power_convertor").reg("power_convertor"); + + endBatch(TagManager.prependTags("buildcraftcompat:", TagManager.EnumTagType.REGISTRY_NAME) + .andThen(TagManager.setTab("buildcraft.main")) + ); + } + + private static TagManager.TagEntry registerTag(String id) { + return tagManager.registerTag(id); + } + + private static void startBatch() { + tagManager.startBatch(); + } + + private static void endBatch(Consumer consumer) { + tagManager.endBatch(consumer); + } } diff --git a/common/buildcraft/compat/BCCompatBlocks.java b/common/buildcraft/compat/BCCompatBlocks.java new file mode 100644 index 0000000..4b831a4 --- /dev/null +++ b/common/buildcraft/compat/BCCompatBlocks.java @@ -0,0 +1,23 @@ +package buildcraft.compat; + +import buildcraft.compat.module.forge.BlockPowerConvertor; +import buildcraft.compat.module.forge.TilePowerConvertor; +import buildcraft.lib.block.BlockPropertiesCreator; +import buildcraft.lib.registry.RegistrationHelper; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.material.Material; +import net.minecraftforge.registries.RegistryObject; + +public class BCCompatBlocks { + public static final RegistrationHelper HELPER = new RegistrationHelper(BCCompat.MODID); + public static final RegistryObject powerConvertor; + public static final RegistryObject> powerConvertorTile; + + static { + powerConvertor = HELPER.addBlockAndItem("block.power_convertor", BlockPropertiesCreator.createDefaultProperties(Material.METAL), BlockPowerConvertor::new); + powerConvertorTile = HELPER.registerTile("tile.power_convertor", TilePowerConvertor::new, powerConvertor); + } + + public static void fmlPreInit() { + } +} diff --git a/common/buildcraft/compat/CompatUtils.java b/common/buildcraft/compat/CompatUtils.java index 091ac1a..b3550b5 100644 --- a/common/buildcraft/compat/CompatUtils.java +++ b/common/buildcraft/compat/CompatUtils.java @@ -1,6 +1,7 @@ package buildcraft.compat; import buildcraft.compat.network.IGuiCreator; +import buildcraft.lib.misc.StackUtil; import buildcraft.lib.tile.item.ItemHandlerSimple; import com.google.common.collect.Lists; import net.minecraft.world.item.ItemStack; @@ -13,7 +14,7 @@ import java.util.List; -@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = BCCompat.MOD_ID) +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = BCCompat.MODID) public class CompatUtils { public static final Capability CAP_GUI_CREATOR = CapabilityManager.get(new CapabilityToken<>() { }); @@ -31,7 +32,8 @@ public static List compactInventory(ItemHandlerSimple inventory) { boolean handled = false; for (ItemStack existing : stacks) { - if (existing.sameItem(stack)) { +// if (existing.isItemEqual(stack)) + if (StackUtil.isSameItemSameDamage(existing, stack)) { existing.grow(stack.getCount()); handled = true; break; diff --git a/common/buildcraft/compat/datagen/BCCompatDataGenerators.java b/common/buildcraft/compat/datagen/BCCompatDataGenerators.java new file mode 100644 index 0000000..8629407 --- /dev/null +++ b/common/buildcraft/compat/datagen/BCCompatDataGenerators.java @@ -0,0 +1,23 @@ +package buildcraft.compat.datagen; + +import buildcraft.core.BCCore; +import net.minecraft.data.DataGenerator; +import net.minecraftforge.common.data.ExistingFileHelper; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.forge.event.lifecycle.GatherDataEvent; + +@Mod.EventBusSubscriber(modid = BCCore.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) +public class BCCompatDataGenerators { + @SubscribeEvent + public static void onGatherData(GatherDataEvent event) { + DataGenerator generator = event.getGenerator(); + ExistingFileHelper existingFileHelper = event.getExistingFileHelper(); + + // BlockState and Block Model + generator.addProvider(new CompatBlockStateGenerator(generator, existingFileHelper)); + + // Item Model + generator.addProvider(new CompatItemModelGenerator(generator, existingFileHelper)); + } +} diff --git a/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java b/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java new file mode 100644 index 0000000..9cb1981 --- /dev/null +++ b/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java @@ -0,0 +1,28 @@ +package buildcraft.compat.datagen; + +import buildcraft.compat.BCCompat; +import buildcraft.compat.BCCompatBlocks; +import buildcraft.datagen.base.BCBaseBlockStateGenerator; +import net.minecraft.data.DataGenerator; +import net.minecraft.resources.ResourceLocation; +import net.minecraftforge.client.model.generators.ConfiguredModel; +import net.minecraftforge.client.model.generators.ModelFile; +import net.minecraftforge.common.data.ExistingFileHelper; + +public class CompatBlockStateGenerator extends BCBaseBlockStateGenerator { + public CompatBlockStateGenerator(DataGenerator gen, ExistingFileHelper exFileHelper) { + super(gen, BCCompat.MODID, exFileHelper); + } + + @Override + protected void registerStatesAndModels() { + // power_convertor + getVariantBuilder(BCCompatBlocks.powerConvertor.get()).forAllStates(s -> + ConfiguredModel.builder().modelFile( + models().withExistingParent("buildcraftcompat:block/power_convertor", CUBE_ALL) + .texture("all", "buildcraftcompat:block/power_convertor") + ) + .build() + ); + } +} diff --git a/common/buildcraft/compat/datagen/CompatItemModelGenerator.java b/common/buildcraft/compat/datagen/CompatItemModelGenerator.java new file mode 100644 index 0000000..35ca240 --- /dev/null +++ b/common/buildcraft/compat/datagen/CompatItemModelGenerator.java @@ -0,0 +1,20 @@ +package buildcraft.compat.datagen; + +import buildcraft.compat.BCCompat; +import buildcraft.compat.BCCompatBlocks; +import buildcraft.datagen.base.BCBaseItemModelGenerator; +import net.minecraft.data.DataGenerator; +import net.minecraft.resources.ResourceLocation; +import net.minecraftforge.common.data.ExistingFileHelper; + +public class CompatItemModelGenerator extends BCBaseItemModelGenerator { + public CompatItemModelGenerator(DataGenerator generator, ExistingFileHelper existingFileHelper) { + super(generator, BCCompat.MODID, existingFileHelper); + } + + @Override + protected void registerModels() { + // power_convertor + withExistingParent(BCCompatBlocks.powerConvertor.get().getRegistryName().toString(), new ResourceLocation("buildcraftcompat:block/power_convertor")); + } +} diff --git a/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java b/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java index 27895ca..37cbc3f 100644 --- a/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java +++ b/common/buildcraft/compat/module/crafttweaker/AssemblyTable.java @@ -12,7 +12,6 @@ import com.blamejared.crafttweaker.api.action.recipe.ActionRemoveRecipeByName; import com.blamejared.crafttweaker.api.annotation.ZenRegister; import com.blamejared.crafttweaker.api.ingredient.IIngredient; -import com.blamejared.crafttweaker.api.ingredient.type.IIngredientList; import com.blamejared.crafttweaker.api.item.IItemStack; import com.blamejared.crafttweaker.api.recipe.handler.IRecipeHandler; import com.blamejared.crafttweaker.api.recipe.manager.base.IRecipeManager; @@ -75,6 +74,7 @@ private void enableFacadeAssembly0() { // @ZenMethod @ZenCodeType.Method + @Override // public static void removeByName(String name) public void removeByName(String name) { // CraftTweakerAPI.apply(new RemoveRecipeByNameAction(new ResourceLocation(name))); diff --git a/common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java b/common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java index b5616bf..1f43709 100644 --- a/common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java +++ b/common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java @@ -3,7 +3,6 @@ import buildcraft.compat.CompatModuleBase; public class CompatModuleCraftTweaker extends CompatModuleBase { - // TODO Calen /ct recipes manager -> error public CompatModuleCraftTweaker() { } diff --git a/common/buildcraft/compat/module/forge/BlockPowerConvertor.java b/common/buildcraft/compat/module/forge/BlockPowerConvertor.java new file mode 100644 index 0000000..8e8c32c --- /dev/null +++ b/common/buildcraft/compat/module/forge/BlockPowerConvertor.java @@ -0,0 +1,17 @@ +package buildcraft.compat.module.forge; + +import buildcraft.lib.block.BlockBCTile_Neptune; +import buildcraft.lib.tile.TileBC_Neptune; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; + +public class BlockPowerConvertor extends BlockBCTile_Neptune { + public BlockPowerConvertor(String idBC, Properties props) { + super(idBC, props); + } + + @Override + public TileBC_Neptune newBlockEntity(BlockPos pos, BlockState state) { + return new TilePowerConvertor(pos, state); + } +} diff --git a/common/buildcraft/compat/module/forge/TilePowerConvertor.java b/common/buildcraft/compat/module/forge/TilePowerConvertor.java new file mode 100644 index 0000000..7605433 --- /dev/null +++ b/common/buildcraft/compat/module/forge/TilePowerConvertor.java @@ -0,0 +1,276 @@ +package buildcraft.compat.module.forge; + +import buildcraft.api.core.EnumPipePart; +import buildcraft.api.mj.*; +import buildcraft.compat.BCCompatBlocks; +import buildcraft.lib.tile.TileBC_Neptune; +import it.unimi.dsi.fastutil.objects.ObjectObjectImmutablePair; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.energy.CapabilityEnergy; +import net.minecraftforge.energy.IEnergyStorage; + +import javax.annotation.Nonnull; +import java.util.Arrays; +import java.util.List; + +// Calen +public class TilePowerConvertor extends TileBC_Neptune implements IEnergyStorage, IMjConnector, IMjReceiver, IMjRedstoneReceiver, IMjReadable, IMjPassiveProvider { + public TilePowerConvertor(BlockPos pos, BlockState blockState) { + super(BCCompatBlocks.powerConvertorTile.get(), pos, blockState); + caps.addCapabilityInstance(CapabilityEnergy.ENERGY, this, EnumPipePart.VALUES); + caps.addCapabilityInstance(MjAPI.CAP_CONNECTOR, this, EnumPipePart.VALUES); + caps.addCapabilityInstance(MjAPI.CAP_REDSTONE_RECEIVER, this, EnumPipePart.VALUES); + caps.addCapabilityInstance(MjAPI.CAP_READABLE, this, EnumPipePart.VALUES); + caps.addCapabilityInstance(MjAPI.CAP_RECEIVER, this, EnumPipePart.VALUES); + caps.addCapabilityInstance(MjAPI.CAP_PASSIVE_PROVIDER, this, EnumPipePart.VALUES); + } + + // IMjConnector + @Override + public boolean canConnect(@Nonnull IMjConnector other) { + return true; + } + + // IMjPassiveProvider + @Override + public long extractPower(long min, long max, final boolean simulate) { + int min_FE = convert_mMJ_2_FE(min); + int max_FE = convert_mMJ_2_FE(max); + List> toQuery = getAllHasCapAround(CapabilityEnergy.ENERGY); + // try getting power from each IEnergyStorage in toQuery + List>> queried = toQuery.stream().map(p -> { + IEnergyStorage energyStorage = p.right(); + int extractedFE = energyStorage.extractEnergy(max_FE, true); + return new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right(), extractedFE)); + }) + .filter(p -> p.right().right() > 0) + .toList(); + // get max power can get + int neighbourTotalCanProvide_FE = 0; + for (ObjectObjectImmutablePair> p : queried) { + neighbourTotalCanProvide_FE += p.right().right(); + } + if (neighbourTotalCanProvide_FE < min_FE) { + // if cannot support [min], fail + return 0; + } else { + // if can support [min] + final int final_neighbourTotalCanProvide_FE = neighbourTotalCanProvide_FE; + // if can provide more than [max], each provides weighted average value + if (neighbourTotalCanProvide_FE > max_FE) { + queried = queried.stream() + .map(p -> new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right().left(), p.right().right() * max_FE / final_neighbourTotalCanProvide_FE))) + .toList(); + } + // extract! + int trueExtracted_FE = 0; + for (ObjectObjectImmutablePair> p : queried) { + trueExtracted_FE += p.right().left().extractEnergy(p.right().right(), simulate); + } + return convert_FE_2_mMJ(trueExtracted_FE); + } + } + + // IMjReadable + @Override + public long getStored() { + List> toQuery = getAllHasCapAround(CapabilityEnergy.ENERGY); + int stored_FE = 0; + for (ObjectObjectImmutablePair p : toQuery) { + stored_FE += p.right().getEnergyStored(); + } + return convert_FE_2_mMJ(stored_FE); + } + + // IMjReadable + @Override + public long getCapacity() { + List> toQuery = getAllHasCapAround(CapabilityEnergy.ENERGY); + int stored_FE = 0; + for (ObjectObjectImmutablePair p : toQuery) { + stored_FE += p.right().getMaxEnergyStored(); + } + return convert_FE_2_mMJ(stored_FE); + } + + // IMjReceiver + @Override + public long getPowerRequested() { + List> toQuery = getAllHasCapAround(CapabilityEnergy.ENERGY); + int stored_FE = 0; + for (ObjectObjectImmutablePair p : toQuery) { + IEnergyStorage capFE = p.right(); + stored_FE += capFE.canReceive() ? Math.max(capFE.receiveEnergy(Integer.MAX_VALUE, true), 0) : 0; + } + return convert_FE_2_mMJ(stored_FE); + } + + // IMjReceiver + @Override + public long receivePower(long max_mMJ, boolean simulate) { + int max_FE = convert_mMJ_2_FE(max_mMJ); + List> toQuery = getAllHasCapAround(CapabilityEnergy.ENERGY); + // try getting power from each IEnergyStorage in toQuery + List>> queried = toQuery.stream().map(p -> { + IEnergyStorage energyStorage = p.right(); + int receivedFE = energyStorage.receiveEnergy(max_FE, true); + return new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right(), receivedFE)); + }) + .filter(p -> p.right().right() > 0) + .toList(); + // get max power can receive + int neighbourTotalCanReceive_FE = 0; + for (ObjectObjectImmutablePair> p : queried) { + neighbourTotalCanReceive_FE += p.right().right(); + } + // if can provide more than [max], each provides weighted average value + final int final_neighbourTotalCanReceive_FE = neighbourTotalCanReceive_FE; + if (neighbourTotalCanReceive_FE > max_FE) { + queried = queried.stream() + .map(p -> new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right().left(), p.right().right() * max_FE / final_neighbourTotalCanReceive_FE))) + .toList(); + } + // receive! + int trueReceived_FE = 0; + for (ObjectObjectImmutablePair> p : queried) { + trueReceived_FE += p.right().left().receiveEnergy(p.right().right(), simulate); + } + int trueExcess_FE = max_FE - trueReceived_FE; + return convert_FE_2_mMJ(trueExcess_FE); + } + + // IEnergyStorage + // IMjReceiver + @Override + public boolean canReceive() { + return true; + } + + // IEnergyStorage + @Override + public int receiveEnergy(int max_FE, boolean simulate) { + long max_mMJ = convert_FE_2_mMJ(max_FE); + List> toQuery = getAllHasCapAround(MjAPI.CAP_RECEIVER); + // try getting power from each IMjReceiver in toQuery + List>> queried = toQuery.stream().map(p -> { + IMjReceiver mjReceiver = p.right(); + long excess_FE = mjReceiver.receivePower(max_mMJ, true); + long received_FE = max_mMJ - excess_FE; + return new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right(), received_FE)); + }) + .filter(p -> p.right().right() > 0) + .toList(); + // get max power can receive + long neighbourTotalCanReceive_FE = 0; + for (ObjectObjectImmutablePair> p : queried) { + neighbourTotalCanReceive_FE += p.right().right(); + } + // if can provide more than [max], each provides weighted average value + final long final_neighbourTotalCanReceive_FE = neighbourTotalCanReceive_FE; + if (neighbourTotalCanReceive_FE > max_mMJ) { + queried = queried.stream() + .map(p -> new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right().left(), p.right().right() * max_mMJ / final_neighbourTotalCanReceive_FE))) + .toList(); + } + // receive! + long trueExcess_FE = 0; + for (ObjectObjectImmutablePair> p : queried) { + trueExcess_FE += p.right().left().receivePower(p.right().right(), simulate); + } + long trueReceived_FE = max_FE - trueExcess_FE; + return convert_mMJ_2_FE(trueReceived_FE); + } + + @Override + public int extractEnergy(int max_FE, boolean simulate) { + long max_mMJ = convert_FE_2_mMJ(max_FE); + List> toQuery = getAllHasCapAround(MjAPI.CAP_PASSIVE_PROVIDER); + // try getting power from each IEnergyStorage in toQuery + List>> queried = toQuery.stream().map(p -> { + IMjPassiveProvider energyStorage = p.right(); + long extractedFE = energyStorage.extractPower(0, max_mMJ, true); + return new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right(), extractedFE)); + }) + .filter(p -> p.right().right() > 0) + .toList(); + // get max power can get + long neighbourTotalCanProvide_mMJ = 0; + for (ObjectObjectImmutablePair> p : queried) { + neighbourTotalCanProvide_mMJ += p.right().right(); + } + // if can provide more than [max], each provides weighted average value + final long final_neighbourTotalCanProvide_FE = neighbourTotalCanProvide_mMJ; + if (neighbourTotalCanProvide_mMJ > max_mMJ) { + queried = queried.stream() + .map(p -> new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right().left(), p.right().right() * max_mMJ / final_neighbourTotalCanProvide_FE))) + .toList(); + } + // extract! + long trueExtracted_mMJ = 0; + for (ObjectObjectImmutablePair> p : queried) { + trueExtracted_mMJ += p.right().left().extractPower(0, p.right().right(), simulate); + } + return convert_mMJ_2_FE(trueExtracted_mMJ); + } + + @Override + public int getEnergyStored() { + List> toQuery = getAllHasCapAround(MjAPI.CAP_READABLE); + long neighbourTotalEnergyStored_mMJ = 0; + for (ObjectObjectImmutablePair p : toQuery) { + neighbourTotalEnergyStored_mMJ += p.right().getStored(); + } + return convert_mMJ_2_FE(neighbourTotalEnergyStored_mMJ); + } + + @Override + public int getMaxEnergyStored() { + List> toQuery = getAllHasCapAround(MjAPI.CAP_READABLE); + long neighbourTotalMaxEnergyStored_mMJ = 0; + for (ObjectObjectImmutablePair p : toQuery) { + neighbourTotalMaxEnergyStored_mMJ += p.right().getCapacity(); + } + return convert_mMJ_2_FE(neighbourTotalMaxEnergyStored_mMJ); + } + + @Override + public boolean canExtract() { + return true; + } + + /** + * To get all capability instances of capability provider TileEntities all around this. + * {@link TilePowerConvertor} and any TileEntity both has {@link CapabilityEnergy#ENERGY} and {@link MjAPI#CAP_CONNECTOR} will be excluded. + */ + private List> getAllHasCapAround(Capability capability) { + return Arrays.stream(Direction.values()) + .map(d -> new ObjectObjectImmutablePair<>(d, this.worldPosition.relative(d))) + .filter(p -> this.level.getBlockState(p.right()).getBlock() != BCCompatBlocks.powerConvertor.get()) + .map(p -> new ObjectObjectImmutablePair<>(p.left(), this.level.getBlockEntity(p.right()))) + .filter(p -> p.right() != null) + // should not have both + .filter(p -> { + Direction dir = p.left(); + BlockEntity te = p.right(); + boolean has_FORGE_ENERGY = te.getCapability(CapabilityEnergy.ENERGY, dir).isPresent(); + boolean has_CAP_CONNECTOR = te.getCapability(MjAPI.CAP_CONNECTOR, dir).isPresent(); + return !(has_FORGE_ENERGY && has_CAP_CONNECTOR); + }) + .map(p -> new ObjectObjectImmutablePair<>(p.left(), p.right().getCapability(capability, p.left().getOpposite()))) + .filter(p -> p.right().isPresent()) + .map(p -> new ObjectObjectImmutablePair<>(p.left(), p.right().orElse(null))) + .toList(); + } + + public static int convert_mMJ_2_FE(long mMJ) { + return (int) Math.min(Integer.MAX_VALUE, mMJ / MjAPI.MJ * 16L); + } + + public static long convert_FE_2_mMJ(int fe) { + return fe * MjAPI.MJ / 16L; + } +} diff --git a/common/buildcraft/compat/module/jei/factory/CategoryCoolable.java b/common/buildcraft/compat/module/jei/factory/CategoryCoolable.java index 7d368c3..7f09e18 100644 --- a/common/buildcraft/compat/module/jei/factory/CategoryCoolable.java +++ b/common/buildcraft/compat/module/jei/factory/CategoryCoolable.java @@ -56,6 +56,7 @@ public CategoryCoolable(IGuiHelper guiHelper) { this.animatedHeating = guiHelper.createAnimatedDrawable(overComplete, 40, IDrawableAnimated.StartDirection.RIGHT, false); } + @Override public ResourceLocation getUid() { return UID; } diff --git a/common/buildcraft/compat/module/jei/gui/GuiHandlerBuildCraft.java b/common/buildcraft/compat/module/jei/gui/GuiHandlerBuildCraft.java index 6c5a688..8cf0f13 100644 --- a/common/buildcraft/compat/module/jei/gui/GuiHandlerBuildCraft.java +++ b/common/buildcraft/compat/module/jei/gui/GuiHandlerBuildCraft.java @@ -15,8 +15,7 @@ public class GuiHandlerBuildCraft implements IGuiContainerHandler> { @NotNull @Override public List getGuiExtraAreas(GuiBC8 guiDirty) { -// return screen.getGuiExtraAreas(); - List list = new ArrayList(); + List list = new ArrayList<>(); for (IGuiElement element : guiDirty.mainGui.shownElements) { GuiRectangle rect = element.asImmutable(); diff --git a/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java b/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java index 090627f..7a86b93 100644 --- a/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java +++ b/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java @@ -69,6 +69,7 @@ public CategoryIntegrationTable(IGuiHelper guiHelper, IntegrationRecipe recipe) this.progressBar = guiHelper.createAnimatedDrawable(progressDrawable, 720, IDrawableAnimated.StartDirection.BOTTOM, false); } + @Override public ResourceLocation getUid() { return UID; } @@ -105,6 +106,7 @@ public void draw(IntegrationRecipe recipe, IRecipeSlotsView recipeSlotsView, Pos } + @Override // public void setRecipe(IRecipeLayout recipeLayout, WrapperIntegrationTable recipeWrapper, IIngredients ingredients) public void setRecipe(IRecipeLayoutBuilder builder, IntegrationRecipe recipe, IFocusGroup focuses) { // IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); diff --git a/common/buildcraft/compat/module/waila/BCPluginJade.java b/common/buildcraft/compat/module/waila/HWYLAPlugin.java similarity index 63% rename from common/buildcraft/compat/module/waila/BCPluginJade.java rename to common/buildcraft/compat/module/waila/HWYLAPlugin.java index e2febe8..43ee5ea 100644 --- a/common/buildcraft/compat/module/waila/BCPluginJade.java +++ b/common/buildcraft/compat/module/waila/HWYLAPlugin.java @@ -3,20 +3,23 @@ import buildcraft.lib.block.BlockBCTile_Neptune; import buildcraft.lib.tile.TileBC_Neptune; import mcp.mobius.waila.api.*; +import net.minecraft.world.level.block.entity.BlockEntity; @WailaPlugin -public class BCPluginJade implements IWailaPlugin { +public class HWYLAPlugin implements IWailaPlugin { // Calen: in 1.18.2 we should use Block or TE class instead of interface here, it's too difficult to get all matched if allowing some BC modules absent, // so just use TileBC_Neptune and BlockBCTile_Neptune @Override public void register(IWailaCommonRegistration registrar) { - IServerDataProvider autoCraftNbtProvider = new AutoCraftDataProvider.NBTProvider(); - IServerDataProvider laserTargetNbtProvider = new LaserTargetDataProvider.NBTProvider(); - IServerDataProvider assemblyCraftNbtProvider = new AssemblyCraftDataProvider.NBTProvider(); + IServerDataProvider autoCraftNbtProvider = new AutoCraftDataProvider.NBTProvider(); + IServerDataProvider laserTargetNbtProvider = new LaserTargetDataProvider.NBTProvider(); + IServerDataProvider assemblyCraftNbtProvider = new AssemblyCraftDataProvider.NBTProvider(); + IServerDataProvider mjStorageNbtProvider = new MjStorageDataProvider.NBTProvider(); registrar.registerBlockDataProvider(autoCraftNbtProvider, TileBC_Neptune.class); registrar.registerBlockDataProvider(laserTargetNbtProvider, TileBC_Neptune.class); registrar.registerBlockDataProvider(assemblyCraftNbtProvider, TileBC_Neptune.class); + registrar.registerBlockDataProvider(mjStorageNbtProvider, TileBC_Neptune.class); } @Override @@ -24,9 +27,11 @@ public void registerClient(IWailaClientRegistration registrar) { IComponentProvider autoCraftBodyProvider = new AutoCraftDataProvider.BodyProvider(); IComponentProvider laserTargetBodyProvider = new LaserTargetDataProvider.BodyProvider(); IComponentProvider assemblyCraftBodyProvider = new AssemblyCraftDataProvider.BodyProvider(); + IComponentProvider mjStorageBodyProvider = new MjStorageDataProvider.BodyProvider(); registrar.registerComponentProvider(autoCraftBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); registrar.registerComponentProvider(laserTargetBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); registrar.registerComponentProvider(assemblyCraftBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); + registrar.registerComponentProvider(mjStorageBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); } } diff --git a/common/buildcraft/compat/module/waila/MjStorageDataProvider.java b/common/buildcraft/compat/module/waila/MjStorageDataProvider.java new file mode 100644 index 0000000..8937470 --- /dev/null +++ b/common/buildcraft/compat/module/waila/MjStorageDataProvider.java @@ -0,0 +1,58 @@ +package buildcraft.compat.module.waila; + +import buildcraft.api.mj.MjAPI; +import buildcraft.lib.tile.TileBC_Neptune; +import mcp.mobius.waila.api.BlockAccessor; +import mcp.mobius.waila.api.ITooltip; +import mcp.mobius.waila.api.config.IPluginConfig; +import mcp.mobius.waila.impl.ui.BorderStyle; +import mcp.mobius.waila.impl.ui.ProgressElement; +import mcp.mobius.waila.impl.ui.ProgressStyle; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.chat.TextComponent; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; + +public class MjStorageDataProvider { + static class BodyProvider extends BaseWailaDataProvider.BodyProvider { + private static final ProgressStyle PROGRESS_STYLE; + + static { + PROGRESS_STYLE = new ProgressStyle(); + PROGRESS_STYLE.color(-15731468, -16721961) + .textColor(DyeColor.WHITE.getTextColor()); + } + + @Override + public void getWailaBody(ITooltip currentTip, BlockAccessor accessor, IPluginConfig iPluginConfig) { + if (accessor.getBlockEntity() instanceof TileBC_Neptune tileBC) { + tileBC.getCapability(MjAPI.CAP_READABLE).ifPresent(mjReadable -> { + CompoundTag nbt = accessor.getServerData(); + if (nbt.contains("mj_storage", Tag.TAG_COMPOUND)) { + CompoundTag mj_storage_Tag = nbt.getCompound("mj_storage"); + long mj_capability = mj_storage_Tag.getLong("mj_capability"); + long mj_stored = mj_storage_Tag.getLong("mj_stored"); + currentTip.add(new ProgressElement((float) (((double) mj_stored) / ((double) mj_capability)), new TextComponent(mj_stored + " MJ/" + mj_capability + "MJ"), PROGRESS_STYLE, new BorderStyle())); + } + }); + } + } + } + + static class NBTProvider extends BaseWailaDataProvider.NBTProvider { + @Override + public void getNBTData(CompoundTag nbt, ServerPlayer player, Level world, BlockEntity tile, boolean showDetails) { + if (tile instanceof TileBC_Neptune tileBC) { + tileBC.getCapability(MjAPI.CAP_READABLE).ifPresent(mjReadable -> { + CompoundTag mj_storage_Tag = new CompoundTag(); + mj_storage_Tag.putLong("mj_capability", mjReadable.getCapacity() / MjAPI.MJ); + mj_storage_Tag.putLong("mj_stored", mjReadable.getStored() / MjAPI.MJ); + nbt.put("mj_storage", mj_storage_Tag); + }); + } + } + } +} diff --git a/resources/assets/buildcraftcompat/lang/en_us.json b/resources/assets/buildcraftcompat/lang/en_us.json index 03be0b4..fdf3671 100644 --- a/resources/assets/buildcraftcompat/lang/en_us.json +++ b/resources/assets/buildcraftcompat/lang/en_us.json @@ -41,5 +41,8 @@ "buildcraft.waila.crafting_from": "§fFrom: ", "buildcraft.waila.waiting_for_laser": "§fWaiting from laser: §b%s MJ", + // Calen FE compat + "tile.power_convertor.name": "Power Convertor", + "null": "=w=" } diff --git a/resources/assets/buildcraftcompat/lang/zh_cn.json b/resources/assets/buildcraftcompat/lang/zh_cn.json index 9bf01fe..772f4f1 100644 --- a/resources/assets/buildcraftcompat/lang/zh_cn.json +++ b/resources/assets/buildcraftcompat/lang/zh_cn.json @@ -36,5 +36,8 @@ "buildcraft.waila.crafting_from": "§f使用: ", "buildcraft.waila.waiting_for_laser": "§f还需要能量: §b%s MJ", + // Calen FE compat + "tile.power_convertor.name": "能源转换器", + "null": "=w=" } From aaf43d78b304cb28b02f0cd6b39f68847233d0ef Mon Sep 17 00:00:00 2001 From: CalenXwX Date: Tue, 17 Dec 2024 18:15:51 +0800 Subject: [PATCH 11/15] Updated gitsubmodule --- BuildCraft | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildCraft b/BuildCraft index 776118e..1cf391e 160000 --- a/BuildCraft +++ b/BuildCraft @@ -1 +1 @@ -Subproject commit 776118e4049aee30fa576e6604a889a33a81f977 +Subproject commit 1cf391e1527acb9e10014254d573a696e4787ca8 From d4056503bda0c4373247d8aa9c9c0d681153fc5c Mon Sep 17 00:00:00 2001 From: CalenXwX Date: Sat, 28 Dec 2024 13:14:19 +0800 Subject: [PATCH 12/15] Updated config & JEI plugin --- common/buildcraft/compat/BCCompat.java | 48 ++++++---------- common/buildcraft/compat/BCCompatConfig.java | 56 +++++++++++++++++++ .../datagen/CompatBlockStateGenerator.java | 2 - .../compat/module/jei/BCPluginJEI.java | 25 +++++++++ 4 files changed, 97 insertions(+), 34 deletions(-) create mode 100644 common/buildcraft/compat/BCCompatConfig.java diff --git a/common/buildcraft/compat/BCCompat.java b/common/buildcraft/compat/BCCompat.java index 21959fc..285b193 100644 --- a/common/buildcraft/compat/BCCompat.java +++ b/common/buildcraft/compat/BCCompat.java @@ -1,23 +1,16 @@ package buildcraft.compat; -import buildcraft.api.BCModules; import buildcraft.api.core.BCLog; import buildcraft.compat.module.crafttweaker.CompatModuleCraftTweaker; import buildcraft.compat.module.ic2.CompatModuleIndustrialCraft2; import buildcraft.compat.module.theoneprobe.CompatModuleTheOneProbe; import buildcraft.core.BCCore; -import buildcraft.lib.config.BCConfig; -import buildcraft.lib.config.Configuration; +import buildcraft.lib.config.ConfigCategory; import buildcraft.lib.config.EnumRestartRequirement; import buildcraft.lib.registry.RegistryConfig; import buildcraft.lib.registry.TagManager; -import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.common.ForgeConfigSpec.BooleanValue; import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.ModContainer; -import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLConstructModEvent; import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; @@ -57,9 +50,7 @@ public class BCCompat { // @Instance(MOD_ID) public static BCCompat instance; private static final Map modules = new HashMap<>(); - private static final Map moduleConfigs = new HashMap<>(); - - public static Configuration config; + private static final Map> moduleConfigs = new HashMap<>(); public BCCompat() { instance = this; @@ -69,20 +60,19 @@ private static void offerAndPreInitModule(CompatModuleBase module) { String cModId = module.compatModId(); if (module.canLoad()) { String _modules = "modules"; - BooleanValue prop = config + ConfigCategory prop = BCCompatConfig.config .define(_modules, "", EnumRestartRequirement.NONE, cModId, true); - modules.put(cModId, module); - moduleConfigs.put(cModId, prop); -// if (prop.get()) { -// modules.put(cModId, module); -// BCLog.logger.info("[compat] + " + cModId); -// module.preInit(); -// } else { -// BCLog.logger.info("[compat] x " + cModId + " (It has been disabled in the config)"); -// } + if (prop.get()) { + modules.put(cModId, module); + moduleConfigs.put(cModId, prop); + BCLog.logger.info("[compat] + " + cModId); + module.preInit(); + } else { + BCLog.logger.info("[compat] x " + cModId + " (It has been disabled in the config)"); + } } else { BCLog.logger.info("[compat] x " + cModId + " (It cannot load)"); } @@ -90,13 +80,9 @@ private static void offerAndPreInitModule(CompatModuleBase module) { @SubscribeEvent public static void preInit(FMLConstructModEvent evt) { - // Calen for block and item register + // Calen RegistryConfig.useOtherModConfigFor(MODID, BCCore.MODID); - - // Start config - BCModules module = BCModules.COMPAT; - ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder(); - config = new Configuration(builder, module); + BCCompatConfig.preInit(); // init BCLog.logger.info(""); @@ -121,11 +107,6 @@ public static void preInit(FMLConstructModEvent evt) { offerAndPreInitModule(new CompatModuleIndustrialCraft2()); // End of module list - // Finalize config - ForgeConfigSpec spec = config.build(); - ModContainer container = ModList.get().getModContainerById(module.getModId()).get(); - container.addConfig(new ModConfig(ModConfig.Type.COMMON, spec, container, config.getFileName())); - // Calen BCCompatBlocks.fmlPreInit(); } @@ -160,9 +141,12 @@ public static void postInit(FMLLoadCompleteEvent evt) { for (CompatModuleBase m : modules.values()) { m.postInit(); } + + BCCompatConfig.saveConfigs(); } private static final TagManager tagManager = new TagManager(); + static { startBatch(); diff --git a/common/buildcraft/compat/BCCompatConfig.java b/common/buildcraft/compat/BCCompatConfig.java new file mode 100644 index 0000000..8ce5d63 --- /dev/null +++ b/common/buildcraft/compat/BCCompatConfig.java @@ -0,0 +1,56 @@ +package buildcraft.compat; + +import buildcraft.api.BCModules; +import buildcraft.lib.config.BCConfig; +import buildcraft.lib.config.ConfigCategory; +import buildcraft.lib.config.Configuration; +import buildcraft.lib.config.EnumRestartRequirement; + +public class BCCompatConfig { + public static Configuration config; + + // Calen: remove the json file + public static boolean coloredPipesVisible; + public static boolean facadesVisible; + private static ConfigCategory propColoredPipesVisible; + private static ConfigCategory propFacadesVisible; + + public static void preInit() { + // Start config + BCModules module = BCModules.COMPAT; + config = new Configuration(module); + createProps(); + reloadConfig(); +// BCCoreConfig.addReloadListener(BCEnergyConfig::reloadConfig); + BCConfig.registerReloadListener(module, BCCompatConfig::reloadConfig); + } + + public static void createProps() { + EnumRestartRequirement world = EnumRestartRequirement.WORLD; + + propColoredPipesVisible = config + .define("client", + "Should all colored pipes be visible in JEI/REI?", + world, + "colored_pipes_visible", false); + + propFacadesVisible = config + .define("client", + "Should all facades be visible in JEI/REI?", + world, + "facades_visible", false); + } + + public static void reloadConfig() { + coloredPipesVisible = propColoredPipesVisible.get(); + facadesVisible = propFacadesVisible.get(); + + saveConfigs(); + } + + public static void saveConfigs() { + if (config.hasChanged()) { + config.save(); + } + } +} diff --git a/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java b/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java index 9cb1981..3c487ac 100644 --- a/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java +++ b/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java @@ -4,9 +4,7 @@ import buildcraft.compat.BCCompatBlocks; import buildcraft.datagen.base.BCBaseBlockStateGenerator; import net.minecraft.data.DataGenerator; -import net.minecraft.resources.ResourceLocation; import net.minecraftforge.client.model.generators.ConfiguredModel; -import net.minecraftforge.client.model.generators.ModelFile; import net.minecraftforge.common.data.ExistingFileHelper; public class CompatBlockStateGenerator extends BCBaseBlockStateGenerator { diff --git a/common/buildcraft/compat/module/jei/BCPluginJEI.java b/common/buildcraft/compat/module/jei/BCPluginJEI.java index fd5c157..fdb7189 100644 --- a/common/buildcraft/compat/module/jei/BCPluginJEI.java +++ b/common/buildcraft/compat/module/jei/BCPluginJEI.java @@ -5,6 +5,7 @@ import buildcraft.api.enums.EnumEngineType; import buildcraft.api.fuels.IFuel; import buildcraft.api.recipes.IRefineryRecipeManager; +import buildcraft.compat.BCCompatConfig; import buildcraft.compat.module.jei.energy.combustionengine.CategoryCombustionEngine; import buildcraft.compat.module.jei.factory.CategoryCoolable; import buildcraft.compat.module.jei.factory.CategoryDistiller; @@ -20,21 +21,27 @@ import buildcraft.lib.recipe.assembly.AssemblyRecipeRegistry; import buildcraft.lib.recipe.fuel.FuelRegistry; import buildcraft.silicon.BCSiliconBlocks; +import buildcraft.silicon.BCSiliconItems; import buildcraft.silicon.container.ContainerAssemblyTable; +import buildcraft.transport.pipe.PipeRegistry; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import mezz.jei.api.IModPlugin; import mezz.jei.api.JeiPlugin; import mezz.jei.api.constants.RecipeTypes; +import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.helpers.IGuiHelper; import mezz.jei.api.recipe.category.IRecipeCategory; import mezz.jei.api.registration.*; import mezz.jei.api.runtime.IJeiRuntime; import net.minecraft.client.Minecraft; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraftforge.fml.ModList; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -197,5 +204,23 @@ public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) { @Override public void onRuntimeAvailable(IJeiRuntime jeiRuntime) { BCPluginJEI.jeiRuntime = jeiRuntime; + + if (!BCCompatConfig.coloredPipesVisible) { + List itemsToRemove = new ArrayList<>(); + Arrays.stream(DyeColor.values()).forEach( + color -> PipeRegistry.INSTANCE.getAllRegisteredPipes().forEach( + def -> itemsToRemove.add(new ItemStack((Item) PipeRegistry.INSTANCE.getItemForPipe(def, color))) + ) + ); + jeiRuntime.getIngredientManager().removeIngredientsAtRuntime(VanillaTypes.ITEM_STACK, itemsToRemove); + } + + if (!BCCompatConfig.facadesVisible) { + jeiRuntime.getIngredientManager().removeIngredientsAtRuntime( + VanillaTypes.ITEM_STACK, + jeiRuntime.getIngredientManager().getAllIngredients(VanillaTypes.ITEM_STACK).stream() + .filter(stack -> stack.getItem() == BCSiliconItems.plugFacade.get()).toList() + ); + } } } From c14bdb75d4fefa4eaab4751698a48415f2a835f9 Mon Sep 17 00:00:00 2001 From: CalenXwX Date: Sat, 8 Mar 2025 19:10:24 +0800 Subject: [PATCH 13/15] Replaced power convertor with FE engine & updated gitsubmodule --- BuildCraft | 2 +- build.gradle | 43 +-- build.properties | 6 +- common/buildcraft/compat/BCCompat.java | 7 +- common/buildcraft/compat/BCCompatBlocks.java | 20 +- common/buildcraft/compat/BCCompatModels.java | 102 +++++++ common/buildcraft/compat/BCCompatProxy.java | 42 +++ .../datagen/CompatBlockStateGenerator.java | 11 +- .../datagen/CompatItemModelGenerator.java | 5 +- .../forge/BlockEnergyCompatEngine_BC8.java | 14 + .../module/forge/BlockPowerConvertor.java | 17 -- .../forge/EnumEnergyCompatEngineTypes.java | 21 ++ .../compat/module/forge/RenderEngineFe.java | 20 ++ .../compat/module/forge/TileEngineFe.java | 113 +++++++ .../module/forge/TilePowerConvertor.java | 276 ------------------ .../models/tiles/engine_fe.json | 7 + .../textures/block/engine/fe/back.png | Bin 0 -> 460 bytes .../textures/block/engine/fe/side.png | Bin 0 -> 265 bytes 18 files changed, 360 insertions(+), 346 deletions(-) create mode 100644 common/buildcraft/compat/BCCompatModels.java create mode 100644 common/buildcraft/compat/BCCompatProxy.java create mode 100644 common/buildcraft/compat/module/forge/BlockEnergyCompatEngine_BC8.java delete mode 100644 common/buildcraft/compat/module/forge/BlockPowerConvertor.java create mode 100644 common/buildcraft/compat/module/forge/EnumEnergyCompatEngineTypes.java create mode 100644 common/buildcraft/compat/module/forge/RenderEngineFe.java create mode 100644 common/buildcraft/compat/module/forge/TileEngineFe.java delete mode 100644 common/buildcraft/compat/module/forge/TilePowerConvertor.java create mode 100644 resources/assets/buildcraftcompat/models/tiles/engine_fe.json create mode 100644 resources/assets/buildcraftcompat/textures/block/engine/fe/back.png create mode 100644 resources/assets/buildcraftcompat/textures/block/engine/fe/side.png diff --git a/BuildCraft b/BuildCraft index 1cf391e..39fa4cd 160000 --- a/BuildCraft +++ b/BuildCraft @@ -1 +1 @@ -Subproject commit 1cf391e1527acb9e10014254d573a696e4787ca8 +Subproject commit 39fa4cd029be9593274735c0e734436dda1b415c diff --git a/build.gradle b/build.gradle index 904fd29..1a77f4a 100755 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,6 @@ buildscript { // Mixin //classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT' classpath 'org.spongepowered:mixingradle:0.7.+' - classpath 'javax.vecmath:vecmath:1.5.2' } } // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. @@ -40,7 +39,6 @@ configFile.withReader { } version = config.compat_version -// version = config.compat_version + "-" + new Date().format("yyyy-MM-dd'T'HH-mm-ssZ") group = "com.mod-buildcraft-compat" archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension] @@ -161,7 +159,9 @@ minecraft { // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. // args '--mod', 'buildcraftcore', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') - args '--mod', 'buildcraftcore', '--all', '--output', file('BuildCraft/buildcraft_resources_generated/'), '--existing', file('BuildCraft/buildcraft_resources/') + args '--mod', 'buildcraftcore', '--all', '--output', file('BuildCraft/buildcraft_resources_generated/'), + '--existing', file('BuildCraft/buildcraft_resources/'), + '--existing', file('resources/') mods { buildcraftcore { @@ -191,6 +191,8 @@ sourceSets { srcDir "BuildCraft/BuildCraftGuide/guide_resources" exclude "**/.md" // exclude readme from localization repo exclude "pack.png" // exclude from the guide repo + exclude '.cache' + exclude "pack.mcmeta_" // Calen: we should not exclude the pack.mcmeta file in buildcraft_resources, or all the resources will be lost // exclude "pack.mcmeta" // exclude from the guide repo } @@ -319,8 +321,6 @@ repositories { dir 'libs' } -// maven { url = 'https://mvnrepository.com/artifact/net.sf.trove4j/trove4j' } - maven { name 'prog' url 'https://dvs1.progwml6.com/files/maven' @@ -363,10 +363,6 @@ repositories { includeGroup "mcjty" } } -// // Calen test -// maven { -// url = "https://files.minecraftforge.net/maven" -// } } //processResources { @@ -409,38 +405,25 @@ dependencies { // Examples using mod jars from ./libs + // JEI compileOnly fg.deobf("mezz.jei:jei-" + config.mc_version + ":" + config.jei_version + ":api") runtimeOnly fg.deobf("mezz.jei:jei-" + config.mc_version + ":" + config.jei_version) - compileOnly fg.deobf("curse.maven:jade-324717:" + config.jade_id) - runtimeOnly fg.deobf("curse.maven:jade-324717:" + config.jade_id) - -// compileOnly fg.deobf("blank:ae2-${mc_version}:11.7.6") -// runtimeOnly fg.deobf("blank:ae2-${mc_version}:11.7.6") + // Jade + implementation fg.deobf("curse.maven:jade-324717:" + config.jade_id) - compileOnly(fg.deobf("com.blamejared.crafttweaker:CraftTweaker-forge-" + config.mc_version + ":" + config.crafttweaker_version)) - runtimeOnly(fg.deobf("com.blamejared.crafttweaker:CraftTweaker-forge-" + config.mc_version + ":" + config.crafttweaker_version)) + // CraftTweaker + implementation(fg.deobf("com.blamejared.crafttweaker:CraftTweaker-forge-" + config.mc_version + ":" + config.crafttweaker_version)) - compileOnly(fg.deobf("curse.maven:the-one-probe-245211:3965688")) - runtimeOnly(fg.deobf("curse.maven:the-one-probe-245211:3965688")) - - compileOnly fg.deobf("javax.vecmath:vecmath:1.5.2") - runtimeOnly fg.deobf("javax.vecmath:vecmath:1.5.2") - compileOnly fg.deobf("net.sf.trove4j:trove4j:3.0.3") - runtimeOnly fg.deobf("net.sf.trove4j:trove4j:3.0.3") - - jarJar(group: 'net.sf.trove4j', name: 'trove4j', version: '[3.0.3,)') { - jarJar.pin(it, '3.0.3') - } - jarJar(group: 'javax.vecmath', name: 'vecmath', version: '[1.5.2,)') { - jarJar.pin(it, '1.5.2') - } + // The One Probe + implementation(fg.deobf("curse.maven:the-one-probe-245211:3965688")) // Testing testImplementation "junit:junit:4.12" testImplementation 'org.hamcrest:hamcrest:2.2' // compileOnly "junit:junit:4.12" + // Mixin annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' // For more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html diff --git a/build.properties b/build.properties index 45feca5..0ac75ba 100644 --- a/build.properties +++ b/build.properties @@ -1,4 +1,8 @@ -compat_version=7.99.15 + +mc_version=1.18.2 + +#compat_version=7.99.15 +compat_version=7.99.24.9 #jei_version=4.8.5.138 jei_version=9.7.1.255 diff --git a/common/buildcraft/compat/BCCompat.java b/common/buildcraft/compat/BCCompat.java index 285b193..9af0947 100644 --- a/common/buildcraft/compat/BCCompat.java +++ b/common/buildcraft/compat/BCCompat.java @@ -109,6 +109,7 @@ public static void preInit(FMLConstructModEvent evt) { // Calen BCCompatBlocks.fmlPreInit(); + BCCompatProxy.getProxy().fmlPreInit(); } /** This is called after config loaded. */ @@ -150,9 +151,9 @@ public static void postInit(FMLLoadCompleteEvent evt) { static { startBatch(); - registerTag("item.block.power_convertor").reg("power_convertor").locale("power_convertor"); - registerTag("block.power_convertor").reg("power_convertor").locale("power_convertor"); - registerTag("tile.power_convertor").reg("power_convertor"); + registerTag("item.block.engine.bc.fe").reg("engine_fe").locale("engineFe"); + registerTag("block.engine.bc.fe").reg("engine_fe").locale("engineFe"); + registerTag("tile.engine.fe").reg("engine_fe"); endBatch(TagManager.prependTags("buildcraftcompat:", TagManager.EnumTagType.REGISTRY_NAME) .andThen(TagManager.setTab("buildcraft.main")) diff --git a/common/buildcraft/compat/BCCompatBlocks.java b/common/buildcraft/compat/BCCompatBlocks.java index 4b831a4..148fbb3 100644 --- a/common/buildcraft/compat/BCCompatBlocks.java +++ b/common/buildcraft/compat/BCCompatBlocks.java @@ -1,21 +1,29 @@ package buildcraft.compat; -import buildcraft.compat.module.forge.BlockPowerConvertor; -import buildcraft.compat.module.forge.TilePowerConvertor; +import buildcraft.compat.module.forge.BlockEnergyCompatEngine_BC8; +import buildcraft.compat.module.forge.EnumEnergyCompatEngineTypes; +import buildcraft.compat.module.forge.TileEngineFe; +import buildcraft.core.item.ItemEngine_BC8; import buildcraft.lib.block.BlockPropertiesCreator; import buildcraft.lib.registry.RegistrationHelper; +import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.material.Material; import net.minecraftforge.registries.RegistryObject; public class BCCompatBlocks { public static final RegistrationHelper HELPER = new RegistrationHelper(BCCompat.MODID); - public static final RegistryObject powerConvertor; - public static final RegistryObject> powerConvertorTile; + public static final RegistryObject engineFe; + public static final RegistryObject> engineFeTile; static { - powerConvertor = HELPER.addBlockAndItem("block.power_convertor", BlockPropertiesCreator.createDefaultProperties(Material.METAL), BlockPowerConvertor::new); - powerConvertorTile = HELPER.registerTile("tile.power_convertor", TilePowerConvertor::new, powerConvertor); + engineFe = HELPER.addBlockAndItem("block.engine.bc." + EnumEnergyCompatEngineTypes.FE.getSerializedName(), + BlockPropertiesCreator.createDefaultProperties(Material.METAL) + .strength(5.0F, 10.0F) + .sound(SoundType.METAL) + .noOcclusion() + , (idBC, properties) -> new BlockEnergyCompatEngine_BC8(idBC, properties, EnumEnergyCompatEngineTypes.FE, TileEngineFe::new), ItemEngine_BC8::new); + engineFeTile = HELPER.registerTile("tile.engine.fe", TileEngineFe::new, engineFe); } public static void fmlPreInit() { diff --git a/common/buildcraft/compat/BCCompatModels.java b/common/buildcraft/compat/BCCompatModels.java new file mode 100644 index 0000000..6da31b2 --- /dev/null +++ b/common/buildcraft/compat/BCCompatModels.java @@ -0,0 +1,102 @@ +package buildcraft.compat; + +import buildcraft.api.enums.EnumPowerStage; +import buildcraft.compat.module.forge.EnumEnergyCompatEngineTypes; +import buildcraft.compat.module.forge.RenderEngineFe; +import buildcraft.compat.module.forge.TileEngineFe; +import buildcraft.core.block.BlockEngine_BC8; +import buildcraft.lib.client.model.ModelHolderVariable; +import buildcraft.lib.client.model.ModelItemSimple; +import buildcraft.lib.client.model.MutableQuad; +import buildcraft.lib.engine.TileEngineBase_BC8; +import buildcraft.lib.expression.DefaultContexts; +import buildcraft.lib.expression.FunctionContext; +import buildcraft.lib.expression.node.value.NodeVariableDouble; +import buildcraft.lib.expression.node.value.NodeVariableObject; +import buildcraft.lib.misc.ExpressionCompat; +import buildcraft.lib.misc.data.ModelVariableData; +import net.minecraft.client.renderer.blockentity.BlockEntityRenderers; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.core.Direction; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.client.event.EntityRenderersEvent; +import net.minecraftforge.client.event.ModelBakeEvent; +import net.minecraftforge.eventbus.api.IEventBus; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.ModList; +import net.minecraftforge.fml.javafmlmod.FMLModContainer; + +import java.util.Arrays; +import java.util.stream.Collectors; + +@OnlyIn(Dist.CLIENT) +public class BCCompatModels { + private static final NodeVariableDouble ENGINE_PROGRESS; + private static final NodeVariableObject ENGINE_STAGE; + private static final NodeVariableObject ENGINE_FACING; + + private static final ModelHolderVariable ENGINE_FE; + + static { + FunctionContext fnCtx = new FunctionContext(ExpressionCompat.ENUM_POWER_STAGE, DefaultContexts.createWithAll()); + ENGINE_PROGRESS = fnCtx.putVariableDouble("progress"); + ENGINE_STAGE = fnCtx.putVariableObject("stage", EnumPowerStage.class); + ENGINE_FACING = fnCtx.putVariableObject("direction", Direction.class); + // TODO: Item models from "item/engine_stone.json" + ENGINE_FE = new ModelHolderVariable( + "buildcraftcompat:models/tiles/engine_fe.json", + fnCtx + ); + BlockEngine_BC8.setModel(EnumEnergyCompatEngineTypes.FE, ENGINE_FE); + } + + public static void fmlPreInit() { + // 1.18.2: following events are IModBusEvent + IEventBus modEventBus = ((FMLModContainer) ModList.get().getModContainerById(BCCompat.MODID).get()).getEventBus(); + modEventBus.register(BCCompatModels.class); + } + + @SubscribeEvent + public static void onTesrReg(EntityRenderersEvent.RegisterRenderers event) { + BlockEntityRenderers.register(BCCompatBlocks.engineFeTile.get(), RenderEngineFe::new); + } + + @SubscribeEvent + public static void onModelBake(ModelBakeEvent event) { + ENGINE_PROGRESS.value = 0.2; + ENGINE_STAGE.value = EnumPowerStage.BLUE; + ENGINE_FACING.value = Direction.UP; + ModelVariableData varData = new ModelVariableData(); + varData.setNodes(ENGINE_FE.createTickableNodes()); + varData.tick(); + varData.refresh(); + event.getModelRegistry().put( + new ModelResourceLocation(BCCompatBlocks.engineFe.getId(), "inventory"), + new ModelItemSimple( + Arrays.stream(ENGINE_FE.getCutoutQuads()) + .map(MutableQuad::toBakedItem) + .collect(Collectors.toList()), + ModelItemSimple.TRANSFORM_BLOCK, + true + ) + ); + } + + private static MutableQuad[] getEngineQuads(ModelHolderVariable model, + TileEngineBase_BC8 tile, + float partialTicks) { + ENGINE_PROGRESS.value = tile.getProgressClient(partialTicks); + ENGINE_STAGE.value = tile.getPowerStage(); + ENGINE_FACING.value = tile.getCurrentFacing(); + if (tile.clientModelData.hasNoNodes()) { + tile.clientModelData.setNodes(model.createTickableNodes()); + } + tile.clientModelData.refresh(); + return model.getCutoutQuads(); + } + + public static MutableQuad[] getFeEngineQuads(TileEngineFe tile, float partialTicks) { + return getEngineQuads(ENGINE_FE, tile, partialTicks); + } +} diff --git a/common/buildcraft/compat/BCCompatProxy.java b/common/buildcraft/compat/BCCompatProxy.java new file mode 100644 index 0000000..ffcb5ff --- /dev/null +++ b/common/buildcraft/compat/BCCompatProxy.java @@ -0,0 +1,42 @@ +package buildcraft.compat; + +import net.minecraftforge.fml.loading.FMLLoader; + +public abstract class BCCompatProxy { + private static BCCompatProxy proxy = null; + + public static BCCompatProxy getProxy() { + if (proxy == null) { + switch (FMLLoader.getDist()) { + case CLIENT: + proxy = new ClientProxy(); + break; + case DEDICATED_SERVER: + proxy = new ServerProxy(); + break; + } + } + return proxy; + } + + public void fmlPreInit() { + } + + public void fmlInit() { + } + + public void fmlPostInit() { + } + + public static class ServerProxy extends BCCompatProxy { + + } + + public static class ClientProxy extends BCCompatProxy { + @Override + public void fmlPreInit() { + super.fmlPreInit(); + BCCompatModels.fmlPreInit(); + } + } +} diff --git a/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java b/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java index 3c487ac..13edea4 100644 --- a/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java +++ b/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java @@ -4,7 +4,6 @@ import buildcraft.compat.BCCompatBlocks; import buildcraft.datagen.base.BCBaseBlockStateGenerator; import net.minecraft.data.DataGenerator; -import net.minecraftforge.client.model.generators.ConfiguredModel; import net.minecraftforge.common.data.ExistingFileHelper; public class CompatBlockStateGenerator extends BCBaseBlockStateGenerator { @@ -14,13 +13,7 @@ public CompatBlockStateGenerator(DataGenerator gen, ExistingFileHelper exFileHel @Override protected void registerStatesAndModels() { - // power_convertor - getVariantBuilder(BCCompatBlocks.powerConvertor.get()).forAllStates(s -> - ConfiguredModel.builder().modelFile( - models().withExistingParent("buildcraftcompat:block/power_convertor", CUBE_ALL) - .texture("all", "buildcraftcompat:block/power_convertor") - ) - .build() - ); + // fe engine + builtinEntity(BCCompatBlocks.engineFe.get(), "buildcraftcompat:block/engine/fe/back"); } } diff --git a/common/buildcraft/compat/datagen/CompatItemModelGenerator.java b/common/buildcraft/compat/datagen/CompatItemModelGenerator.java index 35ca240..da6af70 100644 --- a/common/buildcraft/compat/datagen/CompatItemModelGenerator.java +++ b/common/buildcraft/compat/datagen/CompatItemModelGenerator.java @@ -4,7 +4,6 @@ import buildcraft.compat.BCCompatBlocks; import buildcraft.datagen.base.BCBaseItemModelGenerator; import net.minecraft.data.DataGenerator; -import net.minecraft.resources.ResourceLocation; import net.minecraftforge.common.data.ExistingFileHelper; public class CompatItemModelGenerator extends BCBaseItemModelGenerator { @@ -14,7 +13,7 @@ public CompatItemModelGenerator(DataGenerator generator, ExistingFileHelper exis @Override protected void registerModels() { - // power_convertor - withExistingParent(BCCompatBlocks.powerConvertor.get().getRegistryName().toString(), new ResourceLocation("buildcraftcompat:block/power_convertor")); + // fe engine + getBuilder(BCCompatBlocks.engineFe.get().getRegistryName().toString()).parent(BUILTIN_ENTITY); } } diff --git a/common/buildcraft/compat/module/forge/BlockEnergyCompatEngine_BC8.java b/common/buildcraft/compat/module/forge/BlockEnergyCompatEngine_BC8.java new file mode 100644 index 0000000..bb018c8 --- /dev/null +++ b/common/buildcraft/compat/module/forge/BlockEnergyCompatEngine_BC8.java @@ -0,0 +1,14 @@ +package buildcraft.compat.module.forge; + +import buildcraft.lib.engine.BlockEngineBase_BC8; +import buildcraft.lib.engine.TileEngineBase_BC8; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; + +import java.util.function.BiFunction; + +public class BlockEnergyCompatEngine_BC8 extends BlockEngineBase_BC8 { + public BlockEnergyCompatEngine_BC8(String idBC, Properties properties, EnumEnergyCompatEngineTypes type, BiFunction engineTileConstructor) { + super(idBC, properties, type, engineTileConstructor); + } +} diff --git a/common/buildcraft/compat/module/forge/BlockPowerConvertor.java b/common/buildcraft/compat/module/forge/BlockPowerConvertor.java deleted file mode 100644 index 8e8c32c..0000000 --- a/common/buildcraft/compat/module/forge/BlockPowerConvertor.java +++ /dev/null @@ -1,17 +0,0 @@ -package buildcraft.compat.module.forge; - -import buildcraft.lib.block.BlockBCTile_Neptune; -import buildcraft.lib.tile.TileBC_Neptune; -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.block.state.BlockState; - -public class BlockPowerConvertor extends BlockBCTile_Neptune { - public BlockPowerConvertor(String idBC, Properties props) { - super(idBC, props); - } - - @Override - public TileBC_Neptune newBlockEntity(BlockPos pos, BlockState state) { - return new TilePowerConvertor(pos, state); - } -} diff --git a/common/buildcraft/compat/module/forge/EnumEnergyCompatEngineTypes.java b/common/buildcraft/compat/module/forge/EnumEnergyCompatEngineTypes.java new file mode 100644 index 0000000..a1053b2 --- /dev/null +++ b/common/buildcraft/compat/module/forge/EnumEnergyCompatEngineTypes.java @@ -0,0 +1,21 @@ +package buildcraft.compat.module.forge; + +import buildcraft.api.core.IEngineType; +import net.minecraft.util.StringRepresentable; + +public enum EnumEnergyCompatEngineTypes implements StringRepresentable, IEngineType { + FE("compat", "fe"); + + public static final EnumEnergyCompatEngineTypes[] VALUES = values(); + + public final String unlocalizedTag; + + EnumEnergyCompatEngineTypes(String mod, String loc) { + unlocalizedTag = loc; + } + + @Override + public String getSerializedName() { + return unlocalizedTag; + } +} diff --git a/common/buildcraft/compat/module/forge/RenderEngineFe.java b/common/buildcraft/compat/module/forge/RenderEngineFe.java new file mode 100644 index 0000000..8bef1b2 --- /dev/null +++ b/common/buildcraft/compat/module/forge/RenderEngineFe.java @@ -0,0 +1,20 @@ +package buildcraft.compat.module.forge; + +import buildcraft.compat.BCCompatModels; +import buildcraft.lib.client.model.MutableQuad; +import buildcraft.lib.client.render.tile.RenderEngine_BC8; +import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +@OnlyIn(Dist.CLIENT) +public class RenderEngineFe extends RenderEngine_BC8 { + public RenderEngineFe(BlockEntityRendererProvider.Context context) { + super(context); + } + + @Override + protected MutableQuad[] getEngineModel(TileEngineFe engine, float partialTicks) { + return BCCompatModels.getFeEngineQuads(engine, partialTicks); + } +} diff --git a/common/buildcraft/compat/module/forge/TileEngineFe.java b/common/buildcraft/compat/module/forge/TileEngineFe.java new file mode 100644 index 0000000..a9b3341 --- /dev/null +++ b/common/buildcraft/compat/module/forge/TileEngineFe.java @@ -0,0 +1,113 @@ +package buildcraft.compat.module.forge; + +import buildcraft.api.core.EnumPipePart; +import buildcraft.api.enums.EnumPowerStage; +import buildcraft.api.mj.IMjConnector; +import buildcraft.api.mj.MjAPI; +import buildcraft.compat.BCCompatBlocks; +import buildcraft.lib.engine.EngineConnector; +import buildcraft.lib.engine.TileEngineBase_BC8; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraftforge.energy.CapabilityEnergy; +import net.minecraftforge.energy.IEnergyStorage; +import org.jetbrains.annotations.NotNull; + +public class TileEngineFe extends TileEngineBase_BC8 { + private static final int MJ_CAP = 10_000; + private static final int FE_CAP = convert_mMJ_2_FE(MJ_CAP * MjAPI.MJ); + + private final IEnergyStorage feStorage = new IEnergyStorage() { + @Override + public int receiveEnergy(int maxReceive, boolean simulate) { + int received_FE = Math.min(convert_mMJ_2_FE(TileEngineFe.this.getMaxPower() - TileEngineFe.this.getEnergyStored()), maxReceive); + if (!simulate) { + addPower(convert_FE_2_mMJ(received_FE)); + } + return received_FE; + } + + @Override + public int extractEnergy(int maxExtract, boolean simulate) { + return 0; + } + + @Override + public int getEnergyStored() { + return convert_mMJ_2_FE(TileEngineFe.this.getEnergyStored()); + } + + @Override + public int getMaxEnergyStored() { + return FE_CAP; + } + + @Override + public boolean canExtract() { + return false; + } + + @Override + public boolean canReceive() { + return true; + } + }; + + public TileEngineFe(BlockPos pos, BlockState blockState) { + super(BCCompatBlocks.engineFeTile.get(), pos, blockState); + caps.addCapabilityInstance(CapabilityEnergy.ENERGY, this.feStorage, EnumPipePart.VALUES); + } + + @NotNull + @Override + protected IMjConnector createConnector() { + return new EngineConnector(false); + } + + @Override + public boolean isBurning() { + return isRedstonePowered; + } + + @Override + public long getMaxPower() { + return MJ_CAP * MjAPI.MJ; + } + + @Override + public long maxPowerReceived() { + return 2_000 * MjAPI.MJ; + } + + @Override + public long maxPowerExtracted() { + return 1_000 * MjAPI.MJ; + } + + @Override + public float explosionRange() { + return 0; + } + + @Override + public long getCurrentOutput() { + return 256 * MjAPI.MJ; + } + + @Override + protected EnumPowerStage computePowerStage() { + return EnumPowerStage.RED; + } + + @Override + protected void burn() { + } + + public static int convert_mMJ_2_FE(long mMJ) { + return (int) Math.min(Integer.MAX_VALUE, mMJ * 16L / MjAPI.MJ); + } + + public static long convert_FE_2_mMJ(int fe) { + return fe * MjAPI.MJ / 16L; + } +} diff --git a/common/buildcraft/compat/module/forge/TilePowerConvertor.java b/common/buildcraft/compat/module/forge/TilePowerConvertor.java deleted file mode 100644 index 7605433..0000000 --- a/common/buildcraft/compat/module/forge/TilePowerConvertor.java +++ /dev/null @@ -1,276 +0,0 @@ -package buildcraft.compat.module.forge; - -import buildcraft.api.core.EnumPipePart; -import buildcraft.api.mj.*; -import buildcraft.compat.BCCompatBlocks; -import buildcraft.lib.tile.TileBC_Neptune; -import it.unimi.dsi.fastutil.objects.ObjectObjectImmutablePair; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.energy.CapabilityEnergy; -import net.minecraftforge.energy.IEnergyStorage; - -import javax.annotation.Nonnull; -import java.util.Arrays; -import java.util.List; - -// Calen -public class TilePowerConvertor extends TileBC_Neptune implements IEnergyStorage, IMjConnector, IMjReceiver, IMjRedstoneReceiver, IMjReadable, IMjPassiveProvider { - public TilePowerConvertor(BlockPos pos, BlockState blockState) { - super(BCCompatBlocks.powerConvertorTile.get(), pos, blockState); - caps.addCapabilityInstance(CapabilityEnergy.ENERGY, this, EnumPipePart.VALUES); - caps.addCapabilityInstance(MjAPI.CAP_CONNECTOR, this, EnumPipePart.VALUES); - caps.addCapabilityInstance(MjAPI.CAP_REDSTONE_RECEIVER, this, EnumPipePart.VALUES); - caps.addCapabilityInstance(MjAPI.CAP_READABLE, this, EnumPipePart.VALUES); - caps.addCapabilityInstance(MjAPI.CAP_RECEIVER, this, EnumPipePart.VALUES); - caps.addCapabilityInstance(MjAPI.CAP_PASSIVE_PROVIDER, this, EnumPipePart.VALUES); - } - - // IMjConnector - @Override - public boolean canConnect(@Nonnull IMjConnector other) { - return true; - } - - // IMjPassiveProvider - @Override - public long extractPower(long min, long max, final boolean simulate) { - int min_FE = convert_mMJ_2_FE(min); - int max_FE = convert_mMJ_2_FE(max); - List> toQuery = getAllHasCapAround(CapabilityEnergy.ENERGY); - // try getting power from each IEnergyStorage in toQuery - List>> queried = toQuery.stream().map(p -> { - IEnergyStorage energyStorage = p.right(); - int extractedFE = energyStorage.extractEnergy(max_FE, true); - return new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right(), extractedFE)); - }) - .filter(p -> p.right().right() > 0) - .toList(); - // get max power can get - int neighbourTotalCanProvide_FE = 0; - for (ObjectObjectImmutablePair> p : queried) { - neighbourTotalCanProvide_FE += p.right().right(); - } - if (neighbourTotalCanProvide_FE < min_FE) { - // if cannot support [min], fail - return 0; - } else { - // if can support [min] - final int final_neighbourTotalCanProvide_FE = neighbourTotalCanProvide_FE; - // if can provide more than [max], each provides weighted average value - if (neighbourTotalCanProvide_FE > max_FE) { - queried = queried.stream() - .map(p -> new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right().left(), p.right().right() * max_FE / final_neighbourTotalCanProvide_FE))) - .toList(); - } - // extract! - int trueExtracted_FE = 0; - for (ObjectObjectImmutablePair> p : queried) { - trueExtracted_FE += p.right().left().extractEnergy(p.right().right(), simulate); - } - return convert_FE_2_mMJ(trueExtracted_FE); - } - } - - // IMjReadable - @Override - public long getStored() { - List> toQuery = getAllHasCapAround(CapabilityEnergy.ENERGY); - int stored_FE = 0; - for (ObjectObjectImmutablePair p : toQuery) { - stored_FE += p.right().getEnergyStored(); - } - return convert_FE_2_mMJ(stored_FE); - } - - // IMjReadable - @Override - public long getCapacity() { - List> toQuery = getAllHasCapAround(CapabilityEnergy.ENERGY); - int stored_FE = 0; - for (ObjectObjectImmutablePair p : toQuery) { - stored_FE += p.right().getMaxEnergyStored(); - } - return convert_FE_2_mMJ(stored_FE); - } - - // IMjReceiver - @Override - public long getPowerRequested() { - List> toQuery = getAllHasCapAround(CapabilityEnergy.ENERGY); - int stored_FE = 0; - for (ObjectObjectImmutablePair p : toQuery) { - IEnergyStorage capFE = p.right(); - stored_FE += capFE.canReceive() ? Math.max(capFE.receiveEnergy(Integer.MAX_VALUE, true), 0) : 0; - } - return convert_FE_2_mMJ(stored_FE); - } - - // IMjReceiver - @Override - public long receivePower(long max_mMJ, boolean simulate) { - int max_FE = convert_mMJ_2_FE(max_mMJ); - List> toQuery = getAllHasCapAround(CapabilityEnergy.ENERGY); - // try getting power from each IEnergyStorage in toQuery - List>> queried = toQuery.stream().map(p -> { - IEnergyStorage energyStorage = p.right(); - int receivedFE = energyStorage.receiveEnergy(max_FE, true); - return new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right(), receivedFE)); - }) - .filter(p -> p.right().right() > 0) - .toList(); - // get max power can receive - int neighbourTotalCanReceive_FE = 0; - for (ObjectObjectImmutablePair> p : queried) { - neighbourTotalCanReceive_FE += p.right().right(); - } - // if can provide more than [max], each provides weighted average value - final int final_neighbourTotalCanReceive_FE = neighbourTotalCanReceive_FE; - if (neighbourTotalCanReceive_FE > max_FE) { - queried = queried.stream() - .map(p -> new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right().left(), p.right().right() * max_FE / final_neighbourTotalCanReceive_FE))) - .toList(); - } - // receive! - int trueReceived_FE = 0; - for (ObjectObjectImmutablePair> p : queried) { - trueReceived_FE += p.right().left().receiveEnergy(p.right().right(), simulate); - } - int trueExcess_FE = max_FE - trueReceived_FE; - return convert_FE_2_mMJ(trueExcess_FE); - } - - // IEnergyStorage - // IMjReceiver - @Override - public boolean canReceive() { - return true; - } - - // IEnergyStorage - @Override - public int receiveEnergy(int max_FE, boolean simulate) { - long max_mMJ = convert_FE_2_mMJ(max_FE); - List> toQuery = getAllHasCapAround(MjAPI.CAP_RECEIVER); - // try getting power from each IMjReceiver in toQuery - List>> queried = toQuery.stream().map(p -> { - IMjReceiver mjReceiver = p.right(); - long excess_FE = mjReceiver.receivePower(max_mMJ, true); - long received_FE = max_mMJ - excess_FE; - return new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right(), received_FE)); - }) - .filter(p -> p.right().right() > 0) - .toList(); - // get max power can receive - long neighbourTotalCanReceive_FE = 0; - for (ObjectObjectImmutablePair> p : queried) { - neighbourTotalCanReceive_FE += p.right().right(); - } - // if can provide more than [max], each provides weighted average value - final long final_neighbourTotalCanReceive_FE = neighbourTotalCanReceive_FE; - if (neighbourTotalCanReceive_FE > max_mMJ) { - queried = queried.stream() - .map(p -> new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right().left(), p.right().right() * max_mMJ / final_neighbourTotalCanReceive_FE))) - .toList(); - } - // receive! - long trueExcess_FE = 0; - for (ObjectObjectImmutablePair> p : queried) { - trueExcess_FE += p.right().left().receivePower(p.right().right(), simulate); - } - long trueReceived_FE = max_FE - trueExcess_FE; - return convert_mMJ_2_FE(trueReceived_FE); - } - - @Override - public int extractEnergy(int max_FE, boolean simulate) { - long max_mMJ = convert_FE_2_mMJ(max_FE); - List> toQuery = getAllHasCapAround(MjAPI.CAP_PASSIVE_PROVIDER); - // try getting power from each IEnergyStorage in toQuery - List>> queried = toQuery.stream().map(p -> { - IMjPassiveProvider energyStorage = p.right(); - long extractedFE = energyStorage.extractPower(0, max_mMJ, true); - return new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right(), extractedFE)); - }) - .filter(p -> p.right().right() > 0) - .toList(); - // get max power can get - long neighbourTotalCanProvide_mMJ = 0; - for (ObjectObjectImmutablePair> p : queried) { - neighbourTotalCanProvide_mMJ += p.right().right(); - } - // if can provide more than [max], each provides weighted average value - final long final_neighbourTotalCanProvide_FE = neighbourTotalCanProvide_mMJ; - if (neighbourTotalCanProvide_mMJ > max_mMJ) { - queried = queried.stream() - .map(p -> new ObjectObjectImmutablePair<>(p.left(), new ObjectObjectImmutablePair<>(p.right().left(), p.right().right() * max_mMJ / final_neighbourTotalCanProvide_FE))) - .toList(); - } - // extract! - long trueExtracted_mMJ = 0; - for (ObjectObjectImmutablePair> p : queried) { - trueExtracted_mMJ += p.right().left().extractPower(0, p.right().right(), simulate); - } - return convert_mMJ_2_FE(trueExtracted_mMJ); - } - - @Override - public int getEnergyStored() { - List> toQuery = getAllHasCapAround(MjAPI.CAP_READABLE); - long neighbourTotalEnergyStored_mMJ = 0; - for (ObjectObjectImmutablePair p : toQuery) { - neighbourTotalEnergyStored_mMJ += p.right().getStored(); - } - return convert_mMJ_2_FE(neighbourTotalEnergyStored_mMJ); - } - - @Override - public int getMaxEnergyStored() { - List> toQuery = getAllHasCapAround(MjAPI.CAP_READABLE); - long neighbourTotalMaxEnergyStored_mMJ = 0; - for (ObjectObjectImmutablePair p : toQuery) { - neighbourTotalMaxEnergyStored_mMJ += p.right().getCapacity(); - } - return convert_mMJ_2_FE(neighbourTotalMaxEnergyStored_mMJ); - } - - @Override - public boolean canExtract() { - return true; - } - - /** - * To get all capability instances of capability provider TileEntities all around this. - * {@link TilePowerConvertor} and any TileEntity both has {@link CapabilityEnergy#ENERGY} and {@link MjAPI#CAP_CONNECTOR} will be excluded. - */ - private List> getAllHasCapAround(Capability capability) { - return Arrays.stream(Direction.values()) - .map(d -> new ObjectObjectImmutablePair<>(d, this.worldPosition.relative(d))) - .filter(p -> this.level.getBlockState(p.right()).getBlock() != BCCompatBlocks.powerConvertor.get()) - .map(p -> new ObjectObjectImmutablePair<>(p.left(), this.level.getBlockEntity(p.right()))) - .filter(p -> p.right() != null) - // should not have both - .filter(p -> { - Direction dir = p.left(); - BlockEntity te = p.right(); - boolean has_FORGE_ENERGY = te.getCapability(CapabilityEnergy.ENERGY, dir).isPresent(); - boolean has_CAP_CONNECTOR = te.getCapability(MjAPI.CAP_CONNECTOR, dir).isPresent(); - return !(has_FORGE_ENERGY && has_CAP_CONNECTOR); - }) - .map(p -> new ObjectObjectImmutablePair<>(p.left(), p.right().getCapability(capability, p.left().getOpposite()))) - .filter(p -> p.right().isPresent()) - .map(p -> new ObjectObjectImmutablePair<>(p.left(), p.right().orElse(null))) - .toList(); - } - - public static int convert_mMJ_2_FE(long mMJ) { - return (int) Math.min(Integer.MAX_VALUE, mMJ / MjAPI.MJ * 16L); - } - - public static long convert_FE_2_mMJ(int fe) { - return fe * MjAPI.MJ / 16L; - } -} diff --git a/resources/assets/buildcraftcompat/models/tiles/engine_fe.json b/resources/assets/buildcraftcompat/models/tiles/engine_fe.json new file mode 100644 index 0000000..9e4921b --- /dev/null +++ b/resources/assets/buildcraftcompat/models/tiles/engine_fe.json @@ -0,0 +1,7 @@ +{ + "textures": { + "#back":"buildcraftcompat:block/engine/fe/back", + "#side":"buildcraftcompat:block/engine/fe/side" + }, + "parent":"buildcraftlib:models/tiles/engine_base" +} diff --git a/resources/assets/buildcraftcompat/textures/block/engine/fe/back.png b/resources/assets/buildcraftcompat/textures/block/engine/fe/back.png new file mode 100644 index 0000000000000000000000000000000000000000..06da85225017205de7397d88ff759b3a94821106 GIT binary patch literal 460 zcmV;-0WEj-sCeeS$ouV}3m=N$L@eH4Wd zMzenIU=iW@d;(Bw#R5#zM2wO1`ON>s;cyt=R#gchFijHx`~4nO9U9bHQPlysTrNu; zI)f0x5GJLx0M}YqMFu_^%o&IXA%q2Z&Y;(%l)emJuh(DzkWxZb$vOW8257C}y+=eo z4K|z2;-_;C0OuSzXMmCCm$cTt4A!ELxaS@@=W$j5@BJ{x96Z;czxkJ$cDt_Gw1Y(i z@BNrYHyMEa_4)6d*P`2d7zyC|62=&E&STMfvlt_#ln;YB?Y_EQlYg!8JpKS;V&J`$ec0y!0000 zi-E7Opkwyi1E)7Vco(uaukUdO(+=ykrg!F+#&&YJv~(yKcXBYC$uVb6QJXfC=P<*D z>vvtkukst;E6-oEs`|y!pXPN6{lC}#U^vzOgT2Q2fbgF)xk1+p{#*mPkipZ{&t;uc GLK6U9sb}v1 literal 0 HcmV?d00001 From 1d12f21a4b4ecc39e4fed160bfef2030bc67185e Mon Sep 17 00:00:00 2001 From: CalenXwX Date: Thu, 24 Apr 2025 14:21:03 +0800 Subject: [PATCH 14/15] Update JEI plugin for robotics recipes, update HWYLA plugin for robot energy and remove FE engine --- BuildCraft | 2 +- build.gradle | 3 +- common/buildcraft/compat/BCCompat.java | 5 - common/buildcraft/compat/BCCompatBlocks.java | 31 ----- common/buildcraft/compat/BCCompatModels.java | 102 ---------------- common/buildcraft/compat/BCCompatProxy.java | 1 - .../datagen/BCCompatDataGenerators.java | 23 ---- .../datagen/CompatBlockStateGenerator.java | 19 --- .../datagen/CompatItemModelGenerator.java | 19 --- .../forge/BlockEnergyCompatEngine_BC8.java | 14 --- .../forge/EnumEnergyCompatEngineTypes.java | 21 ---- .../compat/module/forge/RenderEngineFe.java | 20 --- .../compat/module/forge/TileEngineFe.java | 113 ----------------- .../compat/module/jei/BCPluginJEI.java | 15 +++ .../jei/silicon/CategoryIntegrationTable.java | 55 ++++----- .../jei/silicon/CategoryProgrammingTable.java | 114 ++++++++++++++++++ .../module/theoneprobe/BCPluginTOP.java | 6 +- .../module/waila/BaseWailaDataProvider.java | 24 +++- .../compat/module/waila/HWYLAPlugin.java | 6 + .../module/waila/RobotPowerDataProvider.java | 54 +++++++++ .../assets/buildcraftcompat/lang/en_us.json | 3 - .../assets/buildcraftcompat/lang/zh_cn.json | 3 - .../models/tiles/engine_fe.json | 7 -- .../textures/block/engine/fe/back.png | Bin 460 -> 0 bytes .../textures/block/engine/fe/side.png | Bin 265 -> 0 bytes 25 files changed, 240 insertions(+), 420 deletions(-) delete mode 100644 common/buildcraft/compat/BCCompatBlocks.java delete mode 100644 common/buildcraft/compat/BCCompatModels.java delete mode 100644 common/buildcraft/compat/datagen/BCCompatDataGenerators.java delete mode 100644 common/buildcraft/compat/datagen/CompatBlockStateGenerator.java delete mode 100644 common/buildcraft/compat/datagen/CompatItemModelGenerator.java delete mode 100644 common/buildcraft/compat/module/forge/BlockEnergyCompatEngine_BC8.java delete mode 100644 common/buildcraft/compat/module/forge/EnumEnergyCompatEngineTypes.java delete mode 100644 common/buildcraft/compat/module/forge/RenderEngineFe.java delete mode 100644 common/buildcraft/compat/module/forge/TileEngineFe.java create mode 100644 common/buildcraft/compat/module/jei/silicon/CategoryProgrammingTable.java create mode 100644 common/buildcraft/compat/module/waila/RobotPowerDataProvider.java delete mode 100644 resources/assets/buildcraftcompat/models/tiles/engine_fe.json delete mode 100644 resources/assets/buildcraftcompat/textures/block/engine/fe/back.png delete mode 100644 resources/assets/buildcraftcompat/textures/block/engine/fe/side.png diff --git a/BuildCraft b/BuildCraft index 39fa4cd..53b1cfa 160000 --- a/BuildCraft +++ b/BuildCraft @@ -1 +1 @@ -Subproject commit 39fa4cd029be9593274735c0e734436dda1b415c +Subproject commit 53b1cfaeb689294b59dc73cfaad110d0dfafa336 diff --git a/build.gradle b/build.gradle index 1a77f4a..7631b52 100755 --- a/build.gradle +++ b/build.gradle @@ -160,8 +160,7 @@ minecraft { // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. // args '--mod', 'buildcraftcore', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') args '--mod', 'buildcraftcore', '--all', '--output', file('BuildCraft/buildcraft_resources_generated/'), - '--existing', file('BuildCraft/buildcraft_resources/'), - '--existing', file('resources/') + '--existing', file('BuildCraft/buildcraft_resources/') mods { buildcraftcore { diff --git a/common/buildcraft/compat/BCCompat.java b/common/buildcraft/compat/BCCompat.java index 9af0947..9668a92 100644 --- a/common/buildcraft/compat/BCCompat.java +++ b/common/buildcraft/compat/BCCompat.java @@ -108,7 +108,6 @@ public static void preInit(FMLConstructModEvent evt) { // End of module list // Calen - BCCompatBlocks.fmlPreInit(); BCCompatProxy.getProxy().fmlPreInit(); } @@ -151,10 +150,6 @@ public static void postInit(FMLLoadCompleteEvent evt) { static { startBatch(); - registerTag("item.block.engine.bc.fe").reg("engine_fe").locale("engineFe"); - registerTag("block.engine.bc.fe").reg("engine_fe").locale("engineFe"); - registerTag("tile.engine.fe").reg("engine_fe"); - endBatch(TagManager.prependTags("buildcraftcompat:", TagManager.EnumTagType.REGISTRY_NAME) .andThen(TagManager.setTab("buildcraft.main")) ); diff --git a/common/buildcraft/compat/BCCompatBlocks.java b/common/buildcraft/compat/BCCompatBlocks.java deleted file mode 100644 index 148fbb3..0000000 --- a/common/buildcraft/compat/BCCompatBlocks.java +++ /dev/null @@ -1,31 +0,0 @@ -package buildcraft.compat; - -import buildcraft.compat.module.forge.BlockEnergyCompatEngine_BC8; -import buildcraft.compat.module.forge.EnumEnergyCompatEngineTypes; -import buildcraft.compat.module.forge.TileEngineFe; -import buildcraft.core.item.ItemEngine_BC8; -import buildcraft.lib.block.BlockPropertiesCreator; -import buildcraft.lib.registry.RegistrationHelper; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.material.Material; -import net.minecraftforge.registries.RegistryObject; - -public class BCCompatBlocks { - public static final RegistrationHelper HELPER = new RegistrationHelper(BCCompat.MODID); - public static final RegistryObject engineFe; - public static final RegistryObject> engineFeTile; - - static { - engineFe = HELPER.addBlockAndItem("block.engine.bc." + EnumEnergyCompatEngineTypes.FE.getSerializedName(), - BlockPropertiesCreator.createDefaultProperties(Material.METAL) - .strength(5.0F, 10.0F) - .sound(SoundType.METAL) - .noOcclusion() - , (idBC, properties) -> new BlockEnergyCompatEngine_BC8(idBC, properties, EnumEnergyCompatEngineTypes.FE, TileEngineFe::new), ItemEngine_BC8::new); - engineFeTile = HELPER.registerTile("tile.engine.fe", TileEngineFe::new, engineFe); - } - - public static void fmlPreInit() { - } -} diff --git a/common/buildcraft/compat/BCCompatModels.java b/common/buildcraft/compat/BCCompatModels.java deleted file mode 100644 index 6da31b2..0000000 --- a/common/buildcraft/compat/BCCompatModels.java +++ /dev/null @@ -1,102 +0,0 @@ -package buildcraft.compat; - -import buildcraft.api.enums.EnumPowerStage; -import buildcraft.compat.module.forge.EnumEnergyCompatEngineTypes; -import buildcraft.compat.module.forge.RenderEngineFe; -import buildcraft.compat.module.forge.TileEngineFe; -import buildcraft.core.block.BlockEngine_BC8; -import buildcraft.lib.client.model.ModelHolderVariable; -import buildcraft.lib.client.model.ModelItemSimple; -import buildcraft.lib.client.model.MutableQuad; -import buildcraft.lib.engine.TileEngineBase_BC8; -import buildcraft.lib.expression.DefaultContexts; -import buildcraft.lib.expression.FunctionContext; -import buildcraft.lib.expression.node.value.NodeVariableDouble; -import buildcraft.lib.expression.node.value.NodeVariableObject; -import buildcraft.lib.misc.ExpressionCompat; -import buildcraft.lib.misc.data.ModelVariableData; -import net.minecraft.client.renderer.blockentity.BlockEntityRenderers; -import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.core.Direction; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.client.event.EntityRenderersEvent; -import net.minecraftforge.client.event.ModelBakeEvent; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.ModList; -import net.minecraftforge.fml.javafmlmod.FMLModContainer; - -import java.util.Arrays; -import java.util.stream.Collectors; - -@OnlyIn(Dist.CLIENT) -public class BCCompatModels { - private static final NodeVariableDouble ENGINE_PROGRESS; - private static final NodeVariableObject ENGINE_STAGE; - private static final NodeVariableObject ENGINE_FACING; - - private static final ModelHolderVariable ENGINE_FE; - - static { - FunctionContext fnCtx = new FunctionContext(ExpressionCompat.ENUM_POWER_STAGE, DefaultContexts.createWithAll()); - ENGINE_PROGRESS = fnCtx.putVariableDouble("progress"); - ENGINE_STAGE = fnCtx.putVariableObject("stage", EnumPowerStage.class); - ENGINE_FACING = fnCtx.putVariableObject("direction", Direction.class); - // TODO: Item models from "item/engine_stone.json" - ENGINE_FE = new ModelHolderVariable( - "buildcraftcompat:models/tiles/engine_fe.json", - fnCtx - ); - BlockEngine_BC8.setModel(EnumEnergyCompatEngineTypes.FE, ENGINE_FE); - } - - public static void fmlPreInit() { - // 1.18.2: following events are IModBusEvent - IEventBus modEventBus = ((FMLModContainer) ModList.get().getModContainerById(BCCompat.MODID).get()).getEventBus(); - modEventBus.register(BCCompatModels.class); - } - - @SubscribeEvent - public static void onTesrReg(EntityRenderersEvent.RegisterRenderers event) { - BlockEntityRenderers.register(BCCompatBlocks.engineFeTile.get(), RenderEngineFe::new); - } - - @SubscribeEvent - public static void onModelBake(ModelBakeEvent event) { - ENGINE_PROGRESS.value = 0.2; - ENGINE_STAGE.value = EnumPowerStage.BLUE; - ENGINE_FACING.value = Direction.UP; - ModelVariableData varData = new ModelVariableData(); - varData.setNodes(ENGINE_FE.createTickableNodes()); - varData.tick(); - varData.refresh(); - event.getModelRegistry().put( - new ModelResourceLocation(BCCompatBlocks.engineFe.getId(), "inventory"), - new ModelItemSimple( - Arrays.stream(ENGINE_FE.getCutoutQuads()) - .map(MutableQuad::toBakedItem) - .collect(Collectors.toList()), - ModelItemSimple.TRANSFORM_BLOCK, - true - ) - ); - } - - private static MutableQuad[] getEngineQuads(ModelHolderVariable model, - TileEngineBase_BC8 tile, - float partialTicks) { - ENGINE_PROGRESS.value = tile.getProgressClient(partialTicks); - ENGINE_STAGE.value = tile.getPowerStage(); - ENGINE_FACING.value = tile.getCurrentFacing(); - if (tile.clientModelData.hasNoNodes()) { - tile.clientModelData.setNodes(model.createTickableNodes()); - } - tile.clientModelData.refresh(); - return model.getCutoutQuads(); - } - - public static MutableQuad[] getFeEngineQuads(TileEngineFe tile, float partialTicks) { - return getEngineQuads(ENGINE_FE, tile, partialTicks); - } -} diff --git a/common/buildcraft/compat/BCCompatProxy.java b/common/buildcraft/compat/BCCompatProxy.java index ffcb5ff..1e79f0d 100644 --- a/common/buildcraft/compat/BCCompatProxy.java +++ b/common/buildcraft/compat/BCCompatProxy.java @@ -36,7 +36,6 @@ public static class ClientProxy extends BCCompatProxy { @Override public void fmlPreInit() { super.fmlPreInit(); - BCCompatModels.fmlPreInit(); } } } diff --git a/common/buildcraft/compat/datagen/BCCompatDataGenerators.java b/common/buildcraft/compat/datagen/BCCompatDataGenerators.java deleted file mode 100644 index 8629407..0000000 --- a/common/buildcraft/compat/datagen/BCCompatDataGenerators.java +++ /dev/null @@ -1,23 +0,0 @@ -package buildcraft.compat.datagen; - -import buildcraft.core.BCCore; -import net.minecraft.data.DataGenerator; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.forge.event.lifecycle.GatherDataEvent; - -@Mod.EventBusSubscriber(modid = BCCore.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) -public class BCCompatDataGenerators { - @SubscribeEvent - public static void onGatherData(GatherDataEvent event) { - DataGenerator generator = event.getGenerator(); - ExistingFileHelper existingFileHelper = event.getExistingFileHelper(); - - // BlockState and Block Model - generator.addProvider(new CompatBlockStateGenerator(generator, existingFileHelper)); - - // Item Model - generator.addProvider(new CompatItemModelGenerator(generator, existingFileHelper)); - } -} diff --git a/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java b/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java deleted file mode 100644 index 13edea4..0000000 --- a/common/buildcraft/compat/datagen/CompatBlockStateGenerator.java +++ /dev/null @@ -1,19 +0,0 @@ -package buildcraft.compat.datagen; - -import buildcraft.compat.BCCompat; -import buildcraft.compat.BCCompatBlocks; -import buildcraft.datagen.base.BCBaseBlockStateGenerator; -import net.minecraft.data.DataGenerator; -import net.minecraftforge.common.data.ExistingFileHelper; - -public class CompatBlockStateGenerator extends BCBaseBlockStateGenerator { - public CompatBlockStateGenerator(DataGenerator gen, ExistingFileHelper exFileHelper) { - super(gen, BCCompat.MODID, exFileHelper); - } - - @Override - protected void registerStatesAndModels() { - // fe engine - builtinEntity(BCCompatBlocks.engineFe.get(), "buildcraftcompat:block/engine/fe/back"); - } -} diff --git a/common/buildcraft/compat/datagen/CompatItemModelGenerator.java b/common/buildcraft/compat/datagen/CompatItemModelGenerator.java deleted file mode 100644 index da6af70..0000000 --- a/common/buildcraft/compat/datagen/CompatItemModelGenerator.java +++ /dev/null @@ -1,19 +0,0 @@ -package buildcraft.compat.datagen; - -import buildcraft.compat.BCCompat; -import buildcraft.compat.BCCompatBlocks; -import buildcraft.datagen.base.BCBaseItemModelGenerator; -import net.minecraft.data.DataGenerator; -import net.minecraftforge.common.data.ExistingFileHelper; - -public class CompatItemModelGenerator extends BCBaseItemModelGenerator { - public CompatItemModelGenerator(DataGenerator generator, ExistingFileHelper existingFileHelper) { - super(generator, BCCompat.MODID, existingFileHelper); - } - - @Override - protected void registerModels() { - // fe engine - getBuilder(BCCompatBlocks.engineFe.get().getRegistryName().toString()).parent(BUILTIN_ENTITY); - } -} diff --git a/common/buildcraft/compat/module/forge/BlockEnergyCompatEngine_BC8.java b/common/buildcraft/compat/module/forge/BlockEnergyCompatEngine_BC8.java deleted file mode 100644 index bb018c8..0000000 --- a/common/buildcraft/compat/module/forge/BlockEnergyCompatEngine_BC8.java +++ /dev/null @@ -1,14 +0,0 @@ -package buildcraft.compat.module.forge; - -import buildcraft.lib.engine.BlockEngineBase_BC8; -import buildcraft.lib.engine.TileEngineBase_BC8; -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.block.state.BlockState; - -import java.util.function.BiFunction; - -public class BlockEnergyCompatEngine_BC8 extends BlockEngineBase_BC8 { - public BlockEnergyCompatEngine_BC8(String idBC, Properties properties, EnumEnergyCompatEngineTypes type, BiFunction engineTileConstructor) { - super(idBC, properties, type, engineTileConstructor); - } -} diff --git a/common/buildcraft/compat/module/forge/EnumEnergyCompatEngineTypes.java b/common/buildcraft/compat/module/forge/EnumEnergyCompatEngineTypes.java deleted file mode 100644 index a1053b2..0000000 --- a/common/buildcraft/compat/module/forge/EnumEnergyCompatEngineTypes.java +++ /dev/null @@ -1,21 +0,0 @@ -package buildcraft.compat.module.forge; - -import buildcraft.api.core.IEngineType; -import net.minecraft.util.StringRepresentable; - -public enum EnumEnergyCompatEngineTypes implements StringRepresentable, IEngineType { - FE("compat", "fe"); - - public static final EnumEnergyCompatEngineTypes[] VALUES = values(); - - public final String unlocalizedTag; - - EnumEnergyCompatEngineTypes(String mod, String loc) { - unlocalizedTag = loc; - } - - @Override - public String getSerializedName() { - return unlocalizedTag; - } -} diff --git a/common/buildcraft/compat/module/forge/RenderEngineFe.java b/common/buildcraft/compat/module/forge/RenderEngineFe.java deleted file mode 100644 index 8bef1b2..0000000 --- a/common/buildcraft/compat/module/forge/RenderEngineFe.java +++ /dev/null @@ -1,20 +0,0 @@ -package buildcraft.compat.module.forge; - -import buildcraft.compat.BCCompatModels; -import buildcraft.lib.client.model.MutableQuad; -import buildcraft.lib.client.render.tile.RenderEngine_BC8; -import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - -@OnlyIn(Dist.CLIENT) -public class RenderEngineFe extends RenderEngine_BC8 { - public RenderEngineFe(BlockEntityRendererProvider.Context context) { - super(context); - } - - @Override - protected MutableQuad[] getEngineModel(TileEngineFe engine, float partialTicks) { - return BCCompatModels.getFeEngineQuads(engine, partialTicks); - } -} diff --git a/common/buildcraft/compat/module/forge/TileEngineFe.java b/common/buildcraft/compat/module/forge/TileEngineFe.java deleted file mode 100644 index a9b3341..0000000 --- a/common/buildcraft/compat/module/forge/TileEngineFe.java +++ /dev/null @@ -1,113 +0,0 @@ -package buildcraft.compat.module.forge; - -import buildcraft.api.core.EnumPipePart; -import buildcraft.api.enums.EnumPowerStage; -import buildcraft.api.mj.IMjConnector; -import buildcraft.api.mj.MjAPI; -import buildcraft.compat.BCCompatBlocks; -import buildcraft.lib.engine.EngineConnector; -import buildcraft.lib.engine.TileEngineBase_BC8; -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.energy.CapabilityEnergy; -import net.minecraftforge.energy.IEnergyStorage; -import org.jetbrains.annotations.NotNull; - -public class TileEngineFe extends TileEngineBase_BC8 { - private static final int MJ_CAP = 10_000; - private static final int FE_CAP = convert_mMJ_2_FE(MJ_CAP * MjAPI.MJ); - - private final IEnergyStorage feStorage = new IEnergyStorage() { - @Override - public int receiveEnergy(int maxReceive, boolean simulate) { - int received_FE = Math.min(convert_mMJ_2_FE(TileEngineFe.this.getMaxPower() - TileEngineFe.this.getEnergyStored()), maxReceive); - if (!simulate) { - addPower(convert_FE_2_mMJ(received_FE)); - } - return received_FE; - } - - @Override - public int extractEnergy(int maxExtract, boolean simulate) { - return 0; - } - - @Override - public int getEnergyStored() { - return convert_mMJ_2_FE(TileEngineFe.this.getEnergyStored()); - } - - @Override - public int getMaxEnergyStored() { - return FE_CAP; - } - - @Override - public boolean canExtract() { - return false; - } - - @Override - public boolean canReceive() { - return true; - } - }; - - public TileEngineFe(BlockPos pos, BlockState blockState) { - super(BCCompatBlocks.engineFeTile.get(), pos, blockState); - caps.addCapabilityInstance(CapabilityEnergy.ENERGY, this.feStorage, EnumPipePart.VALUES); - } - - @NotNull - @Override - protected IMjConnector createConnector() { - return new EngineConnector(false); - } - - @Override - public boolean isBurning() { - return isRedstonePowered; - } - - @Override - public long getMaxPower() { - return MJ_CAP * MjAPI.MJ; - } - - @Override - public long maxPowerReceived() { - return 2_000 * MjAPI.MJ; - } - - @Override - public long maxPowerExtracted() { - return 1_000 * MjAPI.MJ; - } - - @Override - public float explosionRange() { - return 0; - } - - @Override - public long getCurrentOutput() { - return 256 * MjAPI.MJ; - } - - @Override - protected EnumPowerStage computePowerStage() { - return EnumPowerStage.RED; - } - - @Override - protected void burn() { - } - - public static int convert_mMJ_2_FE(long mMJ) { - return (int) Math.min(Integer.MAX_VALUE, mMJ * 16L / MjAPI.MJ); - } - - public static long convert_FE_2_mMJ(int fe) { - return fe * MjAPI.MJ / 16L; - } -} diff --git a/common/buildcraft/compat/module/jei/BCPluginJEI.java b/common/buildcraft/compat/module/jei/BCPluginJEI.java index fdb7189..c7ef598 100644 --- a/common/buildcraft/compat/module/jei/BCPluginJEI.java +++ b/common/buildcraft/compat/module/jei/BCPluginJEI.java @@ -4,7 +4,9 @@ import buildcraft.api.core.BCLog; import buildcraft.api.enums.EnumEngineType; import buildcraft.api.fuels.IFuel; +import buildcraft.api.recipes.IProgrammingRecipe; import buildcraft.api.recipes.IRefineryRecipeManager; +import buildcraft.api.recipes.IntegrationRecipe; import buildcraft.compat.BCCompatConfig; import buildcraft.compat.module.jei.energy.combustionengine.CategoryCombustionEngine; import buildcraft.compat.module.jei.factory.CategoryCoolable; @@ -12,6 +14,8 @@ import buildcraft.compat.module.jei.factory.CategoryHeatable; import buildcraft.compat.module.jei.gui.GuiHandlerBuildCraft; import buildcraft.compat.module.jei.silicon.CategoryAssemblyTable; +import buildcraft.compat.module.jei.silicon.CategoryIntegrationTable; +import buildcraft.compat.module.jei.silicon.CategoryProgrammingTable; import buildcraft.compat.module.jei.transferhandlers.AdvancedCraftingItemsTransferHandler; import buildcraft.compat.module.jei.transferhandlers.AutoCraftItemsTransferHandler; import buildcraft.core.BCCoreBlocks; @@ -20,9 +24,12 @@ import buildcraft.lib.recipe.assembly.AssemblyRecipe; import buildcraft.lib.recipe.assembly.AssemblyRecipeRegistry; import buildcraft.lib.recipe.fuel.FuelRegistry; +import buildcraft.lib.recipe.programming.ProgrammingRecipeManager; import buildcraft.silicon.BCSiliconBlocks; import buildcraft.silicon.BCSiliconItems; import buildcraft.silicon.container.ContainerAssemblyTable; +import buildcraft.silicon.container.ContainerIntegrationTable; +import buildcraft.silicon.container.ContainerProgrammingTable_Neptune; import buildcraft.transport.pipe.PipeRegistry; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -98,6 +105,8 @@ public void registerRecipes(IRecipeRegistration registry) { // registry.handleRecipes(AssemblyRecipeBasic.class, WrapperAssemblyTable::new, "buildcraft-compat:silicon.assembly"); // registry.addRecipes(ImmutableList.copyOf(AssemblyRecipeRegistry.REGISTRY.values()), new ResourceLocation("buildcraft-compat:silicon.assembly")); registry.addRecipes(CategoryAssemblyTable.RECIPE_TYPE, ImmutableList.copyOf(Minecraft.getInstance().level.getRecipeManager().getAllRecipesFor(AssemblyRecipe.TYPE))); + registry.addRecipes(CategoryIntegrationTable.RECIPE_TYPE, ImmutableList.copyOf(Minecraft.getInstance().level.getRecipeManager().getAllRecipesFor(IntegrationRecipe.TYPE))); + registry.addRecipes(CategoryProgrammingTable.RECIPE_TYPE, ImmutableList.copyOf(Minecraft.getInstance().level.getRecipeManager().getAllRecipesFor(IProgrammingRecipe.TYPE))); } } @@ -111,6 +120,8 @@ public void registerRecipeTransferHandlers(IRecipeTransferRegistration registry) registry.addRecipeTransferHandler(new AdvancedCraftingItemsTransferHandler(), RecipeTypes.CRAFTING); // registry.addRecipeTransferHandler(ContainerAssemblyTable.class, "buildcraft-compat:silicon.assembly", 36, 12, 0, 36); registry.addRecipeTransferHandler(ContainerAssemblyTable.class, CategoryAssemblyTable.RECIPE_TYPE, 36, 12, 0, 36); + registry.addRecipeTransferHandler(ContainerIntegrationTable.class, CategoryIntegrationTable.RECIPE_TYPE, 36, 11, 0, 36); + registry.addRecipeTransferHandler(ContainerProgrammingTable_Neptune.class, CategoryProgrammingTable.RECIPE_TYPE, 36, 26, 0, 36); } @Override @@ -140,6 +151,8 @@ public void registerCategories(IRecipeCategoryRegistration registry) { lst.add("silicon"); // registry.addRecipeCategories(new IRecipeCategory[]{new CategoryAssemblyTable(helper)}); registry.addRecipeCategories(new IRecipeCategory[] { new CategoryAssemblyTable(helper, AssemblyRecipeRegistry.getAll(Minecraft.getInstance().level)) }); + registry.addRecipeCategories(new IRecipeCategory[] { new CategoryIntegrationTable(helper) }); + registry.addRecipeCategories(new IRecipeCategory[] { new CategoryProgrammingTable(helper, ProgrammingRecipeManager.INSTANCE.getRecipes(Minecraft.getInstance().level)) }); } BCLog.logger.info("Loaded JEI mods: " + Arrays.toString(lst.toArray())); @@ -192,6 +205,8 @@ public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) { if (BCSiliconBlocks.assemblyTable != null) { // registry.addRecipeCatalyst(new ItemStack(BCSiliconBlocks.assemblyTable.get()), new String[]{"buildcraft-compat:silicon.assembly"}); registry.addRecipeCatalyst(new ItemStack(BCSiliconBlocks.assemblyTable.get()), CategoryAssemblyTable.RECIPE_TYPE); + registry.addRecipeCatalyst(new ItemStack(BCSiliconBlocks.integrationTable.get()), CategoryIntegrationTable.RECIPE_TYPE); + registry.addRecipeCatalyst(new ItemStack(BCSiliconBlocks.programmingTable.get()), CategoryProgrammingTable.RECIPE_TYPE); } if (BCSiliconBlocks.advancedCraftingTable != null) { diff --git a/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java b/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java index 7a86b93..709fc13 100644 --- a/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java +++ b/common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java @@ -2,10 +2,9 @@ import buildcraft.api.BCModules; import buildcraft.api.mj.MjAPI; +import buildcraft.api.recipes.IngredientStack; import buildcraft.api.recipes.IntegrationRecipe; import buildcraft.silicon.BCSiliconBlocks; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; import com.mojang.blaze3d.vertex.PoseStack; import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; @@ -25,14 +24,13 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.level.block.Blocks; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import java.awt.*; import java.util.List; -//public class CategoryIntegrationTable implements IRecipeCategory +// public class CategoryIntegrationTable implements IRecipeCategory public class CategoryIntegrationTable implements IRecipeCategory { // Calen public static final RecipeType RECIPE_TYPE = @@ -44,28 +42,19 @@ public class CategoryIntegrationTable implements IRecipeCategory inputs; - private final List outputs; @OnlyIn(Dist.CLIENT) private Font font = Minecraft.getInstance().font; - public CategoryIntegrationTable(IGuiHelper guiHelper, IntegrationRecipe recipe) { + public CategoryIntegrationTable(IGuiHelper guiHelper) { // this.background = guiHelper.createDrawable(this.backgroundLocation, 17, 22, 153, 71, 0, 0, 9, 0); - this.background = guiHelper.drawableBuilder(this.backgroundLocation, 17, 22, 153, 71).addPadding(0, 0, 9, 0).build(); + this.background = guiHelper.drawableBuilder(this.backgroundLocation, 17, 21, 153, 72).addPadding(0, 0, 9, 0).build(); this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(BCSiliconBlocks.integrationTable.get())); - this.recipe = recipe; - // Calen: not impl in 1.12.2 - List inputs = Lists.newArrayList(); - this.inputs = ImmutableList.copyOf(inputs); - this.outputs = ImmutableList.of(new ItemStack(Blocks.COBBLESTONE)); - ResourceLocation backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/integration_table.png"); // IDrawableStatic progressDrawable = guiHelper.createDrawable(backgroundLocation, 176, 17, 4, 69, 0, 0, 0, 0); - IDrawableStatic progressDrawable = guiHelper.drawableBuilder(this.backgroundLocation, 176, 17, 4, 69).addPadding(0, 0, 0, 0).build(); + IDrawableStatic progressDrawable = guiHelper.drawableBuilder(this.backgroundLocation, 176, 0, 4, 70).addPadding(0, 0, 0, 0).build(); this.progressBar = guiHelper.createAnimatedDrawable(progressDrawable, 720, IDrawableAnimated.StartDirection.BOTTOM, false); } @@ -97,13 +86,11 @@ public IDrawable getIcon() { return this.icon; } - @OnlyIn(Dist.CLIENT) @Override public void draw(IntegrationRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) { - this.progressBar.draw(stack, 156, 1); - this.font.draw(stack, MjAPI.formatMj(0L) + " MJ", 80, 52, Color.gray.getRGB()); - + progressBar.draw(stack, 156, 1); + this.font.draw(stack, MjAPI.formatMj(recipe.getRequiredMicroJoules()) + " MJ", 80, 52, Color.gray.getRGB()); } @Override @@ -113,16 +100,25 @@ public void setRecipe(IRecipeLayoutBuilder builder, IntegrationRecipe recipe, IF // List> inputs = ingredients.getInputs(ItemStack.class); // int inventoryIndex = 0; + List surroundings = recipe.getRequirements(); + int surroundingsIndexCounter = 0; for (int y = 0; y < 3; ++y) { for (int x = 0; x < 3; ++x) { - int slotIndex = x == 1 && y == 1 ? 0 : x + y * 3 + 1; - if (inputs.size() > slotIndex) { -// guiItemStacks.init(inventoryIndex, true, 19 + x * 25, 24 + y * 25); -// guiItemStacks.set(inventoryIndex, (List) inputs.get(slotIndex)); +// int slotIndex = x == 1 && y == 1 ? 0 : x + y * 3 + 1; +// if (inputs.size() > slotIndex) { +// guiItemStacks.init(inventoryIndex, true, 11 + x * 25, 3 + y * 25); +// guiItemStacks.set(inventoryIndex, inputs.get(slotIndex)); +// inventoryIndex++; +// } + if (x == 1 && y == 1) { + builder + .addSlot(RecipeIngredientRole.INPUT, 11 + x * 25, 3 + y * 25) + .addIngredients(recipe.getCenterStack().ingredient); + } else if (surroundingsIndexCounter < surroundings.size()) { builder - .addSlot(RecipeIngredientRole.INPUT, 19 + x * 25, 24 + y * 25) - .addIngredient(VanillaTypes.ITEM_STACK, this.inputs.get(slotIndex)); -// ++inventoryIndex; + .addSlot(RecipeIngredientRole.INPUT, 11 + x * 25, 3 + y * 25) + .addIngredients(surroundings.get(surroundingsIndexCounter).ingredient); + surroundingsIndexCounter++; } } } @@ -130,8 +126,7 @@ public void setRecipe(IRecipeLayoutBuilder builder, IntegrationRecipe recipe, IF // guiItemStacks.init(inventoryIndex, false, 129, 26); // guiItemStacks.set(inventoryIndex, (List) ingredients.getOutputs(ItemStack.class).get(0)); builder - .addSlot(RecipeIngredientRole.INPUT, 129, 26) - .addIngredients(Ingredient.of(this.outputs.stream())); -// ++inventoryIndex; + .addSlot(RecipeIngredientRole.OUTPUT, 130, 28) + .addIngredients(Ingredient.of(recipe.getExampleOutput())); } } diff --git a/common/buildcraft/compat/module/jei/silicon/CategoryProgrammingTable.java b/common/buildcraft/compat/module/jei/silicon/CategoryProgrammingTable.java new file mode 100644 index 0000000..5543e3e --- /dev/null +++ b/common/buildcraft/compat/module/jei/silicon/CategoryProgrammingTable.java @@ -0,0 +1,114 @@ +package buildcraft.compat.module.jei.silicon; + +import buildcraft.api.BCModules; +import buildcraft.api.mj.MjAPI; +import buildcraft.api.recipes.IProgrammingRecipe; +import buildcraft.silicon.BCSiliconBlocks; +import com.mojang.blaze3d.vertex.PoseStack; +import mezz.jei.api.constants.VanillaTypes; +import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; +import mezz.jei.api.gui.drawable.IDrawable; +import mezz.jei.api.gui.drawable.IDrawableAnimated; +import mezz.jei.api.gui.drawable.IDrawableStatic; +import mezz.jei.api.gui.ingredient.IRecipeSlotsView; +import mezz.jei.api.helpers.IGuiHelper; +import mezz.jei.api.recipe.IFocusGroup; +import mezz.jei.api.recipe.RecipeIngredientRole; +import mezz.jei.api.recipe.RecipeType; +import mezz.jei.api.recipe.category.IRecipeCategory; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Font; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +import java.awt.*; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +public class CategoryProgrammingTable implements IRecipeCategory { + public static final RecipeType RECIPE_TYPE = + RecipeType.create(BCModules.SILICON.getModId(), "programming", IProgrammingRecipe.class); + public static final ResourceLocation UID = new ResourceLocation(BCModules.SILICON.getModId(), "programming"); + protected final ResourceLocation backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/programming_table.png"); + private final IDrawable background; + private final IDrawable inputSlot; + private final IDrawable outputSlot; + private final IDrawable arrow; + private final IDrawable progressBarBackground; + private final IDrawableAnimated defaultProgressBar; + private final Map progressBarMap = new HashMap<>(); + private final IDrawable icon; + @OnlyIn(Dist.CLIENT) + private Font font = Minecraft.getInstance().font; + + public CategoryProgrammingTable(IGuiHelper guiHelper, Collection recipes) { + this.background = guiHelper.createBlankDrawable(72, 72); + this.inputSlot = guiHelper.drawableBuilder(this.backgroundLocation, 7, 35, 18, 18).build(); + this.outputSlot = guiHelper.drawableBuilder(this.backgroundLocation, 7, 89, 18, 18).build(); + this.arrow = guiHelper.drawableBuilder(this.backgroundLocation, 28, 40, 11, 8).build(); + this.progressBarBackground = guiHelper.drawableBuilder(this.backgroundLocation, 163, 35, 6, 72).build(); + + this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(BCSiliconBlocks.programmingTable.get())); + + IDrawableStatic progressDrawable = guiHelper.drawableBuilder(this.backgroundLocation, 176, 18, 4, 70).addPadding(0, 0, 0, 0).build(); + this.defaultProgressBar = guiHelper.createAnimatedDrawable(progressDrawable, 720, IDrawableAnimated.StartDirection.BOTTOM, false); + for (IProgrammingRecipe recipe : recipes) { + long mj = recipe.getEnergyCost(); + progressBarMap.put(mj, guiHelper.createAnimatedDrawable(progressDrawable, (int) Math.max(10L, mj / MjAPI.MJ / 50L), IDrawableAnimated.StartDirection.BOTTOM, false)); + } + } + + @Override + public Component getTitle() { + return new TranslatableComponent("tile.programmingTableBlock.name"); + } + + @Override + public IDrawable getBackground() { + return background; + } + + @Override + public IDrawable getIcon() { + return this.icon; + } + + @Override + public ResourceLocation getUid() { + return UID; + } + + @Override + public Class getRecipeClass() { + return IProgrammingRecipe.class; + } + + @OnlyIn(Dist.CLIENT) + @Override + public void draw(IProgrammingRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) { + this.inputSlot.draw(stack, 2, 27); + this.arrow.draw(stack, 2 + 18 + 5, 27 + 5); + this.outputSlot.draw(stack, 2 + 18 + 5 + 11 + 5, 27); + this.progressBarBackground.draw(stack, 66, 0); + this.progressBarMap.getOrDefault(recipe.getEnergyCost(), this.defaultProgressBar).draw(stack, 67, 1); + long mj = recipe.getEnergyCost(); + this.font.draw(stack, MjAPI.formatMj(mj) + " MJ", 10, 30 + 5 + 8 + 10, Color.gray.getRGB()); + } + + @Override + public void setRecipe(IRecipeLayoutBuilder builder, IProgrammingRecipe recipe, IFocusGroup focuses) { + builder + .addSlot(RecipeIngredientRole.INPUT, 2 + 1, 27 + 1) + .addIngredients(recipe.getInput().ingredient); + + builder + .addSlot(RecipeIngredientRole.OUTPUT, 2 + 18 + 5 + 11 + 5 + 1, 27 + 1) + .addIngredients(Ingredient.of(recipe.getOutput())); + } +} diff --git a/common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java b/common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java index 122b09e..1aefed5 100644 --- a/common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java +++ b/common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java @@ -30,6 +30,7 @@ public enum BCPluginTOP implements Function, IBlockDisplayOv INSTANCE; static final String TOP_MOD_ID = "theoneprobe"; + @Override // @Method(modid = "theoneprobe") public Void apply(ITheOneProbe top) { top.registerBlockDisplayOverride(this); @@ -37,12 +38,14 @@ public Void apply(ITheOneProbe top) { return null; } + @Override // @Method(modid = "theoneprobe") // public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo probeInfo, Player player, Level world, BlockState blockState, IProbeHitData data) { return false; } + @Override // @Method(modid = "theoneprobe") // public String getID() public ResourceLocation getID() { @@ -50,6 +53,7 @@ public ResourceLocation getID() { return new ResourceLocation("buildcraftcompat.top"); } + @Override // @Method(modid = "theoneprobe") // public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, Player player, Level world, BlockState blockState, IProbeHitData data) { @@ -68,7 +72,6 @@ public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, Player player, Le this.addAssemblyInfo(probeInfo, (IAssemblyCraft) entity); } } - } // @Method(modid = "theoneprobe") @@ -88,7 +91,6 @@ private void addAutoCraftInfo(IProbeInfo probeInfo, IAutoCraft crafter) { IProbeInfo mainInfo = probeInfo.vertical(); mainInfo.horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)).text(new TranslatableComponent("buildcraft.waila.no_recipe")); } - } // @Method(modid = "theoneprobe") diff --git a/common/buildcraft/compat/module/waila/BaseWailaDataProvider.java b/common/buildcraft/compat/module/waila/BaseWailaDataProvider.java index ebf7a6c..b109da3 100644 --- a/common/buildcraft/compat/module/waila/BaseWailaDataProvider.java +++ b/common/buildcraft/compat/module/waila/BaseWailaDataProvider.java @@ -1,12 +1,10 @@ package buildcraft.compat.module.waila; -import mcp.mobius.waila.api.BlockAccessor; -import mcp.mobius.waila.api.IComponentProvider; -import mcp.mobius.waila.api.IServerDataProvider; -import mcp.mobius.waila.api.ITooltip; +import mcp.mobius.waila.api.*; import mcp.mobius.waila.api.config.IPluginConfig; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.Entity; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; @@ -30,4 +28,22 @@ public void appendServerData(CompoundTag tag, ServerPlayer player, Level blockAc abstract void getNBTData(CompoundTag tag, ServerPlayer player, Level blockAccessor, BlockEntity blockEntity, boolean showDetails); } + + static abstract class BodyProviderEntity implements IEntityComponentProvider { + @Override + public void appendTooltip(ITooltip iTooltip, EntityAccessor blockAccessor, IPluginConfig iPluginConfig) { + getWailaBody(iTooltip, blockAccessor, iPluginConfig); + } + + abstract void getWailaBody(ITooltip iTooltip, EntityAccessor accessor, IPluginConfig iPluginConfig); + } + + static abstract class NBTProviderEntity implements IServerDataProvider { + @Override + public void appendServerData(CompoundTag tag, ServerPlayer player, Level world, Entity entity, boolean showDetails) { + getNBTData(tag, player, world, entity, showDetails); + } + + abstract void getNBTData(CompoundTag tag, ServerPlayer player, Level world, Entity entity, boolean showDetails); + } } diff --git a/common/buildcraft/compat/module/waila/HWYLAPlugin.java b/common/buildcraft/compat/module/waila/HWYLAPlugin.java index 43ee5ea..d36979e 100644 --- a/common/buildcraft/compat/module/waila/HWYLAPlugin.java +++ b/common/buildcraft/compat/module/waila/HWYLAPlugin.java @@ -1,8 +1,10 @@ package buildcraft.compat.module.waila; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.lib.block.BlockBCTile_Neptune; import buildcraft.lib.tile.TileBC_Neptune; import mcp.mobius.waila.api.*; +import net.minecraft.world.entity.Entity; import net.minecraft.world.level.block.entity.BlockEntity; @WailaPlugin @@ -15,11 +17,13 @@ public void register(IWailaCommonRegistration registrar) { IServerDataProvider laserTargetNbtProvider = new LaserTargetDataProvider.NBTProvider(); IServerDataProvider assemblyCraftNbtProvider = new AssemblyCraftDataProvider.NBTProvider(); IServerDataProvider mjStorageNbtProvider = new MjStorageDataProvider.NBTProvider(); + IServerDataProvider robotPowerNbtProvider = new RobotPowerDataProvider.NBTProvider(); registrar.registerBlockDataProvider(autoCraftNbtProvider, TileBC_Neptune.class); registrar.registerBlockDataProvider(laserTargetNbtProvider, TileBC_Neptune.class); registrar.registerBlockDataProvider(assemblyCraftNbtProvider, TileBC_Neptune.class); registrar.registerBlockDataProvider(mjStorageNbtProvider, TileBC_Neptune.class); + registrar.registerEntityDataProvider(robotPowerNbtProvider, EntityRobotBase.class); } @Override @@ -28,10 +32,12 @@ public void registerClient(IWailaClientRegistration registrar) { IComponentProvider laserTargetBodyProvider = new LaserTargetDataProvider.BodyProvider(); IComponentProvider assemblyCraftBodyProvider = new AssemblyCraftDataProvider.BodyProvider(); IComponentProvider mjStorageBodyProvider = new MjStorageDataProvider.BodyProvider(); + IEntityComponentProvider robotPowerBodyProvider = new RobotPowerDataProvider.BodyProvider(); registrar.registerComponentProvider(autoCraftBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); registrar.registerComponentProvider(laserTargetBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); registrar.registerComponentProvider(assemblyCraftBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); registrar.registerComponentProvider(mjStorageBodyProvider, TooltipPosition.BODY, BlockBCTile_Neptune.class); + registrar.registerComponentProvider(robotPowerBodyProvider, TooltipPosition.BODY, EntityRobotBase.class); } } diff --git a/common/buildcraft/compat/module/waila/RobotPowerDataProvider.java b/common/buildcraft/compat/module/waila/RobotPowerDataProvider.java new file mode 100644 index 0000000..4b3f193 --- /dev/null +++ b/common/buildcraft/compat/module/waila/RobotPowerDataProvider.java @@ -0,0 +1,54 @@ +package buildcraft.compat.module.waila; + +import buildcraft.api.mj.MjAPI; +import buildcraft.api.robots.EntityRobotBase; +import mcp.mobius.waila.api.EntityAccessor; +import mcp.mobius.waila.api.ITooltip; +import mcp.mobius.waila.api.config.IPluginConfig; +import mcp.mobius.waila.impl.ui.BorderStyle; +import mcp.mobius.waila.impl.ui.ProgressElement; +import mcp.mobius.waila.impl.ui.ProgressStyle; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.chat.TextComponent; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.Level; + +public class RobotPowerDataProvider { + static class BodyProvider extends BaseWailaDataProvider.BodyProviderEntity { + private static final ProgressStyle PROGRESS_STYLE; + + static { + PROGRESS_STYLE = new ProgressStyle(); + PROGRESS_STYLE.color(-15731468, -16721961) + .textColor(DyeColor.WHITE.getTextColor()); + } + + @Override + public void getWailaBody(ITooltip currentTip, EntityAccessor accessor, IPluginConfig iPluginConfig) { + if (accessor.getEntity() instanceof EntityRobotBase) { + CompoundTag nbt = accessor.getServerData(); + if (nbt.contains("mj_storage", Tag.TAG_COMPOUND)) { + CompoundTag mj_storage_Tag = nbt.getCompound("mj_storage"); + long mj_capability = mj_storage_Tag.getLong("mj_capability"); + long mj_stored = mj_storage_Tag.getLong("mj_stored"); + currentTip.add(new ProgressElement((float) (((double) mj_stored) / ((double) mj_capability)), new TextComponent(mj_stored + " MJ/" + mj_capability + "MJ"), PROGRESS_STYLE, new BorderStyle())); + } + } + } + } + + static class NBTProvider extends BaseWailaDataProvider.NBTProviderEntity { + @Override + public void getNBTData(CompoundTag nbt, ServerPlayer player, Level world, Entity entity, boolean showDetails) { + if (entity instanceof EntityRobotBase) { + CompoundTag mj_storage_Tag = new CompoundTag(); + mj_storage_Tag.putLong("mj_capability", ((EntityRobotBase) entity).getBattery().getCapacity() / MjAPI.MJ); + mj_storage_Tag.putLong("mj_stored", ((EntityRobotBase) entity).getBattery().getStored() / MjAPI.MJ); + nbt.put("mj_storage", mj_storage_Tag); + } + } + } +} diff --git a/resources/assets/buildcraftcompat/lang/en_us.json b/resources/assets/buildcraftcompat/lang/en_us.json index fdf3671..03be0b4 100644 --- a/resources/assets/buildcraftcompat/lang/en_us.json +++ b/resources/assets/buildcraftcompat/lang/en_us.json @@ -41,8 +41,5 @@ "buildcraft.waila.crafting_from": "§fFrom: ", "buildcraft.waila.waiting_for_laser": "§fWaiting from laser: §b%s MJ", - // Calen FE compat - "tile.power_convertor.name": "Power Convertor", - "null": "=w=" } diff --git a/resources/assets/buildcraftcompat/lang/zh_cn.json b/resources/assets/buildcraftcompat/lang/zh_cn.json index 772f4f1..9bf01fe 100644 --- a/resources/assets/buildcraftcompat/lang/zh_cn.json +++ b/resources/assets/buildcraftcompat/lang/zh_cn.json @@ -36,8 +36,5 @@ "buildcraft.waila.crafting_from": "§f使用: ", "buildcraft.waila.waiting_for_laser": "§f还需要能量: §b%s MJ", - // Calen FE compat - "tile.power_convertor.name": "能源转换器", - "null": "=w=" } diff --git a/resources/assets/buildcraftcompat/models/tiles/engine_fe.json b/resources/assets/buildcraftcompat/models/tiles/engine_fe.json deleted file mode 100644 index 9e4921b..0000000 --- a/resources/assets/buildcraftcompat/models/tiles/engine_fe.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "textures": { - "#back":"buildcraftcompat:block/engine/fe/back", - "#side":"buildcraftcompat:block/engine/fe/side" - }, - "parent":"buildcraftlib:models/tiles/engine_base" -} diff --git a/resources/assets/buildcraftcompat/textures/block/engine/fe/back.png b/resources/assets/buildcraftcompat/textures/block/engine/fe/back.png deleted file mode 100644 index 06da85225017205de7397d88ff759b3a94821106..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 460 zcmV;-0WEj-sCeeS$ouV}3m=N$L@eH4Wd zMzenIU=iW@d;(Bw#R5#zM2wO1`ON>s;cyt=R#gchFijHx`~4nO9U9bHQPlysTrNu; zI)f0x5GJLx0M}YqMFu_^%o&IXA%q2Z&Y;(%l)emJuh(DzkWxZb$vOW8257C}y+=eo z4K|z2;-_;C0OuSzXMmCCm$cTt4A!ELxaS@@=W$j5@BJ{x96Z;czxkJ$cDt_Gw1Y(i z@BNrYHyMEa_4)6d*P`2d7zyC|62=&E&STMfvlt_#ln;YB?Y_EQlYg!8JpKS;V&J`$ec0y!0000 zi-E7Opkwyi1E)7Vco(uaukUdO(+=ykrg!F+#&&YJv~(yKcXBYC$uVb6QJXfC=P<*D z>vvtkukst;E6-oEs`|y!pXPN6{lC}#U^vzOgT2Q2fbgF)xk1+p{#*mPkipZ{&t;uc GLK6U9sb}v1 From fdb62402e4ade9db16401a20c445d9e6228d76b9 Mon Sep 17 00:00:00 2001 From: CalenXwX Date: Thu, 24 Apr 2025 20:11:54 +0800 Subject: [PATCH 15/15] Update gitsubmodule --- .gitignore | 1 + BuildCraft | 2 +- build.gradle | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f73156f..4cdb876 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ libs #runtime run run_server +run_data #mac .DS_Store diff --git a/BuildCraft b/BuildCraft index 53b1cfa..fccc1d4 160000 --- a/BuildCraft +++ b/BuildCraft @@ -1 +1 @@ -Subproject commit 53b1cfaeb689294b59dc73cfaad110d0dfafa336 +Subproject commit fccc1d4530c575f850c52ed23b4df3700f7e1a14 diff --git a/build.gradle b/build.gradle index 7631b52..d212458 100755 --- a/build.gradle +++ b/build.gradle @@ -149,7 +149,7 @@ minecraft { } data { - workingDirectory project.file('run') + workingDirectory project.file('run_data') property 'forge.logging.markers', 'REGISTRIES'