diff --git a/.github/scripts/test-no-error-reports.sh b/.github/scripts/test-no-error-reports.sh new file mode 100644 index 0000000..e387660 --- /dev/null +++ b/.github/scripts/test-no-error-reports.sh @@ -0,0 +1,27 @@ +if [[ -d "run/crash-reports" ]]; then + echo "Crash reports detected:" + cat $directory/* + exit 1 +fi + +if grep --quiet "Fatal errors were detected" server.log; then + echo "Fatal errors detected:" + cat server.log + exit 1 +fi + +if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" server.log; then + echo "Server force stopped:" + cat server.log + exit 1 +fi + +if grep --quiet 'Done .+ For help, type "help" or "?"' server.log; then + echo "Server didn't finish startup:" + cat server.log + exit 1 +fi + +echo "No crash reports detected" +exit 0 + diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..08df9fe --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,45 @@ +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Build and test + +on: + pull_request: + branches: [ master, main ] + push: + branches: [ master, main ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Setup the workspace + run: ./gradlew setupCIWorkspace + + - name: Build the mod + run: ./gradlew build + + - name: Run server for 1.5 minutes + run: | + mkdir run + echo "eula=true" > run/eula.txt + timeout 90 ./gradlew runServer | tee --append server.log || true + + - name: Test no errors reported during server run + run: | + chmod +x .github/scripts/test-no-error-reports.sh + .github/scripts/test-no-error-reports.sh diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml new file mode 100644 index 0000000..c86d888 --- /dev/null +++ b/.github/workflows/release-tags.yml @@ -0,0 +1,51 @@ +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Release tagged build + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set release version + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Setup the workspace + run: ./gradlew setupCIWorkspace + + - name: Build the mod + run: ./gradlew build + + - name: Release under current tag + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "${{ env.RELEASE_VERSION }}" + prerelease: false + title: "${{ env.RELEASE_VERSION }}" + files: build/libs/*.jar + + - name: Publish to Maven + run: ./gradlew publish + env: + MAVEN_USER: ${{ secrets.MAVEN_USER }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} diff --git a/.gitignore b/.gitignore index 8212b3d..92daf92 100644 --- a/.gitignore +++ b/.gitignore @@ -1,56 +1,32 @@ +.gradle +.settings +/.idea/ +/run/ +/build/ +/eclipse/ +.classpath +.project /bin/ -# Forge -/LICENSE-fml.txt -/MinecraftForge-Credits.txt -/MinecraftForge-License.txt -/README.txt -/CREDITS-fml.txt -/forge-1.7.2* -/logs/* -/config/* -/configs/* -/asm/* -/saves/* -/usernamecache.json -/options.txt -/minetweaker.log -/BotaniaVars.dat -/.analytics/* +/config/ /crash-reports/ -/scripts/* - -/bin/* - -# Modproject -/src/api/resources/* -/mods/* - -# Gradle -/.gradle -/build - -# Eclipse -/.classpath -/.project -/.settings -/bin -/eclipse/* -/.metadata - -# IntelliJ IDEA -/*.iml -/*.ipr -/*.iws -/.idea -/out - -# Debugging -/run - -# OS X -.DS_Store - -# other -/.nb-gradle/private/ -/common - +/logs/ +options.txt +/saves/ +usernamecache.json +banned-ips.json +banned-players.json +eula.txt +ops.json +server.properties +servers.dat +usercache.json +whitelist.json +/out/ +*.iml +*.ipr +*.iws +src/main/resources/mixins.*.json +*.bat +*.DS_Store +!gradlew.bat +/deobf/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index d12fb5c..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "src/api/java/thaumcraft"] - path = src/api/java/thaumcraft - url = git@github.com:Azanor/thaumcraft-api.git diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..a6b5f68 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,3 @@ +# Any Github changes require admin approval +/.github/** @GTNewHorizons/admin + diff --git a/CoFH_at.cfg b/CoFH_at.cfg deleted file mode 100644 index 19fe7ac..0000000 --- a/CoFH_at.cfg +++ /dev/null @@ -1,51 +0,0 @@ -# NetherOres -public net.minecraft.entity.monster.EntityPigZombie func_70835_c(Lnet/minecraft/entity/Entity;)V # becomeAngryAt -public net.minecraft.entity.monster.EntitySilverfish field_70843_d # allySummonCooldown -public-f net.minecraft.init.Blocks field_150449_bY # oreNetherQuartz - -# MineFactory Reloaded -protected net.minecraft.util.WeightedRandomFishable * # need it all -public net.minecraft.entity.EntityList field_75624_e # classToIDMapping -public net.minecraft.entity.EntityList field_75622_f # stringToIDMapping -public net.minecraft.entity.monster.EntitySlime func_70799_a(I)V # setSlimeSize -public net.minecraft.entity.monster.EntityZombie func_82228_a(I)V # startConversion -public net.minecraft.entity.EntityLivingBase field_70718_bc # recentlyHit -public-f net.minecraft.init.Blocks field_150432_aD # ice -public-f net.minecraft.init.Blocks field_150410_aZ # glass_pane -public-f net.minecraft.init.Items field_151117_aB # milkBucket -protected net.minecraft.block.Block field_149770_b # unlocalizedName -public net.minecraft.server.management.PlayerManager func_72690_a(IIZ)Lnet/minecraft/server/management/PlayerManager$PlayerInstance; # getOrCreateChunkWatcher -public net.minecraft.server.management.PlayerManager$PlayerInstance -public net.minecraft.server.management.PlayerManager$PlayerInstance field_73263_b # playersWatchingChunk -public net.minecraft.entity.EntityLiving field_70728_aV # experienceValue -public net.minecraft.entity.EntityLiving field_82174_bp # equipmentDropChances - -# Thermal Expansion -public net.minecraft.entity.Entity field_83001_bt # invulnerable -public net.minecraft.entity.Entity field_70178_ae # isImmuneToFire -public net.minecraft.entity.player.EntityPlayer field_71074_e # itemInUse -public net.minecraft.server.management.ItemInWorldManager field_73094_o #durabilityRemainingOnBlock - -# PC Core -public net.minecraft.client.gui.GuiScreen field_146289_q # fontRenderer -public net.minecraft.client.gui.inventory.GuiContainer field_147003_i # guiLeft -public net.minecraft.client.gui.inventory.GuiContainer field_147009_r # guiTop -public net.minecraft.world.WorldServer field_73068_P # allPlayersSleeping - -# CoFH Core -protected net.minecraft.inventory.Container * # senseless to have private stuff here -protected net.minecraft.client.gui.inventory.GuiContainer * # senseless to have private stuff here -protected net.minecraft.client.gui.FontRenderer func_78280_d(Ljava/lang/String;I)Ljava/lang/String; # wrapFormattedStringToWidth -protected net.minecraft.client.gui.FontRenderer func_78255_a(Ljava/lang/String;Z)V # renderStringAtPos -public net.minecraft.entity.projectile.EntityFishHook * # (nearly) literally everything is private -protected net.minecraft.entity.player.EntityPlayer field_71072_f # itemInUseCount -public net.minecraft.item.ItemPickaxe field_150915_c # blocksEffectiveAgainst -public net.minecraft.item.ItemSpade field_150916_c # blocksEffectiveAgainst -public net.minecraft.item.ItemAxe field_150917_c # blocksEffectiveAgainst -public net.minecraft.util.RegistrySimple field_82596_a # registryObjects -public-f net.minecraft.util.RegistryNamespaced field_148759_a # underlyingIntegerMap -public net.minecraft.world.World field_72998_d # collidingBoundingBoxes - -# WorldProxy -public-f net.minecraft.world.World *()V # Doesn't matter what it is, we need it public -public-f net.minecraft.world.WorldServer *()V # Doesn't matter what it is, we need it public diff --git a/addon.gradle b/addon.gradle new file mode 100644 index 0000000..d76f0d1 --- /dev/null +++ b/addon.gradle @@ -0,0 +1,10 @@ +configurations { + compileHelper +} + +sourceSets { + compileStubs + compileHelper { + compileClasspath += configurations.compileHelper + } +} diff --git a/build.gradle b/build.gradle index d069f8f..7914dd8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,17 @@ +//version: 1643020202 +/* +DO NOT CHANGE THIS FILE! + +Also, you may replace this file at any time if there is an update available. +Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle for updates. + */ + + +import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + +import java.util.concurrent.TimeUnit + buildscript { repositories { maven { @@ -18,74 +32,664 @@ buildscript { } } dependencies { - classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.4' + classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7' } } -apply plugin: 'forge' -apply plugin: 'java' - -// define the properties file -ext.configFile = file "build.properties" -configFile.withReader { - // read config. it shall from now on be referenced as simply config or as project.config - def prop = new Properties() - prop.load(it) - project.ext.config = new ConfigSlurper().parse prop +plugins { + id 'idea' + id 'eclipse' + id 'scala' + id("org.ajoberstar.grgit") version("3.1.1") + id("com.github.johnrengelman.shadow") version("4.0.4") + id("com.palantir.git-version") version("0.12.3") + id('de.undercouch.download') version('4.1.2') + id("maven-publish") } -version=config.mod.version -group= "modtweaker" // http://maven.apache.org/guides/mini/guide-naming-conventions.html -archivesBaseName = "ModTweaker2" +apply plugin: 'forge' + +def projectJavaVersion = JavaLanguageVersion.of(8) + +java { + toolchain { + languageVersion.set(projectJavaVersion) + } +} + +idea { + module { + inheritOutputDirs = true + downloadJavadoc = true + downloadSources = true + } +} + +if(JavaVersion.current() != JavaVersion.VERSION_1_8) { + throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current()) +} + +checkPropertyExists("modName") +checkPropertyExists("modId") +checkPropertyExists("modGroup") +checkPropertyExists("autoUpdateBuildScript") +checkPropertyExists("minecraftVersion") +checkPropertyExists("forgeVersion") +checkPropertyExists("replaceGradleTokenInFile") +checkPropertyExists("gradleTokenModId") +checkPropertyExists("gradleTokenModName") +checkPropertyExists("gradleTokenVersion") +checkPropertyExists("gradleTokenGroupName") +checkPropertyExists("apiPackage") +checkPropertyExists("accessTransformersFile") +checkPropertyExists("usesMixins") +checkPropertyExists("mixinPlugin") +checkPropertyExists("mixinsPackage") +checkPropertyExists("coreModClass") +checkPropertyExists("containsMixinsAndOrCoreModOnly") +checkPropertyExists("usesShadowedDependencies") +checkPropertyExists("developmentEnvironmentUserName") + +boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false + +String javaSourceDir = "src/main/java/" +String scalaSourceDir = "src/main/scala/" + +String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") +String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") +if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) { + throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala) +} + +if(apiPackage) { + targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) { + throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala) + } +} + +if(accessTransformersFile) { + String targetFile = "src/main/resources/META-INF/" + accessTransformersFile + if(getFile(targetFile).exists() == false) { + throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) + } +} + +if(usesMixins.toBoolean()) { + if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) { + throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!") + } + + targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") + targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") + if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) { + throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala) + } + + String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java" + String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".scala" + String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java" + if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) { + throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava) + } +} + +if(coreModClass) { + String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java" + String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".scala" + String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java" + if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) { + throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava) + } +} + +configurations.all { + resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) + + // Make sure GregTech build won't time out + System.setProperty("org.gradle.internal.http.connectionTimeout", 120000 as String) + System.setProperty("org.gradle.internal.http.socketTimeout", 120000 as String) +} + +// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version +'git config core.fileMode false'.execute() + +// Pulls version first from the VERSION env and then git tag +String identifiedVersion +try { + String versionOverride = System.getenv("VERSION") ?: null + identifiedVersion = versionOverride == null ? gitVersion() : versionOverride + version = minecraftVersion + "-" + identifiedVersion +} +catch (Exception e) { + throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag, or the VERSION override must be set!"); +} + +group = modGroup +if(project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { + archivesBaseName = customArchiveBaseName +} +else { + archivesBaseName = modId +} + + +def arguments = [] +def jvmArguments = [] + +if(usesMixins.toBoolean()) { + arguments += [ + "--tweakClass org.spongepowered.asm.launch.MixinTweaker" + ] + jvmArguments += [ + "-Dmixin.debug.countInjections=true", "-Dmixin.debug.verbose=true", "-Dmixin.debug.export=true" + ] +} minecraft { - version = "${config.minecraft.version}-${config.forge.version}" - runDir = "eclipse" - replace "@modVersion@", config.mod.version + version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion + runDir = "run" + + if (replaceGradleTokenInFile) { + replaceIn replaceGradleTokenInFile + if(gradleTokenModId) { + replace gradleTokenModId, modId + } + if(gradleTokenModName) { + replace gradleTokenModName, modName + } + if(gradleTokenVersion) { + replace gradleTokenVersion, versionDetails().lastTag + } + if(gradleTokenGroupName) { + replace gradleTokenGroupName, modGroup + } + } + + clientIntellijRun { + args(arguments) + jvmArgs(jvmArguments) + + if(developmentEnvironmentUserName) { + args("--username", developmentEnvironmentUserName) + } + } + + serverIntellijRun { + args(arguments) + jvmArgs(jvmArguments) + } +} + +if(file("addon.gradle").exists()) { + apply from: "addon.gradle" +} + +apply from: 'repositories.gradle' + +configurations { + implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored + implementation.extendsFrom(shadowCompile) + implementation.extendsFrom(shadeCompile) } repositories { maven { - name = "forestry" - url = "http://maven.ic2.player.to/" + name = "Overmind forge repo mirror" + url = "https://gregtech.overminddl1.com/" + } + if(usesMixins.toBoolean()) { + maven { + name = "sponge" + url = "https://repo.spongepowered.org/repository/maven-public" + } + maven { + url = "https://jitpack.io" + } } } dependencies { - compile "net.sengir.forestry:forestry_${config.minecraft.version}:${config.forestry.version}:api" + if(usesMixins.toBoolean()) { + annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3") + annotationProcessor("com.google.guava:guava:24.1.1-jre") + annotationProcessor("com.google.code.gson:gson:2.8.6") + annotationProcessor("org.spongepowered:mixin:0.8-SNAPSHOT") + // using 0.8 to workaround a issue in 0.7 which fails mixin application + compile("com.github.GTNewHorizons:SpongePoweredMixin:0.7.12-GTNH") { + // Mixin includes a lot of dependencies that are too up-to-date + exclude module: "launchwrapper" + exclude module: "guava" + exclude module: "gson" + exclude module: "commons-io" + exclude module: "log4j-core" + } + compile("com.github.GTNewHorizons:SpongeMixins:1.5.0") + } +} + +apply from: 'dependencies.gradle' + +def mixingConfigRefMap = "mixins." + modId + ".refmap.json" +def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap +def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg" + +task generateAssets { + if(usesMixins.toBoolean()) { + getFile("/src/main/resources/mixins." + modId + ".json").text = """{ + "required": true, + "minVersion": "0.7.11", + "package": "${modGroup}.${mixinsPackage}", + "plugin": "${modGroup}.${mixinPlugin}", + "refmap": "${mixingConfigRefMap}", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8" +} + +""" + } +} + +task relocateShadowJar(type: ConfigureShadowRelocation) { + target = tasks.shadowJar + prefix = modGroup + ".shadow" +} + +shadowJar { + project.configurations.shadeCompile.each { dep -> + from(project.zipTree(dep)) { + exclude 'META-INF', 'META-INF/**' + } + } + + manifest { + attributes(getManifestAttributes()) + } + + minimize() // This will only allow shading for actually used classes + configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile] + dependsOn(relocateShadowJar) +} + +jar { + project.configurations.shadeCompile.each { dep -> + from(project.zipTree(dep)) { + exclude 'META-INF', 'META-INF/**' + } + } + + manifest { + attributes(getManifestAttributes()) + } + + if(usesShadowedDependencies.toBoolean()) { + dependsOn(shadowJar) + enabled = false + } +} + +reobf { + if(usesMixins.toBoolean()) { + addExtraSrgFile mixinSrg + } +} + +afterEvaluate { + if(usesMixins.toBoolean()) { + tasks.compileJava { + options.compilerArgs += [ + "-AreobfSrgFile=${tasks.reobf.srg}", + "-AoutSrgFile=${mixinSrg}", + "-AoutRefMapFile=${refMap}", + // Elan: from what I understand they are just some linter configs so you get some warning on how to properly code + "-XDenableSunApiLintControl", + "-XDignore.symbol.file" + ] + } + } +} + +runClient { + if(developmentEnvironmentUserName) { + arguments += [ + "--username", + developmentEnvironmentUserName + ] + } + + args(arguments) + jvmArgs(jvmArguments) +} + +runServer { + args(arguments) + jvmArgs(jvmArguments) +} + +tasks.withType(JavaExec).configureEach { + javaLauncher.set( + javaToolchains.launcherFor { + languageVersion = projectJavaVersion + } + ) } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version - inputs.property "mcversion", config.minecraft.version + inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' - + // replace version and mcversion - expand 'version':project.version, 'mcversion':config.minecraft.version + expand "minecraftVersion": project.minecraft.version, + "modVersion": versionDetails().lastTag, + "modId": modId, + "modName": modName } - + + if(usesMixins.toBoolean()) { + from refMap + } + // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } -task deobfJar(type: Jar) { - from sourceSets.main.output - classifier = 'deobf' +def getManifestAttributes() { + def manifestAttributes = [:] + if(containsMixinsAndOrCoreModOnly.toBoolean() == false && (usesMixins.toBoolean() || coreModClass)) { + manifestAttributes += ["FMLCorePluginContainsFMLMod": true] + } + + if(accessTransformersFile) { + manifestAttributes += ["FMLAT" : accessTransformersFile.toString()] + } + + if(coreModClass) { + manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass] + } + + if(usesMixins.toBoolean()) { + manifestAttributes += [ + "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", + "MixinConfigs" : "mixins." + modId + ".json", + "ForceLoadAsMod" : containsMixinsAndOrCoreModOnly.toBoolean() == false + ] + } + return manifestAttributes } -tasks.build.dependsOn deobfJar +task sourcesJar(type: Jar) { + from (sourceSets.main.allJava) + from (file("$projectDir/LICENSE")) + getArchiveClassifier().set('sources') +} -idea { - module { - inheritOutputDirs = false - outputDir = compileJava.destinationDir - testOutputDir = compileTestJava.destinationDir +task shadowDevJar(type: ShadowJar) { + project.configurations.shadeCompile.each { dep -> + from(project.zipTree(dep)) { + exclude 'META-INF', 'META-INF/**' + } + } + + from sourceSets.main.output + getArchiveClassifier().set("dev") + + manifest { + attributes(getManifestAttributes()) + } + + minimize() // This will only allow shading for actually used classes + configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile] +} + +task relocateShadowDevJar(type: ConfigureShadowRelocation) { + target = tasks.shadowDevJar + prefix = modGroup + ".shadow" +} + +task circularResolverJar(type: Jar) { + dependsOn(relocateShadowDevJar) + dependsOn(shadowDevJar) + enabled = false +} + +task devJar(type: Jar) { + project.configurations.shadeCompile.each { dep -> + from(project.zipTree(dep)) { + exclude 'META-INF', 'META-INF/**' + } + } + + from sourceSets.main.output + getArchiveClassifier().set("dev") + + manifest { + attributes(getManifestAttributes()) + } + + if(usesShadowedDependencies.toBoolean()) { + dependsOn(circularResolverJar) + enabled = false } } + +task apiJar(type: Jar) { + from (sourceSets.main.allJava) { + include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' + } + + from (sourceSets.main.output) { + include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' + } + + from (sourceSets.main.resources.srcDirs) { + include("LICENSE") + } + + getArchiveClassifier().set('api') +} + +artifacts { + if(!noPublishedSources) { + archives sourcesJar + } + archives devJar + if(apiPackage) { + archives apiJar + } +} + +// The gradle metadata includes all of the additional deps that we disabled from POM generation (including forgeBin with no groupID), +// and isn't strictly needed with the POM so just disable it. +tasks.withType(GenerateModuleMetadata) { + enabled = false +} + + +// publishing +publishing { + publications { + maven(MavenPublication) { + from components.java + if(usesShadowedDependencies.toBoolean()) { + artifact source: shadowJar, classifier: "" + } + if(!noPublishedSources) { + artifact source: sourcesJar, classifier: "src" + } + artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev" + if (apiPackage) { + artifact source: apiJar, classifier: "api" + } + + groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons" + artifactId = System.getenv("ARTIFACT_ID") ?: project.name + // Using the identified version, not project.version as it has the prepended 1.7.10 + version = System.getenv("RELEASE_VERSION") ?: identifiedVersion + + // Remove all non GTNH deps here. + // Original intention was to remove an invalid forgeBin being generated without a groupId (mandatory), but + // it also removes all of the MC deps + pom.withXml { + Node pomNode = asNode() + pomNode.dependencies.'*'.findAll() { + it.groupId.text() != 'com.github.GTNewHorizons' + }.each() { + it.parent().remove(it) + } + } + } + } + + repositories { + maven { + url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases" + credentials { + username = System.getenv("MAVEN_USER") ?: "NONE" + password = System.getenv("MAVEN_PASSWORD") ?: "NONE" + } + } + } +} + +// Updating +task updateBuildScript { + doLast { + if (performBuildScriptUpdate(projectDir.toString())) return + + print("Build script already up-to-date!") + } +} + +if (isNewBuildScriptVersionAvailable(projectDir.toString())) { + if (autoUpdateBuildScript.toBoolean()) { + performBuildScriptUpdate(projectDir.toString()) + } else { + println("Build script update available! Run 'gradle updateBuildScript'") + } +} + +static URL availableBuildScriptUrl() { + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle") +} + +boolean performBuildScriptUpdate(String projectDir) { + if (isNewBuildScriptVersionAvailable(projectDir)) { + def buildscriptFile = getFile("build.gradle") + availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } } + print("Build script updated. Please REIMPORT the project or RESTART your IDE!") + return true + } + return false +} + +boolean isNewBuildScriptVersionAvailable(String projectDir) { + Map parameters = ["connectTimeout": 2000, "readTimeout": 2000] + + String currentBuildScript = getFile("build.gradle").getText() + String currentBuildScriptHash = getVersionHash(currentBuildScript) + String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText() + String availableBuildScriptHash = getVersionHash(availableBuildScript) + + boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash + return !isUpToDate +} + +static String getVersionHash(String buildScriptContent) { + String versionLine = buildScriptContent.find("^//version: [a-z0-9]*") + if(versionLine != null) { + return versionLine.split(": ").last() + } + return "" +} + +configure(updateBuildScript) { + group = 'forgegradle' + description = 'Updates the build script to the latest version' +} + +// Deobfuscation + +def deobf(String sourceURL) { + try { + URL url = new URL(sourceURL) + String fileName = url.getFile() + + //get rid of directories: + int lastSlash = fileName.lastIndexOf("/") + if(lastSlash > 0) { + fileName = fileName.substring(lastSlash + 1) + } + //get rid of extension: + if(fileName.endsWith(".jar")) { + fileName = fileName.substring(0, fileName.lastIndexOf(".")) + } + + String hostName = url.getHost() + if(hostName.startsWith("www.")) { + hostName = hostName.substring(4) + } + List parts = Arrays.asList(hostName.split("\\.")) + Collections.reverse(parts) + hostName = String.join(".", parts) + + return deobf(sourceURL, hostName + "/" + fileName) + } catch(Exception e) { + return deobf(sourceURL, "deobf/" + String.valueOf(sourceURL.hashCode())) + } +} + +// The method above is to be prefered. Use this method if the filename is not at the end of the URL. +def deobf(String sourceURL, String fileName) { + String cacheDir = System.getProperty("user.home") + "/.gradle/caches/" + String bon2Dir = cacheDir + "forge_gradle/deobf" + String bon2File = bon2Dir + "/BON2-2.5.0.jar" + String obfFile = cacheDir + "modules-2/files-2.1/" + fileName + ".jar" + String deobfFile = cacheDir + "modules-2/files-2.1/" + fileName + "-deobf.jar" + + if(file(deobfFile).exists()) { + return files(deobfFile) + } + + download { + src 'https://github.com/GTNewHorizons/BON2/releases/download/2.5.0/BON2-2.5.0.CUSTOM-all.jar' + dest bon2File + quiet true + overwrite false + } + + download { + src sourceURL + dest obfFile + quiet true + overwrite false + } + + exec { + commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', '1.7.10', '--mappingsVer', 'stable_12', '--notch' + workingDir bon2Dir + standardOutput = new ByteArrayOutputStream() + } + + return files(deobfFile) +} + +// Helper methods + +def checkPropertyExists(String propertyName) { + if (project.hasProperty(propertyName) == false) { + throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties") + } +} + +def getFile(String relativePath) { + return new File(projectDir, relativePath) +} diff --git a/build.properties b/build.properties deleted file mode 100644 index 5d21211..0000000 --- a/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -minecraft.version=1.7.10 -forge.version=10.13.4.1614-1.7.10 - -mod.version=0.9.8-GTNH - -forestry.version=4.1.0.43 diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 0000000..789c436 --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,25 @@ +dependencies { + compile("com.powerofbytes.minetweaker3:MineTweaker3:1.7.10-3.0.10B:Dev-Full") + compile("com.github.GTNewHorizons:ZenScript:unspecified") + + compileOnly("com.azanor:Thaumcraft:1.7.10-4.2.3.5:deobf") { transitive = false } + compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-72-GTNH:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:Botania:1.9.1-GTNH:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:Chisel:2.10.7-GTNH:api") { transitive = false } + compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.5:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:Mantle:0.3.4:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:Railcraft:9.13.5:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.9.0.10-GTNH:api") { transitive = false } + compileOnly("curse.maven:botanical-addons-237152:2281663") { transitive = false } + compileOnly("curse.maven:extra-utilities-225561:2264384") { transitive = false } + compileOnly("curse.maven:thermal-expansion-69163:2388759") { transitive = false } + compileOnly("exnihilo:Ex-Nihilo:1.38-53:deobf") { transitive = false } + compileOnly("net.industrial-craft:industrialcraft-2:2.2.828-experimental:api") { transitive = false } + compileOnly("pneumaticCraft:PneumaticCraft-1.7.10:1.7.0-74:userdev") { transitive = false } + compileOnly(deobf("https://media.forgecdn.net/files/2261/766/AuraCascade-557.jar")) + compileOnly(deobf("https://media.forgecdn.net/files/2322/815/Metallurgy-1.7.10-4.0.9.148.jar")) + compileOnly(deobf("https://media.forgecdn.net/files/2323/944/Mariculture-Deluxe-1.7.10-1.3.0-6.jar")) + compileOnly(deobf("https://s3.amazonaws.com/aidancbrady/mekanism/265/Mekanism-1.7.10-8.1.9.265.jar")) + compileOnly(sourceSets.compileHelper.output) + compileHelper(sourceSets.compileStubs.output) +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..375d46d --- /dev/null +++ b/gradle.properties @@ -0,0 +1,67 @@ +modName = Mod Tweaker 2 + +# This is a case-sensitive string to identify your mod. Convention is to use lower case. +modId = modtweaker2 + +modGroup = modtweaker2 + +# WHY is there no version field? +# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the +# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/ + +# Will update your build.gradle automatically whenever an update is available +autoUpdateBuildScript = false + +minecraftVersion = 1.7.10 +forgeVersion = 10.13.4.1614 + +# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you +# restart Minecraft in development. Choose this dependent on your mod: +# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name +# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty +developmentEnvironmentUserName = Developer + +# Define a source file of your project with: +# public static final String VERSION = "GRADLETOKEN_VERSION"; +# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's +# version in @Mod([...], version = VERSION, [...]) +# Leave these properties empty to skip individual token replacements +replaceGradleTokenInFile = ModProps.java +gradleTokenModId = +gradleTokenModName = +gradleTokenVersion = GRADLETOKEN_VERSION +gradleTokenGroupName = + +# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can +# leave this property empty. +# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api +apiPackage = + +# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/ +# Example value: mymodid_at.cfg +accessTransformersFile = modtweaker2_at.cfg + +# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! +usesMixins = false +# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. +mixinPlugin = +# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! +mixinsPackage = +# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! +# This parameter is for legacy compatibility only +# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin +coreModClass = +# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class +# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false! +containsMixinsAndOrCoreModOnly = false + +# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your +# responsibility check the licence and request permission for distribution, if required. +usesShadowedDependencies = false + +# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older +# projects. New projects should not use this parameter. +customArchiveBaseName = ModTweaker2 + +# Optional parameter to prevent the source code from being published +# noPublishedSources = diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index b761216..5c2d1cf 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4e35a1..3ab0b72 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Wed Jul 02 15:54:47 CDT 2014 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip diff --git a/gradlew b/gradlew index 91a7e26..83f2acf 100755 --- a/gradlew +++ b/gradlew @@ -1,4 +1,20 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################## ## @@ -6,47 +22,6 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" @@ -61,9 +36,49 @@ while [ -h "$PRG" ] ; do fi done SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- +cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" -cd "$SAVED" >&- +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -90,7 +105,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -110,10 +125,11 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` @@ -154,11 +170,19 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=$(save "$@") -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 8a0b282..9618d8d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -8,14 +24,14 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome @@ -46,10 +62,9 @@ echo location of your Java installation. goto fail :init -@rem Get command-line arguments, handling Windowz variants +@rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,11 +75,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000..09bbb51 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +before_install: + - ./gradlew setupCIWorkspace \ No newline at end of file diff --git a/libs/AuraCascade-552-dev.jar b/libs/AuraCascade-552-dev.jar deleted file mode 100644 index a0838c6..0000000 Binary files a/libs/AuraCascade-552-dev.jar and /dev/null differ diff --git a/libs/Baubles-deobf-1.7.10-1.0.1.10.jar b/libs/Baubles-deobf-1.7.10-1.0.1.10.jar deleted file mode 100644 index 8585569..0000000 Binary files a/libs/Baubles-deobf-1.7.10-1.0.1.10.jar and /dev/null differ diff --git a/libs/BloodMagic-1.7.10-1.3.0b-3-deobf.jar b/libs/BloodMagic-1.7.10-1.3.0b-3-deobf.jar deleted file mode 100644 index 8db3ee6..0000000 Binary files a/libs/BloodMagic-1.7.10-1.3.0b-3-deobf.jar and /dev/null differ diff --git a/libs/Botania r1.7-223-deobf.jar b/libs/Botania r1.7-223-deobf.jar deleted file mode 100644 index 95d1e7a..0000000 Binary files a/libs/Botania r1.7-223-deobf.jar and /dev/null differ diff --git a/libs/BotanicalAddons-r0.1.20-0-deobf.jar b/libs/BotanicalAddons-r0.1.20-0-deobf.jar deleted file mode 100644 index 28462ee..0000000 Binary files a/libs/BotanicalAddons-r0.1.20-0-deobf.jar and /dev/null differ diff --git a/libs/CTMLib-1.2.0-11.jar b/libs/CTMLib-1.2.0-11.jar deleted file mode 100644 index f4d5905..0000000 Binary files a/libs/CTMLib-1.2.0-11.jar and /dev/null differ diff --git a/libs/Chisel2_DEV-2.5.0.163-deobf.jar b/libs/Chisel2_DEV-2.5.0.163-deobf.jar deleted file mode 100644 index 7d7bf1e..0000000 Binary files a/libs/Chisel2_DEV-2.5.0.163-deobf.jar and /dev/null differ diff --git a/libs/CoFHCore-[1.7.10]3.0.4B1-308-dev.jar b/libs/CoFHCore-[1.7.10]3.0.4B1-308-dev.jar deleted file mode 100644 index c5b1e44..0000000 Binary files a/libs/CoFHCore-[1.7.10]3.0.4B1-308-dev.jar and /dev/null differ diff --git a/libs/CoFHLib-[1.7.10]1.0.4B1-176-dev.jar b/libs/CoFHLib-[1.7.10]1.0.4B1-176-dev.jar deleted file mode 100644 index a62a2e3..0000000 Binary files a/libs/CoFHLib-[1.7.10]1.0.4B1-176-dev.jar and /dev/null differ diff --git a/libs/CodeChickenCore-1.7.10-1.0.4.29-dev (2).jar b/libs/CodeChickenCore-1.7.10-1.0.4.29-dev (2).jar deleted file mode 100644 index 40a38e3..0000000 Binary files a/libs/CodeChickenCore-1.7.10-1.0.4.29-dev (2).jar and /dev/null differ diff --git a/libs/CodeChickenLib-1.7.10-1.1.1.110-dev.jar b/libs/CodeChickenLib-1.7.10-1.1.1.110-dev.jar deleted file mode 100644 index f7a9ecc..0000000 Binary files a/libs/CodeChickenLib-1.7.10-1.1.1.110-dev.jar and /dev/null differ diff --git a/libs/Enchiridion 2-1.7.10-2.0.2a-73-dev.jar b/libs/Enchiridion 2-1.7.10-2.0.2a-73-dev.jar deleted file mode 100644 index 5199e25..0000000 Binary files a/libs/Enchiridion 2-1.7.10-2.0.2a-73-dev.jar and /dev/null differ diff --git a/libs/Ex-Nihilo-1.38-46-deobf.jar b/libs/Ex-Nihilo-1.38-46-deobf.jar deleted file mode 100644 index e5d4837..0000000 Binary files a/libs/Ex-Nihilo-1.38-46-deobf.jar and /dev/null differ diff --git a/libs/ForgeMultipart-1.7.10-1.2.0.345-dev.jar b/libs/ForgeMultipart-1.7.10-1.2.0.345-dev.jar deleted file mode 100644 index 7244bfb..0000000 Binary files a/libs/ForgeMultipart-1.7.10-1.2.0.345-dev.jar and /dev/null differ diff --git a/libs/IC2.Classic.Version.1.1.0.19.Dev.jar b/libs/IC2.Classic.Version.1.1.0.19.Dev.jar deleted file mode 100644 index 8db0d5c..0000000 Binary files a/libs/IC2.Classic.Version.1.1.0.19.Dev.jar and /dev/null differ diff --git a/libs/Mantle-1.7.10-0.3.2.jenkins190-deobf.jar b/libs/Mantle-1.7.10-0.3.2.jenkins190-deobf.jar deleted file mode 100644 index ba29253..0000000 Binary files a/libs/Mantle-1.7.10-0.3.2.jenkins190-deobf.jar and /dev/null differ diff --git a/libs/Mariculture-Deluxe-1.7.10-1.2.4.2-51-dev.jar b/libs/Mariculture-Deluxe-1.7.10-1.2.4.2-51-dev.jar deleted file mode 100644 index 036ae95..0000000 Binary files a/libs/Mariculture-Deluxe-1.7.10-1.2.4.2-51-dev.jar and /dev/null differ diff --git a/libs/Mekanism-1.7.10-8.1.7.252.jar b/libs/Mekanism-1.7.10-8.1.7.252.jar deleted file mode 100644 index e2731a7..0000000 Binary files a/libs/Mekanism-1.7.10-8.1.7.252.jar and /dev/null differ diff --git a/libs/Metallurgy-1.7.10-4.0.8.128-deobf.jar b/libs/Metallurgy-1.7.10-4.0.8.128-deobf.jar deleted file mode 100644 index 1357d50..0000000 Binary files a/libs/Metallurgy-1.7.10-4.0.8.128-deobf.jar and /dev/null differ diff --git a/libs/MetallurgyCore-1.7.10-4.0.4.24-deobf.jar b/libs/MetallurgyCore-1.7.10-4.0.4.24-deobf.jar deleted file mode 100644 index 868c458..0000000 Binary files a/libs/MetallurgyCore-1.7.10-4.0.4.24-deobf.jar and /dev/null differ diff --git a/libs/MineTweaker3-Dev-Full-1.7.10-3.0.10B.jar b/libs/MineTweaker3-Dev-Full-1.7.10-3.0.10B.jar deleted file mode 100644 index 299ae58..0000000 Binary files a/libs/MineTweaker3-Dev-Full-1.7.10-3.0.10B.jar and /dev/null differ diff --git a/libs/NotEnoughItems-1.7.10-1.0.4.83-dev.jar b/libs/NotEnoughItems-1.7.10-1.0.4.83-dev.jar deleted file mode 100644 index da520d5..0000000 Binary files a/libs/NotEnoughItems-1.7.10-1.0.4.83-dev.jar and /dev/null differ diff --git a/libs/Railcraft_1.7.10-9.7.0.0-dev.jar b/libs/Railcraft_1.7.10-9.7.0.0-dev.jar deleted file mode 100644 index e598037..0000000 Binary files a/libs/Railcraft_1.7.10-9.7.0.0-dev.jar and /dev/null differ diff --git a/libs/Steamcraft-0.27.3-dev.jar b/libs/Steamcraft-0.27.3-dev.jar deleted file mode 100644 index a58eba7..0000000 Binary files a/libs/Steamcraft-0.27.3-dev.jar and /dev/null differ diff --git a/libs/TConstruct-1.7.10-1.8.7.build982-deobf.jar b/libs/TConstruct-1.7.10-1.8.7.build982-deobf.jar deleted file mode 100644 index f466980..0000000 Binary files a/libs/TConstruct-1.7.10-1.8.7.build982-deobf.jar and /dev/null differ diff --git a/libs/ThermalExpansion-[1.7.10]4.0.3B1-218-dev.jar b/libs/ThermalExpansion-[1.7.10]4.0.3B1-218-dev.jar deleted file mode 100644 index 94a2f7f..0000000 Binary files a/libs/ThermalExpansion-[1.7.10]4.0.3B1-218-dev.jar and /dev/null differ diff --git a/libs/ThermalFoundation-[1.7.10]1.2.0-102-dev.jar b/libs/ThermalFoundation-[1.7.10]1.2.0-102-dev.jar deleted file mode 100644 index e1d406f..0000000 Binary files a/libs/ThermalFoundation-[1.7.10]1.2.0-102-dev.jar and /dev/null differ diff --git a/libs/appliedenergistics2-rv2-stable-10-dev.jar b/libs/appliedenergistics2-rv2-stable-10-dev.jar deleted file mode 100644 index b087987..0000000 Binary files a/libs/appliedenergistics2-rv2-stable-10-dev.jar and /dev/null differ diff --git a/libs/extrautilities-1.2.11-deobf.jar b/libs/extrautilities-1.2.11-deobf.jar deleted file mode 100644 index e4099e5..0000000 Binary files a/libs/extrautilities-1.2.11-deobf.jar and /dev/null differ diff --git a/repositories.gradle b/repositories.gradle new file mode 100644 index 0000000..3dc2b09 --- /dev/null +++ b/repositories.gradle @@ -0,0 +1,44 @@ +repositories { + maven { + name "GTNH Maven" + url "http://jenkins.usrv.eu:8081/nexus/content/repositories/public/" + } + maven { + name "Thaumcraft" + url "https://maven.mcmoddev.com/" + } + maven { + name "ExNihilo" + url "https://maven.tterrag.com/" + } + maven { + name "PneumaticCraft" + url "https://maven.k-4u.nl/" + metadataSources { + artifact() + } + } + maven { + name "IC2" + url "https://maven.ic2.player.to/" + metadataSources { + mavenPom() + artifact() + } + } + ivy { + name "MineTweaker3" + artifactPattern "http://minetweaker3.powerofbytes.com/download/[module](-[classifier])-[revision].[ext]" + metadataSources { + artifact() + } + } + maven { + name "CurseMaven" + url "https://www.cursemaven.com/" + } + maven { + name "Jitpack" + url "https://jitpack.io/" + } +} diff --git a/src/api/java/naruto1310/extendedWorkbench/crafting/ExtendedCraftingManager.java b/src/api/java/naruto1310/extendedWorkbench/crafting/ExtendedCraftingManager.java deleted file mode 100644 index 26a0bfb..0000000 --- a/src/api/java/naruto1310/extendedWorkbench/crafting/ExtendedCraftingManager.java +++ /dev/null @@ -1,141 +0,0 @@ -package naruto1310.extendedWorkbench.crafting; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.world.World; - -public class ExtendedCraftingManager -{ - /** The static instance of this class */ - private static final ExtendedCraftingManager instance = new ExtendedCraftingManager(); - - /** A list of all the recipes added */ - private List recipes = new ArrayList(); - - /** - * Returns the static instance of this class - */ - public static final ExtendedCraftingManager getInstance() - { - return instance; - } - - private void addExtendedRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj) - { - String var3 = ""; - int var4 = 0; - int var5 = 0; - int var6 = 0; - - if(par2ArrayOfObj[var4] instanceof String[]) - { - String[] var7 =((String[])par2ArrayOfObj[var4++]); - - for(int var8 = 0; var8 < var7.length; ++var8) - { - String var9 = var7[var8]; - ++var6; - var5 = var9.length(); - var3 = var3 + var9; - } - } - else - { - while(par2ArrayOfObj[var4] instanceof String) - { - String var11 =(String)par2ArrayOfObj[var4++]; - ++var6; - var5 = var11.length(); - var3 = var3 + var11; - } - } - - HashMap var12; - - for(var12 = new HashMap(); var4 < par2ArrayOfObj.length; var4 += 2) - { - Character var13 =(Character)par2ArrayOfObj[var4]; - ItemStack var14 = null; - - if(par2ArrayOfObj[var4 + 1] instanceof Item) - var14 = new ItemStack((Item)par2ArrayOfObj[var4 + 1], 1, 32767); - if(par2ArrayOfObj[var4 + 1] instanceof Block) - var14 = new ItemStack((Block)par2ArrayOfObj[var4 + 1], 1, 32767); - if(par2ArrayOfObj[var4 + 1] instanceof ItemStack) - var14 =(ItemStack)par2ArrayOfObj[var4 + 1]; - - var12.put(var13, var14); - } - - ItemStack[] var15 = new ItemStack[var5 * var6]; - - for(int var16 = 0; var16 < var5 * var6; ++var16) - { - char var10 = var3.charAt(var16); - - if(var12.containsKey(Character.valueOf(var10))) - var15[var16] = var12.get(Character.valueOf(var10)).copy(); - else - var15[var16] = null; - } - - this.recipes.add(new ExtendedShapedRecipes(var5, var6, var15, par1ItemStack)); - } - - private void addExtendedShapelessRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj) - { - ArrayList var3 = new ArrayList(); - Object[] var4 = par2ArrayOfObj; - int var5 = par2ArrayOfObj.length; - - for(int var6 = 0; var6 < var5; var6++) - { - Object var7 = var4[var6]; - - if(var7 instanceof Item) - var3.add(new ItemStack((Item)var7, 1, 32767)); - else if(var7 instanceof Block) - var3.add(new ItemStack((Block)var7, 1, 32767)); - else if(var7 instanceof ItemStack) - var3.add(((ItemStack)var7).copy()); - else throw new RuntimeException("Invalid shapeless recipy!"); - } - - this.recipes.add(new ExtendedShapelessRecipes(par1ItemStack, var3)); - } - - public ItemStack findMatchingRecipe(InventoryCrafting inv, World world) - { - for(int i = 0; i < this.recipes.size(); i++) - { - IRecipe recipe = this.recipes.get(i); - - if(recipe.matches(inv, world)) - return recipe.getCraftingResult(inv); - } - - return null; - } - - public List getRecipeList() - { - return this.recipes; - } - - public static void addRecipe(ItemStack output, Object ... input) - { - ExtendedCraftingManager.getInstance().addExtendedRecipe(output, input); - } - - public static void addShapelessRecipe(ItemStack output, Object ... input) - { - ExtendedCraftingManager.getInstance().addExtendedShapelessRecipe(output, input); - } -} diff --git a/src/api/java/naruto1310/extendedWorkbench/crafting/ExtendedShapedRecipes.java b/src/api/java/naruto1310/extendedWorkbench/crafting/ExtendedShapedRecipes.java deleted file mode 100644 index 78c6c09..0000000 --- a/src/api/java/naruto1310/extendedWorkbench/crafting/ExtendedShapedRecipes.java +++ /dev/null @@ -1,103 +0,0 @@ -package naruto1310.extendedWorkbench.crafting; - -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public class ExtendedShapedRecipes implements IExtendedRecipe -{ - private int maxRecipeSize = 6; - - /** How many horizontal slots this recipe is wide. */ - private int recipeWidth; - - /** How many vertical slots this recipe uses. */ - private int recipeHeight; - - /** Is a array of ItemStack that composes the recipe. */ - private ItemStack[] recipeItems; - - /** Is the ItemStack that you get when craft the recipe. */ - private ItemStack recipeOutput; - - public ExtendedShapedRecipes(int par1, int par2, ItemStack[] par3ArrayOfItemStack, ItemStack par4ItemStack) - { - this.recipeWidth = par1; - this.recipeHeight = par2; - this.recipeItems = par3ArrayOfItemStack; - this.recipeOutput = par4ItemStack; - } - - @Override - public ItemStack getRecipeOutput() - { - return this.recipeOutput; - } - - /** - * Used to check if a recipe matches current crafting inventory - */ - @Override - public boolean matches(InventoryCrafting par1InventoryCrafting, World world) - { - for(int x = 0; x <= this.maxRecipeSize - this.recipeWidth; ++x) - for(int y = 0; y <= this.maxRecipeSize - this.recipeHeight; ++y) - if(this.checkMatch(par1InventoryCrafting, x, y, true) || this.checkMatch(par1InventoryCrafting, x, y, false)) - return true; - - return false; - } - - /** - * Checks if the region of a crafting inventory is match for the recipe. - */ - private boolean checkMatch(InventoryCrafting par1InventoryCrafting, int x, int y, boolean mirrored) - { - for(int i = 0; i < this.maxRecipeSize; ++i) - { - for(int j = 0; j < this.maxRecipeSize; ++j) - { - int var7 = i - x; - int var8 = j - y; - ItemStack stackFound = null; - - if(var7 >= 0 && var8 >= 0 && var7 < this.recipeWidth && var8 < this.recipeHeight) - if(mirrored) - stackFound = this.recipeItems[this.recipeWidth - var7 - 1 + var8 * this.recipeWidth]; - else - stackFound = this.recipeItems[var7 + var8 * this.recipeWidth]; - - ItemStack stackExcpected = par1InventoryCrafting.getStackInRowAndColumn(i, j); - - if(stackFound == null && stackExcpected == null) - continue; - if((stackExcpected == null && stackFound != null) || (stackExcpected != null && stackFound == null)) - return false; - if(stackFound.getItem() != stackExcpected.getItem()) - return false; - if(stackFound.getItemDamage() != 32767 && stackFound.getItemDamage() != stackExcpected.getItemDamage()) - return false; - } - } - - return true; - } - - /** - * Returns an Item that is the result of this recipe - */ - @Override - public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) - { - return this.getRecipeOutput().copy(); - } - - /** - * Returns the size of the recipe area - */ - @Override - public int getRecipeSize() - { - return this.recipeWidth * this.recipeHeight; - } -} diff --git a/src/api/java/naruto1310/extendedWorkbench/crafting/ExtendedShapelessRecipes.java b/src/api/java/naruto1310/extendedWorkbench/crafting/ExtendedShapelessRecipes.java deleted file mode 100644 index 077e823..0000000 --- a/src/api/java/naruto1310/extendedWorkbench/crafting/ExtendedShapelessRecipes.java +++ /dev/null @@ -1,92 +0,0 @@ -package naruto1310.extendedWorkbench.crafting; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public class ExtendedShapelessRecipes implements IExtendedRecipe -{ - private int maxRecipeSize = 6; - - /** Is the ItemStack that you get when craft the recipe. */ - private final ItemStack recipeOutput; - - /** Is a List of ItemStack that composes the recipe. */ - private final List recipeItems; - - public ExtendedShapelessRecipes(ItemStack par1ItemStack, List par2List) - { - this.recipeOutput = par1ItemStack; - this.recipeItems = par2List; - } - - @Override - public ItemStack getRecipeOutput() - { - return this.recipeOutput; - } - - /** - * Used to check if a recipe matches current crafting inventory - */ - @Override - public boolean matches(InventoryCrafting par1InventoryCrafting, World world) - { - ArrayList var2 = new ArrayList(this.recipeItems); - - for (int var3 = 0; var3 < this.maxRecipeSize; ++var3) - { - for (int var4 = 0; var4 < this.maxRecipeSize; ++var4) - { - ItemStack var5 = par1InventoryCrafting.getStackInRowAndColumn(var4, var3); - - if (var5 != null) - { - boolean var6 = false; - Iterator var7 = var2.iterator(); - - while (var7.hasNext()) - { - ItemStack var8 = var7.next(); - - if (var5 == var8 && (var8.getItemDamage() == 32767 || var5.getItemDamage() == var8.getItemDamage())) - { - var6 = true; - var2.remove(var8); - break; - } - } - - if (!var6) - { - return false; - } - } - } - } - - return var2.isEmpty(); - } - - /** - * Returns an Item that is the result of this recipe - */ - @Override - public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) - { - return this.recipeOutput.copy(); - } - - /** - * Returns the size of the recipe area - */ - @Override - public int getRecipeSize() - { - return this.recipeItems.size(); - } -} diff --git a/src/api/java/pneumaticCraft/api/recipe/AssemblyRecipe.java b/src/api/java/pneumaticCraft/api/recipe/AssemblyRecipe.java deleted file mode 100644 index 8c74b4b..0000000 --- a/src/api/java/pneumaticCraft/api/recipe/AssemblyRecipe.java +++ /dev/null @@ -1,49 +0,0 @@ -package pneumaticCraft.api.recipe; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class AssemblyRecipe{ - public static List drillRecipes = new ArrayList(); - public static List laserRecipes = new ArrayList(); - public static List drillLaserRecipes = new ArrayList(); - - private final ItemStack input; - private final ItemStack output; - - public AssemblyRecipe(ItemStack input, ItemStack output){ - this.input = input; - this.output = output; - } - - public ItemStack getInput(){ - return input; - } - - public ItemStack getOutput(){ - return output; - } - - public static void addDrillRecipe(Object input, Object output){ - drillRecipes.add(new AssemblyRecipe(getStackFromObject(input), getStackFromObject(output))); - } - - public static void addLaserRecipe(Object input, Object output){ - laserRecipes.add(new AssemblyRecipe(getStackFromObject(input), getStackFromObject(output))); - } - - private static ItemStack getStackFromObject(Object object){ - if(object instanceof Block) { - return new ItemStack((Block)object); - } else if(object instanceof Item) { - return new ItemStack((Item)object); - } else { - return (ItemStack)object; - } - } - -} diff --git a/src/api/java/pneumaticCraft/api/recipe/IPressureChamberRecipe.java b/src/api/java/pneumaticCraft/api/recipe/IPressureChamberRecipe.java deleted file mode 100644 index 93eba67..0000000 --- a/src/api/java/pneumaticCraft/api/recipe/IPressureChamberRecipe.java +++ /dev/null @@ -1,34 +0,0 @@ -package pneumaticCraft.api.recipe; - -import net.minecraft.item.ItemStack; - -public interface IPressureChamberRecipe{ - - /** - * Returns the threshold which is minimal to craft the recipe. Negative pressures also work. - * @return threshold pressure - */ - public float getCraftingPressure(); - - /** - * This method should return the used items in the recipe when the right items are provided to craft this recipe. - * @param inputStacks - * @return usedStacks, return null when the inputStacks aren't valid for this recipe. - */ - public ItemStack[] isValidRecipe(ItemStack[] inputStacks); - - /** - * When returned true, only the exact same references of the stacks returned by isValidRecipe() will be removed. This is useful - * to remove stacks with a certain NBT value (like Enchanted Books). Return false for normal behaviour. - * @return true if exact stacks should be removed only. - */ - public boolean shouldRemoveExactStacks(); - - /** - * This method will be called when the recipe should output its items. the stacks the recipe output, may be dependent on the input stacks. - * @param removedStacks same reference to the stacks returned by isValidRecipe. - * @param inputStacks. These stacks can be modified (like adding/removing NBT data eg.) - * @return outputStacks. Stacks that will pop 'out of the chamber' - */ - public ItemStack[] craftRecipe(ItemStack[] inputStacks, ItemStack[] removedStacks); -} diff --git a/src/api/java/pneumaticCraft/api/recipe/PressureChamberRecipe.java b/src/api/java/pneumaticCraft/api/recipe/PressureChamberRecipe.java deleted file mode 100644 index 5d6b29e..0000000 --- a/src/api/java/pneumaticCraft/api/recipe/PressureChamberRecipe.java +++ /dev/null @@ -1,24 +0,0 @@ -package pneumaticCraft.api.recipe; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.ItemStack; - -public class PressureChamberRecipe{ - public static List chamberRecipes = new ArrayList(); - public static List specialRecipes = new ArrayList(); - - public final ItemStack[] input; - public final ItemStack[] output; - public final float pressure; - public final boolean outputAsBlock; - - public PressureChamberRecipe(ItemStack[] input, float pressureRequired, ItemStack[] output, boolean outputAsBlock){ - this.input = input; - this.output = output; - pressure = pressureRequired; - this.outputAsBlock = outputAsBlock; - } - -} diff --git a/src/api/java/thaumcraft b/src/api/java/thaumcraft deleted file mode 160000 index ced30ed..0000000 --- a/src/api/java/thaumcraft +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ced30ed35097d53cdb2a843d705477e52896e54b diff --git a/src/compileHelper/README.md b/src/compileHelper/README.md new file mode 100644 index 0000000..2b86c1c --- /dev/null +++ b/src/compileHelper/README.md @@ -0,0 +1 @@ +This directory contains all classes required to allow ExtendedWorkbench support. ExtendedWorkbench can be found on the [MinecraftForum](https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/1282775). diff --git a/src/compileHelper/java/naruto1310/extendedWorkbench/crafting/ExtendedCraftingManager.java b/src/compileHelper/java/naruto1310/extendedWorkbench/crafting/ExtendedCraftingManager.java new file mode 100644 index 0000000..468a004 --- /dev/null +++ b/src/compileHelper/java/naruto1310/extendedWorkbench/crafting/ExtendedCraftingManager.java @@ -0,0 +1,17 @@ +package naruto1310.extendedWorkbench.crafting; + +import java.util.List; + +import net.minecraft.item.crafting.IRecipe; + +public class ExtendedCraftingManager { + + public static final ExtendedCraftingManager getInstance() { + throw new UnsupportedOperationException(); + } + + public List getRecipeList() { + throw new UnsupportedOperationException(); + } + +} diff --git a/src/compileHelper/java/naruto1310/extendedWorkbench/crafting/ExtendedShapedRecipes.java b/src/compileHelper/java/naruto1310/extendedWorkbench/crafting/ExtendedShapedRecipes.java new file mode 100644 index 0000000..21caf25 --- /dev/null +++ b/src/compileHelper/java/naruto1310/extendedWorkbench/crafting/ExtendedShapedRecipes.java @@ -0,0 +1,29 @@ +package naruto1310.extendedWorkbench.crafting; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ExtendedShapedRecipes implements IExtendedRecipe { + + public ExtendedShapedRecipes(int width, int height, ItemStack[] recipe, ItemStack stack) { + throw new UnsupportedOperationException(); + } + + public boolean matches(InventoryCrafting inventory, World world) { + throw new UnsupportedOperationException(); + } + + public ItemStack getCraftingResult(InventoryCrafting inventory) { + throw new UnsupportedOperationException(); + } + + public int getRecipeSize() { + throw new UnsupportedOperationException(); + } + + public ItemStack getRecipeOutput() { + throw new UnsupportedOperationException(); + } + +} diff --git a/src/compileHelper/java/naruto1310/extendedWorkbench/crafting/ExtendedShapelessRecipes.java b/src/compileHelper/java/naruto1310/extendedWorkbench/crafting/ExtendedShapelessRecipes.java new file mode 100644 index 0000000..d3fde08 --- /dev/null +++ b/src/compileHelper/java/naruto1310/extendedWorkbench/crafting/ExtendedShapelessRecipes.java @@ -0,0 +1,31 @@ +package naruto1310.extendedWorkbench.crafting; + +import java.util.List; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ExtendedShapelessRecipes implements IExtendedRecipe { + + public ExtendedShapelessRecipes(ItemStack output, List input) { + throw new UnsupportedOperationException(); + } + + public boolean matches(InventoryCrafting inventory, World world) { + throw new UnsupportedOperationException(); + } + + public ItemStack getCraftingResult(InventoryCrafting inventory) { + throw new UnsupportedOperationException(); + } + + public int getRecipeSize() { + throw new UnsupportedOperationException(); + } + + public ItemStack getRecipeOutput() { + throw new UnsupportedOperationException(); + } + +} diff --git a/src/api/java/naruto1310/extendedWorkbench/crafting/IExtendedRecipe.java b/src/compileHelper/java/naruto1310/extendedWorkbench/crafting/IExtendedRecipe.java similarity index 65% rename from src/api/java/naruto1310/extendedWorkbench/crafting/IExtendedRecipe.java rename to src/compileHelper/java/naruto1310/extendedWorkbench/crafting/IExtendedRecipe.java index 526cfca..3cf84e6 100644 --- a/src/api/java/naruto1310/extendedWorkbench/crafting/IExtendedRecipe.java +++ b/src/compileHelper/java/naruto1310/extendedWorkbench/crafting/IExtendedRecipe.java @@ -2,7 +2,6 @@ package naruto1310.extendedWorkbench.crafting; import net.minecraft.item.crafting.IRecipe; -public interface IExtendedRecipe extends IRecipe -{ +public interface IExtendedRecipe extends IRecipe { } diff --git a/src/compileStubs/README.md b/src/compileStubs/README.md new file mode 100644 index 0000000..351a6ae --- /dev/null +++ b/src/compileStubs/README.md @@ -0,0 +1 @@ +These Class Stups are used to compile all sources in compileHelper. They are not meant to be passed on to the actual mod! diff --git a/src/compileStubs/java/net/minecraft/inventory/InventoryCrafting.java b/src/compileStubs/java/net/minecraft/inventory/InventoryCrafting.java new file mode 100644 index 0000000..86f710a --- /dev/null +++ b/src/compileStubs/java/net/minecraft/inventory/InventoryCrafting.java @@ -0,0 +1,5 @@ +package net.minecraft.inventory; + +public class InventoryCrafting { + +} diff --git a/src/compileStubs/java/net/minecraft/item/ItemStack.java b/src/compileStubs/java/net/minecraft/item/ItemStack.java new file mode 100644 index 0000000..5f7fb17 --- /dev/null +++ b/src/compileStubs/java/net/minecraft/item/ItemStack.java @@ -0,0 +1,5 @@ +package net.minecraft.item; + +public class ItemStack { + +} diff --git a/src/compileStubs/java/net/minecraft/item/crafting/IRecipe.java b/src/compileStubs/java/net/minecraft/item/crafting/IRecipe.java new file mode 100644 index 0000000..9fcc882 --- /dev/null +++ b/src/compileStubs/java/net/minecraft/item/crafting/IRecipe.java @@ -0,0 +1,5 @@ +package net.minecraft.item.crafting; + +public interface IRecipe { + +} diff --git a/src/compileStubs/java/net/minecraft/world/World.java b/src/compileStubs/java/net/minecraft/world/World.java new file mode 100644 index 0000000..f1c3048 --- /dev/null +++ b/src/compileStubs/java/net/minecraft/world/World.java @@ -0,0 +1,5 @@ +package net.minecraft.world; + +public class World { + +} diff --git a/src/main/java/modtweaker2/ModProps.java b/src/main/java/modtweaker2/ModProps.java index ce1a1a1..5e92be7 100644 --- a/src/main/java/modtweaker2/ModProps.java +++ b/src/main/java/modtweaker2/ModProps.java @@ -4,6 +4,6 @@ public class ModProps { public static final String NAME = "Mod Tweaker 2", name = NAME; public static final String MODID = "modtweaker2", modid = MODID; - public static final String VERSION = "@modVersion@", version = VERSION; + public static final String VERSION = "GRADLETOKEN_VERSION", version = VERSION; public static final String DEPENDENCIES = "required-after:MineTweaker3;after:Forestry@[4.1.0,);", dependencies = DEPENDENCIES; } diff --git a/src/main/java/modtweaker2/mods/appeng/handlers/Inscriber.java b/src/main/java/modtweaker2/mods/appeng/handlers/Inscriber.java index 650edb5..8b02cc0 100644 --- a/src/main/java/modtweaker2/mods/appeng/handlers/Inscriber.java +++ b/src/main/java/modtweaker2/mods/appeng/handlers/Inscriber.java @@ -5,6 +5,7 @@ import static modtweaker2.helpers.InputHelper.toStack; import static modtweaker2.helpers.InputHelper.toStacks; import static modtweaker2.helpers.StackHelper.matches; +import java.util.ArrayList; import java.util.LinkedList; import minetweaker.MineTweakerAPI; @@ -83,7 +84,7 @@ public class Inscriber { public static class Add extends BaseListAddition { public Add(IInscriberRecipe recipe) { - super(Inscriber.name, AEApi.instance().registries().inscriber().getRecipes()); + super(Inscriber.name, new ArrayList<>(AEApi.instance().registries().inscriber().getRecipes())); recipes.add(recipe); } @@ -158,7 +159,7 @@ public class Inscriber { public static class Remove extends BaseListRemoval { public Remove(LinkedList recipes) { - super(Inscriber.name, AEApi.instance().registries().inscriber().getRecipes(), recipes); + super(Inscriber.name, new ArrayList<>(AEApi.instance().registries().inscriber().getRecipes()), recipes); } @Override diff --git a/src/main/resources/CoFH_at.cfg b/src/main/resources/CoFH_at.cfg deleted file mode 100644 index 19fe7ac..0000000 --- a/src/main/resources/CoFH_at.cfg +++ /dev/null @@ -1,51 +0,0 @@ -# NetherOres -public net.minecraft.entity.monster.EntityPigZombie func_70835_c(Lnet/minecraft/entity/Entity;)V # becomeAngryAt -public net.minecraft.entity.monster.EntitySilverfish field_70843_d # allySummonCooldown -public-f net.minecraft.init.Blocks field_150449_bY # oreNetherQuartz - -# MineFactory Reloaded -protected net.minecraft.util.WeightedRandomFishable * # need it all -public net.minecraft.entity.EntityList field_75624_e # classToIDMapping -public net.minecraft.entity.EntityList field_75622_f # stringToIDMapping -public net.minecraft.entity.monster.EntitySlime func_70799_a(I)V # setSlimeSize -public net.minecraft.entity.monster.EntityZombie func_82228_a(I)V # startConversion -public net.minecraft.entity.EntityLivingBase field_70718_bc # recentlyHit -public-f net.minecraft.init.Blocks field_150432_aD # ice -public-f net.minecraft.init.Blocks field_150410_aZ # glass_pane -public-f net.minecraft.init.Items field_151117_aB # milkBucket -protected net.minecraft.block.Block field_149770_b # unlocalizedName -public net.minecraft.server.management.PlayerManager func_72690_a(IIZ)Lnet/minecraft/server/management/PlayerManager$PlayerInstance; # getOrCreateChunkWatcher -public net.minecraft.server.management.PlayerManager$PlayerInstance -public net.minecraft.server.management.PlayerManager$PlayerInstance field_73263_b # playersWatchingChunk -public net.minecraft.entity.EntityLiving field_70728_aV # experienceValue -public net.minecraft.entity.EntityLiving field_82174_bp # equipmentDropChances - -# Thermal Expansion -public net.minecraft.entity.Entity field_83001_bt # invulnerable -public net.minecraft.entity.Entity field_70178_ae # isImmuneToFire -public net.minecraft.entity.player.EntityPlayer field_71074_e # itemInUse -public net.minecraft.server.management.ItemInWorldManager field_73094_o #durabilityRemainingOnBlock - -# PC Core -public net.minecraft.client.gui.GuiScreen field_146289_q # fontRenderer -public net.minecraft.client.gui.inventory.GuiContainer field_147003_i # guiLeft -public net.minecraft.client.gui.inventory.GuiContainer field_147009_r # guiTop -public net.minecraft.world.WorldServer field_73068_P # allPlayersSleeping - -# CoFH Core -protected net.minecraft.inventory.Container * # senseless to have private stuff here -protected net.minecraft.client.gui.inventory.GuiContainer * # senseless to have private stuff here -protected net.minecraft.client.gui.FontRenderer func_78280_d(Ljava/lang/String;I)Ljava/lang/String; # wrapFormattedStringToWidth -protected net.minecraft.client.gui.FontRenderer func_78255_a(Ljava/lang/String;Z)V # renderStringAtPos -public net.minecraft.entity.projectile.EntityFishHook * # (nearly) literally everything is private -protected net.minecraft.entity.player.EntityPlayer field_71072_f # itemInUseCount -public net.minecraft.item.ItemPickaxe field_150915_c # blocksEffectiveAgainst -public net.minecraft.item.ItemSpade field_150916_c # blocksEffectiveAgainst -public net.minecraft.item.ItemAxe field_150917_c # blocksEffectiveAgainst -public net.minecraft.util.RegistrySimple field_82596_a # registryObjects -public-f net.minecraft.util.RegistryNamespaced field_148759_a # underlyingIntegerMap -public net.minecraft.world.World field_72998_d # collidingBoundingBoxes - -# WorldProxy -public-f net.minecraft.world.World *()V # Doesn't matter what it is, we need it public -public-f net.minecraft.world.WorldServer *()V # Doesn't matter what it is, we need it public diff --git a/src/main/resources/IMC Todo b/src/main/resources/IMC Todo deleted file mode 100644 index c106fea..0000000 --- a/src/main/resources/IMC Todo +++ /dev/null @@ -1,3 +0,0 @@ -Tinkers construct -EnderIO -Forestry \ No newline at end of file diff --git a/src/main/resources/META-INF/modtweaker2_at.cfg b/src/main/resources/META-INF/modtweaker2_at.cfg new file mode 100644 index 0000000..d0d75c4 --- /dev/null +++ b/src/main/resources/META-INF/modtweaker2_at.cfg @@ -0,0 +1 @@ +public net.minecraft.entity.EntityList field_75622_f # stringToIDMapping diff --git a/src/main/resources/TConstruct_at.cfg b/src/main/resources/TConstruct_at.cfg deleted file mode 100644 index 467fa4b..0000000 --- a/src/main/resources/TConstruct_at.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# Tinkers Construct -- Access Transformer -# Required for any build system. -# Last update: Minecraft 1.7.2 - 2014 Feb 02 by Progwml6 -# EntityArrow - Grabbed 'em all, since so much is accessed -public net.minecraft.entity.projectile.EntityArrow field_145789_f -public net.minecraft.entity.projectile.EntityArrow field_145790_g -public net.minecraft.entity.projectile.EntityArrow field_145791_d -public net.minecraft.entity.projectile.EntityArrow field_145792_e -public net.minecraft.entity.projectile.EntityArrow field_70254_i -public net.minecraft.entity.projectile.EntityArrow field_70252_j -public net.minecraft.entity.projectile.EntityArrow field_70253_h -public net.minecraft.entity.projectile.EntityArrow field_70257_an -public net.minecraft.entity.projectile.EntityArrow field_70255_ao -public net.minecraft.entity.projectile.EntityArrow field_70256_ap -public net.minecraft.entity.projectile.EntityArrow *() #we need waaaaaaay to much in here to bother going through it -# RenderGlobal -public net.minecraft.client.renderer.RenderGlobal field_147592_B -# Blocks -public-f net.minecraft.block.Block field_149764_J -public net.minecraft.block.BlockLeavesBase field_150121_P -public net.minecraft.block.BlockRailBase$Rail func_150650_a()I -# GuiContainer -public net.minecraft.client.gui.inventory.GuiContainer field_146999_f -public net.minecraft.client.gui.inventory.GuiContainer field_147009_r -public net.minecraft.client.gui.inventory.GuiContainer field_147003_i -# GuiScreen -public net.minecraft.client.gui.GuiScreen field_146292_n #buttonList -# ThreadDownloadImageData -public net.minecraft.client.renderer.ThreadDownloadImageData field_110559_g #field_110559_g -public net.minecraft.client.renderer.ThreadDownloadImageData field_110560_d #field_110560_d -public net.minecraft.world.gen.structure.StructureVillagePieces$Village #cant make village houses w/o this -public net.minecraft.client.renderer.Tessellator field_78415_z -public net.minecraft.client.renderer.entity.RenderPlayer field_77109_a #modelBipedMain -# needs to have a space at the end of every line or SS will derp diff --git a/src/main/resources/hee_at.cfg b/src/main/resources/hee_at.cfg deleted file mode 100644 index 421fc37..0000000 --- a/src/main/resources/hee_at.cfg +++ /dev/null @@ -1,20 +0,0 @@ -# C:\Gradle\caches\minecraft\net\minecraftforge\forge\1.7.10-10.13.0.1208\unpacked\conf - -public net.minecraft.util.RegistrySimple field_82596_a # registryObjects -public net.minecraft.util.RegistryNamespaced field_148759_a # underlyingIntegerMap -public net.minecraft.entity.EntityLivingBase field_110153_bc # lastDamage -public net.minecraft.entity.EntityLiving field_82174_bp # equipmentDropChances -public net.minecraft.entity.Entity field_70151_c # fire -public net.minecraft.entity.monster.EntityGhast field_70792_g # targetedEntity -public net.minecraft.network.NetHandlerPlayServer field_147365_f # floatingTickCount -public net.minecraft.network.NetHandlerPlayServer field_147373_o # lastPosX -public net.minecraft.network.NetHandlerPlayServer field_147382_p # lastPosY -public net.minecraft.network.NetHandlerPlayServer field_147381_q # lastPosZ -public net.minecraft.world.gen.ChunkProviderEnd field_73204_i # endRNG -public-f net.minecraft.world.biome.BiomeGenBase field_76779_k # sky -public net.minecraft.world.World field_73020_y # chunkProvider - -public net.minecraft.client.Minecraft field_147126_aw # mcMusicTicker -public net.minecraft.client.gui.inventory.GuiContainer field_146999_f # xSize -public net.minecraft.client.gui.inventory.GuiContainer field_147000_g # ySize -public net.minecraft.client.renderer.RenderGlobal field_147593_P # mapSoundPositions \ No newline at end of file diff --git a/src/main/resources/mariculture_at.cfg b/src/main/resources/mariculture_at.cfg deleted file mode 100644 index 8155760..0000000 --- a/src/main/resources/mariculture_at.cfg +++ /dev/null @@ -1,12 +0,0 @@ -public net.minecraft.client.gui.inventory.GuiContainer field_146999_f #xSize -public net.minecraft.client.gui.inventory.GuiContainer field_147000_g #ySize -public net.minecraft.entity.projectile.EntityFishHook * -public net.minecraft.util.WeightedRandomFishable * -public net.minecraft.client.renderer.EntityRenderer * -public net.minecraft.world.biome.BiomeGenMutated * -public net.minecraft.entity.item.EntityBoat * -public net.minecraft.world.gen.ChunkProviderGenerate * -public net.minecraft.inventory.Container field_94535_f -public net.minecraft.inventory.Container field_94536_g -public net.minecraft.inventory.Container field_94537_h -public net.minecraft.entity.player.EntityPlayer func_70693_a(Lnet/minecraft/entity/player/EntityPlayer;)I \ No newline at end of file diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 1a037ce..48af7e6 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,10 +1,10 @@ [ { - "modid": "modtweaker2", - "name": "Mod Tweaker 2", + "modid": "${modId}", + "name": "${modName}", "description": "ModTweaker is an addon for MineTweaker 3.", - "version": "${version}", - "mcversion": "${mcversion}", + "version": "${modVersion}", + "mcversion": "${minecraftVersion}", "url": "", "updateUrl": "", "authorList": ["Jaredlll08"], diff --git a/src/main/resources/micdoodlecore_at.cfg b/src/main/resources/micdoodlecore_at.cfg deleted file mode 100644 index 3799fea..0000000 --- a/src/main/resources/micdoodlecore_at.cfg +++ /dev/null @@ -1,32 +0,0 @@ -# Micdoodle Core Access Transformer configuration file -# Fields -public net.minecraft.client.gui.inventory.GuiContainer field_147003_i #guiLeft -public net.minecraft.client.gui.inventory.GuiContainer field_147009_r #guiLeft -public net.minecraft.client.gui.GuiScreen field_146292_n #buttonList -public net.minecraft.inventory.InventoryCrafting field_70465_c #eventHandler -public net.minecraft.client.renderer.entity.RenderPlayer field_77109_a #modelBipedMain -public net.minecraft.client.renderer.entity.RenderPlayer field_77108_b #modelArmorChestplate -public net.minecraft.client.renderer.entity.RenderPlayer field_77111_i #modelArmor -public net.minecraft.entity.player.EntityPlayer field_71083_bS #sleeping -public net.minecraft.entity.player.EntityPlayer field_71076_b #sleepTimer -public net.minecraft.entity.EntityLivingBase field_70718_bc #recentlyHit -public net.minecraft.entity.EntityLivingBase field_70717_bb #attackingPlayer -public net.minecraft.network.EnumConnectionState field_150761_f -public net.minecraft.network.EnumConnectionState field_150770_i -public net.minecraft.client.renderer.EntityRenderer field_78490_B #thirdPersonDistance -public net.minecraft.client.renderer.EntityRenderer field_78491_C #thirdPersonDistanceTemp -public net.minecraft.client.renderer.WorldRenderer field_78942_y #glRenderList -public net.minecraft.client.audio.MusicTicker field_147679_a -public net.minecraft.client.audio.MusicTicker field_147677_b -public net.minecraft.client.audio.MusicTicker field_147678_c -public net.minecraft.client.audio.MusicTicker field_147676_d -public net.minecraft.client.gui.GuiIngame field_73838_g #recordPlaying -# Methods -public net.minecraft.entity.player.EntityPlayer func_71053_j()V #closeScreen -public net.minecraft.entity.player.EntityPlayerMP func_71053_j()V #closeScreen -public net.minecraft.client.entity.EntityClientPlayerMP func_71053_j()V #closeScreen -public net.minecraft.client.entity.EntityPlayerSP func_71053_j()V #closeScreen -public net.minecraft.world.World func_72847_b(Lnet/minecraft/entity/Entity;)V #onEntityRemoved -public net.minecraft.client.multiplayer.WorldClient func_72847_b(Lnet/minecraft/entity/Entity;)V #onEntityRemoved -public net.minecraft.world.WorldServer func_72847_b(Lnet/minecraft/entity/Entity;)V #onEntityRemoved -public net.minecraft.entity.DataWatcher func_75691_i(I)Lnet/minecraft/entity/DataWatcher$WatchableObject; #getWatchedObject \ No newline at end of file diff --git a/src/main/resources/tfc_at.cfg b/src/main/resources/tfc_at.cfg deleted file mode 100644 index 4fb1a16..0000000 --- a/src/main/resources/tfc_at.cfg +++ /dev/null @@ -1,20 +0,0 @@ -public net.minecraft.world.gen.ChunkProviderGenerate field_147430_m -public net.minecraft.world.gen.ChunkProviderGenerate field_73220_k -public net.minecraft.world.gen.ChunkProviderGenerate field_73230_p -public net.minecraft.world.gen.ChunkProviderGenerate func_147423_a(III)V -public net.minecraft.world.gen.ChunkProviderGenerate field_147434_q -public net.minecraft.world.WorldType (ILjava/lang/String;)V -public-f net.minecraft.world.WorldType field_77137_b #Default WorldType -public-f net.minecraft.world.WorldType field_77138_c #Flat WorldType -public-f net.minecraft.world.WorldType field_77135_d #LargeBiomes WorldType -public-f net.minecraft.world.WorldType field_151360_e #Amplified WorldType -protected net.minecraft.client.gui.inventory.GuiContainer func_146977_a(Lnet.minecraft.inventory.Slot;)V -public-f net.minecraft.init.Items field_151058_ca #Items.lead -public-f net.minecraft.init.Items field_151031_f #Items.bow -public net.minecraft.entity.player.EntityPlayer field_71076_b #sleepTimer -public-f net.minecraft.init.Blocks field_150431_aC #snow_layer -public net.minecraft.client.gui.inventory.GuiContainer func_146975_c(II)Lnet/minecraft/inventory/Slot; #getSlotAtPosition -public net.minecraft.client.gui.inventory.GuiContainer field_147003_i #guiLeft -public net.minecraft.client.gui.inventory.GuiContainer field_147009_r #guiTop -public net.minecraft.block.BlockDynamicLiquid func_149807_p(Lnet/minecraft/world/World;III)Z #displaceBlocks -public net.minecraft.entity.passive.EntityHorse field_110296_bG #horseChest \ No newline at end of file