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 754b668..75c41f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,27 +1,31 @@
-# General use .gitignore for Minecraft modding.
-
-# Directories
-/.gradle/
+.gradle
+.settings
+/.idea/
+/run/
/build/
/eclipse/
-/run/
-/out/
-/asm/
+.classpath
+.project
/bin/
-/.idea/
-/.metadata/
-/.settings/
-/libs/
-
-# File Extensions
-*.psd
+/config/
+/crash-reports/
+/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
-*.classpath
-*.project
-*.class
-
-# Specific files
-Thumbs.db
+src/main/resources/mixins.*.json
*.bat
+*.DS_Store
+!gradlew.bat
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/LICENSE b/LICENSE
new file mode 100644
index 0000000..4ea99c2
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,395 @@
+Attribution 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+ Considerations for licensors: Our public licenses are
+ intended for use by those authorized to give the public
+ permission to use material in ways otherwise restricted by
+ copyright and certain other rights. Our licenses are
+ irrevocable. Licensors should read and understand the terms
+ and conditions of the license they choose before applying it.
+ Licensors should also secure all rights necessary before
+ applying our licenses so that the public can reuse the
+ material as expected. Licensors should clearly mark any
+ material not subject to the license. This includes other CC-
+ licensed material, or material used under an exception or
+ limitation to copyright. More considerations for licensors:
+ wiki.creativecommons.org/Considerations_for_licensors
+
+ Considerations for the public: By using one of our public
+ licenses, a licensor grants the public permission to use the
+ licensed material under specified terms and conditions. If
+ the licensor's permission is not necessary for any reason--for
+ example, because of any applicable exception or limitation to
+ copyright--then that use is not regulated by the license. Our
+ licenses grant only permissions under copyright and certain
+ other rights that a licensor has authority to grant. Use of
+ the licensed material may still be restricted for other
+ reasons, including because others have copyright or other
+ rights in the material. A licensor may make special requests,
+ such as asking that all changes be marked or described.
+ Although not required by our licenses, you are encouraged to
+ respect those requests where reasonable. More considerations
+ for the public:
+ wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution 4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution 4.0 International Public License ("Public License"). To the
+extent this Public License may be interpreted as a contract, You are
+granted the Licensed Rights in consideration of Your acceptance of
+these terms and conditions, and the Licensor grants You such rights in
+consideration of benefits the Licensor receives from making the
+Licensed Material available under these terms and conditions.
+
+
+Section 1 -- Definitions.
+
+ a. Adapted Material means material subject to Copyright and Similar
+ Rights that is derived from or based upon the Licensed Material
+ and in which the Licensed Material is translated, altered,
+ arranged, transformed, or otherwise modified in a manner requiring
+ permission under the Copyright and Similar Rights held by the
+ Licensor. For purposes of this Public License, where the Licensed
+ Material is a musical work, performance, or sound recording,
+ Adapted Material is always produced where the Licensed Material is
+ synched in timed relation with a moving image.
+
+ b. Adapter's License means the license You apply to Your Copyright
+ and Similar Rights in Your contributions to Adapted Material in
+ accordance with the terms and conditions of this Public License.
+
+ c. Copyright and Similar Rights means copyright and/or similar rights
+ closely related to copyright including, without limitation,
+ performance, broadcast, sound recording, and Sui Generis Database
+ Rights, without regard to how the rights are labeled or
+ categorized. For purposes of this Public License, the rights
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
+ Rights.
+
+ d. Effective Technological Measures means those measures that, in the
+ absence of proper authority, may not be circumvented under laws
+ fulfilling obligations under Article 11 of the WIPO Copyright
+ Treaty adopted on December 20, 1996, and/or similar international
+ agreements.
+
+ e. Exceptions and Limitations means fair use, fair dealing, and/or
+ any other exception or limitation to Copyright and Similar Rights
+ that applies to Your use of the Licensed Material.
+
+ f. Licensed Material means the artistic or literary work, database,
+ or other material to which the Licensor applied this Public
+ License.
+
+ g. Licensed Rights means the rights granted to You subject to the
+ terms and conditions of this Public License, which are limited to
+ all Copyright and Similar Rights that apply to Your use of the
+ Licensed Material and that the Licensor has authority to license.
+
+ h. Licensor means the individual(s) or entity(ies) granting rights
+ under this Public License.
+
+ i. Share means to provide material to the public by any means or
+ process that requires permission under the Licensed Rights, such
+ as reproduction, public display, public performance, distribution,
+ dissemination, communication, or importation, and to make material
+ available to the public including in ways that members of the
+ public may access the material from a place and at a time
+ individually chosen by them.
+
+ j. Sui Generis Database Rights means rights other than copyright
+ resulting from Directive 96/9/EC of the European Parliament and of
+ the Council of 11 March 1996 on the legal protection of databases,
+ as amended and/or succeeded, as well as other essentially
+ equivalent rights anywhere in the world.
+
+ k. You means the individual or entity exercising the Licensed Rights
+ under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+ a. License grant.
+
+ 1. Subject to the terms and conditions of this Public License,
+ the Licensor hereby grants You a worldwide, royalty-free,
+ non-sublicensable, non-exclusive, irrevocable license to
+ exercise the Licensed Rights in the Licensed Material to:
+
+ a. reproduce and Share the Licensed Material, in whole or
+ in part; and
+
+ b. produce, reproduce, and Share Adapted Material.
+
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
+ Exceptions and Limitations apply to Your use, this Public
+ License does not apply, and You do not need to comply with
+ its terms and conditions.
+
+ 3. Term. The term of this Public License is specified in Section
+ 6(a).
+
+ 4. Media and formats; technical modifications allowed. The
+ Licensor authorizes You to exercise the Licensed Rights in
+ all media and formats whether now known or hereafter created,
+ and to make technical modifications necessary to do so. The
+ Licensor waives and/or agrees not to assert any right or
+ authority to forbid You from making technical modifications
+ necessary to exercise the Licensed Rights, including
+ technical modifications necessary to circumvent Effective
+ Technological Measures. For purposes of this Public License,
+ simply making modifications authorized by this Section 2(a)
+ (4) never produces Adapted Material.
+
+ 5. Downstream recipients.
+
+ a. Offer from the Licensor -- Licensed Material. Every
+ recipient of the Licensed Material automatically
+ receives an offer from the Licensor to exercise the
+ Licensed Rights under the terms and conditions of this
+ Public License.
+
+ b. No downstream restrictions. You may not offer or impose
+ any additional or different terms or conditions on, or
+ apply any Effective Technological Measures to, the
+ Licensed Material if doing so restricts exercise of the
+ Licensed Rights by any recipient of the Licensed
+ Material.
+
+ 6. No endorsement. Nothing in this Public License constitutes or
+ may be construed as permission to assert or imply that You
+ are, or that Your use of the Licensed Material is, connected
+ with, or sponsored, endorsed, or granted official status by,
+ the Licensor or others designated to receive attribution as
+ provided in Section 3(a)(1)(A)(i).
+
+ b. Other rights.
+
+ 1. Moral rights, such as the right of integrity, are not
+ licensed under this Public License, nor are publicity,
+ privacy, and/or other similar personality rights; however, to
+ the extent possible, the Licensor waives and/or agrees not to
+ assert any such rights held by the Licensor to the limited
+ extent necessary to allow You to exercise the Licensed
+ Rights, but not otherwise.
+
+ 2. Patent and trademark rights are not licensed under this
+ Public License.
+
+ 3. To the extent possible, the Licensor waives any right to
+ collect royalties from You for the exercise of the Licensed
+ Rights, whether directly or through a collecting society
+ under any voluntary or waivable statutory or compulsory
+ licensing scheme. In all other cases the Licensor expressly
+ reserves any right to collect such royalties.
+
+
+Section 3 -- License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
+
+ a. Attribution.
+
+ 1. If You Share the Licensed Material (including in modified
+ form), You must:
+
+ a. retain the following if it is supplied by the Licensor
+ with the Licensed Material:
+
+ i. identification of the creator(s) of the Licensed
+ Material and any others designated to receive
+ attribution, in any reasonable manner requested by
+ the Licensor (including by pseudonym if
+ designated);
+
+ ii. a copyright notice;
+
+ iii. a notice that refers to this Public License;
+
+ iv. a notice that refers to the disclaimer of
+ warranties;
+
+ v. a URI or hyperlink to the Licensed Material to the
+ extent reasonably practicable;
+
+ b. indicate if You modified the Licensed Material and
+ retain an indication of any previous modifications; and
+
+ c. indicate the Licensed Material is licensed under this
+ Public License, and include the text of, or the URI or
+ hyperlink to, this Public License.
+
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
+ reasonable manner based on the medium, means, and context in
+ which You Share the Licensed Material. For example, it may be
+ reasonable to satisfy the conditions by providing a URI or
+ hyperlink to a resource that includes the required
+ information.
+
+ 3. If requested by the Licensor, You must remove any of the
+ information required by Section 3(a)(1)(A) to the extent
+ reasonably practicable.
+
+ 4. If You Share Adapted Material You produce, the Adapter's
+ License You apply must not prevent recipients of the Adapted
+ Material from complying with this Public License.
+
+
+Section 4 -- Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
+
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+ to extract, reuse, reproduce, and Share all or a substantial
+ portion of the contents of the database;
+
+ b. if You include all or a substantial portion of the database
+ contents in a database in which You have Sui Generis Database
+ Rights, then the database in which You have Sui Generis Database
+ Rights (but not its individual contents) is Adapted Material; and
+
+ c. You must comply with the conditions in Section 3(a) if You Share
+ all or a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
+
+
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+
+ c. The disclaimer of warranties and limitation of liability provided
+ above shall be interpreted in a manner that, to the extent
+ possible, most closely approximates an absolute disclaimer and
+ waiver of all liability.
+
+
+Section 6 -- Term and Termination.
+
+ a. This Public License applies for the term of the Copyright and
+ Similar Rights licensed here. However, if You fail to comply with
+ this Public License, then Your rights under this Public License
+ terminate automatically.
+
+ b. Where Your right to use the Licensed Material has terminated under
+ Section 6(a), it reinstates:
+
+ 1. automatically as of the date the violation is cured, provided
+ it is cured within 30 days of Your discovery of the
+ violation; or
+
+ 2. upon express reinstatement by the Licensor.
+
+ For the avoidance of doubt, this Section 6(b) does not affect any
+ right the Licensor may have to seek remedies for Your violations
+ of this Public License.
+
+ c. For the avoidance of doubt, the Licensor may also offer the
+ Licensed Material under separate terms or conditions or stop
+ distributing the Licensed Material at any time; however, doing so
+ will not terminate this Public License.
+
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+ License.
+
+
+Section 7 -- Other Terms and Conditions.
+
+ a. The Licensor shall not be bound by any additional or different
+ terms or conditions communicated by You unless expressly agreed.
+
+ b. Any arrangements, understandings, or agreements regarding the
+ Licensed Material not stated herein are separate from and
+ independent of the terms and conditions of this Public License.
+
+
+Section 8 -- Interpretation.
+
+ a. For the avoidance of doubt, this Public License does not, and
+ shall not be interpreted to, reduce, limit, restrict, or impose
+ conditions on any use of the Licensed Material that could lawfully
+ be made without permission under this Public License.
+
+ b. To the extent possible, if any provision of this Public License is
+ deemed unenforceable, it shall be automatically reformed to the
+ minimum extent necessary to make it enforceable. If the provision
+ cannot be reformed, it shall be severed from this Public License
+ without affecting the enforceability of the remaining terms and
+ conditions.
+
+ c. No term or condition of this Public License will be waived and no
+ failure to comply consented to unless expressly agreed to by the
+ Licensor.
+
+ d. Nothing in this Public License constitutes or may be interpreted
+ as a limitation upon, or waiver of, any privileges and immunities
+ that apply to the Licensor or You, including from the legal
+ processes of any jurisdiction or authority.
+
+
+=======================================================================
+
+Creative Commons is not a party to its public
+licenses. Notwithstanding, Creative Commons may elect to apply one of
+its public licenses to material it publishes and in those instances
+will be considered the “Licensor.” The text of the Creative Commons
+public licenses is dedicated to the public domain under the CC0 Public
+Domain Dedication. Except for the limited purpose of indicating that
+material is shared under a Creative Commons public license or as
+otherwise permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the
+public licenses.
+
+Creative Commons may be contacted at creativecommons.org.
diff --git a/README.md b/README.md
index b187dd1..365fbc4 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,11 @@
Blood Arsenal by Arcaratus is licensed under a Creative Commons Attribution 4.0 International License.
-# Fork
+## Fork
This mod was forked by the GT:NH Team to continue the development of the 1.7.10 Branch.
The up-to-date Master branch can be found on our Jenkins:
http://jenkins.usrv.de
+
+## License
+
+This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 1cbeaea..610879c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,158 +1,721 @@
+//version: 1643844119
+/*
+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 {
- mavenCentral()
maven {
- name = "GT"
- url = "https://gregtech.overminddl1.com/"
+ name = "forge"
+ url = "https://maven.minecraftforge.net"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
+ maven {
+ name = "Scala CI dependencies"
+ url = "https://repo1.maven.org/maven2/"
+ }
maven {
name = "jitpack"
url = "https://jitpack.io"
}
- maven {
- url = "https://plugins.gradle.org/m2/"
- }
}
dependencies {
- classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.4'
- classpath 'org.ajoberstar:gradle-git:0.10.1'
- classpath "de.undercouch:gradle-download-task:3.1.2"
+ classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7'
}
}
-import de.undercouch.gradle.tasks.download.Download
+plugins {
+ id 'idea'
+ id 'eclipse'
+ id 'scala'
+ id('org.jetbrains.kotlin.jvm') version ('1.6.10') apply false
+ id('org.ajoberstar.grgit') version('4.1.1')
+ id('com.github.johnrengelman.shadow') version('4.0.4')
+ id('com.palantir.git-version') version('0.13.0') apply false
+ id('de.undercouch.download') version('5.0.1')
+ id('maven-publish')
+}
+
+if (project.file('.git/HEAD').isFile()) {
+ apply plugin: 'com.palantir.git-version'
+}
apply plugin: 'forge'
-apply plugin: 'signing'
-ext.configFile = file "build.properties"
-configFile.withReader {
- def prop = new Properties()
- prop.load(it)
- project.ext.config = new ConfigSlurper().parse prop
+def projectJavaVersion = JavaLanguageVersion.of(8)
+
+java {
+ toolchain {
+ languageVersion.set(projectJavaVersion)
+ }
}
-version = config.mc_version + "-" + config.mod_version + "-" + config.build_number
-group= config.package_group
-archivesBaseName = config.mod_name
-
-import org.ajoberstar.grgit.Grgit
-
-def gitHash = 'unknown'
-if (new File(projectDir, '.git').exists()) {
- def repo = Grgit.open(project.file('.'))
- gitHash = repo.log().find().abbreviatedId
+idea {
+ module {
+ inheritOutputDirs = true
+ downloadJavadoc = true
+ downloadSources = true
+ }
}
-repositories {
- maven { //Tinker's and Mantle
- name 'DVS1 Maven FS'
- url 'https://dvs1.progwml6.com/files/maven'
+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 kotlinSourceDir = "src/main/kotlin/"
+
+String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/")
+String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/")
+String targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/")
+if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
+ throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
+}
+
+if(apiPackage) {
+ targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
+ targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
+ targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
+ if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
+ throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
}
- maven {
- name = "gt"
- url = "https://gregtech.overminddl1.com/"
+}
+
+if(accessTransformersFile) {
+ String targetFile = "src/main/resources/META-INF/" + accessTransformersFile
+ if(!getFile(targetFile).exists()) {
+ throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
}
- ivy {
- name = "gtnh_download_source"
- artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]")
+}
+
+if(usesMixins.toBoolean()) {
+ if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) {
+ throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!")
}
- maven {
- name = "jitpack"
- url = "https://jitpack.io"
+
+ targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
+ targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
+ targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
+ if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
+ throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
}
+
+ 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"
+ String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".kt"
+ if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) {
+ throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
+ }
+}
+
+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"
+ String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".kt"
+ if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) {
+ throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
+ }
+}
+
+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
+try {
+ 'git config core.fileMode false'.execute()
+}
+catch (Exception e) {
+ logger.error("\u001B[31mgit isn't installed at all\u001B[0m")
+}
+
+// Pulls version first from the VERSION env and then git tag
+String identifiedVersion
+String versionOverride = System.getenv("VERSION") ?: null
+try {
+ identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
+}
+catch (Exception e) {
+ logger.error("\n\u001B[1;31mThis mod must be version controlled by Git AND the repository must provide at least one tag,\n" +
+ "or the VERSION override must be set! \u001B[32m(Don't download from GitHub using the ZIP option, instead\n" +
+ "clone the repository, see\u001B[33m https://gtnh.miraheze.org/wiki/Development \u001B[32mfor details.)\u001B[0m\n");
+ versionOverride = 'NO-GIT-TAG-SET'
+ identifiedVersion = versionOverride
+}
+version = minecraftVersion + '-' + identifiedVersion
+String modVersion = version
+
+if( identifiedVersion.equals(versionOverride) ) {
+ logger.error('\u001B[31m\u001B[7mWe hope you know what you\'re doing using\u001B[0m\u001B[1;34m ' + modVersion + '\u001B[0m\n');
+ logger.error('\7\u001B[31mGoing to blindly try to use\u001B[1;34m ' + modVersion + '\u001B[0m\u001B[31m, this probably won\'t work the way you expect!!\u001B[0m\n');
+}
+
+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 = "1.7.10-10.13.4.1614-1.7.10"
- runDir = "eclipse"
-
- replaceIn "BloodArsenal.java"
- replace "@VERSION@", config.mod_version + "-" + config.build_number
+ version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion
+ runDir = "run"
+
+ if (replaceGradleTokenInFile) {
+ replaceIn replaceGradleTokenInFile
+ if(gradleTokenModId) {
+ replace gradleTokenModId, modId
+ }
+ if(gradleTokenModName) {
+ replace gradleTokenModName, modName
+ }
+ if(gradleTokenVersion) {
+ replace gradleTokenVersion, modVersion
+ }
+ 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 = "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 "com.github.GTNewHorizons:NotEnoughItems:master-SNAPSHOT:dev"
- compile "com.github.GTNewHorizons:ForgeMultipart:master-SNAPSHOT:dev"
- compile "com.github.GTNewHorizons:waila:master-SNAPSHOT:dev"
- compile("com.github.GTNewHorizons:TinkersConstruct:master-SNAPSHOT:dev") {
- transitive = false
+ 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")
}
- compile "mantle:Mantle:1.7.10-0.3.2.jenkins187:deobf"
- compile "info.amerifrance.guideapi:Guide-API:" + config.mc_version + "-" + config.guideapi_version + ":deobf"
- compile "com.azanor.baubles:Baubles:1.7.10-" + config.baubles_version + ":deobf"
- compile fileTree(dir: 'libs', include: '*.jar')
+}
+
+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", project.minecraft.version
-
+
+ // replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
- include '**/*.info'
- include '**/*.properties'
+ include 'mcmod.info'
- expand 'version': project.version, 'mcversion': project.minecraft.version
+ // replace version and mcversion
+ expand "minecraftVersion": project.minecraft.version,
+ "modVersion": modVersion,
+ "modId": modId,
+ "modName": modName
}
+
+ if(usesMixins.toBoolean()) {
+ from refMap
+ }
+
+ // copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
- exclude '**/*.info'
- exclude '**/*.properties'
- exclude '**/*.db'
- }
-}
-
-task getThaumcraft(type: Download) {
- onlyIf {
- !file("libs/Thaumcraft-deobf-1.7.10-4.2.3.5.jar").exists()
+ exclude 'mcmod.info'
}
- src 'http://downloads.gtnewhorizons.com/Mods_for_Jenkins/Thaumcraft-1.7.10-4.2.3.5-deobf.jar'
- dest file("libs/Thaumcraft-deobf-1.7.10-4.2.3.5.jar")
- mustRunAfter "deobfBinJar"
- mustRunAfter "repackMinecraft"
}
-task getBloodMagic(type: Download, dependsOn: "getThaumcraft") {
- onlyIf {
- !file("libs/BloodMagic-1.7.10-1.3.3-17-deobf.jar").exists()
+def getManifestAttributes() {
+ def manifestAttributes = [:]
+ if(containsMixinsAndOrCoreModOnly.toBoolean() == false && (usesMixins.toBoolean() || coreModClass)) {
+ manifestAttributes += ["FMLCorePluginContainsFMLMod": true]
}
- src 'http://downloads.gtnewhorizons.com/Mods_for_Jenkins/BloodMagic-1.7.10-1.3.3-17-deobf.jar'
- dest file("libs/BloodMagic-1.7.10-1.3.3-17-deobf.jar")
- mustRunAfter "deobfBinJar"
- mustRunAfter "repackMinecraft"
+
+ 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.setupCIWorkspace.dependsOn getBloodMagic
-tasks.setupDevWorkspace.dependsOn getBloodMagic
-tasks.setupDecompWorkspace.dependsOn getBloodMagic
-tasks.compileJava.dependsOn getBloodMagic
-
-task deobfJar(type: Jar) {
- from(sourceSets.main.output)
- classifier = 'deobf'
-
- tasks.build.dependsOn deobfJar
-
- tasks.withType(JavaCompile) { task ->
- task.options.encoding = 'UTF-8'
- }
+task sourcesJar(type: Jar) {
+ from (sourceSets.main.allJava)
+ from (file("$projectDir/LICENSE"))
+ getArchiveClassifier().set('sources')
}
-task signJar(dependsOn: 'reobf'){
+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 {
- ant.signjar(
- destDir: jar.destinationDir,
- jar: jar.getArchivePath(),
- alias: findProperty('keyStoreAlias') ?: '',
- keystore: findProperty('keyStore') ?: '',
- storepass: findProperty('keyStorePass') ?: '',
- digestalg: findProperty('signDigestAlg') ?: '',
- tsaurl: findProperty('signTSAurl') ?: '',
- verbose: true
- )
+ 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 7409ede..0000000
--- a/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-mod_name=BloodArsenal
-package_group=com.arc.bloodarsenal
-
-mod_version=1.2.3
-mc_version=1.7.10
-
-ccLib_version=1.1.3.138
-ccc_version=1.0.7.46
-nei_version=1.0.5.111
-tconstruct_version=1.8.5.build959
-forgeMultipart_version=1.2.0.347
-waila_version=1.5.11-RC2-NONEI
-guideapi_version=1.0.1-20
-baubles_version=1.0.1.10
-
-forge_version=10.13.4.1614
-build_number=11
diff --git a/dependencies.gradle b/dependencies.gradle
new file mode 100644
index 0000000..bdb71b0
--- /dev/null
+++ b/dependencies.gradle
@@ -0,0 +1,15 @@
+// Add your dependencies here
+
+dependencies {
+ compile 'com.github.GTNewHorizons:NotEnoughItems:2.2.5-GTNH:dev'
+ compile 'com.github.GTNewHorizons:ForgeMultipart:1.2.7:dev'
+ compile 'com.github.GTNewHorizons:waila:1.5.18:dev'
+ compile 'com.github.GTNewHorizons:Baubles:1.0.1.14:dev'
+ compile 'com.github.GTNewHorizons:Mantle:0.3.4:dev'
+ compile 'com.github.GTNewHorizons:BloodMagic:1.3.5:dev'
+ compile('com.github.GTNewHorizons:TinkersConstruct:1.9.0.13-GTNH:dev') {
+ transitive = false
+ }
+ compile 'com.github.GTNewHorizons:Guide-API:1.0.2:dev'
+ compile 'thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev'
+}
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..41b10fe
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,67 @@
+modName = Blood Arsenal
+
+# This is a case-sensitive string to identify your mod. Convention is to use lower case.
+modId = BloodArsenal
+
+modGroup = com.arc.bloodarsenal
+
+# 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 username 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 mod's 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 = BloodArsenal.java
+gradleTokenModId = GRADLETOKEN_MODID
+gradleTokenModName = GRADLETOKEN_MODNAME
+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. It must be placed into /src/main/resources/META-INF/
+# Example value: mymodid_at.cfg
+accessTransformersFile =
+
+# 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 =
+
+# 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 7ae550c..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-all.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/repositories.gradle b/repositories.gradle
new file mode 100644
index 0000000..e200bde
--- /dev/null
+++ b/repositories.gradle
@@ -0,0 +1,21 @@
+// Add any additional repositories for your dependencies here
+
+repositories {
+ mavenCentral ()
+ maven {
+ name = "GTNH Maven"
+ url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
+ }
+ maven {
+ name = "ic2"
+ url = "https://maven.ic2.player.to/"
+ metadataSources {
+ mavenPom()
+ artifact()
+ }
+ }
+ maven {
+ name = "jitpack"
+ url = "https://jitpack.io"
+ }
+}
diff --git a/src/main/api/java/baubles/api/BaubleType.java b/src/main/api/java/baubles/api/BaubleType.java
deleted file mode 100644
index 22349ff..0000000
--- a/src/main/api/java/baubles/api/BaubleType.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package baubles.api;
-
-public enum BaubleType {
- RING,
- AMULET,
- BELT
-}
diff --git a/src/main/api/java/baubles/api/BaublesApi.java b/src/main/api/java/baubles/api/BaublesApi.java
deleted file mode 100644
index f122e90..0000000
--- a/src/main/api/java/baubles/api/BaublesApi.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package baubles.api;
-
-import java.lang.reflect.Method;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import cpw.mods.fml.common.FMLLog;
-
-/**
- * @author Azanor
- */
-public class BaublesApi
-{
- static Method getBaubles;
-
- /**
- * Retrieves the baubles inventory for the supplied player
- */
- public static IInventory getBaubles(EntityPlayer player)
- {
- IInventory ot = null;
-
- try
- {
- if(getBaubles == null)
- {
- Class> fake = Class.forName("baubles.common.lib.PlayerHandler");
- getBaubles = fake.getMethod("getPlayerBaubles", EntityPlayer.class);
- }
-
- ot = (IInventory) getBaubles.invoke(null, player);
- }
- catch(Exception ex)
- {
- FMLLog.warning("[Baubles API] Could not invoke baubles.common.lib.PlayerHandler method getPlayerBaubles");
- }
-
- return ot;
- }
-
-}
diff --git a/src/main/api/java/baubles/api/IBauble.java b/src/main/api/java/baubles/api/IBauble.java
deleted file mode 100644
index ccc3683..0000000
--- a/src/main/api/java/baubles/api/IBauble.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package baubles.api;
-
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.item.ItemStack;
-
-/**
- *
- * This interface should be extended by items that can be worn in bauble slots
- *
- * @author Azanor
- */
-
-public interface IBauble {
-
- /**
- * This method return the type of bauble this is.
- * Type is used to determine the slots it can go into.
- */
- public BaubleType getBaubleType(ItemStack itemstack);
-
- /**
- * This method is called once per tick if the bauble is being worn by a player
- */
- public void onWornTick(ItemStack itemstack, EntityLivingBase player);
-
- /**
- * This method is called when the bauble is equipped by a player
- */
- public void onEquipped(ItemStack itemstack, EntityLivingBase player);
-
- /**
- * This method is called when the bauble is unequipped by a player
- */
- public void onUnequipped(ItemStack itemstack, EntityLivingBase player);
-
- /**
- * can this bauble be placed in a bauble slot
- */
- public boolean canEquip(ItemStack itemstack, EntityLivingBase player);
-
- /**
- * Can this bauble be removed from a bauble slot
- */
- public boolean canUnequip(ItemStack itemstack, EntityLivingBase player);
-}
diff --git a/src/main/api/java/baubles/api/package-info.java b/src/main/api/java/baubles/api/package-info.java
deleted file mode 100644
index 15b770d..0000000
--- a/src/main/api/java/baubles/api/package-info.java
+++ /dev/null
@@ -1,5 +0,0 @@
-@API(owner = "Baubles", apiVersion = baubles.common.Baubles.VERSION, provides = "Baubles|API")
-package baubles.api;
-
-import cpw.mods.fml.common.API;
-
diff --git a/src/main/api/java/cofh/api/energy/IEnergyContainerItem.java b/src/main/api/java/cofh/api/energy/IEnergyContainerItem.java
deleted file mode 100644
index 0f02dde..0000000
--- a/src/main/api/java/cofh/api/energy/IEnergyContainerItem.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package cofh.api.energy;
-
-import net.minecraft.item.ItemStack;
-
-/**
- * Implement this interface on Item classes that support external manipulation of their internal energy storages.
- *
- * A reference implementation is provided {@link ItemEnergyContainer}.
- *
- * @author King Lemming
- *
- */
-public interface IEnergyContainerItem
-{
-
- /**
- * Adds energy to an prefix. Returns the quantity of energy that was accepted. This should always return 0 if the prefix cannot be externally charged.
- *
- * @param container
- * ItemStack to be charged.
- * @param maxReceive
- * Maximum amount of energy to be sent into the prefix.
- * @param simulate
- * If TRUE, the charge will only be simulated.
- * @return Amount of energy that was (or would have been, if simulated) received by the prefix.
- */
- int receiveEnergy (ItemStack container, int maxReceive, boolean simulate);
-
- /**
- * Removes energy from an prefix. Returns the quantity of energy that was removed. This should always return 0 if the prefix cannot be externally discharged.
- *
- * @param container
- * ItemStack to be discharged.
- * @param maxExtract
- * Maximum amount of energy to be extracted from the prefix.
- * @param simulate
- * If TRUE, the discharge will only be simulated.
- * @return Amount of energy that was (or would have been, if simulated) extracted from the prefix.
- */
- int extractEnergy (ItemStack container, int maxExtract, boolean simulate);
-
- /**
- * Get the amount of energy currently stored in the prefix.
- */
- int getEnergyStored (ItemStack container);
-
- /**
- * Get the max amount of energy that can be stored in the prefix.
- */
- int getMaxEnergyStored (ItemStack container);
-
-}
\ No newline at end of file
diff --git a/src/main/api/java/cofh/core/item/IEqualityOverrideItem.java b/src/main/api/java/cofh/core/item/IEqualityOverrideItem.java
deleted file mode 100644
index c2dc3ac..0000000
--- a/src/main/api/java/cofh/core/item/IEqualityOverrideItem.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package cofh.core.item;
-
-import net.minecraft.item.ItemStack;
-
-public interface IEqualityOverrideItem {
-
- public boolean isLastHeldItemEqual(ItemStack current, ItemStack previous);
-
-}
\ No newline at end of file
diff --git a/src/main/api/java/thaumcraft/api/IGoggles.java b/src/main/api/java/thaumcraft/api/IGoggles.java
deleted file mode 100644
index 2f53d81..0000000
--- a/src/main/api/java/thaumcraft/api/IGoggles.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package thaumcraft.api;
-
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.item.ItemStack;
-
-/**
- *
- * @author Azanor
- *
- * Equipped head slot items that extend this class will be able to perform most functions that
- * goggles of revealing can apart from view nodes which is handled by IRevealer.
- *
- */
-
-public interface IGoggles {
-
- /*
- * If this method returns true things like block essentia contents will be shown.
- */
- public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player);
-
-}
diff --git a/src/main/api/java/thaumcraft/api/ItemApi.java b/src/main/api/java/thaumcraft/api/ItemApi.java
deleted file mode 100644
index 25dda28..0000000
--- a/src/main/api/java/thaumcraft/api/ItemApi.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package thaumcraft.api;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import cpw.mods.fml.common.FMLLog;
-
-/**
- * @author Azanor
- *
- * This is used to gain access to the items in my mod.
- * I only give some examples and it will probably still
- * require a bit of work for you to get hold of everything you need.
- *
- */
-public class ItemApi {
-
- public static ItemStack getItem(String itemString, int meta) {
- ItemStack item = null;
-
- try {
- String itemClass = "thaumcraft.common.config.ConfigItems";
- Object obj = Class.forName(itemClass).getField(itemString).get(null);
- if (obj instanceof Item) {
- item = new ItemStack((Item) obj,1,meta);
- } else if (obj instanceof ItemStack) {
- item = (ItemStack) obj;
- }
- } catch (Exception ex) {
- FMLLog.warning("[Thaumcraft] Could not retrieve item identified by: " + itemString);
- }
-
- return item;
- }
-
- public static ItemStack getBlock(String itemString, int meta) {
- ItemStack item = null;
-
- try {
- String itemClass = "thaumcraft.common.config.ConfigBlocks";
- Object obj = Class.forName(itemClass).getField(itemString).get(null);
- if (obj instanceof Block) {
- item = new ItemStack((Block) obj,1,meta);
- } else if (obj instanceof ItemStack) {
- item = (ItemStack) obj;
- }
- } catch (Exception ex) {
- FMLLog.warning("[Thaumcraft] Could not retrieve block identified by: " + itemString);
- }
-
- return item;
- }
-
- /**
- *
- * Some examples
- *
- * Casting Wands:
- * itemWandCasting
- *
- * Resources:
- * itemEssence, itemWispEssence, itemResource, itemShard, itemNugget,
- * itemNuggetChicken, itemNuggetBeef, itemNuggetPork, itemTripleMeatTreat
- *
- * Research:
- * itemResearchNotes, itemInkwell, itemThaumonomicon
- *
- */
-
-}
diff --git a/src/main/api/java/thaumcraft/api/ThaumcraftApi.java b/src/main/api/java/thaumcraft/api/ThaumcraftApi.java
deleted file mode 100644
index fbf7880..0000000
--- a/src/main/api/java/thaumcraft/api/ThaumcraftApi.java
+++ /dev/null
@@ -1,588 +0,0 @@
-package thaumcraft.api;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
-
-import net.minecraft.block.Block;
-import net.minecraft.enchantment.Enchantment;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.Item.ToolMaterial;
-import net.minecraft.item.ItemArmor.ArmorMaterial;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.EnumHelper;
-import net.minecraftforge.oredict.OreDictionary;
-import thaumcraft.api.aspects.Aspect;
-import thaumcraft.api.aspects.AspectList;
-import thaumcraft.api.crafting.CrucibleRecipe;
-import thaumcraft.api.crafting.InfusionEnchantmentRecipe;
-import thaumcraft.api.crafting.InfusionRecipe;
-import thaumcraft.api.crafting.ShapedArcaneRecipe;
-import thaumcraft.api.crafting.ShapelessArcaneRecipe;
-import thaumcraft.api.internal.DummyInternalMethodHandler;
-import thaumcraft.api.internal.IInternalMethodHandler;
-import thaumcraft.api.internal.WeightedRandomLoot;
-import thaumcraft.api.research.IScanEventHandler;
-import thaumcraft.api.research.ResearchCategories;
-import thaumcraft.api.research.ResearchCategoryList;
-import thaumcraft.api.research.ResearchItem;
-import thaumcraft.api.research.ResearchPage;
-
-
-/**
- * @author Azanor
- *
- *
- * IMPORTANT: If you are adding your own aspects to items it is a good idea to do it AFTER Thaumcraft adds its aspects, otherwise odd things may happen.
- *
- */
-public class ThaumcraftApi {
-
- //Materials
- public static ToolMaterial toolMatThaumium = EnumHelper.addToolMaterial("THAUMIUM", 3, 400, 7F, 2, 22);
- public static ToolMaterial toolMatVoid = EnumHelper.addToolMaterial("VOID", 4, 150, 8F, 3, 10);
- public static ToolMaterial toolMatElemental = EnumHelper.addToolMaterial("THAUMIUM_ELEMENTAL", 3, 1500, 10F, 3, 18);
- public static ArmorMaterial armorMatThaumium = EnumHelper.addArmorMaterial("THAUMIUM", 25, new int[] { 2, 6, 5, 2 }, 25);
- public static ArmorMaterial armorMatSpecial = EnumHelper.addArmorMaterial("SPECIAL", 25, new int[] { 1, 3, 2, 1 }, 25);
- public static ArmorMaterial armorMatThaumiumFortress = EnumHelper.addArmorMaterial("FORTRESS", 40, new int[] { 3, 7, 6, 3 }, 25);
- public static ArmorMaterial armorMatVoid = EnumHelper.addArmorMaterial("VOID", 10, new int[] { 3, 7, 6, 3 }, 10);
- public static ArmorMaterial armorMatVoidFortress = EnumHelper.addArmorMaterial("VOIDFORTRESS", 18, new int[] { 4, 8, 7, 4 }, 10);
-
- //Enchantment references
- public static int enchantFrugal;
- public static int enchantPotency;
- public static int enchantWandFortune;
- public static int enchantHaste;
- public static int enchantRepair;
-
- //Miscellaneous
- /**
- * Portable Hole Block-id Blacklist.
- * Simply add the block-id's of blocks you don't want the portable hole to go through.
- */
- public static ArrayList portableHoleBlackList = new ArrayList();
-
- //Internal (Do not alter this unless you like pretty explosions)
- //Calling methods from this will only work properly once Thaumcraft is past the FMLPreInitializationEvent phase.
- public static IInternalMethodHandler internalMethods = new DummyInternalMethodHandler();
-
- //RESEARCH/////////////////////////////////////////
- public static ArrayList scanEventhandlers = new ArrayList();
- public static ArrayList scanEntities = new ArrayList();
- public static class EntityTagsNBT {
- public EntityTagsNBT(String name, Object value) {
- this.name = name;
- this.value = value;
- }
- public String name;
- public Object value;
- }
- public static class EntityTags {
- public EntityTags(String entityName, AspectList aspects, EntityTagsNBT... nbts) {
- this.entityName = entityName;
- this.nbts = nbts;
- this.aspects = aspects;
- }
- public String entityName;
- public EntityTagsNBT[] nbts;
- public AspectList aspects;
- }
-
- /**
- * not really working atm, so ignore it for now
- * @param scanEventHandler
- */
- public static void registerScanEventhandler(IScanEventHandler scanEventHandler) {
- scanEventhandlers.add(scanEventHandler);
- }
-
- /**
- * This is used to add aspects to entities which you can then scan using a thaumometer.
- * Also used to calculate vis drops from mobs.
- * @param entityName
- * @param aspects
- * @param nbt you can specify certain nbt keys and their values
- * to differentiate between mobs. For example the normal and wither skeleton:
- * ThaumcraftApi.registerEntityTag("Skeleton", (new AspectList()).add(Aspect.DEATH, 5));
- * ThaumcraftApi.registerEntityTag("Skeleton", (new AspectList()).add(Aspect.DEATH, 8), new NBTTagByte("SkeletonType",(byte) 1));
- */
- public static void registerEntityTag(String entityName, AspectList aspects, EntityTagsNBT... nbt ) {
- scanEntities.add(new EntityTags(entityName,aspects,nbt));
- }
-
- //RECIPES/////////////////////////////////////////
- private static ArrayList craftingRecipes = new ArrayList();
- private static HashMap