├── .gitignore ├── .gitmodules ├── .travis.yml ├── README.md ├── build.gradle ├── build.properties ├── common └── buildcraft │ └── compat │ ├── BCCompat.java │ ├── CompatModuleBase.java │ ├── CompatUtils.java │ ├── module │ ├── crafttweaker │ │ ├── AssemblyTable.java │ │ ├── CombustionEngine.java │ │ ├── CompatModuleCraftTweaker.java │ │ └── Refinery.java │ ├── forestry │ │ ├── CompatModuleForestry.java │ │ ├── list │ │ │ └── ListMatchGenome.java │ │ └── pipe │ │ │ ├── ContainerPropolisPipe.java │ │ │ ├── ForestryPipes.java │ │ │ └── PipeBehaviourPropolis.java │ ├── ic2 │ │ └── CompatModuleIndustrialCraft2.java │ ├── jei │ │ ├── BCPluginJEI.java │ │ ├── energy │ │ │ └── combustionengine │ │ │ │ ├── CategoryCombustionEngine.java │ │ │ │ ├── HandlerCombustionEngine.java │ │ │ │ ├── WrapperCombustionEngine.java │ │ │ │ └── package-info.java │ │ ├── factory │ │ │ ├── CategoryCoolable.java │ │ │ ├── CategoryDistiller.java │ │ │ ├── CategoryHeatable.java │ │ │ ├── HandlerCoolable.java │ │ │ ├── HandlerDistiller.java │ │ │ ├── HandlerHeatable.java │ │ │ ├── WrapperCoolable.java │ │ │ ├── WrapperDistiller.java │ │ │ ├── WrapperHeatable.java │ │ │ └── package-info.java │ │ ├── recipe │ │ │ ├── GateGuiHandler.java │ │ │ ├── GuiHandlerBuildCraft.java │ │ │ ├── HandlerFlexibleRecipe.java │ │ │ └── LedgerGuiHandler.java │ │ ├── silicon │ │ │ ├── CategoryAssemblyTable.java │ │ │ ├── CategoryIntegrationTable.java │ │ │ ├── HandlerIntegrationTable.java │ │ │ ├── Utils.java │ │ │ ├── WrapperAssemblyTable.java │ │ │ ├── WrapperIntegrationTable.java │ │ │ └── package-info.java │ │ └── transferhandlers │ │ │ ├── AdvancedCraftingItemsTransferHandler.java │ │ │ ├── AssemblyTableTransferHandler.java │ │ │ ├── AutoCraftItemsTransferHandler.java │ │ │ └── package-info.java │ ├── theoneprobe │ │ ├── BCPluginTOP.java │ │ └── CompatModuleTheOneProbe.java │ └── waila │ │ ├── AutoCraftDataProvider.java │ │ ├── BaseWailaDataProvider.java │ │ ├── HWYLAPlugin.java │ │ └── LaserTargetDataProvider.java │ └── network │ ├── CompatGui.java │ └── IGuiCreator.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── guidelines ├── Buildcraft.xml ├── buildcraft.checkstyle ├── buildcraft.checkstyle.xml ├── buildcraft.epf └── header.txt ├── resources ├── LICENSE.COMPAT ├── assets │ └── buildcraftcompat │ │ ├── lang │ │ ├── de_DE.lang │ │ ├── en_US.lang │ │ ├── fr_FR.lang │ │ ├── ko_KR.lang │ │ ├── pt_BR.lang │ │ ├── ru_RU.lang │ │ ├── uk_UA.lang │ │ └── zh_CN.lang │ │ └── textures │ │ ├── gui │ │ └── propolisPipe.png │ │ ├── items │ │ ├── action_bundled.png │ │ ├── propolisPipe │ │ │ ├── anything.png │ │ │ ├── bee.png │ │ │ ├── cave.png │ │ │ ├── closed.png │ │ │ ├── drone.png │ │ │ ├── flyer.png │ │ │ ├── item.png │ │ │ ├── nocturnal.png │ │ │ ├── princess.png │ │ │ ├── pure_breed.png │ │ │ ├── pure_cave.png │ │ │ ├── pure_flyer.png │ │ │ ├── pure_nocturnal.png │ │ │ └── queen.png │ │ ├── statements │ │ │ └── mfr │ │ │ │ ├── ConveyorReversed.png │ │ │ │ ├── ConveyorRunning.png │ │ │ │ └── ReverseConveyor.png │ │ ├── trigger_bundled_off.png │ │ └── trigger_bundled_on.png │ │ └── pipes │ │ ├── propolis.png │ │ ├── propolis_down.png │ │ ├── propolis_east.png │ │ ├── propolis_itemstack.png │ │ ├── propolis_north.png │ │ ├── propolis_south.png │ │ ├── propolis_up.png │ │ └── propolis_west.png ├── changelog_compat │ ├── 7.0.0 │ ├── 7.0.1 │ ├── 7.0.10 │ ├── 7.0.11 │ ├── 7.0.12 │ ├── 7.0.2 │ ├── 7.0.3 │ ├── 7.0.4 │ ├── 7.0.5 │ ├── 7.0.6 │ ├── 7.0.8 │ ├── 7.0.9 │ ├── 7.1.0 │ ├── 7.1.1 │ ├── 7.1.2 │ ├── 7.1.3 │ ├── 7.2.0 │ ├── 7.2.1 │ ├── 7.99.14 │ └── 7.99.15 └── mcmod.info └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | #eclipse 2 | .project 3 | .classpath 4 | .metadata 5 | org.* 6 | bin 7 | *.launch 8 | 9 | #idea 10 | *.iml 11 | *.ipr 12 | *.iws 13 | .idea 14 | out 15 | 16 | #gradle 17 | build 18 | .gradle 19 | libs 20 | 21 | #runtime 22 | run 23 | classes 24 | 25 | #mac 26 | .DS_Store 27 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "BuildCraft"] 2 | path = BuildCraft 3 | url = https://github.com/BuildCraft/BuildCraft.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - openjdk8 4 | 5 | jobs: 6 | include: 7 | - stage: build 8 | install: ./gradlew setupCiWorkspace 9 | script: ./gradlew build 10 | env: 11 | global: 12 | TERM=dumb 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | BuildcraftCompat 2 | ================ 3 | 4 | This mod is implementing third party mod compatibility and integration layers with BuildCraft. 5 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // DON'T TOUCH THE BUILDSCRIPT[] BLOCK 2 | // its special, and it is only there to make ForgeGradle work correctly. 3 | 4 | buildscript { 5 | repositories { 6 | mavenCentral() 7 | maven { 8 | name = "forge" 9 | url = "https://files.minecraftforge.net/maven" 10 | } 11 | maven { 12 | name = "sonatype" 13 | url = "https://oss.sonatype.org/content/repositories/snapshots/" 14 | } 15 | maven { 16 | url "https://plugins.gradle.org/m2/" 17 | } 18 | } 19 | dependencies { 20 | classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT" 21 | classpath "org.ajoberstar:grgit:2.2.1" 22 | } 23 | } 24 | 25 | apply plugin: "net.minecraftforge.gradle.forge" // adds the forge dependency 26 | apply plugin: "maven" // for uploading to a maven repo 27 | apply plugin: 'maven-publish' // for uploading to a maven repo 28 | apply plugin: "org.ajoberstar.grgit" 29 | 30 | ext.configFile = file "build.properties" 31 | configFile.withReader { 32 | // Load config. It shall from now be referenced as simply config or project.config 33 | def prop = new Properties() 34 | File cfg2 = file "BuildCraft/build.properties" 35 | cfg2.withReader { 36 | prop.load(it) 37 | } 38 | prop.load(it) 39 | project.ext.config = new ConfigSlurper().parse prop 40 | } 41 | 42 | version = config.compat_version 43 | group = "com.mod-buildcraft-compat" 44 | archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension] 45 | 46 | ext { 47 | compatModInfo = new groovy.json.JsonSlurper().parse(file("resources/mcmod.info")) 48 | mainModInfo = new groovy.json.JsonSlurper().parse(file("BuildCraft/buildcraft_resources/mcmod.info")) 49 | } 50 | 51 | sourceCompatibility = 1.8 52 | targetCompatibility = 1.8 53 | 54 | repositories { 55 | maven { name="JEI"; url="http://dvs1.progwml6.com/files/maven" } 56 | maven { name="TOP"; url="http://maven.tterrag.com/" } 57 | maven { name="cofh"; url="http://maven.covers1624.net" } 58 | maven { name "CraftTweaker"; url "http://maven.blamejared.com/" } 59 | maven { name "personal_mirror_for_buildcraft"; url "https://alexiil.uk/mirrors/for_buildcraft_compat/maven" } 60 | } 61 | 62 | dependencies { 63 | // JEI Stuff 64 | // Versions from http://minecraft.curseforge.com/projects/just-enough-items-jei/files 65 | compileOnly "mezz.jei:jei_${config.mc_version}:${config.jei_version}:api" 66 | runtime "mezz.jei:jei_${config.mc_version}:${config.jei_version}" 67 | 68 | // The One Probe Stuff 69 | compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${config.top_version}:api" 70 | runtime "mcjty.theoneprobe:TheOneProbe-1.12:${config.top_version}" 71 | // The One Probe depends on the RF api for some odd reason... we never intend to add support for RF ourselves though. 72 | 73 | // HWYLA 74 | compileOnly "mcp.mobius.waila:Hwyla:${config.hwyla_version}:api" 75 | runtime "mcp.mobius.waila:Hwyla:${config.hwyla_version}" 76 | 77 | // Forestry 78 | deobfCompile "net.sengir.forestry:forestry_${config.mc_version}:${config.forestry_version}" 79 | 80 | // CraftTweaker 81 | deobfCompile "CraftTweaker2:CraftTweaker2-API:${config.crafttweaker_version}" 82 | deobfCompile "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-${config.crafttweaker_version}" 83 | } 84 | 85 | minecraft { 86 | version = config.mc_version + "-" + config.forge_version 87 | runDir = "run" 88 | 89 | // the mappings can be changed at any time, and must be in the following format. 90 | // snapshot_YYYYMMDD snapshot are built nightly. 91 | // stable_# stables are built at the discretion of the MCP team. 92 | // Use non-default mappings at your own risk. they may not allways work. 93 | // simply re-run your setup task after changing the mappings to update your workspace. 94 | mappings = config.mappings_version 95 | 96 | useDepAts = true 97 | 98 | def separate = Boolean.getBoolean("build_compat_only") 99 | if (separate) { 100 | project.version = config.compat_version 101 | } else { 102 | project.version = config.mod_version; 103 | } 104 | 105 | def addVersionDetails = !Boolean.getBoolean("release") 106 | 107 | // Git versioning stuffs 108 | if (grgit != null) { 109 | def repo = grgit.open(dir: project.rootDir) 110 | replace "\${git_commit_hash}", repo.head().id 111 | replace "\${git_commit_msg}", repo.head().fullMessage.replace("\"", "\\\\\\\"").split("\n")[0] 112 | replace "\${git_commit_author}", repo.head().author.name 113 | replace "\${git_branch}", repo.branch.current().getName() 114 | if (addVersionDetails) { 115 | project.version += "-" + repo.head().id.toString().substring(0, 12) 116 | } 117 | } else { 118 | if (addVersionDetails) { 119 | project.version += "-SNAPSHOT" 120 | } 121 | } 122 | 123 | // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. 124 | 125 | // replacing stuff in the source 126 | replace "\$version", project.version 127 | replace "\${mcversion}", version 128 | // Replace @Mod.acceptedMinecraftVersions specially as it has to be a valid version in a dev environment :/ 129 | replace "(gradle_replace_mcversion,)", "[" + version + "]" 130 | replace "(gradle_replace_forgeversion,)", "[" + config.forge_version + ",)" 131 | replace "\$bc_version", config.mod_version 132 | 133 | useDepAts = true 134 | } 135 | 136 | compileJava { 137 | options.compilerArgs << "-Xmaxerrs" << "2000" 138 | options.compilerArgs << "-Xmaxwarns" << "2" 139 | options.compilerArgs << "-Xlint:all" 140 | options.compilerArgs << "-Xdiags:verbose" 141 | options.compilerArgs << "-encoding" << "UTF-8" 142 | } 143 | 144 | javadoc { 145 | options.setUse(true) 146 | options.addStringsOption("Xmaxerrs").setValue(["2000"]) 147 | options.addStringsOption("Xmaxwarns").setValue(["2000"]) 148 | options.addStringsOption("Xdoclint:all") 149 | options.setEncoding("UTF-8") 150 | } 151 | 152 | task setupSubProjects(dependsOn: "BuildCraft:sub_projects:expression:generateSources") { 153 | // Just an inter-dependency task 154 | } 155 | 156 | eclipseClasspath.dependsOn setupSubProjects 157 | ideaModule.dependsOn setupSubProjects 158 | compileApiJava.dependsOn setupSubProjects 159 | 160 | // configure the source folders 161 | sourceSets { 162 | api { 163 | java { 164 | srcDir "BuildCraft/BuildCraftAPI/api" 165 | srcDir "BuildCraft/common" 166 | srcDir "BuildCraft/sub_projects/expression/src/main/java" 167 | srcDir "BuildCraft/sub_projects/expression/src/autogen/java" 168 | } 169 | resources { 170 | srcDir "BuildCraft/buildcraft_resources" 171 | srcDir "BuildCraft/BuildCraftGuide/guide_resources" 172 | exclude "pack.png" // exclude from the guide repo 173 | exclude "pack.mcmeta" // exclude from the guide repo 174 | } 175 | } 176 | main { 177 | java { 178 | srcDir "common" 179 | } 180 | resources { 181 | srcDir "resources" 182 | } 183 | } 184 | } 185 | 186 | // Obfuscated Jar location 187 | ext.jarFile = zipTree(jar.archivePath) 188 | 189 | processResources { 190 | // replace stuff in mcmod.info, nothing else 191 | from(sourceSets.main.resources.srcDirs) { 192 | include 'mcmod.info' 193 | 194 | // replace version and mcversion 195 | // ${version} and ${mcversion} are the exact strings being replaced 196 | expand 'version': project.version, 'mcversion': project.minecraft.version, 'modid': config.modid 197 | } 198 | 199 | // copy everything else, that's not the mcmod.info 200 | from(sourceSets.main.resources.srcDirs) { 201 | exclude 'mcmod.info' 202 | exclude 'pack.mcmeta' 203 | exclude 'pack.png' 204 | } 205 | } 206 | 207 | def createAllModInfo() { 208 | return new File("$projectDir/build/processing/compat-all/mcmod.info") 209 | } 210 | 211 | task writeAllModInfo() { 212 | outputs.upToDateWhen { false } 213 | doLast { 214 | File temp = createAllModInfo() 215 | temp.parentFile.mkdirs() 216 | if (temp.exists()) 217 | temp.delete() 218 | temp.createNewFile() 219 | def elements = []; 220 | for (int i = 0; i < mainModInfo.size(); i++) { 221 | elements += mainModInfo[i]; 222 | } 223 | elements += compatModInfo[0]; 224 | String prettyPrinted = groovy.json.JsonOutput.prettyPrint(groovy.json.JsonOutput.toJson(elements)) 225 | prettyPrinted = prettyPrinted.replace("\$version", project.version) 226 | prettyPrinted = prettyPrinted.replace("\${mcversion}", project.minecraft.version) 227 | temp.write(prettyPrinted) 228 | return temp 229 | } 230 | } 231 | 232 | def unzippedSourceJar = new File("$projectDir/build/processing/tasks/unzipped_src_jar/unzip") 233 | def libsDir = new File(System.getenv("LIBS_DIR") ?: "build/libs/", project.version) 234 | def modulesDir = new File(libsDir, "modules") 235 | 236 | // forge (or gradle?) creates a special sourceJar which has been processed 237 | // This task unzips that created jar, so that partial source jars can be created. 238 | task unzipSourceJar(type: Copy, dependsOn: sourceJar) { 239 | from (zipTree(sourceJar.archivePath)) { 240 | include "**" 241 | } 242 | into unzippedSourceJar 243 | } 244 | 245 | task compatJar(type: Jar, dependsOn:reobfJar) { 246 | destinationDir = modulesDir 247 | appendix = "compat" 248 | version = project.version 249 | 250 | from(project.ext.jarFile) { 251 | includes.addAll("**") 252 | } 253 | } 254 | 255 | task allJar(type: Jar, dependsOn: [reobfJar, writeAllModInfo]) { 256 | destinationDir = libsDir 257 | appendix = "all" 258 | version = project.version 259 | 260 | from(createAllModInfo().parentFile) 261 | from(project.ext.jarFile) { 262 | includes.addAll("**") 263 | exclude("mcmod.info") 264 | } 265 | } 266 | 267 | task allSrcJar(type: Jar, dependsOn:[reobfJar, writeAllModInfo, unzipSourceJar]) { 268 | destinationDir = libsDir 269 | appendix = "all" 270 | classifier = "sources" 271 | 272 | from(createAllModInfo().parentFile) 273 | from(unzippedSourceJar) { 274 | includes.add("**") 275 | exclude("mcmod.info") 276 | } 277 | } 278 | 279 | build.dependsOn compatJar, allJar, allSrcJar 280 | 281 | publishing { 282 | repositories { 283 | maven { 284 | url System.getenv("MAVEN_DIR") ?: "$projectDir/build/maven" 285 | } 286 | } 287 | publications { 288 | pub_allJar(MavenPublication) { 289 | groupId "com.mod-buildcraft" 290 | artifactId "buildcraft-all" 291 | version project.version 292 | 293 | artifact allJar 294 | } 295 | pub_apiSrcJar(MavenPublication) { 296 | groupId "com.mod-buildcraft" 297 | artifactId "buildcraft-all" 298 | version project.version 299 | 300 | artifact allSrcJar 301 | } 302 | } 303 | } 304 | -------------------------------------------------------------------------------- /build.properties: -------------------------------------------------------------------------------- 1 | compat_version=7.99.15 2 | 3 | jei_version=4.8.5.138 4 | top_version=1.12-1.4.19-11 5 | hwyla_version=1.8.22-B37_1.12 6 | forestry_version=5.7.0.236 7 | crafttweaker_version=4.1.9.491 8 | ic2_version=2.8.221-ex112 9 | -------------------------------------------------------------------------------- /common/buildcraft/compat/BCCompat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 SpaceToad and the BuildCraft team 3 | * 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 4 | * distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/ 5 | */ 6 | 7 | package buildcraft.compat; 8 | 9 | import java.util.HashMap; 10 | import java.util.LinkedHashMap; 11 | import java.util.Map; 12 | 13 | import net.minecraftforge.common.config.Property; 14 | import net.minecraftforge.fml.common.Mod; 15 | import net.minecraftforge.fml.common.event.FMLInitializationEvent; 16 | import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; 17 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 18 | import net.minecraftforge.fml.common.network.NetworkRegistry; 19 | 20 | import buildcraft.api.core.BCLog; 21 | 22 | import buildcraft.compat.module.crafttweaker.CompatModuleCraftTweaker; 23 | import buildcraft.compat.module.forestry.CompatModuleForestry; 24 | import buildcraft.compat.module.ic2.CompatModuleIndustrialCraft2; 25 | import buildcraft.compat.module.theoneprobe.CompatModuleTheOneProbe; 26 | import buildcraft.compat.network.CompatGui; 27 | import buildcraft.core.BCCoreConfig; 28 | 29 | //@formatter:off 30 | @Mod( 31 | modid = BCCompat.MODID, 32 | name = "BuildCraft Compat", 33 | version = BCCompat.VERSION, 34 | updateJSON = "https://mod-buildcraft.com/version/versions-compat.json", 35 | acceptedMinecraftVersions = "(gradle_replace_mcversion,)", 36 | dependencies = BCCompat.DEPENDENCIES 37 | ) 38 | //@formatter:on 39 | public class BCCompat { 40 | 41 | static final String DEPENDENCIES = "required-after:forge@(gradle_replace_forgeversion,)"// 42 | + ";required-after:buildcraftcore@[$bc_version,)"// 43 | + ";after:buildcrafttransport"// 44 | + ";after:buildcraftbuilders"// 45 | + ";after:buildcraftsilicon"// 46 | + ";after:theoneprobe"// 47 | + ";after:forestry"// 48 | + ";after:crafttweaker"// 49 | + ";after:ic2"// 50 | ; 51 | 52 | public static final String MODID = "buildcraftcompat"; 53 | public static final String VERSION = "$version"; 54 | public static final String GIT_BRANCH = "${git_branch}"; 55 | public static final String GIT_COMMIT_HASH = "${git_commit_hash}"; 56 | public static final String GIT_COMMIT_MSG = "${git_commit_msg}"; 57 | public static final String GIT_COMMIT_AUTHOR = "${git_commit_author}"; 58 | 59 | @Mod.Instance(MODID) 60 | public static BCCompat instance; 61 | 62 | private static final Map modules = new LinkedHashMap<>(); 63 | 64 | private static void offerAndPreInitModule(final CompatModuleBase module) { 65 | String cModId = module.compatModId(); 66 | if (module.canLoad()) { 67 | Property prop = BCCoreConfig.config.get("modules", cModId, true); 68 | if (prop.getBoolean(true)) { 69 | modules.put(cModId, module); 70 | BCLog.logger.info("[compat] + " + cModId); 71 | module.preInit(); 72 | } else { 73 | BCLog.logger.info("[compat] x " + cModId + " (It has been disabled in the config)"); 74 | } 75 | } else { 76 | BCLog.logger.info("[compat] x " + cModId + " (It cannot load)"); 77 | } 78 | } 79 | 80 | @Mod.EventHandler 81 | public static void preInit(final FMLPreInitializationEvent evt) { 82 | 83 | BCLog.logger.info(""); 84 | BCLog.logger.info("Starting BuildCraftCompat " + VERSION); 85 | BCLog.logger.info("Copyright (c) the BuildCraft team, 2011-2017"); 86 | BCLog.logger.info("https://www.mod-buildcraft.com"); 87 | if (!GIT_COMMIT_HASH.startsWith("${")) { 88 | BCLog.logger.info("Detailed Build Information:"); 89 | BCLog.logger.info(" Branch " + GIT_BRANCH); 90 | BCLog.logger.info(" Commit " + GIT_COMMIT_HASH); 91 | BCLog.logger.info(" " + GIT_COMMIT_MSG); 92 | BCLog.logger.info(" committed by " + GIT_COMMIT_AUTHOR); 93 | } 94 | BCLog.logger.info(""); 95 | 96 | BCLog.logger.info("[compat] Module list:"); 97 | // List of all modules 98 | offerAndPreInitModule(new CompatModuleForestry()); 99 | offerAndPreInitModule(new CompatModuleTheOneProbe()); 100 | offerAndPreInitModule(new CompatModuleCraftTweaker()); 101 | offerAndPreInitModule(new CompatModuleIndustrialCraft2()); 102 | // End of module list 103 | } 104 | 105 | @Mod.EventHandler 106 | public static void init(final FMLInitializationEvent evt) { 107 | NetworkRegistry.INSTANCE.registerGuiHandler(instance, CompatGui.guiHandlerProxy); 108 | 109 | // compatChannelHandler = new ChannelHandler(); 110 | // MinecraftForge.EVENT_BUS.register(this); 111 | 112 | // compatChannelHandler.registerPacketType(PacketGenomeFilterChange.class); 113 | // compatChannelHandler.registerPacketType(PacketTypeFilterChange.class); 114 | // compatChannelHandler.registerPacketType(PacketRequestFilterSet.class); 115 | 116 | for (final CompatModuleBase m : modules.values()) { 117 | m.init(); 118 | } 119 | } 120 | 121 | @Mod.EventHandler 122 | public static void postInit(final FMLPostInitializationEvent evt) { 123 | for (final CompatModuleBase m : modules.values()) { 124 | m.postInit(); 125 | } 126 | } 127 | 128 | // @Mod.EventHandler 129 | // public void missingMapping(FMLMissingMappingsEvent event) { 130 | // CompatModuleForestry.missingMapping(event); 131 | // } 132 | 133 | // @SubscribeEvent 134 | // @SideOnly(Side.CLIENT) 135 | // public void handleTextureRemap(TextureStitchEvent.Pre event) { 136 | // if (event.map.getTextureType() == 1) { 137 | // TextureManager.getInstance().initIcons(event.map); 138 | // } 139 | // } 140 | 141 | // public static boolean isLoaded(String module) { 142 | // return moduleNames.contains(module); 143 | // } 144 | 145 | // public static boolean hasModule(final String module) { 146 | // return BuildCraftCompat.moduleNames.contains(module); 147 | // } 148 | } 149 | -------------------------------------------------------------------------------- /common/buildcraft/compat/CompatModuleBase.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat; 2 | 3 | import net.minecraftforge.fml.common.Loader; 4 | 5 | public abstract class CompatModuleBase { 6 | public boolean canLoad() { 7 | return Loader.isModLoaded(this.compatModId()); 8 | } 9 | 10 | public abstract String compatModId(); 11 | 12 | public String comment() { 13 | return null; 14 | } 15 | 16 | public void preInit() { 17 | } 18 | 19 | public void init() { 20 | } 21 | 22 | public void postInit() { 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common/buildcraft/compat/CompatUtils.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat; 2 | 3 | import java.util.List; 4 | 5 | import com.google.common.collect.Lists; 6 | 7 | import net.minecraft.item.ItemStack; 8 | 9 | import net.minecraftforge.common.capabilities.Capability; 10 | 11 | import buildcraft.api.core.CapabilitiesHelper; 12 | 13 | import buildcraft.lib.tile.item.ItemHandlerSimple; 14 | 15 | import buildcraft.compat.network.IGuiCreator; 16 | 17 | public class CompatUtils { 18 | 19 | public static final Capability CAP_GUI_CREATOR = 20 | CapabilitiesHelper.registerCapability(IGuiCreator.class); 21 | 22 | private CompatUtils() {} 23 | 24 | public static List compactInventory(ItemHandlerSimple inventory) { 25 | List stacks = Lists.newArrayList(); 26 | 27 | for (int slot = 0; slot < inventory.getSlots(); slot++) { 28 | ItemStack stack = inventory.getStackInSlot(slot); 29 | if (stack.isEmpty()) { 30 | continue; 31 | } 32 | 33 | boolean handled = false; 34 | for (ItemStack existing : stacks) { 35 | if (existing.isItemEqual(stack)) { 36 | existing.grow(stack.getCount()); 37 | handled = true; 38 | break; 39 | } 40 | } 41 | if (!handled) { 42 | stacks.add(stack.copy()); 43 | } 44 | } 45 | 46 | return stacks; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/crafttweaker/AssemblyTable.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.crafttweaker; 2 | 3 | import com.google.common.collect.ImmutableSet; 4 | import com.google.common.collect.ImmutableSet.Builder; 5 | 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.item.crafting.Ingredient; 8 | import net.minecraft.util.ResourceLocation; 9 | 10 | import buildcraft.api.mj.MjAPI; 11 | import buildcraft.api.recipes.AssemblyRecipeBasic; 12 | import buildcraft.api.recipes.IngredientStack; 13 | 14 | import buildcraft.lib.recipe.AssemblyRecipeRegistry; 15 | 16 | import crafttweaker.CraftTweakerAPI; 17 | import crafttweaker.IAction; 18 | import crafttweaker.annotations.ModOnly; 19 | import crafttweaker.api.item.IIngredient; 20 | import crafttweaker.api.item.IItemStack; 21 | import crafttweaker.api.minecraft.CraftTweakerMC; 22 | import stanhebben.zenscript.annotations.ZenClass; 23 | import stanhebben.zenscript.annotations.ZenMethod; 24 | 25 | @ZenClass("mods.buildcraft.AssemblyTable") 26 | @ModOnly("buildcraftsilicon") 27 | public class AssemblyTable { 28 | 29 | private static int ids; 30 | 31 | @ZenMethod 32 | public static void addRecipe(IItemStack output, int power, IIngredient[] ingredients) { 33 | addRecipe0("auto_" + ids++, output, power, ingredients); 34 | } 35 | 36 | @ZenMethod 37 | public static void addRecipe(String name, IItemStack output, int power, IIngredient[] ingredients) { 38 | addRecipe0("custom/" + name, output, power, ingredients); 39 | } 40 | 41 | private static void addRecipe0(String name, IItemStack output, int power, IIngredient[] ingredients) { 42 | CraftTweakerAPI.apply(new AddRecipeAction(name, output, power, ingredients)); 43 | } 44 | 45 | @ZenMethod 46 | public static void removeByName(String name) { 47 | CraftTweakerAPI.apply(new RemoveRecipeByNameAction(new ResourceLocation(name))); 48 | } 49 | 50 | // ###################### 51 | // ### Action classes ### 52 | // ###################### 53 | 54 | private static class AddRecipeAction implements IAction { 55 | 56 | private final ItemStack output; 57 | private final ResourceLocation name; 58 | private final long requiredMj; 59 | private final ImmutableSet requiredStacks; 60 | 61 | public AddRecipeAction(String name, IItemStack output, int power, IIngredient[] ingredients) { 62 | this.output = CraftTweakerMC.getItemStack(output); 63 | 64 | Builder stacks = ImmutableSet.builder(); 65 | for (int i = 0; i < ingredients.length; i++) { 66 | IIngredient ctIng = ingredients[i]; 67 | Ingredient ingredient = CraftTweakerMC.getIngredient(ctIng); 68 | stacks.add(new IngredientStack(ingredient, Math.max(1, ctIng.getAmount()))); 69 | } 70 | requiredStacks = stacks.build(); 71 | 72 | this.requiredMj = power * MjAPI.MJ; 73 | this.name = new ResourceLocation("crafttweaker", name); 74 | } 75 | 76 | @Override 77 | public void apply() { 78 | AssemblyRecipeRegistry.REGISTRY.put(name, 79 | new AssemblyRecipeBasic(name, requiredMj, requiredStacks, output)); 80 | } 81 | 82 | @Override 83 | public String describe() { 84 | return "Adding assembly table recipe for " + output; 85 | } 86 | } 87 | 88 | private static class RemoveRecipeByNameAction implements IAction { 89 | private final ResourceLocation name; 90 | 91 | RemoveRecipeByNameAction(ResourceLocation name) { 92 | this.name = name; 93 | } 94 | 95 | @Override 96 | public void apply() { 97 | AssemblyRecipeRegistry.REGISTRY.remove(name); 98 | } 99 | 100 | @Override 101 | public String describe() { 102 | return "Removing assembly table recipe " + name; 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/crafttweaker/CombustionEngine.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.crafttweaker; 2 | 3 | import net.minecraftforge.fluids.FluidStack; 4 | 5 | import buildcraft.api.fuels.BuildcraftFuelRegistry; 6 | import buildcraft.api.mj.MjAPI; 7 | 8 | import buildcraft.lib.engine.TileEngineBase_BC8; 9 | 10 | import crafttweaker.CraftTweakerAPI; 11 | import crafttweaker.IAction; 12 | import crafttweaker.annotations.ModOnly; 13 | import crafttweaker.api.liquid.ILiquidStack; 14 | import crafttweaker.api.minecraft.CraftTweakerMC; 15 | import stanhebben.zenscript.annotations.ZenClass; 16 | import stanhebben.zenscript.annotations.ZenMethod; 17 | 18 | @ZenClass("mods.buildcraft.CombustionEngine") 19 | @ModOnly("buildcraftenergy") 20 | public class CombustionEngine { 21 | 22 | private static final double MAX_POWER 23 | = (TileEngineBase_BC8.MAX_HEAT - TileEngineBase_BC8.MIN_HEAT) / TileEngineBase_BC8.HEAT_PER_MJ; 24 | 25 | @ZenMethod 26 | public static void addCleanFuel(ILiquidStack liquid, double powerPerTick, int timePerBucket) { 27 | FluidStack fluid = CraftTweakerMC.getLiquidStack(liquid); 28 | if (fluid == null) { 29 | throw new IllegalArgumentException("Fluid was null!"); 30 | } 31 | if (BuildcraftFuelRegistry.fuel.getFuel(fluid) != null) { 32 | throw new IllegalArgumentException("The fluid " + fluid + " is already registered as a fuel!"); 33 | } 34 | if (BuildcraftFuelRegistry.coolant.getCoolant(fluid) != null) { 35 | throw new IllegalArgumentException( 36 | "The fluid " + fluid 37 | + " is already registered as a coolant - so it won't work very well if you add it as a fuel too!" 38 | ); 39 | } 40 | if (powerPerTick <= 0) { 41 | throw new IllegalArgumentException("Power was less than or equal to 0!"); 42 | } 43 | if (powerPerTick > MAX_POWER) { 44 | throw new IllegalArgumentException( 45 | "Maximum power is " + MAX_POWER 46 | + ", as any values above this would instantly bring the engine to overheat." 47 | ); 48 | } 49 | long mj = (long) (MjAPI.MJ * powerPerTick); 50 | CraftTweakerAPI.apply(new AddCleanFuel(fluid, mj, timePerBucket)); 51 | } 52 | 53 | @ZenMethod 54 | public static void addDirtyFuel(ILiquidStack lFuel, double powerPerTick, int timePerBucket, ILiquidStack lResidue) { 55 | FluidStack fuel = CraftTweakerMC.getLiquidStack(lFuel); 56 | FluidStack residue = CraftTweakerMC.getLiquidStack(lResidue); 57 | if (fuel.getFluid() == null) { 58 | throw new IllegalArgumentException("Fuel fluid was null!"); 59 | } 60 | if (residue.getFluid() == null) { 61 | throw new IllegalArgumentException("Residue fluid was null!"); 62 | } 63 | if (BuildcraftFuelRegistry.fuel.getFuel(fuel) != null) { 64 | throw new IllegalArgumentException("The fluid " + fuel + " is already registered as a fuel!"); 65 | } 66 | if (BuildcraftFuelRegistry.coolant.getCoolant(fuel) != null) { 67 | throw new IllegalArgumentException( 68 | "The fluid " + fuel 69 | + " is already registered as a coolant - so it won't work very well if you add it as a fuel too!" 70 | ); 71 | } 72 | if (powerPerTick <= 0) { 73 | throw new IllegalArgumentException("Power was less than or equal to 0!"); 74 | } 75 | if (powerPerTick > MAX_POWER) { 76 | throw new IllegalArgumentException( 77 | "Maximum power is " + MAX_POWER 78 | + ", as any values above this would instantly bring the engine to overheat." 79 | ); 80 | } 81 | long mj = (long) (MjAPI.MJ * powerPerTick); 82 | CraftTweakerAPI.apply(new AddDirtyFuel(fuel, mj, timePerBucket, residue)); 83 | } 84 | 85 | // @ZenMethod 86 | // public static void addLiquidCoolant(FluidStack coolant) { 87 | // 88 | // } 89 | // 90 | // @ZenMethod 91 | // public static void addSolidCoolant(ItemStack stack, FluidStack coolant) { 92 | // 93 | // } 94 | 95 | // ###################### 96 | // ### Action classes ### 97 | // ###################### 98 | 99 | static final class AddCleanFuel implements IAction { 100 | 101 | private final FluidStack fluid; 102 | private final long powerPerTick; 103 | private final int totalBurningTime; 104 | 105 | public AddCleanFuel(FluidStack fluid, long powerPerCycle, int totalBurningTime) { 106 | this.fluid = fluid; 107 | this.powerPerTick = powerPerCycle; 108 | this.totalBurningTime = totalBurningTime; 109 | } 110 | 111 | @Override 112 | public void apply() { 113 | BuildcraftFuelRegistry.fuel.addFuel(fluid, powerPerTick, totalBurningTime); 114 | } 115 | 116 | @Override 117 | public String describe() { 118 | return "Adding combustion engine fuel " + fluid; 119 | } 120 | } 121 | 122 | static final class AddDirtyFuel implements IAction { 123 | 124 | private final FluidStack fuel, residue; 125 | private final long powerPerTick; 126 | private final int totalBurningTime; 127 | 128 | public AddDirtyFuel(FluidStack fuel, long powerPerCycle, int totalBurningTime, FluidStack residue) { 129 | this.fuel = fuel; 130 | this.powerPerTick = powerPerCycle; 131 | this.totalBurningTime = totalBurningTime; 132 | this.residue = residue; 133 | } 134 | 135 | @Override 136 | public void apply() { 137 | BuildcraftFuelRegistry.fuel.addDirtyFuel(fuel, powerPerTick, totalBurningTime, residue); 138 | } 139 | 140 | @Override 141 | public String describe() { 142 | return "Adding combustion engine fuel " + fuel; 143 | } 144 | } 145 | 146 | // static final class AddLiquidCoolant implements IAction { 147 | // 148 | // } 149 | // 150 | // static final class AddSolidCoolant implements IAction { 151 | // 152 | // } 153 | } 154 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/crafttweaker/CompatModuleCraftTweaker.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.crafttweaker; 2 | 3 | import buildcraft.compat.CompatModuleBase; 4 | 5 | import crafttweaker.CraftTweakerAPI; 6 | 7 | public class CompatModuleCraftTweaker extends CompatModuleBase { 8 | @Override 9 | public String compatModId() { 10 | return "crafttweaker"; 11 | } 12 | 13 | @Override 14 | public void preInit() { 15 | CraftTweakerAPI.registerClass(AssemblyTable.class); 16 | CraftTweakerAPI.registerClass(CombustionEngine.class); 17 | CraftTweakerAPI.registerClass(Refinery.class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/crafttweaker/Refinery.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.crafttweaker; 2 | 3 | import net.minecraftforge.fluids.FluidStack; 4 | 5 | import buildcraft.api.recipes.BuildcraftRecipeRegistry; 6 | 7 | import crafttweaker.CraftTweakerAPI; 8 | import crafttweaker.IAction; 9 | import crafttweaker.annotations.ModOnly; 10 | import crafttweaker.api.liquid.ILiquidStack; 11 | import crafttweaker.api.minecraft.CraftTweakerMC; 12 | import stanhebben.zenscript.annotations.ZenClass; 13 | import stanhebben.zenscript.annotations.ZenMethod; 14 | 15 | @ZenClass("mods.buildcraft.Refinery") 16 | @ModOnly("buildcraftfactory") 17 | public class Refinery { 18 | 19 | @ZenMethod 20 | public static void addHeatable(ILiquidStack in, ILiquidStack out, int heatFrom, int heatTo) { 21 | FluidStack flIn = CraftTweakerMC.getLiquidStack(in); 22 | if (flIn == null) { 23 | throw new IllegalArgumentException("Input was null!"); 24 | } 25 | FluidStack flOut = CraftTweakerMC.getLiquidStack(out); 26 | if (flOut == null) { 27 | throw new IllegalArgumentException("Output was null!"); 28 | } 29 | if (BuildcraftRecipeRegistry.refineryRecipes.getHeatableRegistry().getRecipeForInput(flIn) != null) { 30 | throw new IllegalArgumentException("The fluid " + flOut + " is already registered as a heatable fluid!"); 31 | } 32 | if (heatFrom < -10 || heatFrom > +20) { 33 | throw new IllegalArgumentException("Heat From (" + heatFrom + ") was out of range [-10, +20] - buildcraft itself only uses 0,1,2,3."); 34 | } 35 | if (heatTo < -10 || heatTo > +20) { 36 | throw new IllegalArgumentException("Heat To (" + heatTo + ") was out of range [-10, +20] - buildcraft itself only uses 0,1,2,3."); 37 | } 38 | if (heatFrom >= heatTo) { 39 | throw new IllegalArgumentException( 40 | "Heat From (" + heatFrom + ") is greater than or equal to Heat To (" + heatTo 41 | + "), which is incorrect for a heatable recipe (the output fluid should be hotter than the input)" 42 | ); 43 | } 44 | CraftTweakerAPI.apply(new AddHeatable(flIn, flOut, heatFrom, heatTo)); 45 | } 46 | 47 | @ZenMethod 48 | public static void addCoolable(ILiquidStack in, ILiquidStack out, int heatFrom, int heatTo) { 49 | FluidStack flIn = CraftTweakerMC.getLiquidStack(in); 50 | if (flIn == null) { 51 | throw new IllegalArgumentException("Input was null!"); 52 | } 53 | FluidStack flOut = CraftTweakerMC.getLiquidStack(out); 54 | if (flOut == null) { 55 | throw new IllegalArgumentException("Output was null!"); 56 | } 57 | if (BuildcraftRecipeRegistry.refineryRecipes.getCoolableRegistry().getRecipeForInput(flIn) != null) { 58 | throw new IllegalArgumentException("The fluid " + flOut + " is already registered as a coolable fluid!"); 59 | } 60 | if (heatFrom < -10 || heatFrom > +20) { 61 | throw new IllegalArgumentException("Heat From (" + heatFrom + ") was out of range [-10, +20] - buildcraft itself only uses 0,1,2,3."); 62 | } 63 | if (heatTo < -10 || heatTo > +20) { 64 | throw new IllegalArgumentException("Heat To (" + heatTo + ") was out of range [-10, +20] - buildcraft itself only uses 0,1,2,3."); 65 | } 66 | if (heatFrom <= heatTo) { 67 | throw new IllegalArgumentException( 68 | "Heat From (" + heatFrom + ") is less than or equal to Heat To (" + heatTo 69 | + "), which is incorrect for a coolable recipe (the output fluid should be colder than the input)" 70 | ); 71 | } 72 | CraftTweakerAPI.apply(new AddCoolable(flIn, flOut, heatFrom, heatTo)); 73 | } 74 | 75 | // @ZenMethod 76 | // public static void addLiquidCoolant(FluidStack coolant) { 77 | // 78 | // } 79 | // 80 | // @ZenMethod 81 | // public static void addSolidCoolant(ItemStack stack, FluidStack coolant) { 82 | // 83 | // } 84 | 85 | // ###################### 86 | // ### Action classes ### 87 | // ###################### 88 | 89 | static abstract class AddHeatTransfer { 90 | final FluidStack input, output; 91 | final int heatFrom, heatTo; 92 | 93 | public AddHeatTransfer(FluidStack input, FluidStack output, int heatFrom, int heatTo) { 94 | this.input = input; 95 | this.output = output; 96 | this.heatFrom = heatFrom; 97 | this.heatTo = heatTo; 98 | } 99 | } 100 | 101 | static final class AddHeatable extends AddHeatTransfer implements IAction { 102 | 103 | public AddHeatable(FluidStack input, FluidStack output, int heatFrom, int heatTo) { 104 | super(input, output, heatFrom, heatTo); 105 | } 106 | 107 | @Override 108 | public void apply() { 109 | BuildcraftRecipeRegistry.refineryRecipes.addHeatableRecipe(input, output, heatFrom, heatTo); 110 | } 111 | 112 | @Override 113 | public String describe() { 114 | return "Adding heatable fluid " + input; 115 | } 116 | } 117 | 118 | static final class AddCoolable extends AddHeatTransfer implements IAction { 119 | 120 | public AddCoolable(FluidStack input, FluidStack output, int heatFrom, int heatTo) { 121 | super(input, output, heatFrom, heatTo); 122 | } 123 | 124 | @Override 125 | public void apply() { 126 | BuildcraftRecipeRegistry.refineryRecipes.addCoolableRecipe(input, output, heatFrom, heatTo); 127 | } 128 | 129 | @Override 130 | public String describe() { 131 | return "Adding coolable fluid " + input; 132 | } 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/forestry/CompatModuleForestry.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.forestry; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | 5 | import buildcraft.api.BCModules; 6 | import buildcraft.api.core.BCLog; 7 | import buildcraft.api.lists.ListRegistry; 8 | 9 | import buildcraft.compat.CompatModuleBase; 10 | import buildcraft.compat.module.forestry.list.ListMatchGenome; 11 | import buildcraft.compat.module.forestry.pipe.ForestryPipes; 12 | 13 | import forestry.api.core.ForestryAPI; 14 | import forestry.modules.ForestryModuleUids; 15 | import forestry.plugins.ForestryCompatPlugins; 16 | 17 | public class CompatModuleForestry extends CompatModuleBase { 18 | @Override 19 | public String compatModId() { 20 | return "forestry"; 21 | } 22 | 23 | @Override 24 | public void preInit() { 25 | ListRegistry.registerHandler(new ListMatchGenome()); 26 | if (canLoadPropolisPipe()) { 27 | ForestryPipes.preInit(); 28 | } 29 | } 30 | 31 | @Override 32 | public void init() { 33 | if (Boolean.getBoolean("buildcraft.temp_fix_old_forestry.remove_transport_module")) { 34 | // TEMPORARY TO FIX BUG IN OLDER FORESTRY!!!! 35 | /* 36 | * InventoryUtil 37 | @Optional.Method(modid = "BuildCraftAPI|transport") 38 | */ 39 | ForestryAPI.enabledModules.remove(new ResourceLocation(ForestryCompatPlugins.ID, ForestryModuleUids.BUILDCRAFT_TRANSPORT)); 40 | } 41 | } 42 | 43 | private static boolean canLoadPropolisPipe() { 44 | if (!BCModules.TRANSPORT.isLoaded()) { 45 | return false; 46 | } 47 | try { 48 | // Ensure that forestry is up-to-date 49 | Class.forName("forestry.sorting.tiles.IFilterContainer"); 50 | return true; 51 | } catch (ClassNotFoundException ignored) { 52 | BCLog.logger.warn( 53 | "[compat.forestry] IFilterContainer not found -- forestry must be updated to add the propolis pipe!"); 54 | return false; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/forestry/list/ListMatchGenome.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.forestry.list; 2 | 3 | import javax.annotation.Nonnull; 4 | import javax.annotation.Nullable; 5 | 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.util.NonNullList; 8 | 9 | import buildcraft.api.lists.ListMatchHandler; 10 | 11 | import forestry.api.genetics.AlleleManager; 12 | import forestry.api.genetics.IAlleleSpecies; 13 | import forestry.api.genetics.IIndividual; 14 | import forestry.api.genetics.ISpeciesRoot; 15 | 16 | public class ListMatchGenome extends ListMatchHandler { 17 | 18 | @Override 19 | public boolean matches(Type type, ItemStack compare, ItemStack target, boolean precise) { 20 | IIndividual infoCompare = AlleleManager.alleleRegistry.getIndividual(compare); 21 | IIndividual infoTarget = AlleleManager.alleleRegistry.getIndividual(target); 22 | if (infoCompare == null || infoTarget == null) { 23 | return false; 24 | } 25 | switch (type) { 26 | case MATERIAL: { 27 | return matchesMaterial(compare, target, infoCompare, infoTarget, precise); 28 | } 29 | case TYPE: { 30 | return matchesType(compare, target, infoCompare, infoTarget, precise); 31 | } 32 | case CLASS: { 33 | return matchesMaterial(compare, target, infoCompare, infoTarget, precise) 34 | && matchesType(compare, target, infoCompare, infoTarget, precise); 35 | } 36 | default: { 37 | throw new IllegalArgumentException("Unknown type " + type); 38 | } 39 | } 40 | } 41 | 42 | private static boolean matchesMaterial(ItemStack compare, ItemStack target, IIndividual infoCompare, 43 | IIndividual infoTarget, boolean precise) { 44 | // Ensures that both individuals have the same species 45 | // If precise is true then also ensure that the secondary species is the same 46 | IAlleleSpecies speciesCompare = infoCompare.getGenome().getPrimary(); 47 | IAlleleSpecies speciesTarget = infoTarget.getGenome().getPrimary(); 48 | if (speciesCompare != speciesTarget) { 49 | return false; 50 | } 51 | if (precise) { 52 | IAlleleSpecies inactiveCompare = infoCompare.getGenome().getSecondary(); 53 | IAlleleSpecies inactiveTarget = infoTarget.getGenome().getSecondary(); 54 | if (inactiveCompare != inactiveTarget) { 55 | return false; 56 | } 57 | } 58 | return true; 59 | } 60 | 61 | private static boolean matchesType(ItemStack compare, ItemStack target, IIndividual infoCompare, 62 | IIndividual infoTarget, boolean precise) { 63 | ISpeciesRoot speciesRootCompare = infoCompare.getGenome().getSpeciesRoot(); 64 | ISpeciesRoot speciesRootTarget = infoTarget.getGenome().getSpeciesRoot(); 65 | if (speciesRootCompare != speciesRootTarget) { 66 | return false; 67 | } 68 | // Ensure that both fully match (both princesses or both drones etc) 69 | if (speciesRootCompare.getType(compare) != speciesRootTarget.getType(target)) { 70 | return false; 71 | } 72 | return true; 73 | } 74 | 75 | @Override 76 | public boolean isValidSource(Type type, @Nonnull ItemStack stack) { 77 | return AlleleManager.alleleRegistry.getIndividual(stack) != null; 78 | } 79 | 80 | @Override 81 | @Nullable 82 | public NonNullList getClientExamples(Type type, @Nonnull ItemStack stack) { 83 | IIndividual individual = AlleleManager.alleleRegistry.getIndividual(stack); 84 | if (individual == null) { 85 | return null; 86 | } 87 | 88 | NonNullList list = NonNullList.create(); 89 | boolean isType = type != Type.MATERIAL; 90 | boolean isMaterial = type != Type.TYPE; 91 | return list; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/forestry/pipe/ContainerPropolisPipe.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.forestry.pipe; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | 5 | import forestry.sorting.gui.ContainerGeneticFilter; 6 | 7 | public class ContainerPropolisPipe extends ContainerGeneticFilter { 8 | 9 | public final PipeBehaviourPropolis pipeBehaviour; 10 | 11 | public ContainerPropolisPipe(PipeBehaviourPropolis behaviour, EntityPlayer player) { 12 | super(behaviour, player.inventory); 13 | this.pipeBehaviour = behaviour; 14 | behaviour.pipe.getHolder().onPlayerOpen(player); 15 | } 16 | 17 | @Override 18 | public void onContainerClosed(EntityPlayer player) { 19 | super.onContainerClosed(player); 20 | pipeBehaviour.pipe.getHolder().onPlayerClose(player); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/forestry/pipe/ForestryPipes.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.forestry.pipe; 2 | 3 | import net.minecraft.init.Items; 4 | import net.minecraft.item.EnumDyeColor; 5 | import net.minecraft.item.Item; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.item.crafting.IRecipe; 8 | import net.minecraft.util.EnumFacing; 9 | import net.minecraft.util.ResourceLocation; 10 | 11 | import net.minecraftforge.common.MinecraftForge; 12 | import net.minecraftforge.event.RegistryEvent; 13 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 14 | import net.minecraftforge.fml.common.registry.ForgeRegistries; 15 | import net.minecraftforge.oredict.ShapedOreRecipe; 16 | 17 | import buildcraft.api.transport.pipe.PipeApi; 18 | import buildcraft.api.transport.pipe.PipeDefinition; 19 | import buildcraft.api.transport.pipe.PipeDefinition.PipeDefinitionBuilder; 20 | 21 | import buildcraft.lib.misc.ColourUtil; 22 | import buildcraft.lib.registry.CreativeTabManager; 23 | 24 | public class ForestryPipes { 25 | 26 | public static Item pipeItemPropolis; 27 | public static PipeDefinition pipeDefinitionPropolis; 28 | 29 | public static void preInit() { 30 | MinecraftForge.EVENT_BUS.register(ForestryPipes.class); 31 | 32 | String[] textureSuffixes = new String[8]; 33 | textureSuffixes[0] = ""; 34 | textureSuffixes[7] = "_itemstack"; 35 | for (EnumFacing face : EnumFacing.VALUES) { 36 | textureSuffixes[face.ordinal() + 1] = "_" + face.getName(); 37 | } 38 | 39 | pipeDefinitionPropolis = new PipeDefinitionBuilder()// 40 | .id("forestry_propolis")// Note: id() automatically sets the namespace to "buildcraftcompat" 41 | .texPrefix("propolis")// 42 | .texSuffixes(textureSuffixes)// 43 | .logic(PipeBehaviourPropolis::new, PipeBehaviourPropolis::new)// 44 | .flowItem()// 45 | .define(); 46 | 47 | PipeApi.pipeRegistry.createUnnamedItemForPipe(pipeDefinitionPropolis, item -> { 48 | pipeItemPropolis = item; 49 | item.setRegistryName("pipe_item_propolis"); 50 | item.setUnlocalizedName("buildcraftPipe.pipeitemspropolis"); 51 | item.setCreativeTab(CreativeTabManager.getTab("buildcraft.pipes")); 52 | }); 53 | } 54 | 55 | @SubscribeEvent 56 | public static void registerRecipes(RegistryEvent.Register event) { 57 | Item propolis = ForgeRegistries.ITEMS.getValue(new ResourceLocation("forestry:propolis")); 58 | if (propolis != null && propolis != Items.AIR) { 59 | addPipeRecipe(pipeItemPropolis, propolis, Items.DIAMOND); 60 | } 61 | } 62 | 63 | private static void addPipeRecipe(Item pipe, Object surround) { 64 | addPipeRecipe(pipe, surround, surround); 65 | } 66 | 67 | private static void addPipeRecipe(Item pipe, Object left, Object right) { 68 | // Copied directly from BCTransportRecipes 69 | if (pipe == null) { 70 | return; 71 | } 72 | ItemStack result = new ItemStack(pipe, 8); 73 | IRecipe recipe = new ShapedOreRecipe(pipe.getRegistryName(), result, "lgr", 'l', left, 'r', right, 'g', 74 | "blockGlassColorless"); 75 | recipe.setRegistryName(new ResourceLocation(pipe.getRegistryName() + "_colorless")); 76 | ForgeRegistries.RECIPES.register(recipe); 77 | 78 | for (EnumDyeColor colour : EnumDyeColor.values()) { 79 | ItemStack resultStack = new ItemStack(pipe, 8, colour.getMetadata() + 1); 80 | IRecipe colorRecipe = new ShapedOreRecipe(pipe.getRegistryName(), resultStack, "lgr", 'l', left, 'r', right, 81 | 'g', "blockGlass" + ColourUtil.getName(colour)); 82 | colorRecipe.setRegistryName(new ResourceLocation(pipe.getRegistryName() + "_" + colour)); 83 | ForgeRegistries.RECIPES.register(colorRecipe); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/forestry/pipe/PipeBehaviourPropolis.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.forestry.pipe; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.annotation.Nonnull; 6 | import javax.annotation.Nullable; 7 | 8 | import net.minecraft.client.gui.inventory.GuiContainer; 9 | import net.minecraft.entity.player.EntityPlayer; 10 | import net.minecraft.inventory.Container; 11 | import net.minecraft.inventory.IInventory; 12 | import net.minecraft.item.ItemStack; 13 | import net.minecraft.nbt.NBTTagCompound; 14 | import net.minecraft.network.PacketBuffer; 15 | import net.minecraft.tileentity.TileEntity; 16 | import net.minecraft.util.EnumFacing; 17 | import net.minecraft.util.math.BlockPos; 18 | import net.minecraft.util.math.RayTraceResult; 19 | import net.minecraft.world.World; 20 | import net.minecraft.world.WorldServer; 21 | 22 | import net.minecraftforge.common.capabilities.Capability; 23 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 24 | import net.minecraftforge.fml.relauncher.Side; 25 | import net.minecraftforge.fml.relauncher.SideOnly; 26 | 27 | import buildcraft.api.core.EnumPipePart; 28 | import buildcraft.api.transport.pipe.IPipe; 29 | import buildcraft.api.transport.pipe.PipeBehaviour; 30 | import buildcraft.api.transport.pipe.PipeEventHandler; 31 | import buildcraft.api.transport.pipe.PipeEventItem; 32 | 33 | import buildcraft.lib.cap.CapabilityHelper; 34 | 35 | import buildcraft.compat.CompatUtils; 36 | import buildcraft.compat.network.CompatGui; 37 | import buildcraft.compat.network.IGuiCreator; 38 | 39 | import forestry.api.genetics.AlleleManager; 40 | import forestry.api.genetics.GeneticCapabilities; 41 | import forestry.api.genetics.IFilterLogic; 42 | import forestry.api.genetics.IFilterLogic.INetworkHandler; 43 | import forestry.sorting.DefaultFilterRuleType; 44 | import forestry.sorting.gui.ContainerGeneticFilter; 45 | import forestry.sorting.gui.GuiGeneticFilter; 46 | import forestry.sorting.tiles.IFilterContainer; 47 | 48 | public class PipeBehaviourPropolis extends PipeBehaviour implements IFilterContainer, INetworkHandler, IGuiCreator { 49 | 50 | private final CapabilityHelper caps = new CapabilityHelper(); 51 | private final IFilterLogic filter = AlleleManager.filterRegistry.createLogic(this, this); 52 | 53 | { 54 | caps.addCapabilityInstance(GeneticCapabilities.FILTER_LOGIC, filter, EnumPipePart.VALUES); 55 | caps.addCapabilityInstance(CompatUtils.CAP_GUI_CREATOR, this, EnumPipePart.CENTER); 56 | } 57 | 58 | public PipeBehaviourPropolis(IPipe pipe) { 59 | super(pipe); 60 | } 61 | 62 | public PipeBehaviourPropolis(IPipe pipe, NBTTagCompound nbt) { 63 | super(pipe, nbt); 64 | filter.readFromNBT(nbt.getCompoundTag("filter")); 65 | } 66 | 67 | @Override 68 | public NBTTagCompound writeToNbt() { 69 | NBTTagCompound nbt = super.writeToNbt(); 70 | nbt.setTag("filter", filter.writeToNBT(new NBTTagCompound())); 71 | return nbt; 72 | } 73 | 74 | @Override 75 | public void readPayload(PacketBuffer buffer, Side side, MessageContext ctx) throws IOException { 76 | super.readPayload(buffer, side, ctx); 77 | if (side == Side.CLIENT) { 78 | filter.readGuiData(buffer); 79 | } 80 | } 81 | 82 | @Override 83 | public void writePayload(PacketBuffer buffer, Side side) { 84 | super.writePayload(buffer, side); 85 | if (side == Side.SERVER) { 86 | // FIXME: Inefficient to be sending gui updates all the time 87 | // but fixing this requires proper fixes throughout the net code :/ 88 | filter.writeGuiData(buffer); 89 | } 90 | } 91 | 92 | @Override 93 | public T getCapability(@Nonnull Capability capability, EnumFacing facing) { 94 | T value = caps.getCapability(capability, facing); 95 | if (value != null) { 96 | return value; 97 | } 98 | return super.getCapability(capability, facing); 99 | } 100 | 101 | @Override 102 | public int getTextureIndex(EnumFacing face) { 103 | return face == null ? 0 : face.ordinal() + 1; 104 | } 105 | 106 | @Override 107 | public boolean onPipeActivate(EntityPlayer player, RayTraceResult trace, float hitX, float hitY, float hitZ, 108 | EnumPipePart part) { 109 | if (!getWorldObj().isRemote) { 110 | // TODO: Properly abstract this in to make GUI's a bit more sane! 111 | CompatGui.FORESTRY_PROPOLIS_PIPE.openGui(player, pipe.getHolder().getPipePos()); 112 | // sendUpdatePacket(ImmutableList.of()); 113 | } 114 | return true; 115 | } 116 | 117 | @PipeEventHandler 118 | public void sideCheck(PipeEventItem.SideCheck event) { 119 | ItemStack stack = event.stack; 120 | for (EnumFacing face : EnumFacing.VALUES) { 121 | if (!filter.isValid(stack, face)) { 122 | event.disallow(face); 123 | } else if (filter.getRule(face) == DefaultFilterRuleType.ANYTHING) { 124 | event.decreasePriority(face); 125 | } 126 | } 127 | } 128 | 129 | // IFilterContainer 130 | 131 | @Override 132 | public BlockPos getCoordinates() { 133 | return pipe.getHolder().getPipePos(); 134 | } 135 | 136 | @Override 137 | public World getWorldObj() { 138 | return pipe.getHolder().getPipeWorld(); 139 | } 140 | 141 | @Override 142 | public String getUnlocalizedTitle() { 143 | return ForestryPipes.pipeItemPropolis.getUnlocalizedName() + ".name"; 144 | } 145 | 146 | @Override 147 | @Nullable 148 | public IInventory getBuffer() { 149 | return null; 150 | } 151 | 152 | @Override 153 | public TileEntity getTileEntity() { 154 | return pipe.getHolder().getPipeTile(); 155 | } 156 | 157 | @Override 158 | public IFilterLogic getLogic() { 159 | return filter; 160 | } 161 | 162 | // INetworkHandler 163 | 164 | @Override 165 | public void sendToPlayers(IFilterLogic logic, WorldServer server, EntityPlayer currentPlayer) { 166 | for (EntityPlayer player : server.playerEntities) { 167 | if (player != currentPlayer && player.openContainer instanceof ContainerGeneticFilter) { 168 | ContainerGeneticFilter currentContainer = (ContainerGeneticFilter) currentPlayer.openContainer; 169 | ContainerGeneticFilter otherContainer = (ContainerGeneticFilter) player.openContainer; 170 | if (otherContainer.hasSameTile(currentContainer)) { 171 | otherContainer.setGuiNeedsUpdate(true); 172 | } 173 | } 174 | } 175 | } 176 | 177 | // IGuiCreator 178 | 179 | @Override 180 | public Enum getGuiType() { 181 | return CompatGui.FORESTRY_PROPOLIS_PIPE; 182 | } 183 | 184 | @Override 185 | @Nullable 186 | public Container getServerGuiElement(int data, EntityPlayer player) { 187 | return new ContainerPropolisPipe(this, player); 188 | } 189 | 190 | @Override 191 | @Nullable 192 | @SideOnly(Side.CLIENT) 193 | public GuiContainer getClientGuiElement(int data, EntityPlayer player) { 194 | return new GuiGeneticFilter(this, player.inventory); 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/ic2/CompatModuleIndustrialCraft2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 SpaceToad and the BuildCraft team 3 | * 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 4 | * distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/ 5 | */ 6 | 7 | package buildcraft.compat.module.ic2; 8 | 9 | import net.minecraft.item.Item; 10 | 11 | import buildcraft.compat.CompatModuleBase; 12 | 13 | import buildcraft.lib.misc.StackMatchingPredicate; 14 | import buildcraft.lib.misc.StackNbtMatcher; 15 | import buildcraft.lib.misc.StackUtil; 16 | 17 | public class CompatModuleIndustrialCraft2 extends CompatModuleBase { 18 | @Override 19 | public String compatModId() { 20 | return "ic2"; 21 | } 22 | 23 | @Override 24 | public void preInit() { 25 | registerCableMatchingPredicate(); 26 | } 27 | 28 | private void registerCableMatchingPredicate() { 29 | // Distinguish cables by type and insulation 30 | // https://github.com/BuildCraft/BuildCraft/issues/4553 31 | Item cable = Item.getByNameOrId("ic2:cable"); 32 | if (cable != null) { 33 | StackMatchingPredicate predicate = new StackNbtMatcher("insulation", "type"); 34 | StackUtil.registerMatchingPredicate(cable, predicate); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/BCPluginJEI.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | import com.google.common.collect.ImmutableList; 7 | import com.google.common.collect.Lists; 8 | 9 | import net.minecraft.item.ItemStack; 10 | 11 | import net.minecraftforge.fml.common.Loader; 12 | 13 | import buildcraft.api.BCBlocks; 14 | import buildcraft.api.BCModules; 15 | import buildcraft.api.core.BCLog; 16 | import buildcraft.api.enums.EnumEngineType; 17 | import buildcraft.api.fuels.IFuel; 18 | import buildcraft.api.recipes.AssemblyRecipeBasic; 19 | import buildcraft.api.recipes.BuildcraftRecipeRegistry; 20 | import buildcraft.api.recipes.IRefineryRecipeManager; 21 | 22 | import buildcraft.lib.fluid.FuelRegistry; 23 | import buildcraft.lib.recipe.AssemblyRecipeRegistry; 24 | 25 | import buildcraft.compat.module.jei.energy.combustionengine.CategoryCombustionEngine; 26 | import buildcraft.compat.module.jei.energy.combustionengine.HandlerCombustionEngine; 27 | import buildcraft.compat.module.jei.factory.CategoryCoolable; 28 | import buildcraft.compat.module.jei.factory.CategoryDistiller; 29 | import buildcraft.compat.module.jei.factory.CategoryHeatable; 30 | import buildcraft.compat.module.jei.factory.HandlerCoolable; 31 | import buildcraft.compat.module.jei.factory.HandlerDistiller; 32 | import buildcraft.compat.module.jei.factory.HandlerHeatable; 33 | import buildcraft.compat.module.jei.recipe.GuiHandlerBuildCraft; 34 | import buildcraft.compat.module.jei.silicon.CategoryAssemblyTable; 35 | import buildcraft.compat.module.jei.silicon.WrapperAssemblyTable; 36 | import buildcraft.compat.module.jei.transferhandlers.AdvancedCraftingItemsTransferHandler; 37 | import buildcraft.compat.module.jei.transferhandlers.AutoCraftItemsTransferHandler; 38 | import buildcraft.core.BCCoreBlocks; 39 | import buildcraft.silicon.container.ContainerAssemblyTable; 40 | 41 | import mezz.jei.api.IGuiHelper; 42 | import mezz.jei.api.IModPlugin; 43 | import mezz.jei.api.IModRegistry; 44 | import mezz.jei.api.JEIPlugin; 45 | import mezz.jei.api.recipe.IRecipeCategoryRegistration; 46 | import mezz.jei.api.recipe.VanillaRecipeCategoryUid; 47 | 48 | @JEIPlugin 49 | public class BCPluginJEI implements IModPlugin { 50 | // public static boolean disableFacadeJEI; 51 | public static IModRegistry registry; 52 | 53 | @Override 54 | public void register(IModRegistry registry) { 55 | BCPluginJEI.registry = registry; 56 | registry.addAdvancedGuiHandlers(new GuiHandlerBuildCraft()); 57 | // boolean transport = BCModules.TRANSPORT.isLoaded(); 58 | boolean factory = BCModules.FACTORY.isLoaded(); 59 | boolean energy = BCModules.ENERGY.isLoaded(); 60 | boolean silicon = BCModules.SILICON.isLoaded(); 61 | // boolean robotics = BCModules.ROBOTICS.isLoaded(); 62 | 63 | if (factory) { 64 | registry.handleRecipes(IRefineryRecipeManager.ICoolableRecipe.class, new HandlerCoolable(), CategoryCoolable.UID); 65 | registry.handleRecipes(IRefineryRecipeManager.IDistillationRecipe.class, new HandlerDistiller(), CategoryDistiller.UID); 66 | registry.handleRecipes(IRefineryRecipeManager.IHeatableRecipe.class, new HandlerHeatable(), CategoryHeatable.UID); 67 | 68 | registry.addRecipes(ImmutableList.copyOf(BuildcraftRecipeRegistry.refineryRecipes.getCoolableRegistry().getAllRecipes()), CategoryCoolable.UID); 69 | registry.addRecipes(ImmutableList.copyOf(BuildcraftRecipeRegistry.refineryRecipes.getDistillationRegistry().getAllRecipes()), CategoryDistiller.UID); 70 | registry.addRecipes(ImmutableList.copyOf(BuildcraftRecipeRegistry.refineryRecipes.getHeatableRegistry().getAllRecipes()), CategoryHeatable.UID); 71 | if (BCBlocks.Factory.DISTILLER != null) { 72 | registry.addRecipeCatalyst(new ItemStack(BCBlocks.Factory.DISTILLER), CategoryDistiller.UID); 73 | } 74 | if (BCBlocks.Factory.HEAT_EXCHANGE != null) { 75 | registry.addRecipeCatalyst(new ItemStack(BCBlocks.Factory.HEAT_EXCHANGE), CategoryCoolable.UID); 76 | registry.addRecipeCatalyst(new ItemStack(BCBlocks.Factory.HEAT_EXCHANGE), CategoryHeatable.UID); 77 | } 78 | } 79 | if (energy) { 80 | registry.handleRecipes(IFuel.class, new HandlerCombustionEngine(), CategoryCombustionEngine.UID); 81 | registry.addRecipes(ImmutableList.copyOf(FuelRegistry.INSTANCE.getFuels()), CategoryCombustionEngine.UID); 82 | if (BCCoreBlocks.engine != null){ 83 | if (BCCoreBlocks.engine.isRegistered(EnumEngineType.STONE)) { 84 | registry.addRecipeCatalyst(BCCoreBlocks.engine.getStack(EnumEngineType.STONE), VanillaRecipeCategoryUid.FUEL); 85 | } 86 | if (BCCoreBlocks.engine.isRegistered(EnumEngineType.IRON)) { 87 | registry.addRecipeCatalyst(BCCoreBlocks.engine.getStack(EnumEngineType.IRON), CategoryCombustionEngine.UID); 88 | } 89 | } 90 | } 91 | if (silicon) { 92 | registry.handleRecipes(AssemblyRecipeBasic.class, WrapperAssemblyTable::new, CategoryAssemblyTable.UID); 93 | // registry.handleRecipes(IntegrationRecipe.class, new HandlerIntegrationTable(), CategoryIntegrationTable.UID); 94 | 95 | registry.addRecipes(ImmutableList.copyOf(AssemblyRecipeRegistry.REGISTRY.values()), CategoryAssemblyTable.UID); 96 | // registry.addRecipes(ImmutableList.copyOf(IntegrationRecipeRegistry.INSTANCE.getAllRecipes()), CategoryIntegrationTable.UID); 97 | if (BCBlocks.Silicon.ASSEMBLY_TABLE != null) { 98 | registry.addRecipeCatalyst(new ItemStack(BCBlocks.Silicon.ASSEMBLY_TABLE), CategoryAssemblyTable.UID); 99 | } 100 | if (BCBlocks.Silicon.ADVANCED_CRAFTING_TABLE != null) { 101 | registry.addRecipeCatalyst(new ItemStack(BCBlocks.Silicon.ADVANCED_CRAFTING_TABLE), VanillaRecipeCategoryUid.CRAFTING); 102 | } 103 | } 104 | 105 | registry.getRecipeTransferRegistry().addRecipeTransferHandler(new AutoCraftItemsTransferHandler(), VanillaRecipeCategoryUid.CRAFTING); 106 | registry.getRecipeTransferRegistry().addRecipeTransferHandler(new AdvancedCraftingItemsTransferHandler(), VanillaRecipeCategoryUid.CRAFTING); 107 | // registry.getRecipeTransferRegistry().addRecipeTransferHandler(new AssemblyTableTransferHandler(), CategoryAssemblyTable.UID); 108 | registry.getRecipeTransferRegistry().addRecipeTransferHandler(ContainerAssemblyTable.class, CategoryAssemblyTable.UID, 109 | 36, 12, 0, 36); 110 | } 111 | 112 | @Override 113 | public void registerCategories(IRecipeCategoryRegistration registry) { 114 | // boolean transport = Loader.isModLoaded(BCModules.TRANSPORT.getModId()); 115 | boolean factory = Loader.isModLoaded(BCModules.FACTORY.getModId()); 116 | boolean energy = Loader.isModLoaded(BCModules.ENERGY.getModId()); 117 | boolean silicon = Loader.isModLoaded(BCModules.SILICON.getModId()); 118 | // boolean robotics = Loader.isModLoaded(BCModules.ROBOTICS.getModId()); 119 | 120 | List lst = Lists.newArrayList(); 121 | IGuiHelper helper = registry.getJeiHelpers().getGuiHelper(); 122 | 123 | // jeiRegistry.addAdvancedGuiHandlers(new LedgerGuiHandler()); 124 | // if (transport) { 125 | // lst.add("transport"); 126 | // loadTransport(jeiRegistry); 127 | // } 128 | if (factory) { 129 | lst.add("factory"); 130 | registry.addRecipeCategories(new CategoryHeatable(helper)); 131 | registry.addRecipeCategories(new CategoryDistiller(helper)); 132 | registry.addRecipeCategories(new CategoryCoolable(helper)); 133 | } 134 | if (energy) { 135 | lst.add("energy"); 136 | registry.addRecipeCategories(new CategoryCombustionEngine(helper)); 137 | } 138 | if (silicon) { 139 | lst.add("silicon"); 140 | registry.addRecipeCategories(new CategoryAssemblyTable(helper)); 141 | // registry.addRecipeCategories(new CategoryIntegrationTable(helper)); 142 | } 143 | 144 | BCLog.logger.info("Loaded JEI mods: " + Arrays.toString(lst.toArray())); 145 | } 146 | 147 | // private static void loadTransport(IModRegistry jeiRegistry) { 148 | // jeiRegistry.addAdvancedGuiHandlers(new GateGuiHandler()); 149 | // } 150 | } 151 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/energy/combustionengine/CategoryCombustionEngine.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.energy.combustionengine; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | import net.minecraftforge.fluids.FluidStack; 5 | import buildcraft.api.BCModules; 6 | import mezz.jei.api.IGuiHelper; 7 | import mezz.jei.api.gui.IDrawable; 8 | import mezz.jei.api.gui.IGuiFluidStackGroup; 9 | import mezz.jei.api.gui.IRecipeLayout; 10 | import mezz.jei.api.ingredients.IIngredients; 11 | import mezz.jei.api.recipe.BlankRecipeCategory; 12 | 13 | public class CategoryCombustionEngine extends BlankRecipeCategory { 14 | public static final String UID = "buildcraft-compat:engine.combustion"; 15 | 16 | private final IDrawable background; 17 | // private WrapperCombustionEngine wrapper = null; 18 | 19 | public CategoryCombustionEngine(IGuiHelper guiHelper) { 20 | super(); 21 | this.background = guiHelper.createDrawable( 22 | new ResourceLocation("minecraft", "textures/gui/container/furnace.png"), 23 | 55, 38, 18, 32, 0, 0, 0, 80); 24 | guiHelper.createDrawable(new ResourceLocation(BCModules.ENERGY.getModId(), ""), 0, 0, 16, 16); 25 | } 26 | 27 | @Override 28 | public String getUid() { 29 | return UID; 30 | } 31 | 32 | @Override 33 | public String getTitle() { 34 | return "Combustion Engine Fuels"; 35 | } 36 | 37 | @Override 38 | public String getModName() { 39 | return BCModules.ENERGY.name(); 40 | } 41 | 42 | @Override 43 | public IDrawable getBackground() { 44 | return this.background; 45 | } 46 | 47 | @Override 48 | public void setRecipe(IRecipeLayout recipeLayout, WrapperCombustionEngine recipeWrapper, IIngredients ingredients) { 49 | // WrapperCombustionEngine wrapper = (WrapperCombustionEngine) recipeWrapper; 50 | IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); 51 | 52 | guiFluidStacks.init(0, true, 1, 15, 16, 16, 1000, false, null); 53 | guiFluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0)); 54 | 55 | if (recipeWrapper instanceof WrapperCombustionEngine.Dirty) { 56 | // WrapperCombustionEngine.Dirty dirty = (WrapperCombustionEngine.Dirty)recipeWrapper; 57 | 58 | guiFluidStacks.init(1, false, 95, 15, 16, 16, 1000, false, null); 59 | guiFluidStacks.set(1, ingredients.getOutputs(FluidStack.class).get(0)); 60 | } 61 | } 62 | // 63 | // @Override 64 | // public void drawExtras(Minecraft minecraft) { 65 | // super.drawExtras(minecraft); 66 | // 67 | // if (this.wrapper != null) { 68 | // this.wrapper.flame.draw(minecraft, 2, 0); 69 | // } 70 | // } 71 | } 72 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/energy/combustionengine/HandlerCombustionEngine.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.energy.combustionengine; 2 | 3 | import buildcraft.api.fuels.IFuel; 4 | import buildcraft.api.fuels.IFuelManager.IDirtyFuel; 5 | 6 | import buildcraft.compat.module.jei.BCPluginJEI; 7 | 8 | import mezz.jei.api.recipe.IRecipeWrapper; 9 | import mezz.jei.api.recipe.IRecipeWrapperFactory; 10 | 11 | public class HandlerCombustionEngine implements IRecipeWrapperFactory { 12 | @Override 13 | public IRecipeWrapper getRecipeWrapper(IFuel recipe) { 14 | if (recipe instanceof IDirtyFuel) { 15 | return new WrapperCombustionEngine.Dirty(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), (IDirtyFuel) recipe); 16 | } 17 | return new WrapperCombustionEngine(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), recipe); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/energy/combustionengine/WrapperCombustionEngine.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.energy.combustionengine; 2 | 3 | import java.awt.Color; 4 | import java.util.List; 5 | import com.google.common.collect.ImmutableList; 6 | import com.google.common.collect.Lists; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraft.client.renderer.GlStateManager; 9 | import net.minecraft.util.ResourceLocation; 10 | import net.minecraftforge.fluids.Fluid; 11 | import net.minecraftforge.fluids.FluidStack; 12 | import net.minecraftforge.fml.relauncher.Side; 13 | import net.minecraftforge.fml.relauncher.SideOnly; 14 | import buildcraft.api.fuels.IFuel; 15 | import buildcraft.api.fuels.IFuelManager.IDirtyFuel; 16 | import buildcraft.api.mj.MjAPI; 17 | 18 | import buildcraft.lib.misc.LocaleUtil; 19 | 20 | import mezz.jei.api.IGuiHelper; 21 | import mezz.jei.api.gui.IDrawableAnimated; 22 | import mezz.jei.api.gui.IDrawableStatic; 23 | import mezz.jei.api.ingredients.IIngredients; 24 | import mezz.jei.api.recipe.IRecipeWrapper; 25 | 26 | public class WrapperCombustionEngine implements IRecipeWrapper { 27 | private final IFuel fuel; 28 | private final ImmutableList in; 29 | private final IDrawableAnimated flame; 30 | 31 | WrapperCombustionEngine(IGuiHelper guiHelper, IFuel fuel) { 32 | this.fuel = fuel; 33 | in = ImmutableList.of(new FluidStack(fuel.getFluid(), Fluid.BUCKET_VOLUME)); 34 | 35 | ResourceLocation furnaceBackgroundLocation = new ResourceLocation("minecraft", "textures/gui/container/furnace.png"); 36 | IDrawableStatic flameDrawable = guiHelper.createDrawable(furnaceBackgroundLocation, 176, 0, 14, 14); 37 | this.flame = guiHelper.createAnimatedDrawable(flameDrawable, fuel.getTotalBurningTime() / 10, IDrawableAnimated.StartDirection.TOP, true); 38 | } 39 | 40 | // @Override 41 | // public List getInputs() { 42 | // return Collections.emptyList(); 43 | // } 44 | // 45 | // @Override 46 | // public List getOutputs() { 47 | // return Collections.emptyList(); 48 | // } 49 | // 50 | // @Override 51 | // public List getFluidInputs() { 52 | // return in; 53 | // } 54 | // 55 | // @Override 56 | // public List getFluidOutputs() { 57 | // return null; 58 | // } 59 | // 60 | // @Override 61 | // public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight) {} 62 | 63 | @Override 64 | public void getIngredients(IIngredients ingredients) { 65 | ingredients.setInputs(FluidStack.class, this.in); 66 | } 67 | 68 | @Override 69 | @SideOnly(Side.CLIENT) 70 | public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { 71 | this.flame.draw(minecraft, 2, 0); 72 | 73 | GlStateManager.pushMatrix(); 74 | GlStateManager.translate(24, 8, 0); 75 | // GlStateManager.scale(.7, .7, 1.0); 76 | minecraft.fontRenderer.drawString("Burns for " + (fuel.getTotalBurningTime() / 20) + "s", 0, 0, Color.darkGray.getRGB()); 77 | minecraft.fontRenderer.drawString(" at " + LocaleUtil.localizeMjFlow(fuel.getPowerPerCycle()), 0, minecraft.fontRenderer.FONT_HEIGHT, Color.darkGray.getRGB()); 78 | GlStateManager.translate(0, minecraft.fontRenderer.FONT_HEIGHT * 2, 0); 79 | GlStateManager.scale(.7, .7, 1.0); 80 | minecraft.fontRenderer.drawString(" total " + LocaleUtil.localizeMj(fuel.getPowerPerCycle() * fuel.getTotalBurningTime()), 1, 2, Color.gray.getRGB()); 81 | GlStateManager.popMatrix(); 82 | } 83 | 84 | // @Override 85 | // public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight) { 86 | // flame.draw(minecraft, 2, 0); 87 | // } 88 | 89 | @Override 90 | public List getTooltipStrings(int mouseX, int mouseY) { 91 | return Lists.newArrayList(); 92 | } 93 | 94 | @Override 95 | public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { 96 | return false; 97 | } 98 | 99 | public static class Dirty extends WrapperCombustionEngine { 100 | final IDirtyFuel dirty; 101 | 102 | Dirty(IGuiHelper guiHelper, IDirtyFuel fuel) { 103 | super(guiHelper, fuel); 104 | this.dirty = fuel; 105 | } 106 | 107 | @Override 108 | public void getIngredients(IIngredients ingredients) { 109 | super.getIngredients(ingredients); 110 | ingredients.setOutput(FluidStack.class, this.dirty.getResidue()); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/energy/combustionengine/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | package buildcraft.compat.module.jei.energy.combustionengine; 4 | 5 | import javax.annotation.ParametersAreNonnullByDefault; 6 | import mcp.MethodsReturnNonnullByDefault; 7 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/factory/CategoryCoolable.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.factory; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraftforge.fluids.FluidStack; 6 | import buildcraft.api.BCModules; 7 | import mezz.jei.api.IGuiHelper; 8 | import mezz.jei.api.gui.IDrawable; 9 | import mezz.jei.api.gui.IGuiFluidStackGroup; 10 | import mezz.jei.api.gui.IRecipeLayout; 11 | import mezz.jei.api.ingredients.IIngredients; 12 | import mezz.jei.api.recipe.BlankRecipeCategory; 13 | 14 | public class CategoryCoolable extends BlankRecipeCategory { 15 | public static final String UID = "buildcraft:category_coolable"; 16 | public static final ResourceLocation heatExchangerBackground = new ResourceLocation("buildcraftfactory:textures/gui/heat_exchanger.png"); 17 | 18 | private final IDrawable background, slot; 19 | 20 | public CategoryCoolable(IGuiHelper helper) { 21 | this.background = helper.createDrawable(heatExchangerBackground, 61, 38, 54, 17, 0, 0, 18, 80); 22 | this.slot = helper.createDrawable(heatExchangerBackground, 7, 22, 18, 18); 23 | } 24 | 25 | @Override 26 | public String getUid() { 27 | return UID; 28 | } 29 | 30 | @Override 31 | public String getTitle() { 32 | return "Coolable Fluids"; 33 | } 34 | 35 | @Override 36 | public String getModName() { 37 | return BCModules.FACTORY.name(); 38 | } 39 | 40 | @Override 41 | public IDrawable getBackground() { 42 | return this.background; 43 | } 44 | 45 | @Override 46 | public void drawExtras(Minecraft minecraft) { 47 | slot.draw(minecraft, 0, 0); 48 | slot.draw(minecraft, 72, 0); 49 | } 50 | // 51 | // @Override 52 | // public void drawAnimations(Minecraft minecraft) {} 53 | 54 | @Override 55 | public void setRecipe(IRecipeLayout recipeLayout, WrapperCoolable recipeWrapper, IIngredients ingredients) { 56 | IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); 57 | 58 | guiFluidStacks.init(0, true, 1, 1, 16, 16, 10, false, null); 59 | guiFluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0)); 60 | 61 | guiFluidStacks.init(1, false, 73, 1, 16, 16, 10, false, null); 62 | guiFluidStacks.set(1, ingredients.getOutputs(FluidStack.class).get(0)); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/factory/CategoryDistiller.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.factory; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraftforge.fluids.FluidStack; 6 | import buildcraft.api.BCModules; 7 | import mezz.jei.api.IGuiHelper; 8 | import mezz.jei.api.gui.IDrawable; 9 | import mezz.jei.api.gui.IGuiFluidStackGroup; 10 | import mezz.jei.api.gui.IRecipeLayout; 11 | import mezz.jei.api.ingredients.IIngredients; 12 | import mezz.jei.api.recipe.BlankRecipeCategory; 13 | 14 | public class CategoryDistiller extends BlankRecipeCategory { 15 | public static final String UID = "buildcraft:category_distiller"; 16 | public static final ResourceLocation distillerBackground = new ResourceLocation("buildcraftfactory:textures/gui/distiller.png"); 17 | 18 | private final IDrawable background, slot, fakeBackground; 19 | 20 | public CategoryDistiller(IGuiHelper helper) { 21 | this.fakeBackground = helper.createBlankDrawable(76, 65); 22 | this.background = helper.createDrawable(distillerBackground, 61, 12, 36, 57); 23 | this.slot = helper.createDrawable(distillerBackground, 7, 34, 18, 18); 24 | } 25 | 26 | @Override 27 | public String getUid() { 28 | return UID; 29 | } 30 | 31 | @Override 32 | public String getTitle() { 33 | return "Distillable Fluids"; 34 | } 35 | 36 | @Override 37 | public String getModName() { 38 | return BCModules.FACTORY.name(); 39 | } 40 | 41 | @Override 42 | public IDrawable getBackground() { 43 | return fakeBackground; 44 | } 45 | 46 | @Override 47 | public void drawExtras(Minecraft minecraft) { 48 | this.background.draw(minecraft, 20, 4); 49 | this.slot.draw(minecraft, 0, 25); // -20, 21); 50 | this.slot.draw(minecraft, 56, 0); // 36, -4); 51 | this.slot.draw(minecraft, 56, 45); // 36, 41); 52 | } 53 | 54 | // @Override 55 | // public void drawAnimations(Minecraft minecraft) {} 56 | 57 | @Override 58 | public void setRecipe(IRecipeLayout recipeLayout, WrapperDistiller recipeWrapper, IIngredients ingredients) { 59 | IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); 60 | 61 | guiFluidStacks.init(0, true, /*-19, 22*/ 1, 26, 16, 16, 10, false, null); 62 | guiFluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0)); 63 | 64 | guiFluidStacks.init(1, false, /*37, -3*/ 57, 1, 16, 16, 10, false, null); 65 | guiFluidStacks.set(1, ingredients.getOutputs(FluidStack.class).get(0)); 66 | 67 | guiFluidStacks.init(2, false, /*37, 42*/ 57, 46, 16, 16, 10, false, null); 68 | guiFluidStacks.set(2, ingredients.getOutputs(FluidStack.class).get(1)); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/factory/CategoryHeatable.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.factory; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraftforge.fluids.FluidStack; 6 | import buildcraft.api.BCModules; 7 | import mezz.jei.api.IGuiHelper; 8 | import mezz.jei.api.gui.IDrawable; 9 | import mezz.jei.api.gui.IGuiFluidStackGroup; 10 | import mezz.jei.api.gui.IRecipeLayout; 11 | import mezz.jei.api.ingredients.IIngredients; 12 | import mezz.jei.api.recipe.BlankRecipeCategory; 13 | 14 | public class CategoryHeatable extends BlankRecipeCategory { 15 | public static final String UID = "buildcraft:category_heatable"; 16 | public static final ResourceLocation energyHeaterBackground = new ResourceLocation("buildcraftfactory:textures/gui/energy_heater.png"); 17 | 18 | private final IDrawable background, slotIn, slotOut; 19 | 20 | public CategoryHeatable(IGuiHelper helper) { 21 | this.background = helper.createDrawable(energyHeaterBackground, 176, 19, 54, 19, 0, 0, 18, 80); 22 | this.slotIn = helper.createDrawable(energyHeaterBackground, 7, 22, 18, 18, 0, 0, 0, 0); 23 | this.slotOut = helper.createDrawable(energyHeaterBackground, 7, 22, 18, 18, 0, 0, 72, 0); 24 | } 25 | 26 | @Override 27 | public String getUid() { 28 | return UID; 29 | } 30 | 31 | @Override 32 | public String getTitle() { 33 | return "Heatable Fluids"; 34 | } 35 | 36 | @Override 37 | public String getModName() { 38 | return BCModules.FACTORY.name(); 39 | } 40 | 41 | @Override 42 | public IDrawable getBackground() { 43 | return this.background; 44 | } 45 | 46 | @Override 47 | public void drawExtras(Minecraft minecraft) { 48 | slotIn.draw(minecraft); 49 | slotOut.draw(minecraft); 50 | } 51 | 52 | // @Override 53 | // public void drawAnimations(Minecraft minecraft) {} 54 | 55 | @Override 56 | public void setRecipe(IRecipeLayout recipeLayout, WrapperHeatable recipeWrapper, IIngredients ingredients) { 57 | IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); 58 | 59 | guiFluidStacks.init(0, true, 1, 1, 16, 16, 10, false, null); 60 | guiFluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0)); 61 | 62 | guiFluidStacks.init(1, false, 73, 1, 16, 16, 10, false, null); 63 | guiFluidStacks.set(1, ingredients.getOutputs(FluidStack.class).get(0)); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/factory/HandlerCoolable.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.factory; 2 | 3 | import buildcraft.api.recipes.IRefineryRecipeManager; 4 | 5 | import buildcraft.compat.module.jei.BCPluginJEI; 6 | 7 | import mezz.jei.api.recipe.IRecipeWrapper; 8 | import mezz.jei.api.recipe.IRecipeWrapperFactory; 9 | 10 | public class HandlerCoolable implements IRecipeWrapperFactory { 11 | @Override 12 | public IRecipeWrapper getRecipeWrapper(IRefineryRecipeManager.ICoolableRecipe recipe) { 13 | return new WrapperCoolable(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), recipe); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/factory/HandlerDistiller.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.factory; 2 | 3 | import buildcraft.api.recipes.IRefineryRecipeManager; 4 | 5 | import buildcraft.compat.module.jei.BCPluginJEI; 6 | 7 | import mezz.jei.api.recipe.IRecipeWrapper; 8 | import mezz.jei.api.recipe.IRecipeWrapperFactory; 9 | 10 | public class HandlerDistiller implements IRecipeWrapperFactory { 11 | @Override 12 | public IRecipeWrapper getRecipeWrapper(IRefineryRecipeManager.IDistillationRecipe recipe) { 13 | return new WrapperDistiller(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), recipe); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/factory/HandlerHeatable.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.factory; 2 | 3 | import buildcraft.api.recipes.IRefineryRecipeManager; 4 | 5 | import buildcraft.compat.module.jei.BCPluginJEI; 6 | 7 | import mezz.jei.api.recipe.IRecipeWrapper; 8 | import mezz.jei.api.recipe.IRecipeWrapperFactory; 9 | 10 | public class HandlerHeatable implements IRecipeWrapperFactory { 11 | @Override 12 | public IRecipeWrapper getRecipeWrapper(IRefineryRecipeManager.IHeatableRecipe recipe) { 13 | return new WrapperHeatable(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), recipe); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/factory/WrapperCoolable.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.factory; 2 | 3 | import java.util.List; 4 | import com.google.common.collect.ImmutableList; 5 | import com.google.common.collect.Lists; 6 | import net.minecraft.client.Minecraft; 7 | import net.minecraftforge.fluids.FluidStack; 8 | import net.minecraftforge.fml.relauncher.Side; 9 | import net.minecraftforge.fml.relauncher.SideOnly; 10 | import buildcraft.api.recipes.IRefineryRecipeManager; 11 | import mezz.jei.api.IGuiHelper; 12 | import mezz.jei.api.gui.IDrawableAnimated; 13 | import mezz.jei.api.gui.IDrawableStatic; 14 | import mezz.jei.api.ingredients.IIngredients; 15 | import mezz.jei.api.recipe.IRecipeWrapper; 16 | 17 | public class WrapperCoolable implements IRecipeWrapper { 18 | private final IRefineryRecipeManager.ICoolableRecipe recipe; 19 | private final ImmutableList in, out; 20 | private final IDrawableAnimated animatedCooling, animatedHeating; 21 | 22 | WrapperCoolable(IGuiHelper guiHelper, IRefineryRecipeManager.ICoolableRecipe recipe) { 23 | this.recipe = recipe; 24 | this.in = ImmutableList.of(recipe.in()); 25 | //noinspection ConstantConditions 26 | this.out = (recipe.out() != null) ? ImmutableList.of(recipe.out()) : ImmutableList.of(); 27 | 28 | IDrawableStatic overComplete = guiHelper.createDrawable(CategoryCoolable.heatExchangerBackground, 52, 171, 54, 17); 29 | this.animatedCooling = guiHelper.createAnimatedDrawable(overComplete, /*recipe.ticks() * 20*/ 40, IDrawableAnimated.StartDirection.LEFT, false); 30 | overComplete = guiHelper.createDrawable(CategoryCoolable.heatExchangerBackground, 52, 188, 54, 17); 31 | this.animatedHeating = guiHelper.createAnimatedDrawable(overComplete, /*recipe.ticks() * 20*/ 40, IDrawableAnimated.StartDirection.RIGHT, false); 32 | } 33 | 34 | // @Override 35 | // public List getInputs() { 36 | // return Collections.emptyList(); 37 | // } 38 | // 39 | // @Override 40 | // public List getOutputs() { 41 | // return Collections.emptyList(); 42 | // } 43 | // 44 | // @Override 45 | // public List getFluidInputs() { 46 | // return in; 47 | // } 48 | // 49 | // @Override 50 | // public List getFluidOutputs() { 51 | // return out; 52 | // } 53 | // 54 | // @Override 55 | // public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight) {} 56 | 57 | @Override 58 | public void getIngredients(IIngredients ingredients) { 59 | ingredients.setInputs(FluidStack.class, this.in); 60 | ingredients.setOutputs(FluidStack.class, this.out); 61 | } 62 | 63 | @Override 64 | @SideOnly(Side.CLIENT) 65 | public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { 66 | this.animatedCooling.draw(minecraft, 18, 0); 67 | this.animatedHeating.draw(minecraft, 18, 0); 68 | // minecraft.fontRenderer.drawString("Takes " + (recipe.ticks() / 20.0) + "s", 93, 0, Color.gray.getRGB()); 69 | } 70 | 71 | // @Override 72 | // public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight) { 73 | // animatedCooling.draw(minecraft, 18, 0); 74 | // animatedHeating.draw(minecraft, 18, 0); 75 | // } 76 | 77 | @Override 78 | public List getTooltipStrings(int mouseX, int mouseY) { 79 | return Lists.newArrayList(); 80 | } 81 | 82 | @Override 83 | public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { 84 | return false; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/factory/WrapperDistiller.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.factory; 2 | 3 | import java.awt.Color; 4 | import java.util.List; 5 | import com.google.common.collect.ImmutableList; 6 | import com.google.common.collect.Lists; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraftforge.fluids.FluidStack; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | import net.minecraftforge.fml.relauncher.SideOnly; 11 | import buildcraft.api.mj.MjAPI; 12 | import buildcraft.api.recipes.IRefineryRecipeManager; 13 | import mezz.jei.api.IGuiHelper; 14 | import mezz.jei.api.gui.IDrawableAnimated; 15 | import mezz.jei.api.gui.IDrawableStatic; 16 | import mezz.jei.api.ingredients.IIngredients; 17 | import mezz.jei.api.recipe.IRecipeWrapper; 18 | 19 | public class WrapperDistiller implements IRecipeWrapper { 20 | public final IRefineryRecipeManager.IDistillationRecipe recipe; 21 | private final ImmutableList in, out; 22 | private final IDrawableAnimated animated; 23 | 24 | WrapperDistiller(IGuiHelper guiHelper, IRefineryRecipeManager.IDistillationRecipe recipe) { 25 | this.recipe = recipe; 26 | this.in = ImmutableList.of(recipe.in()); 27 | this.out = ImmutableList.of(recipe.outGas(), recipe.outLiquid()); 28 | 29 | IDrawableStatic overComplete = guiHelper.createDrawable(CategoryDistiller.distillerBackground, 212, 0, 36, 57); 30 | this.animated = guiHelper.createAnimatedDrawable(overComplete, /*recipe.ticks() * 20*/ 40, IDrawableAnimated.StartDirection.LEFT, false); 31 | } 32 | 33 | // @Override 34 | // public List getInputs() { 35 | // return Collections.emptyList(); 36 | // } 37 | // 38 | // @Override 39 | // public List getOutputs() { 40 | // return Collections.emptyList(); 41 | // } 42 | // 43 | // @Override 44 | // public List getFluidInputs() { 45 | // return in; 46 | // } 47 | // 48 | // @Override 49 | // public List getFluidOutputs() { 50 | // return out; 51 | // } 52 | // 53 | // @Override 54 | // public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight) {} 55 | 56 | 57 | @Override 58 | public void getIngredients(IIngredients ingredients) { 59 | ingredients.setInputs(FluidStack.class, this.in); 60 | ingredients.setOutputs(FluidStack.class, this.out); 61 | } 62 | 63 | @Override 64 | @SideOnly(Side.CLIENT) 65 | public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { 66 | this.animated.draw(minecraft, 20, 4); 67 | minecraft.fontRenderer.drawString(MjAPI.formatMj(recipe.powerRequired()) + " MJ", 58, 28, Color.CYAN.getRGB()); 68 | } 69 | 70 | // @Override 71 | // public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight) { 72 | // animated.draw(minecraft, 0, 0); 73 | // } 74 | 75 | @Override 76 | public List getTooltipStrings(int mouseX, int mouseY) { 77 | return Lists.newArrayList(); 78 | } 79 | 80 | @Override 81 | public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { 82 | return false; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/factory/WrapperHeatable.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.factory; 2 | 3 | import java.util.List; 4 | import com.google.common.collect.ImmutableList; 5 | import com.google.common.collect.Lists; 6 | import net.minecraft.client.Minecraft; 7 | import net.minecraftforge.fluids.FluidStack; 8 | import net.minecraftforge.fml.relauncher.Side; 9 | import net.minecraftforge.fml.relauncher.SideOnly; 10 | import buildcraft.api.recipes.IRefineryRecipeManager; 11 | import mezz.jei.api.IGuiHelper; 12 | import mezz.jei.api.gui.IDrawableAnimated; 13 | import mezz.jei.api.gui.IDrawableStatic; 14 | import mezz.jei.api.ingredients.IIngredients; 15 | import mezz.jei.api.recipe.IRecipeWrapper; 16 | 17 | public class WrapperHeatable implements IRecipeWrapper { 18 | private final IRefineryRecipeManager.IHeatableRecipe heatable; 19 | private final ImmutableList in, out; 20 | private final IDrawableAnimated animated; 21 | 22 | public WrapperHeatable(IGuiHelper guiHelper, IRefineryRecipeManager.IHeatableRecipe recipe) { 23 | this.heatable = recipe; 24 | this.in = ImmutableList.of(recipe.in()); 25 | //noinspection ConstantConditions 26 | this.out = (recipe.out() != null) ? ImmutableList.of(recipe.out()) : ImmutableList.of(); 27 | 28 | IDrawableStatic overComplete = guiHelper.createDrawable(CategoryHeatable.energyHeaterBackground, 176, 152, 54, 19); 29 | animated = guiHelper.createAnimatedDrawable(overComplete, /*recipe.ticks() * 20*/ 40, IDrawableAnimated.StartDirection.LEFT, false); 30 | } 31 | 32 | // @Override 33 | // public List getInputs() { 34 | // return Collections.emptyList(); 35 | // } 36 | // 37 | // @Override 38 | // public List getOutputs() { 39 | // return Collections.emptyList(); 40 | // } 41 | // 42 | // @Override 43 | // public List getFluidInputs() { 44 | // return in; 45 | // } 46 | // 47 | // @Override 48 | // public List getFluidOutputs() { 49 | // return out; 50 | // } 51 | // 52 | // @Override 53 | // public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight) {} 54 | 55 | @Override 56 | public void getIngredients(IIngredients ingredients) { 57 | ingredients.setInputs(FluidStack.class, this.in); 58 | ingredients.setOutputs(FluidStack.class, this.out); 59 | } 60 | 61 | @Override 62 | @SideOnly(Side.CLIENT) 63 | public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { 64 | this.animated.draw(minecraft, 18, 0); 65 | // minecraft.fontRenderer.drawString("Takes " + (heatable.ticks() / 20.0) + "s", 93, 0, Color.gray.getRGB()); 66 | // int rftick = Math.abs(heatable.heatFrom() - heatable.heatTo()) * BuildCraftFactory.rfPerHeatPerMB * heatable.in().amount; 67 | // minecraft.fontRenderer.drawString(" at " + rftick + "RF/t", 93, 11, Color.gray.getRGB()); 68 | } 69 | 70 | // @Override 71 | // public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight) { 72 | // animated.draw(minecraft, 18, 0); 73 | // } 74 | 75 | @Override 76 | public List getTooltipStrings(int mouseX, int mouseY) { 77 | return Lists.newArrayList(); 78 | } 79 | 80 | @Override 81 | public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { 82 | return false; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/factory/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | package buildcraft.compat.module.jei.factory; 4 | 5 | import javax.annotation.ParametersAreNonnullByDefault; 6 | import mcp.MethodsReturnNonnullByDefault; 7 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/recipe/GateGuiHandler.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.recipe; 2 | //package buildcraft.compat.module.jei; 3 | // 4 | //import java.awt.Rectangle; 5 | //import java.util.ArrayList; 6 | //import java.util.List; 7 | // 8 | //import buildcraft.transport.gui.GuiGateInterface; 9 | // 10 | //import mezz.jei.api.gui.IAdvancedGuiHandler; 11 | // 12 | //public class GateGuiHandler implements IAdvancedGuiHandler { 13 | // @Override 14 | // public Class getGuiContainerClass() { 15 | // return GuiGateInterface.class; 16 | // } 17 | // 18 | // @Override 19 | // public List getGuiExtraAreas(GuiGateInterface gate) { 20 | // List rectangles = new ArrayList<>(); 21 | // int guiLeft = (gate.width - gate.xSize()) / 2; 22 | // int guiTop = (gate.height - gate.ySize()) / 2; 23 | // 24 | // // Actions 25 | // int actionStartX = guiLeft + gate.xSize(); 26 | // int actionStartY = guiTop + 6; 27 | // 28 | // if (gate.actionRows > 1) { 29 | // int endRow = gate.actionRows * 18; 30 | // rectangles.add(new Rectangle(actionStartX, actionStartY, 6 * 18, endRow)); 31 | // rectangles.add(new Rectangle(actionStartX, actionStartY + endRow, gate.lastActionRowSize, 18)); 32 | // } else if (gate.actionRows == 1) { 33 | // rectangles.add(new Rectangle(actionStartX, actionStartY, gate.lastActionRowSize, 18)); 34 | // } 35 | // return rectangles; 36 | // } 37 | //} 38 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/recipe/GuiHandlerBuildCraft.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.recipe; 2 | 3 | import java.awt.Rectangle; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import javax.annotation.Nullable; 8 | 9 | import net.minecraft.util.math.MathHelper; 10 | 11 | import buildcraft.lib.gui.GuiBC8; 12 | import buildcraft.lib.gui.IGuiElement; 13 | import buildcraft.lib.gui.pos.GuiRectangle; 14 | 15 | import mezz.jei.api.gui.IAdvancedGuiHandler; 16 | 17 | public class GuiHandlerBuildCraft implements IAdvancedGuiHandler { 18 | 19 | @Override 20 | public Class getGuiContainerClass() { 21 | return GuiBC8.class; 22 | } 23 | 24 | @Override 25 | @Nullable 26 | public List getGuiExtraAreas(GuiBC8 guiDirty) { 27 | GuiBC8 gui = guiDirty; 28 | // Get the rectangles of everything that is *outside* the main gui area 29 | List list = new ArrayList<>(); 30 | for (IGuiElement element : gui.mainGui.shownElements) { 31 | // Ignore children: all ledger style elements are top level 32 | GuiRectangle rect = element.asImmutable(); 33 | // if (!gui.rootElement.contains(rect)) { 34 | // Round down x and y 35 | int x = (int) rect.x; 36 | int y = (int) rect.y; 37 | // Round up width and height 38 | int endX = MathHelper.ceil(rect.getEndX()); 39 | int endY = MathHelper.ceil(rect.getEndY()); 40 | int width = endX - x; 41 | int height = endY - y; 42 | list.add(new Rectangle(x, y, width, height)); 43 | // } 44 | } 45 | if (list.isEmpty()) { 46 | // Cheapen JEI checks a tiny bit. Possibly. 47 | return null; 48 | } 49 | return list; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/recipe/HandlerFlexibleRecipe.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.recipe; 2 | //package buildcraft.compat.module.jei.recipe; 3 | // 4 | //import buildcraft.api.recipes.IFlexibleRecipe; 5 | // 6 | //import javax.annotation.Nonnull; 7 | //import mezz.jei.api.recipe.IRecipeHandler; 8 | // 9 | //public abstract class HandlerFlexibleRecipe implements IRecipeHandler { 10 | // @Nonnull 11 | // @Override 12 | // public Class getRecipeClass() { 13 | // return IFlexibleRecipe.class; 14 | // } 15 | //} 16 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/recipe/LedgerGuiHandler.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.recipe; 2 | //package buildcraft.compat.module.jei; 3 | // 4 | //import java.awt.Rectangle; 5 | //import java.util.ArrayList; 6 | //import java.util.List; 7 | // 8 | //import buildcraft.core.lib.gui.GuiBuildCraft; 9 | //import buildcraft.core.lib.gui.Ledger; 10 | // 11 | //import mezz.jei.api.gui.IAdvancedGuiHandler; 12 | // 13 | //public class LedgerGuiHandler implements IAdvancedGuiHandler { 14 | // @Override 15 | // public Class getGuiContainerClass() { 16 | // return GuiBuildCraft.class; 17 | // } 18 | // 19 | // @Override 20 | // public List getGuiExtraAreas(GuiBuildCraft gui) { 21 | // List rectangles = new ArrayList<>(); 22 | // int guiLeft = (gui.width - gui.xSize()) / 2; 23 | // int guiTop = (gui.height - gui.ySize()) / 2; 24 | // 25 | // int yPos = 8; 26 | // for (Ledger l : gui.ledgerManager.getAll()) { 27 | // if (l.isVisible()) { 28 | // rectangles.add(new Rectangle(guiLeft + gui.xSize(), guiTop + yPos, l.getWidth(), l.getHeight())); 29 | // yPos += l.getHeight(); 30 | // } 31 | // } 32 | // 33 | // return rectangles; 34 | // } 35 | //} 36 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/silicon/CategoryAssemblyTable.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.silicon; 2 | 3 | import java.util.List; 4 | 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.util.ResourceLocation; 7 | 8 | import buildcraft.api.BCModules; 9 | 10 | import mezz.jei.api.IGuiHelper; 11 | import mezz.jei.api.gui.IDrawable; 12 | import mezz.jei.api.gui.IGuiItemStackGroup; 13 | import mezz.jei.api.gui.IRecipeLayout; 14 | import mezz.jei.api.ingredients.IIngredients; 15 | import mezz.jei.api.recipe.IRecipeCategory; 16 | 17 | public class CategoryAssemblyTable implements IRecipeCategory { 18 | public static final String UID = "buildcraft-compat:silicon.assembly"; 19 | 20 | protected final ResourceLocation backgroundLocation; 21 | private final IDrawable background; 22 | 23 | public CategoryAssemblyTable(IGuiHelper guiHelper) { 24 | this.backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/assembly_table.png"); 25 | this.background = guiHelper.createDrawable(backgroundLocation, 5, 34, 166, 76, 10, 0, 0, 0); 26 | } 27 | 28 | @Override 29 | public String getUid() { 30 | return UID; 31 | } 32 | 33 | @Override 34 | public String getTitle() { 35 | return "Assembly Table"; 36 | } 37 | 38 | @Override 39 | public String getModName() { 40 | return BCModules.SILICON.name(); 41 | } 42 | 43 | @Override 44 | public IDrawable getBackground() { 45 | return background; 46 | } 47 | 48 | @Override 49 | public void setRecipe(IRecipeLayout recipeLayout, WrapperAssemblyTable recipeWrapper, IIngredients ingredients) { 50 | IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); 51 | 52 | List> inputs = ingredients.getInputs(ItemStack.class); 53 | for (int i = 0; i < inputs.size(); i++) { 54 | guiItemStacks.init(i, true, 2 + (i % 3) * 18, 11 + (i / 3) * 18); 55 | 56 | guiItemStacks.set(i, inputs.get(i)); 57 | // Object o = recipeWrapper.getInputs().get(i); 58 | // if (o instanceof ItemStack) { 59 | // guiItemStacks.set(i, (ItemStack) o); 60 | // } else if (o instanceof List) { 61 | // guiItemStacks.set(i, (List) o); 62 | // } 63 | } 64 | 65 | guiItemStacks.init(12, false, 110, 11); 66 | guiItemStacks.set(12, ingredients.getOutputs(ItemStack.class).get(0)); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/silicon/CategoryIntegrationTable.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.silicon; 2 | 3 | import java.util.List; 4 | 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.util.ResourceLocation; 7 | 8 | import buildcraft.api.BCModules; 9 | 10 | import mezz.jei.api.IGuiHelper; 11 | import mezz.jei.api.gui.IDrawable; 12 | import mezz.jei.api.gui.IGuiItemStackGroup; 13 | import mezz.jei.api.gui.IRecipeLayout; 14 | import mezz.jei.api.ingredients.IIngredients; 15 | import mezz.jei.api.recipe.IRecipeCategory; 16 | 17 | public class CategoryIntegrationTable implements IRecipeCategory { 18 | public static final String UID = "buildcraft-compat:silicon.integration"; 19 | 20 | protected final ResourceLocation backgroundLocation; 21 | private final IDrawable background; 22 | private WrapperIntegrationTable wrapper = null; 23 | 24 | public CategoryIntegrationTable(IGuiHelper guiHelper) { 25 | backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/integration_table.png"); 26 | background = guiHelper.createDrawable(backgroundLocation, 17, 22, 153, 71, 0, 0, 9, 0); 27 | } 28 | 29 | @Override 30 | public String getUid() { 31 | return UID; 32 | } 33 | 34 | @Override 35 | public String getTitle() { 36 | return "Integration Table"; 37 | } 38 | 39 | @Override 40 | public String getModName() { 41 | return BCModules.SILICON.name(); 42 | } 43 | 44 | @Override 45 | public IDrawable getBackground() { 46 | return background; 47 | } 48 | 49 | @Override 50 | public void setRecipe(IRecipeLayout recipeLayout, WrapperIntegrationTable recipeWrapper, IIngredients ingredients) { 51 | IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); 52 | 53 | List> inputs = ingredients.getInputs(ItemStack.class); 54 | int inventoryIndex = 0; 55 | for (int y = 0; y < 3; ++y) { 56 | for (int x = 0; x < 3; ++x) { 57 | int slotIndex = ((x == 1) && (y == 1)) ? 0 : (x + y * 3 + 1); 58 | if (inputs.size() > slotIndex) { 59 | guiItemStacks.init(inventoryIndex, true, 19 + x * 25, 24 + y * 25); 60 | guiItemStacks.set(inventoryIndex, inputs.get(slotIndex)); 61 | inventoryIndex++; 62 | } 63 | // this.addSlotToContainer(new SlotBase(x == 1 && y == 1 ? tile.invTarget : tile.invToIntegrate, indexes[x + y * 3], 19 + x * 25, 24 + y * 25)); 64 | } 65 | } 66 | 67 | // for (int i = 0; i < wrapper.getInputs().size(); i++) { 68 | // int x = ContainerIntegrationTable.SLOT_X[i] - 9; 69 | // int y = ContainerIntegrationTable.SLOT_Y[i] - 23; 70 | // guiItemStacks.init(i, true, x, y); 71 | // guiItemStacks.set(i, (List) wrapper.getInputs().get(i)); 72 | // } 73 | 74 | guiItemStacks.init(inventoryIndex, false, 129, 26); 75 | guiItemStacks.set(inventoryIndex, ingredients.getOutputs(ItemStack.class).get(0)); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/silicon/HandlerIntegrationTable.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.silicon; 2 | 3 | import buildcraft.api.recipes.IntegrationRecipe; 4 | 5 | import buildcraft.compat.module.jei.BCPluginJEI; 6 | 7 | import mezz.jei.api.recipe.IRecipeWrapper; 8 | import mezz.jei.api.recipe.IRecipeWrapperFactory; 9 | 10 | public class HandlerIntegrationTable implements IRecipeWrapperFactory { 11 | @Override 12 | public IRecipeWrapper getRecipeWrapper(IntegrationRecipe recipe) { 13 | return new WrapperIntegrationTable(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), recipe); 14 | } 15 | 16 | // 17 | // @Nonnull 18 | // @Override 19 | // public Class getRecipeClass() { 20 | // return IIntegrationRecipe.class; 21 | // } 22 | // 23 | // @Override 24 | // public String getRecipeCategoryUid() { 25 | // return CategoryIntegrationTable.UID; 26 | // } 27 | // 28 | // @Nonnull 29 | // @Override 30 | // public IRecipeWrapper getRecipeWrapper(@Nonnull IIntegrationRecipe recipe) { 31 | // return new WrapperIntegrationTable(BCPluginJEI.registry.getJeiHelpers().getGuiHelper(), recipe); 32 | // } 33 | // 34 | // @Override 35 | // public boolean isRecipeValid(@Nonnull IIntegrationRecipe recipe) { 36 | // return true; 37 | // } 38 | } 39 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/silicon/Utils.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.silicon; 2 | 3 | import java.util.List; 4 | import com.google.common.collect.Lists; 5 | import net.minecraft.item.ItemStack; 6 | import buildcraft.api.recipes.StackDefinition; 7 | 8 | public final class Utils { 9 | public static List getItemStacks(StackDefinition definition) { 10 | List list = Lists.newArrayList(); 11 | 12 | if (definition.filter != null) { 13 | for (ItemStack stack : definition.filter.getExamples()) { 14 | ItemStack sizedStack = stack.copy(); 15 | sizedStack.setCount(definition.count); 16 | list.add(sizedStack); 17 | } 18 | } 19 | 20 | return list; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/silicon/WrapperAssemblyTable.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.silicon; 2 | 3 | import java.awt.Color; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import com.google.common.collect.ImmutableList; 8 | import com.google.common.collect.Lists; 9 | 10 | import net.minecraft.client.Minecraft; 11 | import net.minecraft.item.ItemStack; 12 | import net.minecraft.util.ResourceLocation; 13 | 14 | import net.minecraftforge.fml.relauncher.Side; 15 | import net.minecraftforge.fml.relauncher.SideOnly; 16 | 17 | import buildcraft.api.mj.MjAPI; 18 | import buildcraft.api.recipes.AssemblyRecipeBasic; 19 | import buildcraft.api.recipes.IngredientStack; 20 | 21 | import buildcraft.compat.module.jei.BCPluginJEI; 22 | 23 | import mezz.jei.api.IGuiHelper; 24 | import mezz.jei.api.gui.IDrawableAnimated; 25 | import mezz.jei.api.gui.IDrawableStatic; 26 | import mezz.jei.api.ingredients.IIngredients; 27 | import mezz.jei.api.recipe.IRecipeWrapper; 28 | 29 | public class WrapperAssemblyTable implements IRecipeWrapper { 30 | private final AssemblyRecipeBasic recipe; 31 | private final IDrawableAnimated progressBar; 32 | private final List> inputs; 33 | private final List outputs; 34 | 35 | public WrapperAssemblyTable(AssemblyRecipeBasic recipe) { 36 | this.recipe = recipe; 37 | List> _inputs = Lists.newArrayList(); 38 | for (IngredientStack in : recipe.getInputsFor(ItemStack.EMPTY)) { 39 | List inner = new ArrayList<>(); 40 | for (ItemStack matching : in.ingredient.getMatchingStacks()) { 41 | matching = matching.copy(); 42 | matching.setCount(in.count); 43 | inner.add(matching); 44 | } 45 | _inputs.add(inner); 46 | } 47 | this.inputs = ImmutableList.copyOf(_inputs); 48 | this.outputs = ImmutableList.copyOf(recipe.getOutputPreviews()); 49 | 50 | IGuiHelper guiHelper = BCPluginJEI.registry.getJeiHelpers().getGuiHelper(); 51 | 52 | ResourceLocation backgroundLocation = 53 | new ResourceLocation("buildcraftsilicon", "textures/gui/assembly_table.png"); 54 | IDrawableStatic progressDrawable = guiHelper.createDrawable(backgroundLocation, 176, 48, 4, 71, 10, 0, 0, 0); 55 | long mj = this.recipe.getRequiredMicroJoulesFor(ItemStack.EMPTY); 56 | progressBar = guiHelper.createAnimatedDrawable(progressDrawable, (int) Math.max(10, mj / MjAPI.MJ / 50), 57 | IDrawableAnimated.StartDirection.BOTTOM, false); 58 | } 59 | 60 | @Override 61 | public void getIngredients(IIngredients ingredients) { 62 | ingredients.setInputLists(ItemStack.class, this.inputs); 63 | ingredients.setOutputs(ItemStack.class, this.outputs); 64 | } 65 | 66 | @Override 67 | @SideOnly(Side.CLIENT) 68 | public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { 69 | this.progressBar.draw(minecraft, 81, 2); 70 | long mj = this.recipe.getRequiredMicroJoulesFor(ItemStack.EMPTY); 71 | minecraft.fontRenderer.drawString(MjAPI.formatMj(mj) + " MJ", 4, 0, Color.gray.getRGB()); 72 | } 73 | 74 | @Override 75 | public List getTooltipStrings(int mouseX, int mouseY) { 76 | return Lists.newArrayList(); 77 | } 78 | 79 | @Override 80 | public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { 81 | return false; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/silicon/WrapperIntegrationTable.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.silicon; 2 | 3 | import java.awt.Color; 4 | import java.util.List; 5 | import com.google.common.collect.ImmutableList; 6 | import com.google.common.collect.Lists; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraft.init.Blocks; 9 | import net.minecraft.item.ItemStack; 10 | import net.minecraft.util.ResourceLocation; 11 | import net.minecraftforge.fml.relauncher.Side; 12 | import net.minecraftforge.fml.relauncher.SideOnly; 13 | import buildcraft.api.mj.MjAPI; 14 | import buildcraft.api.recipes.IntegrationRecipe; 15 | import buildcraft.api.recipes.StackDefinition; 16 | import mezz.jei.api.IGuiHelper; 17 | import mezz.jei.api.gui.IDrawableAnimated; 18 | import mezz.jei.api.gui.IDrawableStatic; 19 | import mezz.jei.api.ingredients.IIngredients; 20 | import mezz.jei.api.recipe.IRecipeWrapper; 21 | 22 | public class WrapperIntegrationTable implements IRecipeWrapper { 23 | private final IntegrationRecipe recipe; 24 | private final IDrawableAnimated progressBar; 25 | private final List inputs, outputs; 26 | 27 | public WrapperIntegrationTable(IGuiHelper guiHelper, IntegrationRecipe recipe) { 28 | this.recipe = recipe; 29 | 30 | List inputs = Lists.newArrayList(); 31 | // inputs.addAll(Utils.getItemStacks(recipe.target)); 32 | // for (StackDefinition definition : recipe.toIntegrate) { 33 | // inputs.addAll(Utils.getItemStacks(definition)); 34 | // } 35 | this.inputs = ImmutableList.copyOf(inputs); 36 | this.outputs = ImmutableList.of(new ItemStack(Blocks.COBBLESTONE)); 37 | 38 | ResourceLocation backgroundLocation = new ResourceLocation("buildcraftsilicon", "textures/gui/integration_table.png"); 39 | IDrawableStatic progressDrawable = guiHelper.createDrawable(backgroundLocation, 176, 17, 4, 69, 0, 0, 0, 0); 40 | this.progressBar = guiHelper.createAnimatedDrawable(progressDrawable, (int) (/*recipe.requiredMicroJoules / */ 720), IDrawableAnimated.StartDirection.BOTTOM, false); 41 | } 42 | 43 | // @Override 44 | // public List getInputs() { 45 | // return inputs; 46 | // } 47 | // 48 | // @Override 49 | // public List getOutputs() { 50 | // return outputs; 51 | // } 52 | // 53 | // @Override 54 | // public List getFluidInputs() { 55 | // return null; 56 | // } 57 | // 58 | // @Override 59 | // public List getFluidOutputs() { 60 | // return null; 61 | // } 62 | // 63 | // @Override 64 | // public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight) {} 65 | 66 | @Override 67 | public void getIngredients(IIngredients ingredients) { 68 | ingredients.setInputs(ItemStack.class, this.inputs); 69 | ingredients.setOutputs(ItemStack.class, this.outputs); 70 | } 71 | 72 | @Override 73 | @SideOnly(Side.CLIENT) 74 | public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { 75 | this.progressBar.draw(minecraft, 156, 1); 76 | minecraft.fontRenderer.drawString(MjAPI.formatMj(/*this.recipe.requiredMicroJoules*/0) + " MJ", 80, 52, Color.gray.getRGB()); 77 | } 78 | // 79 | // @Override 80 | // public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight) { 81 | // progressBar.draw(minecraft, 156, 1); 82 | // } 83 | 84 | @Override 85 | public List getTooltipStrings(int mouseX, int mouseY) { 86 | return Lists.newArrayList(); 87 | } 88 | 89 | @Override 90 | public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { 91 | return false; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/silicon/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | package buildcraft.compat.module.jei.silicon; 4 | 5 | import javax.annotation.ParametersAreNonnullByDefault; 6 | import mcp.MethodsReturnNonnullByDefault; 7 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/transferhandlers/AdvancedCraftingItemsTransferHandler.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.transferhandlers; 2 | 3 | import javax.annotation.Nullable; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import buildcraft.silicon.container.ContainerAdvancedCraftingTable; 6 | import mezz.jei.api.gui.IRecipeLayout; 7 | import mezz.jei.api.recipe.transfer.IRecipeTransferError; 8 | import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; 9 | 10 | public class AdvancedCraftingItemsTransferHandler implements IRecipeTransferHandler { 11 | @Override 12 | public Class getContainerClass() { 13 | return ContainerAdvancedCraftingTable.class; 14 | } 15 | 16 | @Nullable 17 | @Override 18 | public IRecipeTransferError transferRecipe(ContainerAdvancedCraftingTable container, IRecipeLayout recipeLayout, EntityPlayer player, boolean maxTransfer, boolean doTransfer) { 19 | if (doTransfer) { 20 | // Map> inputs = recipeLayout.getItemStacks().getGuiIngredients(); 21 | // 22 | // for (int slot = 0; slot < 9; slot++) { 23 | // IGuiIngredient ingredient = inputs.getOrDefault(slot + 1, null); 24 | // ItemStack stack = (ingredient == null) ? ItemStack.EMPTY : ingredient.getDisplayedIngredient(); 25 | // 26 | // container.sendSetPhantomSlot(container.tile.invBlueprint, slot, (stack == null) ? ItemStack.EMPTY : stack); 27 | // } 28 | 29 | AutoCraftItemsTransferHandler.transferRecipe( 30 | itemStacks -> container.sendSetPhantomSlots(container.tile.invBlueprint, itemStacks), 31 | recipeLayout); 32 | } 33 | 34 | return null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/transferhandlers/AssemblyTableTransferHandler.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.transferhandlers; 2 | 3 | import javax.annotation.Nullable; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import buildcraft.silicon.container.ContainerAssemblyTable; 6 | import mezz.jei.api.gui.IRecipeLayout; 7 | import mezz.jei.api.recipe.transfer.IRecipeTransferError; 8 | import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; 9 | 10 | public class AssemblyTableTransferHandler implements IRecipeTransferHandler { 11 | @Override 12 | public Class getContainerClass() { 13 | return ContainerAssemblyTable.class; 14 | } 15 | 16 | @Nullable 17 | @Override 18 | public IRecipeTransferError transferRecipe(ContainerAssemblyTable container, IRecipeLayout recipeLayout, EntityPlayer player, boolean maxTransfer, boolean doTransfer) { 19 | 20 | 21 | return null; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/transferhandlers/AutoCraftItemsTransferHandler.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.jei.transferhandlers; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | import java.util.function.Consumer; 6 | import javax.annotation.Nullable; 7 | import com.google.common.collect.Lists; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.item.ItemStack; 10 | import buildcraft.factory.container.ContainerAutoCraftItems; 11 | import mezz.jei.api.gui.IGuiIngredient; 12 | import mezz.jei.api.gui.IRecipeLayout; 13 | import mezz.jei.api.recipe.transfer.IRecipeTransferError; 14 | import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; 15 | 16 | public class AutoCraftItemsTransferHandler implements IRecipeTransferHandler { 17 | @Override 18 | public Class getContainerClass() { 19 | return ContainerAutoCraftItems.class; 20 | } 21 | 22 | @Nullable 23 | @Override 24 | public IRecipeTransferError transferRecipe(ContainerAutoCraftItems container, IRecipeLayout recipeLayout, EntityPlayer player, boolean maxTransfer, boolean doTransfer) { 25 | if (doTransfer) { 26 | // Map> inputs = recipeLayout.getItemStacks().getGuiIngredients(); 27 | // 28 | // for (int slot = 0; slot < 9; slot++) { 29 | // IGuiIngredient ingredient = inputs.getOrDefault(slot + 1, null); 30 | // ItemStack stack = (ingredient == null) ? ItemStack.EMPTY : ingredient.getDisplayedIngredient(); 31 | // 32 | // container.sendSetPhantomSlot(container.tile.invBlueprint, slot, (stack == null) ? ItemStack.EMPTY : stack); 33 | // } 34 | 35 | AutoCraftItemsTransferHandler.transferRecipe( 36 | itemStacks -> container.sendSetPhantomSlots(container.tile.invBlueprint, itemStacks), 37 | recipeLayout); 38 | } 39 | 40 | return null; 41 | } 42 | 43 | static void transferRecipe(Consumer> callback, IRecipeLayout recipeLayout) { 44 | Map> inputs = recipeLayout.getItemStacks().getGuiIngredients(); 45 | 46 | List stacks = Lists.newArrayList(); 47 | for (int slot = 0; slot < 9; slot++) { 48 | IGuiIngredient ingredient = inputs.getOrDefault(slot + 1, null); 49 | ItemStack stack = (ingredient == null) ? ItemStack.EMPTY : ingredient.getDisplayedIngredient(); 50 | stacks.add((stack == null) ? ItemStack.EMPTY : stack); 51 | } 52 | 53 | callback.accept(stacks); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/jei/transferhandlers/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | package buildcraft.compat.module.jei.transferhandlers; 4 | 5 | import javax.annotation.ParametersAreNonnullByDefault; 6 | import mcp.MethodsReturnNonnullByDefault; 7 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/theoneprobe/BCPluginTOP.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.theoneprobe; 2 | 3 | import static buildcraft.compat.module.theoneprobe.BCPluginTOP.TOP_MOD_ID; 4 | 5 | import java.util.List; 6 | 7 | import com.google.common.base.Function; 8 | 9 | import net.minecraft.block.state.IBlockState; 10 | import net.minecraft.entity.player.EntityPlayer; 11 | import net.minecraft.item.ItemStack; 12 | import net.minecraft.tileentity.TileEntity; 13 | import net.minecraft.util.ResourceLocation; 14 | import net.minecraft.util.text.TextFormatting; 15 | import net.minecraft.world.World; 16 | 17 | import net.minecraftforge.fml.common.Loader; 18 | import net.minecraftforge.fml.common.Optional; 19 | import net.minecraftforge.fml.common.event.FMLInterModComms; 20 | 21 | import buildcraft.api.BCModules; 22 | import buildcraft.api.mj.ILaserTarget; 23 | import buildcraft.api.mj.MjAPI; 24 | 25 | import buildcraft.lib.tile.craft.IAutoCraft; 26 | 27 | import buildcraft.compat.CompatUtils; 28 | 29 | import mcjty.theoneprobe.api.ElementAlignment; 30 | import mcjty.theoneprobe.api.IBlockDisplayOverride; 31 | import mcjty.theoneprobe.api.IProbeHitData; 32 | import mcjty.theoneprobe.api.IProbeInfo; 33 | import mcjty.theoneprobe.api.IProbeInfoProvider; 34 | import mcjty.theoneprobe.api.ITheOneProbe; 35 | import mcjty.theoneprobe.api.ProbeMode; 36 | 37 | @Optional.InterfaceList({ 38 | @Optional.Interface(modid = TOP_MOD_ID, iface = "mcjty.theoneprobe.api.IBlockDisplayOverride"), 39 | @Optional.Interface(modid = TOP_MOD_ID, iface = "mcjty.theoneprobe.api.IProbeInfoProvider") 40 | }) 41 | public class BCPluginTOP implements Function, IBlockDisplayOverride, IProbeInfoProvider { 42 | static final String TOP_MOD_ID = "theoneprobe"; 43 | 44 | @Override 45 | @Optional.Method(modid = TOP_MOD_ID) 46 | public Void apply(ITheOneProbe top) { 47 | top.registerBlockDisplayOverride(this); 48 | top.registerProvider(this); 49 | return null; 50 | } 51 | 52 | @Override 53 | @Optional.Method(modid = TOP_MOD_ID) 54 | public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) { 55 | return false; 56 | } 57 | 58 | @Override 59 | @Optional.Method(modid = TOP_MOD_ID) 60 | public String getID() { 61 | return "buildcraftcompat.top"; 62 | } 63 | 64 | @Override 65 | @Optional.Method(modid = TOP_MOD_ID) 66 | public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) { 67 | ResourceLocation blockRegistryName = blockState.getBlock().getRegistryName(); 68 | if ((blockRegistryName != null) && (BCModules.isBcMod(blockRegistryName.getResourceDomain()))) { 69 | TileEntity entity = world.getTileEntity(data.getPos()); 70 | if (entity instanceof IAutoCraft) { 71 | this.addAutoCraftInfo(probeInfo, (IAutoCraft) entity); 72 | } 73 | 74 | if (entity instanceof ILaserTarget) { 75 | this.addLaserTargetInfo(probeInfo, (ILaserTarget) entity); 76 | } 77 | } 78 | } 79 | 80 | @Optional.Method(modid = TOP_MOD_ID) 81 | private void addAutoCraftInfo(IProbeInfo probeInfo, IAutoCraft crafter) { 82 | if (!crafter.getCurrentRecipeOutput().isEmpty()) { 83 | IProbeInfo mainInfo = probeInfo.vertical(); 84 | mainInfo 85 | .horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)) 86 | .text("Making: ") 87 | .item(crafter.getCurrentRecipeOutput()); 88 | IProbeInfo info = mainInfo 89 | .horizontal(mainInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)) 90 | .text("From: "); 91 | List stacks = CompatUtils.compactInventory(crafter.getInvBlueprint()); 92 | 93 | for (ItemStack stack : stacks) 94 | info.item(stack); 95 | } 96 | } 97 | 98 | @Optional.Method(modid = TOP_MOD_ID) 99 | private void addLaserTargetInfo(IProbeInfo probeInfo, ILaserTarget laserTarget) { 100 | long power = laserTarget.getRequiredLaserPower(); 101 | if (power > 0) { 102 | probeInfo.horizontal() 103 | .text(TextFormatting.WHITE + "Waiting from laser: ") 104 | .text(TextFormatting.AQUA + MjAPI.formatMj(power)) 105 | .text(TextFormatting.AQUA + "MJ"); 106 | } 107 | } 108 | } 109 | 110 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/theoneprobe/CompatModuleTheOneProbe.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.theoneprobe; 2 | 3 | import net.minecraftforge.fml.common.event.FMLInterModComms; 4 | 5 | import buildcraft.compat.CompatModuleBase; 6 | 7 | public class CompatModuleTheOneProbe extends CompatModuleBase { 8 | 9 | @Override 10 | public String compatModId() { 11 | return "theoneprobe"; 12 | } 13 | 14 | @Override 15 | public void preInit() { 16 | FMLInterModComms.sendFunctionMessage(compatModId(), "getTheOneProbe", 17 | "buildcraft.compat.module.theoneprobe.BCPluginTOP"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/waila/AutoCraftDataProvider.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.waila; 2 | 3 | import static buildcraft.compat.module.waila.HWYLAPlugin.WAILA_MOD_ID; 4 | 5 | import java.util.List; 6 | 7 | import javax.annotation.Nonnull; 8 | 9 | import net.minecraft.entity.player.EntityPlayerMP; 10 | import net.minecraft.item.ItemStack; 11 | import net.minecraft.nbt.NBTTagCompound; 12 | import net.minecraft.nbt.NBTTagList; 13 | import net.minecraft.tileentity.TileEntity; 14 | import net.minecraft.util.math.BlockPos; 15 | import net.minecraft.util.text.TextFormatting; 16 | import net.minecraft.world.World; 17 | 18 | import net.minecraftforge.common.util.Constants; 19 | import net.minecraftforge.fml.common.Optional; 20 | 21 | import buildcraft.lib.tile.craft.IAutoCraft; 22 | 23 | import buildcraft.compat.CompatUtils; 24 | 25 | import mcp.mobius.waila.api.IWailaConfigHandler; 26 | import mcp.mobius.waila.api.IWailaDataAccessor; 27 | import mcp.mobius.waila.api.SpecialChars; 28 | 29 | class AutoCraftDataProvider extends BaseWailaDataProvider { 30 | @Nonnull 31 | @Override 32 | @Optional.Method(modid = WAILA_MOD_ID) 33 | public List getWailaBody(ItemStack itemStack, List currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { 34 | TileEntity tile = accessor.getTileEntity(); 35 | if (tile instanceof IAutoCraft) { 36 | NBTTagCompound nbt = accessor.getNBTData(); 37 | if (nbt.hasKey("recipe_result", Constants.NBT.TAG_COMPOUND)) { 38 | ItemStack result = new ItemStack(nbt.getCompoundTag("recipe_result")); 39 | currentTip.add(TextFormatting.WHITE + "Making: " + SpecialChars.WailaSplitter + HWYLAPlugin.getItemStackString(result)); 40 | 41 | if (nbt.hasKey("recipe_inputs", Constants.NBT.TAG_LIST)) { 42 | NBTTagList list = nbt.getTagList("recipe_inputs", Constants.NBT.TAG_COMPOUND); 43 | StringBuilder inputs = new StringBuilder(TextFormatting.WHITE + "From: " + SpecialChars.WailaSplitter); 44 | for (int index = 0; index < list.tagCount(); index++) { 45 | NBTTagCompound compound = NBTTagCompound.class.cast(list.get(index)); 46 | inputs.append(HWYLAPlugin.getItemStackString(new ItemStack(compound))); 47 | } 48 | currentTip.add(inputs.toString()); 49 | } 50 | } else { 51 | currentTip.add(TextFormatting.GRAY + "No recipe"); 52 | } 53 | } else { 54 | currentTip.add(TextFormatting.RED + "{wrong tile entity}"); 55 | } 56 | return currentTip; 57 | } 58 | 59 | @Nonnull 60 | @Override 61 | @Optional.Method(modid = WAILA_MOD_ID) 62 | public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) { 63 | NBTTagCompound nbt = super.getNBTData(player, te, tag, world, pos); 64 | 65 | TileEntity tile = world.getTileEntity(pos); 66 | if (tile instanceof IAutoCraft) { 67 | IAutoCraft auto = IAutoCraft.class.cast(tile); 68 | ItemStack output = auto.getCurrentRecipeOutput(); 69 | if (!output.isEmpty()) { 70 | nbt.setTag("recipe_result", output.serializeNBT()); 71 | 72 | List stacks = CompatUtils.compactInventory(auto.getInvBlueprint()); 73 | NBTTagList list = new NBTTagList(); 74 | for (int index = 0; index < stacks.size(); index++) { 75 | list.appendTag(stacks.get(index).serializeNBT()); 76 | } 77 | nbt.setTag("recipe_inputs", list); 78 | } 79 | } 80 | 81 | return nbt; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/waila/BaseWailaDataProvider.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.waila; 2 | 3 | import static buildcraft.compat.module.waila.HWYLAPlugin.WAILA_MOD_ID; 4 | 5 | import java.util.List; 6 | import javax.annotation.Nonnull; 7 | import net.minecraft.entity.player.EntityPlayerMP; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.nbt.NBTTagCompound; 10 | import net.minecraft.tileentity.TileEntity; 11 | import net.minecraft.util.math.BlockPos; 12 | import net.minecraft.world.World; 13 | import net.minecraftforge.fml.common.Optional; 14 | 15 | import mcp.mobius.waila.api.IWailaConfigHandler; 16 | import mcp.mobius.waila.api.IWailaDataAccessor; 17 | import mcp.mobius.waila.api.IWailaDataProvider; 18 | 19 | @Optional.InterfaceList({ 20 | @Optional.Interface(modid = WAILA_MOD_ID, iface = "mcp.mobius.waila.api.IWailaDataProvider") 21 | }) 22 | class BaseWailaDataProvider implements IWailaDataProvider { 23 | @Nonnull 24 | @Override 25 | @Optional.Method(modid = WAILA_MOD_ID) 26 | public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) { 27 | return ItemStack.EMPTY; 28 | } 29 | 30 | @Nonnull 31 | @Override 32 | @Optional.Method(modid = WAILA_MOD_ID) 33 | public List getWailaHead(ItemStack itemStack, List currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { 34 | return currentTip; 35 | } 36 | 37 | @Nonnull 38 | @Override 39 | @Optional.Method(modid = WAILA_MOD_ID) 40 | public List getWailaBody(ItemStack itemStack, List currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { 41 | return currentTip; 42 | } 43 | 44 | @Nonnull 45 | @Override 46 | @Optional.Method(modid = WAILA_MOD_ID) 47 | public List getWailaTail(ItemStack itemStack, List currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { 48 | return currentTip; 49 | } 50 | 51 | @Nonnull 52 | @Override 53 | @Optional.Method(modid = WAILA_MOD_ID) 54 | public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) { 55 | return tag; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/waila/HWYLAPlugin.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.waila; 2 | 3 | import static buildcraft.compat.module.waila.HWYLAPlugin.WAILA_MOD_ID; 4 | 5 | import net.minecraft.item.ItemStack; 6 | 7 | import net.minecraftforge.fml.common.Optional; 8 | 9 | import buildcraft.api.mj.ILaserTarget; 10 | 11 | import buildcraft.lib.tile.craft.IAutoCraft; 12 | 13 | import mcp.mobius.waila.api.IWailaDataProvider; 14 | import mcp.mobius.waila.api.IWailaPlugin; 15 | import mcp.mobius.waila.api.IWailaRegistrar; 16 | import mcp.mobius.waila.api.SpecialChars; 17 | import mcp.mobius.waila.api.WailaPlugin; 18 | 19 | @WailaPlugin 20 | @Optional.InterfaceList({ 21 | @Optional.Interface(modid = WAILA_MOD_ID, iface = "mcp.mobius.waila.api.IWailaPlugin") 22 | }) 23 | public class HWYLAPlugin implements IWailaPlugin { 24 | static final String WAILA_MOD_ID = "waila"; 25 | 26 | @Override 27 | public void register(IWailaRegistrar registrar) { 28 | IWailaDataProvider autoCraftProvider = new AutoCraftDataProvider(); 29 | registrar.registerNBTProvider(autoCraftProvider, IAutoCraft.class); 30 | registrar.registerBodyProvider(autoCraftProvider, IAutoCraft.class); 31 | 32 | IWailaDataProvider laserTargetProvider = new LaserTargetDataProvider(); 33 | registrar.registerNBTProvider(laserTargetProvider, ILaserTarget.class); 34 | registrar.registerBodyProvider(laserTargetProvider, ILaserTarget.class); 35 | } 36 | 37 | static String getItemStackString(ItemStack stack) { 38 | return getItemStackString(stack, "1"); 39 | } 40 | 41 | private static String getItemStackString(ItemStack stack, String thing) { 42 | // TODO: find out what that 'thing' really is 43 | return SpecialChars.getRenderString("waila.stack", thing, 44 | stack.getItem().getRegistryName().toString(), 45 | String.valueOf(stack.getCount()), 46 | String.valueOf(stack.getItemDamage()) 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /common/buildcraft/compat/module/waila/LaserTargetDataProvider.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.module.waila; 2 | 3 | import static buildcraft.compat.module.waila.HWYLAPlugin.WAILA_MOD_ID; 4 | 5 | import java.util.List; 6 | 7 | import javax.annotation.Nonnull; 8 | 9 | import net.minecraft.entity.player.EntityPlayerMP; 10 | import net.minecraft.item.ItemStack; 11 | import net.minecraft.nbt.NBTTagCompound; 12 | import net.minecraft.tileentity.TileEntity; 13 | import net.minecraft.util.math.BlockPos; 14 | import net.minecraft.util.text.TextFormatting; 15 | import net.minecraft.world.World; 16 | 17 | import net.minecraftforge.common.util.Constants; 18 | import net.minecraftforge.fml.common.Optional; 19 | 20 | import buildcraft.api.mj.ILaserTarget; 21 | 22 | import buildcraft.lib.misc.LocaleUtil; 23 | 24 | import mcp.mobius.waila.api.IWailaConfigHandler; 25 | import mcp.mobius.waila.api.IWailaDataAccessor; 26 | 27 | class LaserTargetDataProvider extends BaseWailaDataProvider { 28 | @Nonnull 29 | @Override 30 | @Optional.Method(modid = WAILA_MOD_ID) 31 | public List getWailaBody(ItemStack itemStack, List currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { 32 | TileEntity tile = accessor.getTileEntity(); 33 | if (tile instanceof ILaserTarget) { 34 | NBTTagCompound nbt = accessor.getNBTData(); 35 | if (nbt.hasKey("required_power", Constants.NBT.TAG_LONG)) { 36 | long power = nbt.getLong("required_power"); 37 | if (power > 0) { 38 | currentTip.add(TextFormatting.WHITE + "Waiting from laser: " + TextFormatting.AQUA + LocaleUtil.localizeMj(power)); 39 | } 40 | } 41 | } else { 42 | currentTip.add(TextFormatting.RED + "{wrong tile entity}"); 43 | } 44 | return currentTip; 45 | } 46 | 47 | @Nonnull 48 | @Override 49 | @Optional.Method(modid = WAILA_MOD_ID) 50 | public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) { 51 | NBTTagCompound nbt = super.getNBTData(player, te, tag, world, pos); 52 | 53 | TileEntity tile = world.getTileEntity(pos); 54 | if (tile instanceof ILaserTarget) { 55 | ILaserTarget target = ILaserTarget.class.cast(tile); 56 | nbt.setLong("required_power", target.getRequiredLaserPower()); 57 | } 58 | 59 | return nbt; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /common/buildcraft/compat/network/CompatGui.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.network; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.tileentity.TileEntity; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | 10 | import net.minecraftforge.fml.common.SidedProxy; 11 | import net.minecraftforge.fml.common.network.IGuiHandler; 12 | 13 | import buildcraft.compat.BCCompat; 14 | import buildcraft.compat.CompatUtils; 15 | 16 | // Half-decent class (inspired by how forestry does things) 17 | // This really wants fleshing out and moving into mainline buildcraft though 18 | // Along with a sensible way of dealing with pluggables etc 19 | public enum CompatGui { 20 | 21 | FORESTRY_PROPOLIS_PIPE(IGuiTarget.TILE); 22 | 23 | static final CompatGui[] VALUES = values(); 24 | 25 | @SidedProxy(modId = BCCompat.MODID) 26 | public static CommonProxy guiHandlerProxy; 27 | 28 | public final IGuiTarget target; 29 | 30 | private CompatGui(IGuiTarget target) { 31 | this.target = target; 32 | } 33 | 34 | public void openGui(EntityPlayer player) { 35 | openGui(player, 0, 0, 0, 0); 36 | } 37 | 38 | public void openGui(EntityPlayer player, BlockPos pos) { 39 | openGui(player, pos.getX(), pos.getY(), pos.getZ(), 0); 40 | } 41 | 42 | public void openGui(EntityPlayer player, int x, int y, int z) { 43 | openGui(player, x, y, z, 0); 44 | } 45 | 46 | public void openGui(EntityPlayer player, int data) { 47 | openGui(player, 0, 0, 0, data); 48 | } 49 | 50 | public void openGui(EntityPlayer player, BlockPos pos, int data) { 51 | openGui(player, pos.getX(), pos.getY(), pos.getZ(), data); 52 | } 53 | 54 | public void openGui(EntityPlayer player, int x, int y, int z, int data) { 55 | player.openGui(BCCompat.instance, packGui(this, data), player.world, x, y, z); 56 | } 57 | 58 | protected static int packGui(Enum gui, int data) { 59 | if (data < 0 || data > 0xFF_FF_FF) { 60 | throw new IllegalArgumentException("Data must be between 0 and 0xFF_FF_FF (inclusive)"); 61 | } 62 | return (data << 8) | gui.ordinal(); 63 | } 64 | 65 | @Nullable 66 | protected static CompatGui getGui(int id) { 67 | id &= 0xFF; 68 | if (id < 0 || id >= CompatGui.VALUES.length) { 69 | return null; 70 | } 71 | return CompatGui.VALUES[id]; 72 | } 73 | 74 | protected static int getData(int id) { 75 | return id >>> 8; 76 | } 77 | 78 | @FunctionalInterface 79 | public interface IGuiTarget { 80 | public static final IGuiTarget TILE = (player, world, x, y, z, data) -> { 81 | TileEntity tile = world.getTileEntity(new BlockPos(x, y, z)); 82 | if (tile instanceof IGuiCreator) { 83 | return (IGuiCreator) tile; 84 | } 85 | if (tile != null) { 86 | return tile.getCapability(CompatUtils.CAP_GUI_CREATOR, null); 87 | } 88 | return null; 89 | }; 90 | 91 | @Nullable 92 | IGuiCreator getCreator(EntityPlayer player, World world, int x, int y, int z, int data); 93 | } 94 | 95 | public static abstract class CommonProxy implements IGuiHandler { 96 | 97 | @Nullable 98 | protected static IGuiCreator getGuiCreator(int id, EntityPlayer player, World world, int x, int y, int z) { 99 | CompatGui type = getGui(id); 100 | int data = getData(id); 101 | if (type == null) { 102 | return null; 103 | } 104 | IGuiCreator creator = type.target.getCreator(player, world, x, y, z, data); 105 | if (creator == null || creator.getGuiType() != type) { 106 | return null; 107 | } 108 | return creator; 109 | } 110 | 111 | @Override 112 | @Nullable 113 | public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { 114 | IGuiCreator creator = getGuiCreator(id, player, world, x, y, z); 115 | if (creator == null) { 116 | return null; 117 | } 118 | return creator.getServerGuiElement(getData(id), player); 119 | } 120 | } 121 | 122 | public static class ServerProxy extends CommonProxy { 123 | 124 | @Override 125 | @Nullable 126 | public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { 127 | return null; 128 | } 129 | } 130 | 131 | public static class ClientProxy extends CommonProxy { 132 | 133 | @Override 134 | @Nullable 135 | public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { 136 | IGuiCreator creator = getGuiCreator(id, player, world, x, y, z); 137 | if (creator == null) { 138 | return null; 139 | } 140 | return creator.getClientGuiElement(getData(id), player); 141 | } 142 | } 143 | 144 | } 145 | -------------------------------------------------------------------------------- /common/buildcraft/compat/network/IGuiCreator.java: -------------------------------------------------------------------------------- 1 | package buildcraft.compat.network; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | import net.minecraft.client.gui.inventory.GuiContainer; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.inventory.Container; 8 | 9 | import net.minecraftforge.fml.relauncher.Side; 10 | import net.minecraftforge.fml.relauncher.SideOnly; 11 | 12 | /** A creator that can */ 13 | // TODO: Move this into bc lib and make it more useful! 14 | public interface IGuiCreator { 15 | Enum getGuiType(); 16 | 17 | /** @param data The extra 24 bits that are unused by the byte ID. */ 18 | @Nullable 19 | @SideOnly(Side.CLIENT) 20 | GuiContainer getClientGuiElement(int data, EntityPlayer player); 21 | 22 | /** @param data The extra 24 bits that are unused by the byte ID. */ 23 | @Nullable 24 | Container getServerGuiElement(int data, EntityPlayer player); 25 | } 26 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Sep 05 20:44:05 EEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /guidelines/Buildcraft.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /guidelines/buildcraft.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /guidelines/buildcraft.checkstyle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /guidelines/header.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 SpaceToad and the BuildCraft team 3 | * 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 4 | * distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/ 5 | */ 6 | -------------------------------------------------------------------------------- /resources/LICENSE.COMPAT: -------------------------------------------------------------------------------- 1 | Minecraft Mod Public License 2 | ============================ 3 | 4 | Version 1.0.1 5 | 6 | 0. Definitions 7 | -------------- 8 | 9 | Minecraft: Denotes a copy of the Minecraft game licensed by Mojang AB 10 | 11 | User: Anybody that interacts with the software in one of the following ways: 12 | - play 13 | - decompile 14 | - recompile or compile 15 | - modify 16 | - distribute 17 | 18 | Mod: The mod code designated by the present license, in source form, binary 19 | form, as obtained standalone, as part of a wider distribution or resulting from 20 | the compilation of the original or modified sources. 21 | 22 | Dependency: Code required for the mod to work properly. This includes 23 | dependencies required to compile the code as well as any file or modification 24 | that is explicitely or implicitely required for the mod to be working. 25 | 26 | 1. Scope 27 | -------- 28 | 29 | The present license is granted to any user of the mod. As a prerequisite, 30 | a user must own a legally acquired copy of Minecraft 31 | 32 | 2. Liability 33 | ------------ 34 | 35 | This mod is provided 'as is' with no warranties, implied or otherwise. The owner 36 | of this mod takes no responsibility for any damages incurred from the use of 37 | this mod. This mod alters fundamental parts of the Minecraft game, parts of 38 | Minecraft may not work with this mod installed. All damages caused from the use 39 | or misuse of this mad fall on the user. 40 | 41 | 3. Play rights 42 | -------------- 43 | 44 | The user is allowed to install this mod on a client or a server and to play 45 | without restriction. 46 | 47 | 4. Modification rights 48 | ---------------------- 49 | 50 | The user has the right to decompile the source code, look at either the 51 | decompiled version or the original source code, and to modify it. 52 | 53 | 5. Derivation rights 54 | -------------------- 55 | 56 | The user has the rights to derive code from this mod, that is to say to 57 | write code that extends or instanciate the mod classes or interfaces, refer to 58 | its objects, or calls its functions. This code is known as "derived" code, and 59 | can be licensed under a license different from this mod. 60 | 61 | 6. Distribution of original or modified copy rights 62 | --------------------------------------------------- 63 | 64 | Is subject to distribution rights this entire mod in its various forms. This 65 | include: 66 | - original binary or source forms of this mod files 67 | - modified versions of these binaries or source files, as well as binaries 68 | resulting from source modifications 69 | - patch to its source or binary files 70 | - any copy of a portion of its binary source files 71 | 72 | The user is allowed to redistribute this mod partially, in totality, or 73 | included in a distribution. 74 | 75 | When distributing binary files, the user must provide means to obtain its 76 | entire set of sources or modified sources at no costs. 77 | 78 | All distributions of this mod must remain licensed under the MMPL. 79 | 80 | All dependencies that this mod have on other mods or classes must be licensed 81 | under conditions comparable to this version of MMPL, with the exception of the 82 | Minecraft code and the mod loading framework (e.g. ModLoader, ModLoaderMP or 83 | Bukkit). 84 | 85 | Modified version of binaries and sources, as well as files containing sections 86 | copied from this mod, should be distributed under the terms of the present 87 | license. 88 | -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/lang/de_DE.lang: -------------------------------------------------------------------------------- 1 | #################### 2 | # APIARIST'S PIPE 3 | #################### 4 | 5 | item.buildcraftPipe.pipeitemspropolis.name=Bienenrohr 6 | 7 | for.gui.pipe.filter.anything=Alles 8 | for.gui.pipe.filter.bee=Alle Bienen 9 | for.gui.pipe.filter.cave=Höhlenbewohner 10 | for.gui.pipe.filter.closed=Geschlossen 11 | for.gui.pipe.filter.drone=Dronen 12 | for.gui.pipe.filter.flyer=Starke Flieger 13 | for.gui.pipe.filter.item=Gegenstände 14 | for.gui.pipe.filter.nocturnal=Nachtaktive 15 | for.gui.pipe.filter.princess=Prinzessinnen 16 | for.gui.pipe.filter.pure_breed=Reinrassige 17 | for.gui.pipe.filter.pure_cave=Reinrassige Höhlenbewohner 18 | for.gui.pipe.filter.pure_flyer=Reinrassig starke Flieger 19 | for.gui.pipe.filter.pure_nocturnal=Reinrassig nachtaktive 20 | for.gui.pipe.filter.queen=Königinnen 21 | -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/lang/en_US.lang: -------------------------------------------------------------------------------- 1 | #################### 2 | # APIARIST'S PIPE 3 | #################### 4 | 5 | item.buildcraftPipe.pipeitemspropolis.name=Apiarist's Pipe 6 | 7 | for.gui.pipe.filter.anything=Anything 8 | for.gui.pipe.filter.bee=Any Bees 9 | for.gui.pipe.filter.cave=Cave-Dwellers 10 | for.gui.pipe.filter.closed=Closed 11 | for.gui.pipe.filter.drone=Drones 12 | for.gui.pipe.filter.flyer=Strong Flyers 13 | for.gui.pipe.filter.item=Items 14 | for.gui.pipe.filter.natural=Natural Origin 15 | for.gui.pipe.filter.nocturnal=Nocturnal Bees 16 | for.gui.pipe.filter.princess=Princesses 17 | for.gui.pipe.filter.pure_breed=Pure-Bred Bees 18 | for.gui.pipe.filter.pure_cave=Pure Cave-Dwellers 19 | for.gui.pipe.filter.pure_flyer=Pure Flyers 20 | for.gui.pipe.filter.pure_nocturnal=Pure Nocturnal Bees 21 | for.gui.pipe.filter.queen=Queen 22 | 23 | gate.trigger.mfr.backstuffed=Has Drops 24 | gate.trigger.mfr.conreversed=Conveyor Reversed 25 | gate.trigger.mfr.conrunning=Conveyor Running -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/lang/fr_FR.lang: -------------------------------------------------------------------------------- 1 | #################### 2 | # APIARIST'S PIPE 3 | #################### 4 | 5 | item.buildcraftPipe.pipeitemspropolis.name=Tuyau de transport d'apiculteur 6 | 7 | for.gui.pipe.filter.anything=Tout 8 | for.gui.pipe.filter.bee=Toutes abeilles 9 | for.gui.pipe.filter.cave=De cave 10 | for.gui.pipe.filter.closed=Rien 11 | for.gui.pipe.filter.drone=Ouvrières 12 | for.gui.pipe.filter.flyer=Les volantes 13 | for.gui.pipe.filter.item=Éléments 14 | for.gui.pipe.filter.nocturnal=Les noctures 15 | for.gui.pipe.filter.princess=Princesses 16 | for.gui.pipe.filter.pure_breed=Pures races 17 | for.gui.pipe.filter.pure_cave=De cave pures 18 | for.gui.pipe.filter.pure_flyer=Volantes pures 19 | for.gui.pipe.filter.pure_nocturnal=Nocturne pures 20 | for.gui.pipe.filter.queen=Reines 21 | -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/lang/ko_KR.lang: -------------------------------------------------------------------------------- 1 | #################### 2 | # APIARIST'S PIPE 3 | #################### 4 | 5 | item.buildcraftPipe.pipeitemspropolis.name=양봉업자의 파이프 6 | 7 | for.gui.pipe.filter.anything=모든 아이템과 벌을 통과 8 | for.gui.pipe.filter.bee=모든 벌들 9 | for.gui.pipe.filter.cave=동굴 속에서도 작업 가능 10 | for.gui.pipe.filter.closed=아이템을 받지 않음 11 | for.gui.pipe.filter.drone=일벌 12 | for.gui.pipe.filter.flyer=우천시에도 작업 가능 13 | for.gui.pipe.filter.item=아이템만 14 | for.gui.pipe.filter.nocturnal=야행성 벌 15 | for.gui.pipe.filter.princess=공주벌 16 | for.gui.pipe.filter.pure_breed=공주벌 17 | for.gui.pipe.filter.pure_cave=동굴 속에서도 작업 가능한 순종 벌 18 | for.gui.pipe.filter.pure_flyer=우천시에도 작업 가능한 순종 벌 19 | for.gui.pipe.filter.pure_nocturnal=순종 야행성 벌 20 | for.gui.pipe.filter.queen=여왕벌 21 | -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/lang/pt_BR.lang: -------------------------------------------------------------------------------- 1 | #################### 2 | # APIARIST'S PIPE 3 | #################### 4 | 5 | item.buildcraftPipe.pipeitemspropolis.name=Tubo do Apicultor 6 | 7 | for.gui.pipe.filter.anything=Nada 8 | for.gui.pipe.filter.bee=Quaisquer Abelhas 9 | for.gui.pipe.filter.cave=Habitante de Cavernas 10 | for.gui.pipe.filter.closed=Fechado 11 | for.gui.pipe.filter.drone=Zangões 12 | for.gui.pipe.filter.flyer=Insetos Fortes 13 | for.gui.pipe.filter.item=Ítens 14 | for.gui.pipe.filter.nocturnal=Abelhas Noturnas 15 | for.gui.pipe.filter.princess=Princesas 16 | for.gui.pipe.filter.pure_breed=Abelhas de Raça Pura 17 | for.gui.pipe.filter.pure_cave=Puras Habitantes das Cavernas 18 | for.gui.pipe.filter.pure_flyer=Insetos Puros 19 | for.gui.pipe.filter.pure_nocturnal=Abelhas Noturnas Puras 20 | for.gui.pipe.filter.queen=Rainha 21 | -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/lang/ru_RU.lang: -------------------------------------------------------------------------------- 1 | #################### 2 | # APIARIST'S PIPE 3 | #################### 4 | 5 | item.buildcraftPipe.pipeitemspropolis.name=Труба пчеловода 6 | 7 | for.gui.pipe.filter.anything=Всё 8 | for.gui.pipe.filter.bee=Любые пчелы 9 | for.gui.pipe.filter.cave=Пещерные 10 | for.gui.pipe.filter.closed=Закрыт 11 | for.gui.pipe.filter.drone=Трутни 12 | for.gui.pipe.filter.flyer=Летуны 13 | for.gui.pipe.filter.item=Предметы 14 | for.gui.pipe.filter.natural=Естественного происх. 15 | for.gui.pipe.filter.nocturnal=Ночные 16 | for.gui.pipe.filter.princess=Принцессы 17 | for.gui.pipe.filter.pure_breed=Чистопородные 18 | for.gui.pipe.filter.pure_cave=Породистые пещерные 19 | for.gui.pipe.filter.pure_flyer=Породистые летуны 20 | for.gui.pipe.filter.pure_nocturnal=Породистые ночные 21 | for.gui.pipe.filter.queen=Матки 22 | 23 | gate.trigger.mfr.backstuffed=Есть предметы 24 | gate.trigger.mfr.conreversed=Конвейер реверсирован 25 | gate.trigger.mfr.conrunning=Конвейер работает -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/lang/uk_UA.lang: -------------------------------------------------------------------------------- 1 | #################### 2 | # APIARIST'S PIPE 3 | #################### 4 | 5 | item.buildcraftPipe.pipeitemspropolis.name=Труба пчеловода 6 | 7 | for.gui.pipe.filter.anything=Всё 8 | for.gui.pipe.filter.bee=Любые пчелы 9 | for.gui.pipe.filter.cave=Пещерные 10 | for.gui.pipe.filter.closed=Закрыт 11 | for.gui.pipe.filter.drone=Трутни 12 | for.gui.pipe.filter.flyer=Летуны 13 | for.gui.pipe.filter.item=Предметы 14 | for.gui.pipe.filter.nocturnal=Ночные 15 | for.gui.pipe.filter.princess=Принцессы 16 | for.gui.pipe.filter.pure_breed=Чистопородные 17 | for.gui.pipe.filter.pure_cave=Породистые пещерные 18 | for.gui.pipe.filter.pure_flyer=Породистые летуны 19 | for.gui.pipe.filter.pure_nocturnal=Породистые ночные 20 | for.gui.pipe.filter.queen=Королевы 21 | -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/lang/zh_CN.lang: -------------------------------------------------------------------------------- 1 | #################### 2 | # APIARIST'S PIPE 3 | #################### 4 | 5 | item.buildcraftPipe.pipeitemspropolis.name=养蜂员管道 6 | 7 | for.gui.pipe.filter.anything=任意物品 8 | for.gui.pipe.filter.bee=任意蜜蜂 9 | for.gui.pipe.filter.cave=穴居蜂 10 | for.gui.pipe.filter.closed=已关闭 11 | for.gui.pipe.filter.drone=雄蜂 12 | for.gui.pipe.filter.flyer=强壮飞蜂 13 | for.gui.pipe.filter.item=物品 14 | for.gui.pipe.filter.nocturnal=夜行蜜蜂 15 | for.gui.pipe.filter.princess=公主蜂 16 | for.gui.pipe.filter.pure_breed=纯种蜜蜂 17 | for.gui.pipe.filter.pure_cave=纯种穴居蜂 18 | for.gui.pipe.filter.pure_flyer=纯种飞蜂 19 | for.gui.pipe.filter.pure_nocturnal=纯种夜行蜜蜂 20 | for.gui.pipe.filter.queen=蜂后 21 | -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/gui/propolisPipe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/gui/propolisPipe.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/action_bundled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/action_bundled.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/anything.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/anything.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/bee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/bee.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/cave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/cave.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/closed.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/drone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/drone.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/flyer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/flyer.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/item.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/nocturnal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/nocturnal.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/princess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/princess.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/pure_breed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/pure_breed.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/pure_cave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/pure_cave.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/pure_flyer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/pure_flyer.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/pure_nocturnal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/pure_nocturnal.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/propolisPipe/queen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/propolisPipe/queen.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/statements/mfr/ConveyorReversed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/statements/mfr/ConveyorReversed.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/statements/mfr/ConveyorRunning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/statements/mfr/ConveyorRunning.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/statements/mfr/ReverseConveyor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/statements/mfr/ReverseConveyor.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/trigger_bundled_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/trigger_bundled_off.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/items/trigger_bundled_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/items/trigger_bundled_on.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/pipes/propolis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/pipes/propolis.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/pipes/propolis_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/pipes/propolis_down.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/pipes/propolis_east.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/pipes/propolis_east.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/pipes/propolis_itemstack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/pipes/propolis_itemstack.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/pipes/propolis_north.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/pipes/propolis_north.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/pipes/propolis_south.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/pipes/propolis_south.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/pipes/propolis_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/pipes/propolis_up.png -------------------------------------------------------------------------------- /resources/assets/buildcraftcompat/textures/pipes/propolis_west.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuildCraft/BuildCraftCompat/569b9b18af79486a3363cfa9fc626458d55fa499/resources/assets/buildcraftcompat/textures/pipes/propolis_west.png -------------------------------------------------------------------------------- /resources/changelog_compat/7.0.0: -------------------------------------------------------------------------------- 1 | Added: 2 | 3 | * [AppleMilkTea 2] Stripes Pipes and Robots can now harvest tea. 4 | * [NEI] Better Integration Table support. 5 | * [WAILA] More informative tooltips for Robots. 6 | * Proper modularization and refactoring. 7 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.0.1: -------------------------------------------------------------------------------- 1 | Bugs fixed: 2 | 3 | * [NEI] Assembly Table and Refinery now have proper textures (asie) 4 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.0.10: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * AquaTweaks support (asie) 4 | 5 | Bugs fixed: 6 | 7 | * Connection issues with MineFactory Reloaded (asie) 8 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.0.11: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * Support for Big Reactors reactors, turbines, etc. (asie) 4 | * Support for most of Factorization (excluding sculptures and hinges - including barrels though!) (asie) 5 | * Support for (small, single-block) parts of Immersive Engineering (connectors, structural arms, other minor things) (asie) 6 | * Support for RedLogic lamps and buttons (asie) 7 | 8 | Improvements: 9 | 10 | * Speed up Immibis' Microblocks builder support loading (asie) 11 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.0.12: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * EnderStorage support for Builders (knexer) 4 | * Improved Pam's HarvestCraft support for harvesting (right-click support!) (asie) 5 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.0.2: -------------------------------------------------------------------------------- 1 | Added: 2 | * BluePower bundled cable support! (asie) 3 | 4 | Bugs fixed: 5 | * [#13] Crash without NEI installed (asie) 6 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.0.3: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * BluePower tube support (asie) 4 | * Witchery crop support (Thog92) 5 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.0.4: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * Add AgriCraft support for planting/harvesting (hea3ven) 4 | * Move Apiarist Pipe from Forestry to BC Compat (mezz, asie) 5 | * Partial Builder Forestry support: stairs, certain machines, farm blocks? (asie) 6 | * Partial Builder RailCraft support: stairs, slabs, tracks and detectors (asie) 7 | 8 | Bugs fixed: 9 | 10 | * Fix NEI offset for assembly table energy (asie) 11 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.0.5: -------------------------------------------------------------------------------- 1 | Bugs fixed: 2 | 3 | * Fix crash with Forestry 3.5.7 (asie) 4 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.0.6: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * [Builder] Binnie's Mods decorative blocks of all kinds 4 | * [Builder] Immibis' Microblocks (on all TEs) 5 | * [Builder] RailCraft engines 6 | * [Builder] RedLogic wires, array cells and gates 7 | * Ender IO insulated redstone improvements for Engines 8 | 9 | Bugs fixed: 10 | 11 | * [#23] Apiarist Pipe crash with Forestry 3.5.x 12 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.0.8: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * Support for Carpenter's Blocks Barriers, Torches and Collapsible Blocks (asie) 4 | 5 | Bug fixes: 6 | 7 | * [#26] Improvements to Immibis' Microblocks TE checking code (asie) 8 | * [#22] BuildCraft Compat 7.0.5 crashes if BC Transport is not installed (asie) 9 | 10 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.0.9: -------------------------------------------------------------------------------- 1 | Bugs fixed: 2 | 3 | * BluePower methods not being Optional crashing Bukkit plugins (krwminer) 4 | * FMP support in Builder not working (ChickenBones) 5 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.1.0: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * Added Forestry sapling support (asie) 4 | * Updated to BuildCraft 7.1.3 (asie) 5 | 6 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.1.1: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * Builder: 4 | * "Is Supported?" debug option for WAILA (asie) 5 | * Experimental support for TE4's Machines and Lights (asie) 6 | * Improved support for RailCraft (more machines!) (asie) 7 | * Support for Remain in Motion frames (asie) 8 | * MineFactory Reloaded's old 1.6 gate triggers, now with new fancy icons! (asie) 9 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.1.2: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * MineTweaker support for adding Programming Table recipes (asie) 4 | * WAILA support for the Creative Engine and Iron Kinesis Pipe (asie) 5 | 6 | Improvements: 7 | 8 | * Sensible name for Refinery MineTweaker removeRecipe method (Yulife) 9 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.1.3: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * Added option to disable facade recipe showing in NEI (asie) 4 | 5 | Bugs fixed: 6 | 7 | * Crash with EnderStorage when BC Builders not present (loordgek) 8 | * NEI crash when spawning item in full inventory (Adaptivity) 9 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.2.0: -------------------------------------------------------------------------------- 1 | * Updated to Minecraft 1.8.9, which means the compatibility list has been emptied! 2 | 3 | Additions: 4 | 5 | * JustEnoughItems support for the Assembly and Integration Table (asie, AlexIIL) 6 | * Ported MineTweaker, WAILA and Iron Chests support (asie) 7 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.2.1: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * Rewritten AgriCraft compatibility (asie) 4 | 5 | Improvements: 6 | 7 | * Speed up JEI loading performance - don't forget to update JEI! (asie) 8 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.99.14: -------------------------------------------------------------------------------- 1 | Additions: 2 | 3 | * Added a bee handler for lists. 4 | * Ported the apiarist's pipe (Thanks to Nedelosk for adding the relevent code to forestry) 5 | * This is only present if forestry 5.7.0.236 or later is installed. 6 | * This is *mostly* identical to forestry's new genetic filter, with a few exceptions: 7 | * This pipe doesn't have a buffer. 8 | * If a rule is "anything" then that direction has a lower priority. 9 | -------------------------------------------------------------------------------- /resources/changelog_compat/7.99.15: -------------------------------------------------------------------------------- 1 | Bug fixes: 2 | 3 | * [#80] Recipes aren't registered properly which breaks a few things when connecting to a server without buildcraftcompat. 4 | -------------------------------------------------------------------------------- /resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [{ 2 | "modid": "buildcraftcompat", 3 | "name": "BuildCraft Compat", 4 | "version": "$version", 5 | "mcversion": "$mcversion", 6 | "description": "Compatibility add-on for BuildCraft", 7 | "credits": "Created by asie", 8 | "url": "http://www.mod-buildcraft.com/", 9 | "updateUrl": "", 10 | "authorList": [ "BuildCraft Team" ], 11 | "parent":"buildcraftcore", 12 | "screenshots": [], 13 | "dependencies": [ 14 | "mod_MinecraftForge" 15 | ] 16 | }] 17 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include 'BuildCraft' 2 | include 'BuildCraft:sub_projects:expression' 3 | --------------------------------------------------------------------------------