Compare commits

...
6 Commits
Author SHA1 Message Date
Raven Szewczyk 581d497c9b Only use GTNH CT APIs when GTNH CraftTweaker is present (#46)
* Update buildscript&dependencies

* Only use GTNH CT APIs when GTNH CraftTweaker is present

* Clean up post-rfg migration

* Add warning to the log
2023-07-04 22:11:37 +01:00
Martin Robertz 480e168dc8 bs+sa 2023-04-28 19:35:28 +02:00
chochemandAlastors 748552a3a5 Remove blood frame from BM (reinvented in magic bees) (#45)
* disable blood frame recipe

* Nuking the Blood Frame

* bs+sa

---------

Co-authored-by: Alastors <[email protected]>
2023-04-28 19:29:25 +02:00
Martin Robertz 6d64513e59 Update dependencies.gradle 2023-04-10 18:36:50 +02:00
Martin Robertz 8232130bb2 Update dependencies.gradle 2023-04-10 18:30:35 +02:00
Raphael 3794eaa8bd fix wrong biomeID (#44) 2023-04-10 18:22:16 +02:00
41 changed files with 352 additions and 454 deletions

No files matched your search

-27
View File
@@ -1,27 +0,0 @@
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
+215 -138
View File
@@ -1,4 +1,4 @@
//version: 1676031737 //version: 1685785062
/* /*
DO NOT CHANGE THIS FILE! DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available. Also, you may replace this file at any time if there is an update available.
@@ -6,32 +6,28 @@
*/ */
import com.diffplug.blowdryer.Blowdryer
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.gtnewhorizons.retrofuturagradle.ObfuscationAttribute import com.gtnewhorizons.retrofuturagradle.ObfuscationAttribute
import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar
import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask
import com.gtnewhorizons.retrofuturagradle.util.Distribution
import com.matthewprenger.cursegradle.CurseArtifact import com.matthewprenger.cursegradle.CurseArtifact
import com.matthewprenger.cursegradle.CurseRelation import com.matthewprenger.cursegradle.CurseRelation
import com.modrinth.minotaur.dependencies.ModDependency import com.modrinth.minotaur.dependencies.ModDependency
import com.modrinth.minotaur.dependencies.VersionDependency import com.modrinth.minotaur.dependencies.VersionDependency
import cpw.mods.fml.relauncher.Side
import org.gradle.api.tasks.options.Option;
import org.gradle.internal.logging.text.StyledTextOutput.Style import org.gradle.internal.logging.text.StyledTextOutput.Style
import org.gradle.internal.logging.text.StyledTextOutputFactory import org.gradle.internal.logging.text.StyledTextOutputFactory
import org.jetbrains.gradle.ext.* import org.gradle.internal.xml.XmlTransformer
import org.jetbrains.gradle.ext.Application
import org.jetbrains.gradle.ext.Gradle
import javax.inject.Inject
import java.nio.file.Files import java.nio.file.Files
import java.nio.file.Paths import java.nio.file.Paths
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream
import javax.inject.Inject
buildscript { buildscript {
repositories { repositories {
mavenLocal()
mavenCentral() mavenCentral()
maven { maven {
@@ -52,6 +48,8 @@ buildscript {
name 'Scala CI dependencies' name 'Scala CI dependencies'
url 'https://repo1.maven.org/maven2/' url 'https://repo1.maven.org/maven2/'
} }
mavenLocal()
} }
} }
plugins { plugins {
@@ -63,22 +61,26 @@ plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false
id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false
id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false
id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version ,unused, available for addon.gradle id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
id 'com.palantir.git-version' version '0.13.0' apply false // 0.13.0 is the last jvm8 supporting version id 'com.palantir.git-version' version '3.0.0' apply false
id 'de.undercouch.download' version '5.3.0' id 'de.undercouch.download' version '5.4.0'
id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle
id 'com.diffplug.spotless' version '6.7.2' apply false id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version
id 'com.modrinth.minotaur' version '2.+' apply false id 'com.modrinth.minotaur' version '2.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id 'com.gtnewhorizons.retrofuturagradle' version '1.1.6' id 'com.gtnewhorizons.retrofuturagradle' version '1.3.14'
} }
print("You might want to check out './gradlew :faq' if your build fails.\n")
boolean settingsupdated = verifySettingsGradle() boolean settingsupdated = verifySettingsGradle()
settingsupdated = verifyGitAttributes() || settingsupdated settingsupdated = verifyGitAttributes() || settingsupdated
if (settingsupdated) if (settingsupdated)
throw new GradleException("Settings has been updated, please re-run task.") throw new GradleException("Settings has been updated, please re-run task.")
if (project.file('.git/HEAD').isFile()) { // In submodules, .git is a file pointing to the real git dir
if (project.file('.git/HEAD').isFile() || project.file('.git').isFile()) {
apply plugin: 'com.palantir.git-version' apply plugin: 'com.palantir.git-version'
} }
@@ -127,7 +129,10 @@ propertyDefaultIfUnset("gradleTokenGroupName", "")
propertyDefaultIfUnset("enableModernJavaSyntax", false) // On by default for new projects only propertyDefaultIfUnset("enableModernJavaSyntax", false) // On by default for new projects only
propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new projects only propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new projects only
project.extensions.add(Blowdryer, "Blowdryer", Blowdryer) // Make blowdryer available in "apply from:" scripts // this is meant to be set using the user wide property file. by default we do nothing.
propertyDefaultIfUnset("ideaOverrideBuildType", "") // Can be nothing, "gradle" or "idea"
project.extensions.add(com.diffplug.blowdryer.Blowdryer, "Blowdryer", com.diffplug.blowdryer.Blowdryer) // Make blowdryer available in "apply from:" scripts
if (!disableSpotless) { if (!disableSpotless) {
apply plugin: 'com.diffplug.spotless' apply plugin: 'com.diffplug.spotless'
apply from: Blowdryer.file('spotless.gradle') apply from: Blowdryer.file('spotless.gradle')
@@ -148,13 +153,21 @@ java {
} else { } else {
languageVersion.set(projectJavaVersion) languageVersion.set(projectJavaVersion)
} }
vendor.set(JvmVendorSpec.ADOPTIUM) vendor.set(JvmVendorSpec.AZUL)
} }
if (!noPublishedSources) { if (!noPublishedSources) {
withSourcesJar() withSourcesJar()
} }
} }
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}
tasks.withType(ScalaCompile).configureEach {
options.encoding = "UTF-8"
}
pluginManager.withPlugin('org.jetbrains.kotlin.jvm') { pluginManager.withPlugin('org.jetbrains.kotlin.jvm') {
// If Kotlin is enabled in the project // If Kotlin is enabled in the project
kotlin { kotlin {
@@ -188,6 +201,14 @@ configurations {
canBeConsumed = false canBeConsumed = false
canBeResolved = false canBeResolved = false
} }
create("devOnlyNonPublishable") {
description = "Runtime and compiletime dependencies that are not published alongside the jar (compileOnly + runtimeOnlyNonPublishable)"
canBeConsumed = false
canBeResolved = false
}
compileOnly.extendsFrom(devOnlyNonPublishable)
runtimeOnlyNonPublishable.extendsFrom(devOnlyNonPublishable)
} }
if (enableModernJavaSyntax.toBoolean()) { if (enableModernJavaSyntax.toBoolean()) {
@@ -201,6 +222,8 @@ if (enableModernJavaSyntax.toBoolean()) {
dependencies { dependencies {
annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0' annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0'
// workaround for https://github.com/bsideup/jabel/issues/174
annotationProcessor 'net.java.dev.jna:jna-platform:5.13.0'
compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') { compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') {
transitive = false // We only care about the 1 annotation class transitive = false // We only care about the 1 annotation class
} }
@@ -217,7 +240,7 @@ if (enableModernJavaSyntax.toBoolean()) {
javaCompiler.set(javaToolchains.compilerFor { javaCompiler.set(javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(17)) languageVersion.set(JavaLanguageVersion.of(17))
vendor.set(JvmVendorSpec.ADOPTIUM) vendor.set(JvmVendorSpec.AZUL)
}) })
} }
} }
@@ -249,12 +272,14 @@ if (apiPackage) {
} }
if (accessTransformersFile) { if (accessTransformersFile) {
String targetFile = "src/main/resources/META-INF/" + accessTransformersFile for (atFile in accessTransformersFile.split(",")) {
if (!getFile(targetFile).exists()) { String targetFile = "src/main/resources/META-INF/" + atFile.trim()
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) if (!getFile(targetFile).exists()) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
}
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile)
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile)
} }
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile)
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile)
} else { } else {
boolean atsFound = false boolean atsFound = false
for (File at : sourceSets.getByName("main").resources.files) { for (File at : sourceSets.getByName("main").resources.files) {
@@ -382,12 +407,14 @@ minecraft {
injectMissingGenerics.set(true) injectMissingGenerics.set(true)
} }
username = developmentEnvironmentUserName.toString()
lwjgl3Version = "3.3.2"
// Enable assertions in the current mod // Enable assertions in the current mod
extraRunJvmArguments.add("-ea:${modGroup}") extraRunJvmArguments.add("-ea:${modGroup}")
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
extraTweakClasses.add("org.spongepowered.asm.launch.MixinTweaker")
if (usesMixinDebug.toBoolean()) { if (usesMixinDebug.toBoolean()) {
extraRunJvmArguments.addAll([ extraRunJvmArguments.addAll([
"-Dmixin.debug.countInjections=true", "-Dmixin.debug.countInjections=true",
@@ -455,8 +482,9 @@ repositories.configureEach { repo ->
apply from: 'repositories.gradle' apply from: 'repositories.gradle'
configurations { configurations {
runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
for (config in [compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath]) { for (config in [compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath]) {
config.extendsFrom(runtimeOnlyNonPublishable)
if (usesShadowedDependencies.toBoolean()) { if (usesShadowedDependencies.toBoolean()) {
config.extendsFrom(shadowImplementation) config.extendsFrom(shadowImplementation)
// TODO: remove Compile after all uses are refactored to Implementation // TODO: remove Compile after all uses are refactored to Implementation
@@ -501,12 +529,11 @@ repositories {
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true allowInsecureProtocol = true
} }
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { maven {
if (usesMixinDebug.toBoolean()) { name 'sonatype'
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/'
name = "Fabric Maven" content {
url = "https://maven.fabricmc.net/" includeGroup "org.lwjgl"
}
} }
} }
if (includeWellKnownRepositories.toBoolean()) { if (includeWellKnownRepositories.toBoolean()) {
@@ -540,29 +567,50 @@ repositories {
} }
} }
def mixinProviderGroup = "io.github.legacymoddingmc"
def mixinProviderModule = "unimixins"
def mixinProviderVersion = "0.1.7.1"
def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
ext.mixinProviderSpec = mixinProviderSpec
dependencies { dependencies {
if (usesMixins.toBoolean()) { if (usesMixins.toBoolean()) {
annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3') annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3')
annotationProcessor('com.google.guava:guava:24.1.1-jre') annotationProcessor('com.google.guava:guava:24.1.1-jre')
annotationProcessor('com.google.code.gson:gson:2.8.6') annotationProcessor('com.google.code.gson:gson:2.8.6')
annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.12:processor') annotationProcessor(mixinProviderSpec)
if (usesMixinDebug.toBoolean()) { if (usesMixinDebug.toBoolean()) {
runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16') runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16')
} }
} }
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { if (usesMixins.toBoolean()) {
implementation('com.gtnewhorizon:gtnhmixins:2.1.12') implementation(mixinProviderSpec)
} else if (forceEnableMixins.toBoolean()) {
runtimeOnlyNonPublishable(mixinProviderSpec)
} }
} }
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') { pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
if (usesMixins.toBoolean()) { if (usesMixins.toBoolean()) {
dependencies { dependencies {
kapt('com.gtnewhorizon:gtnhmixins:2.1.12:processor') kapt(mixinProviderSpec)
} }
} }
} }
// Replace old mixin mods with unimixins
// https://docs.gradle.org/8.0.2/userguide/resolution_rules.html#sec:substitution_with_classifier
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module('com.gtnewhorizon:gtnhmixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
substitute module('com.github.GTNewHorizons:Mixingasm') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier")
}
}
apply from: 'dependencies.gradle' apply from: 'dependencies.gradle'
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json' def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
@@ -667,17 +715,22 @@ ext.java17Toolchain = (JavaToolchainSpec spec) -> {
spec.vendor.set(JvmVendorSpec.matching("jetbrains")) spec.vendor.set(JvmVendorSpec.matching("jetbrains"))
} }
ext.java17DependenciesCfg = configurations.create("java17Dependencies") ext.java17DependenciesCfg = configurations.create("java17Dependencies") {
ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies") extendsFrom(configurations.getByName("runtimeClasspath")) // Ensure consistent transitive dependency resolution
canBeConsumed = false
}
ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies") {
canBeConsumed = false
}
dependencies { dependencies {
def lwjgl3ifyVersion = '1.1.21' def lwjgl3ifyVersion = '1.3.5'
def asmVersion = '9.4' def asmVersion = '9.4'
if (modId != 'lwjgl3ify') { if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
} }
if (modId != 'hodgepodge') { if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.31') java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.13')
} }
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false} java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
@@ -688,14 +741,14 @@ dependencies {
java17PatchDependencies("org.ow2.asm:asm-util:${asmVersion}") java17PatchDependencies("org.ow2.asm:asm-util:${asmVersion}")
java17PatchDependencies('org.ow2.asm:asm-deprecated:7.1') java17PatchDependencies('org.ow2.asm:asm-deprecated:7.1')
java17PatchDependencies("org.apache.commons:commons-lang3:3.12.0") java17PatchDependencies("org.apache.commons:commons-lang3:3.12.0")
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
} }
ext.java17JvmArgs = [ ext.java17JvmArgs = [
// Java 9+ support // Java 9+ support
"--illegal-access=warn", "--illegal-access=warn",
"-Dfile.encoding=UTF-8",
"-Djava.security.manager=allow", "-Djava.security.manager=allow",
"-Dfile.encoding=UTF-8",
"--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED", "--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED",
"--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED",
"--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/java.nio=ALL-UNNAMED",
@@ -706,6 +759,7 @@ ext.java17JvmArgs = [
"--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED",
"--add-opens", "java.base/jdk.internal.reflect=ALL-UNNAMED", "--add-opens", "java.base/jdk.internal.reflect=ALL-UNNAMED",
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens", "jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED,java.naming",
"--add-opens", "java.desktop/sun.awt.image=ALL-UNNAMED", "--add-opens", "java.desktop/sun.awt.image=ALL-UNNAMED",
"--add-modules", "jdk.dynalink", "--add-modules", "jdk.dynalink",
"--add-opens", "jdk.dynalink/jdk.dynalink.beans=ALL-UNNAMED", "--add-opens", "jdk.dynalink/jdk.dynalink.beans=ALL-UNNAMED",
@@ -750,8 +804,8 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
public boolean setEnableHotswap(boolean enable) { enableHotswap = enable } public boolean setEnableHotswap(boolean enable) { enableHotswap = enable }
@Inject @Inject
public RunHotswappableMinecraftTask(Side side, String superTask) { public RunHotswappableMinecraftTask(Distribution side, String superTask, org.gradle.api.invocation.Gradle gradle) {
super(side) super(side, gradle)
this.lwjglVersion = 3 this.lwjglVersion = 3
this.javaLauncher = project.javaToolchains.launcherFor(project.java17Toolchain) this.javaLauncher = project.javaToolchains.launcherFor(project.java17Toolchain)
@@ -759,7 +813,7 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
this.extraJvmArgs.addAll(project.provider(() -> enableHotswap ? project.hotswapJvmArgs : [])) this.extraJvmArgs.addAll(project.provider(() -> enableHotswap ? project.hotswapJvmArgs : []))
this.classpath(project.java17PatchDependenciesCfg) this.classpath(project.java17PatchDependenciesCfg)
if (side == Side.CLIENT) { if (side == Distribution.CLIENT) {
this.classpath(project.minecraftTasks.lwjgl3Configuration) this.classpath(project.minecraftTasks.lwjgl3Configuration)
} }
// Use a raw provider instead of map to not create a dependency on the task // Use a raw provider instead of map to not create a dependency on the task
@@ -768,23 +822,33 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
!file.path.contains("2.9.4-nightly-20150209") // Remove lwjgl2 !file.path.contains("2.9.4-nightly-20150209") // Remove lwjgl2
} }
this.classpath(project.java17DependenciesCfg) this.classpath(project.java17DependenciesCfg)
}
if (!(project.usesMixins.toBoolean() || project.forceEnableMixins.toBoolean())) { public void setup(Project project) {
this.extraArgs.addAll("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker") super.setup(project)
if (project.usesMixins.toBoolean()) {
this.extraJvmArgs.addAll(project.provider(() -> {
def mixinCfg = project.configurations.detachedConfiguration(project.dependencies.create(project.mixinProviderSpec))
mixinCfg.canBeConsumed = false
mixinCfg.transitive = false
enableHotswap ? ["-javaagent:" + mixinCfg.singleFile.absolutePath] : []
}))
} }
} }
} }
def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Side.CLIENT, "runClient") def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient")
runClient17Task.configure { runClient17Task.configure {
setup(project) setup(project)
group = "Modded Minecraft" group = "Modded Minecraft"
description = "Runs the modded client using Java 17, lwjgl3ify and Hodgepodge" description = "Runs the modded client using Java 17, lwjgl3ify and Hodgepodge"
dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar') dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar')
mainClass = "GradleStart" mainClass = "GradleStart"
username = minecraft.username
userUUID = minecraft.userUUID
} }
def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Side.SERVER, "runServer") def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Distribution.DEDICATED_SERVER, "runServer")
runServer17Task.configure { runServer17Task.configure {
setup(project) setup(project)
group = "Modded Minecraft" group = "Modded Minecraft"
@@ -825,11 +889,6 @@ tasks.named("jar", Jar).configure {
} }
if (usesShadowedDependencies.toBoolean()) { if (usesShadowedDependencies.toBoolean()) {
tasks.register('relocateShadowJar', ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = modGroup + ".shadow"
enabled = minimizeShadowedDependencies.toBoolean()
}
tasks.named("shadowJar", ShadowJar).configure { tasks.named("shadowJar", ShadowJar).configure {
manifest { manifest {
attributes(getManifestAttributes()) attributes(getManifestAttributes())
@@ -844,8 +903,9 @@ if (usesShadowedDependencies.toBoolean()) {
project.configurations.shadeCompile project.configurations.shadeCompile
] ]
archiveClassifier.set('dev') archiveClassifier.set('dev')
if (minimizeShadowedDependencies.toBoolean()) { if (relocateShadowedDependencies.toBoolean()) {
dependsOn(relocateShadowJar) relocationPrefix = modGroup + ".shadow"
enableRelocation = true
} }
} }
configurations.runtimeElements.outgoing.artifacts.clear() configurations.runtimeElements.outgoing.artifacts.clear()
@@ -905,6 +965,19 @@ idea {
} }
project { project {
settings { settings {
if (ideaOverrideBuildType != "") {
delegateActions {
if ("gradle".equalsIgnoreCase(ideaOverrideBuildType)) {
delegateBuildRunToGradle = true
testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.GRADLE
} else if ("idea".equalsIgnoreCase(ideaOverrideBuildType)) {
delegateBuildRunToGradle = false
testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM
} else {
throw GradleScriptException('Accepted value for ideaOverrideBuildType is one of gradle or idea.')
}
}
}
runConfigurations { runConfigurations {
"1. Run Client"(Gradle) { "1. Run Client"(Gradle) {
taskNames = ["runClient"] taskNames = ["runClient"]
@@ -943,7 +1016,7 @@ idea {
} }
"Run Client (IJ Native)"(Application) { "Run Client (IJ Native)"(Application) {
mainClass = "GradleStart" mainClass = "GradleStart"
moduleName = project.name + ".main" moduleName = project.name + ".ideVirtualMain"
afterEvaluate { afterEvaluate {
workingDirectory = tasks.runClient.workingDir.absolutePath workingDirectory = tasks.runClient.workingDir.absolutePath
programParameters = tasks.runClient.calculateArgs(project).collect { '"' + it + '"' }.join(' ') programParameters = tasks.runClient.calculateArgs(project).collect { '"' + it + '"' }.join(' ')
@@ -954,7 +1027,7 @@ idea {
} }
"Run Server (IJ Native)"(Application) { "Run Server (IJ Native)"(Application) {
mainClass = "GradleStartServer" mainClass = "GradleStartServer"
moduleName = project.name + ".main" moduleName = project.name + ".ideVirtualMain"
afterEvaluate { afterEvaluate {
workingDirectory = tasks.runServer.workingDir.absolutePath workingDirectory = tasks.runServer.workingDir.absolutePath
programParameters = tasks.runServer.calculateArgs(project).collect { '"' + it + '"' }.join(' ') programParameters = tasks.runServer.calculateArgs(project).collect { '"' + it + '"' }.join(' ')
@@ -966,11 +1039,57 @@ idea {
} }
compiler.javac { compiler.javac {
afterEvaluate { afterEvaluate {
javacAdditionalOptions = "-encoding utf8"
moduleJavacAdditionalOptions = [ moduleJavacAdditionalOptions = [
(project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ') (project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ')
] ]
} }
} }
withIDEADir { File ideaDir ->
if (!ideaDir.path.contains(".idea")) {
// If an .ipr file exists, the project root directory is passed here instead of the .idea subdirectory
ideaDir = new File(ideaDir, ".idea")
}
if (ideaDir.isDirectory()) {
def miscFile = new File(ideaDir, "misc.xml")
if (miscFile.isFile()) {
boolean dirty = false
def miscTransformer = new XmlTransformer()
miscTransformer.addAction { root ->
Node rootNode = root.asNode()
def rootManager = rootNode
.component.find { it.@name == 'ProjectRootManager' }
if (!rootManager) {
rootManager = rootNode.appendNode('component', ['name': 'ProjectRootManager', 'version': '2'])
dirty = true
}
def output = rootManager.output
if (!output) {
output = rootManager.appendNode('output')
dirty = true
}
if (!output.@url) {
// Only modify the output url if it doesn't yet have one, or if the existing one is blank somehow.
// This is a sensible default for most setups
output.@url = 'file://$PROJECT_DIR$/build/ideaBuild'
dirty = true
}
}
def result = miscTransformer.transform(miscFile.text)
if (dirty) {
miscFile.write(result)
}
} else {
miscFile.text = """<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2">
<output url="file://\$PROJECT_DIR\$/out" />
</component>
</project>
"""
}
}
}
} }
} }
} }
@@ -1040,7 +1159,7 @@ if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) {
} }
} }
if (usesMixins.toBoolean()) { if (usesMixins.toBoolean()) {
addModrinthDep("required", "project", "gtnhmixins") addModrinthDep("required", "project", "unimixins")
} }
tasks.modrinth.dependsOn(build) tasks.modrinth.dependsOn(build)
tasks.publish.dependsOn(tasks.modrinth) tasks.publish.dependsOn(tasks.modrinth)
@@ -1084,7 +1203,7 @@ if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null
} }
} }
if (usesMixins.toBoolean()) { if (usesMixins.toBoolean()) {
addCurseForgeRelation("requiredDependency", "gtnhmixins") addCurseForgeRelation("requiredDependency", "unimixins")
} }
tasks.curseforge.dependsOn(build) tasks.curseforge.dependsOn(build)
tasks.publish.dependsOn(tasks.curseforge) tasks.publish.dependsOn(tasks.curseforge)
@@ -1118,10 +1237,21 @@ def addCurseForgeRelation(String type, String name) {
} }
// Updating // Updating
def buildscriptGradleVersion = "8.1.1"
tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion
}
tasks.register('updateBuildScript') { tasks.register('updateBuildScript') {
group = 'GTNH Buildscript' group = 'GTNH Buildscript'
description = 'Updates the build script to the latest version' description = 'Updates the build script to the latest version'
if (gradle.gradleVersion != buildscriptGradleVersion && !Boolean.getBoolean('DISABLE_BUILDSCRIPT_GRADLE_UPDATE')) {
dependsOn('wrapper')
}
doLast { doLast {
if (performBuildScriptUpdate()) return if (performBuildScriptUpdate()) return
@@ -1134,6 +1264,26 @@ if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISA
performBuildScriptUpdate() performBuildScriptUpdate()
} else { } else {
out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'") out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'")
if (gradle.gradleVersion != buildscriptGradleVersion) {
out.style(Style.SuccessHeader).println("updateBuildScript can update gradle from ${gradle.gradleVersion} to ${buildscriptGradleVersion}\n")
}
}
}
// If you want to add more cases to this task, implement them as arguments if total amount to print gets too large
tasks.register('faq') {
group = 'GTNH Buildscript'
description = 'Prints frequently asked questions about building a project'
doLast {
print("If your build fails to fetch dependencies, run './gradlew updateDependencies'. " +
"Or you can manually check if the versions are still on the distributing sites - " +
"the links can be found in repositories.gradle and build.gradle:repositories, " +
"but not build.gradle:buildscript.repositories - those ones are for gradle plugin metadata.\n\n" +
"If your build fails to recognize the syntax of new Java versions, enable Jabel in your " +
"gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties. " +
"However, keep in mind that Jabel enables only syntax features, but not APIs that were introduced in " +
"Java 9 or later.")
} }
} }
@@ -1274,7 +1424,7 @@ static int replaceParams(File file, Map<String, String> params) {
return 0 return 0
} }
// Dependency Deobfuscation // Dependency Deobfuscation (Deprecated, use the new RFG API documented in dependencies.gradle)
def deobf(String sourceURL) { def deobf(String sourceURL) {
try { try {
@@ -1316,11 +1466,7 @@ def deobfMaven(String repoURL, String mavenDep) {
} }
def deobfCurse(String curseDep) { def deobfCurse(String curseDep) {
try { return dependencies.rfg.deobf("curse.maven:$curseDep")
return deobfMaven("https://www.cursemaven.com/", "curse.maven:$curseDep")
} catch (Exception ignored) {
out.style(Style.Failure).println("Failed to get $curseDep from cursemaven.")
}
} }
// The method above is to be preferred. Use this method if the filename is not at the end of the URL. // The method above is to be preferred. Use this method if the filename is not at the end of the URL.
@@ -1328,34 +1474,7 @@ def deobf(String sourceURL, String rawFileName) {
String bon2Version = "2.5.1" String bon2Version = "2.5.1"
String fileName = URLDecoder.decode(rawFileName, "UTF-8") String fileName = URLDecoder.decode(rawFileName, "UTF-8")
String cacheDir = "$project.gradle.gradleUserHomeDir/caches" String cacheDir = "$project.gradle.gradleUserHomeDir/caches"
String bon2Dir = "$cacheDir/forge_gradle/deobf"
String bon2File = "$bon2Dir/BON2-${bon2Version}.jar"
String obfFile = "$cacheDir/modules-2/files-2.1/${fileName}.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)
}
String mappingsVer
String remoteMappings = project.hasProperty('remoteMappings') ? project.remoteMappings : 'https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/'
if (remoteMappings) {
String id = "${forgeVersion.split("\\.")[3]}-$minecraftVersion"
String mappingsZIP = "$cacheDir/forge_gradle/maven_downloader/de/oceanlabs/mcp/mcp_snapshot_nodoc/$id/mcp_snapshot_nodoc-${id}.zip"
zipMappings(mappingsZIP, remoteMappings, bon2Dir)
mappingsVer = "snapshot_$id"
} else {
mappingsVer = "${channel}_$mappingsVersion"
}
download.run {
src "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/com/github/parker8283/BON2/$bon2Version-CUSTOM/BON2-$bon2Version-CUSTOM-all.jar"
dest bon2File
quiet true
overwrite false
}
download.run { download.run {
src sourceURL src sourceURL
@@ -1363,50 +1482,8 @@ def deobf(String sourceURL, String rawFileName) {
quiet true quiet true
overwrite false overwrite false
} }
return dependencies.rfg.deobf(files(obfFile))
exec {
commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', minecraftVersion, '--mappingsVer', mappingsVer, '--notch'
workingDir bon2Dir
standardOutput = new FileOutputStream("${deobfFile}.log")
}
return files(deobfFile)
} }
def zipMappings(String zipPath, String url, String bon2Dir) {
File zipFile = new File(zipPath)
if (zipFile.exists()) {
return
}
String fieldsCache = "$bon2Dir/data/fields.csv"
String methodsCache = "$bon2Dir/data/methods.csv"
download.run {
src "${url}fields.csv"
dest fieldsCache
quiet true
}
download.run {
src "${url}methods.csv"
dest methodsCache
quiet true
}
zipFile.getParentFile().mkdirs()
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))
zos.putNextEntry(new ZipEntry("fields.csv"))
Files.copy(Paths.get(fieldsCache), zos)
zos.closeEntry()
zos.putNextEntry(new ZipEntry("methods.csv"))
Files.copy(Paths.get(methodsCache), zos)
zos.closeEntry()
zos.close()
}
// Helper methods // Helper methods
def checkPropertyExists(String propertyName) { def checkPropertyExists(String propertyName) {
+8 -9
View File
@@ -23,20 +23,19 @@
*/ */
dependencies { dependencies {
api("com.github.GTNewHorizons:waila:1.5.22:dev") api("com.github.GTNewHorizons:waila:1.6.0:dev")
api("com.github.GTNewHorizons:CodeChickenLib:1.1.5.7:dev") api("com.github.GTNewHorizons:NotEnoughItems:2.3.63-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.3.21-GTNH:dev")
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.242:dev") {transitive = false } compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.43.111:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Botania:1.9.14-GTNH:api") {transitive = false } compileOnly("com.github.GTNewHorizons:Botania:1.9.23-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForestryMC:4.5.6:api") {transitive = false } compileOnly("com.github.GTNewHorizons:ForestryMC:4.6.10:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.3.1:dev") {transitive = false } compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.3.4:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Chisel:2.10.16-GTNH:api") {transitive = false } compileOnly("com.github.GTNewHorizons:Chisel:2.11.3-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ZenScript:1.0.0-GTNH") {transitive = false } compileOnly("com.github.GTNewHorizons:ZenScript:1.0.0-GTNH") {transitive = false }
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.2.9:dev") {transitive = false } compileOnly("com.github.GTNewHorizons:CraftTweaker:3.2.12:dev") {transitive = false }
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false } compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false }
compileOnly("curse.maven:guide-api-228832:2287185") {transitive = false } compileOnly("curse.maven:guide-api-228832:2287185") {transitive = false }
+11 -7
View File
@@ -21,16 +21,20 @@ forgeVersion = 10.13.4.1614
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty # Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
developmentEnvironmentUserName = "Developer" developmentEnvironmentUserName = "Developer"
# Define a source file of your project with:
# public static final String VERSION = "GRADLETOKEN_VERSION"; # Generate a class with String fields for the mod id, name, version and group name named with the fields below
# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's generateGradleTokenClass =WayofTime.alchemicalWizardry.Tags
# version in @Mod([...], version = VERSION, [...])
# Leave these properties empty to skip individual token replacements
replaceGradleTokenInFile = AlchemicalWizardry.java
gradleTokenModId = gradleTokenModId =
gradleTokenModName = gradleTokenModName =
gradleTokenVersion = GRADLETOKEN_VERSION gradleTokenVersion = VERSION
gradleTokenGroupName = gradleTokenGroupName =
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-seperated list: Class1.java,Class2.java,Class3.java
# 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 =
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise you can # 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. # leave this property empty.
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000 networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
-7
View File
@@ -1,11 +1,4 @@
// Add any additional repositories for your dependencies here // Add any additional repositories for your dependencies here
repositories { repositories {
maven {
name = "GTNH Maven"
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
}
maven {
url "https://cursemaven.com"
}
} }
@@ -36,10 +36,6 @@ import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import thaumcraft.api.ItemApi;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import WayofTime.alchemicalWizardry.api.BlockStack; import WayofTime.alchemicalWizardry.api.BlockStack;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemicalPotionCreationHandler; import WayofTime.alchemicalWizardry.api.alchemy.AlchemicalPotionCreationHandler;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
@@ -118,7 +114,6 @@ import WayofTime.alchemicalWizardry.common.items.ItemIncense;
import WayofTime.alchemicalWizardry.common.items.ItemMailOrderCatalogue; import WayofTime.alchemicalWizardry.common.items.ItemMailOrderCatalogue;
import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner; import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner;
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour; import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour;
import WayofTime.alchemicalWizardry.common.items.forestry.ItemBloodFrame;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.HoldingPacketHandler; import WayofTime.alchemicalWizardry.common.items.sigil.holding.HoldingPacketHandler;
import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour; import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmEarth; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmEarth;
@@ -297,11 +292,15 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import thaumcraft.api.ItemApi;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
@Mod( @Mod(
modid = "AWWayofTime", modid = "AWWayofTime",
name = "AlchemicalWizardry", name = "AlchemicalWizardry",
version = "GRADLETOKEN_VERSION", version = Tags.VERSION,
dependencies = "after:CodeChickenLib@[1.1.5.7,);" + "after:NotEnoughItems@[2.3.20-GTNH,)", dependencies = "after:CodeChickenLib@[1.1.5.7,);" + "after:NotEnoughItems@[2.3.20-GTNH,)",
guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory") guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory")
public class AlchemicalWizardry { public class AlchemicalWizardry {
@@ -3279,27 +3278,6 @@ public class AlchemicalWizardry {
registerBMBook(); registerBMBook();
} }
if (Loader.isModLoaded("Forestry")) {
isForestryLoaded = true;
ModItems.itemBloodFrame = new ItemBloodFrame().setUnlocalizedName("bloodFrame");
ItemStack provenFrame = GameRegistry.findItemStack("Forestry", "frameImpregnated", 1);
if (provenFrame != null) {
AltarRecipeRegistry.registerAltarRecipe(
new ItemStack(ModItems.itemBloodFrame),
provenFrame,
3,
30000,
20,
20,
false);
}
} else {
isForestryLoaded = false;
}
if (Loader.isModLoaded("harvestcraft")) { if (Loader.isModLoaded("harvestcraft")) {
PamHarvestCompatRegistry.registerPamHandlers(); PamHarvestCompatRegistry.registerPamHandlers();
AlchemicalWizardry.logger.info("Loaded Harvestcraft Handlers!"); AlchemicalWizardry.logger.info("Loaded Harvestcraft Handlers!");
@@ -34,7 +34,6 @@ import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn; import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn;
import net.minecraftforge.event.entity.player.EntityInteractEvent; import net.minecraftforge.event.entity.player.EntityInteractEvent;
import vazkii.botania.api.internal.IManaBurst;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.BloodMagicConfiguration; import WayofTime.alchemicalWizardry.BloodMagicConfiguration;
import WayofTime.alchemicalWizardry.api.BlockStack; import WayofTime.alchemicalWizardry.api.BlockStack;
@@ -59,6 +58,7 @@ import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
import vazkii.botania.api.internal.IManaBurst;
public class AlchemicalWizardryEventHooks { public class AlchemicalWizardryEventHooks {
@@ -1,11 +1,11 @@
package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade; package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade;
import WayofTime.alchemicalWizardry.api.BlockStack;
import com.cricketcraft.chisel.api.carving.CarvingUtils; import com.cricketcraft.chisel.api.carving.CarvingUtils;
import com.cricketcraft.chisel.api.carving.ICarvingGroup; import com.cricketcraft.chisel.api.carving.ICarvingGroup;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import WayofTime.alchemicalWizardry.api.BlockStack;
public class CompatChecks { public class CompatChecks {
public static boolean checkChiselBlock(BlockStack blockStack, String groupName) { public static boolean checkChiselBlock(BlockStack blockStack, String groupName) {
@@ -26,6 +26,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.Int3;
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
@@ -40,9 +43,6 @@ import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.DemonPacketRe
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.DemonType; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.DemonType;
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
public class TEDemonPortal extends TileEntity { public class TEDemonPortal extends TileEntity {
public DemonType type = DemonType.FIRE; public DemonType type = DemonType.FIRE;
@@ -19,13 +19,12 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.ForgeHooks;
import com.google.common.collect.HashMultiset;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.ItemType; import WayofTime.alchemicalWizardry.common.ItemType;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import com.google.common.collect.HashMultiset;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -19,14 +19,13 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.ForgeHooks;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.ItemType; import WayofTime.alchemicalWizardry.common.ItemType;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -20,14 +20,13 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.ForgeHooks;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multimap;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.ItemType; import WayofTime.alchemicalWizardry.common.ItemType;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multimap;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -17,14 +17,13 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import com.google.common.collect.Multimap;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
import WayofTime.alchemicalWizardry.common.IDemon; import WayofTime.alchemicalWizardry.common.IDemon;
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import com.google.common.collect.Multimap;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -20,9 +20,6 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor; import net.minecraftforge.common.ISpecialArmor;
import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.Constants;
import thaumcraft.api.IGoggles;
import thaumcraft.api.IRunicArmor;
import thaumcraft.api.nodes.IRevealer;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles; import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles;
@@ -36,6 +33,9 @@ import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.Optional.Interface; import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.IGoggles;
import thaumcraft.api.IRunicArmor;
import thaumcraft.api.nodes.IRevealer;
@Optional.InterfaceList( @Optional.InterfaceList(
value = { @Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"), value = { @Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"),
@@ -10,12 +10,11 @@ import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaEarth;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap; import com.google.common.collect.Multimap;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaEarth;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -12,12 +12,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaFire;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap; import com.google.common.collect.Multimap;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaFire;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -11,12 +11,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWater;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap; import com.google.common.collect.Multimap;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWater;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -10,12 +10,11 @@ import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWind;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap; import com.google.common.collect.Multimap;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWind;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -1,130 +0,0 @@
package WayofTime.alchemicalWizardry.common.items.forestry;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.apiculture.*;
public class ItemBloodFrame extends EnergyItems implements IHiveFrame {
private final IBeeModifier beeModifier = new BloodFrameBeeModifier();
public ItemBloodFrame() {
super();
this.maxStackSize = 1;
this.setMaxDamage(10);
setEnergyUsed(1000);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
}
private static class BloodFrameBeeModifier implements IBeeModifier {
@Override
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
return 1;
}
@Override
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
return 0.0001f;
}
@Override
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
return 0;
}
@Override
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
return 1;
}
@Override
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
return 1;
}
@Override
public boolean isSealed() {
return false;
}
@Override
public boolean isSelfLighted() {
return false;
}
@Override
public boolean isSunlightSimulated() {
return false;
}
@Override
public boolean isHellish() {
return false;
}
@Override
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
return 1;
}
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.bloodframe.desc"));
if (!(par1ItemStack.getTagCompound() == null)) {
par3List.add(
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
+ par1ItemStack.getTagCompound().getString("ownerName"));
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodFrame");
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) {
if (par1ItemStack.getItemDamage() > 0) {
if (EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
}
}
}
return par1ItemStack;
}
@Override
public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) {
// TODO Auto-generated method stub
if (EnergyItems.canSyphonInContainer(frame, getEnergyUsed() * wear)) {
EnergyItems.syphonWhileInContainer(frame, getEnergyUsed() * wear);
return frame;
} else {
frame.setItemDamage(frame.getItemDamage() + wear);
if (frame.getItemDamage() >= frame.getMaxDamage()) {
return null;
}
return frame;
}
}
@Override
public IBeeModifier getBeeModifier() {
return beeModifier;
}
}
@@ -25,11 +25,10 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.Constants;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -12,17 +12,17 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.IGoggles; import thaumcraft.api.IGoggles;
import thaumcraft.api.IRepairable; import thaumcraft.api.IRepairable;
import thaumcraft.api.IRunicArmor; import thaumcraft.api.IRunicArmor;
import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.IVisDiscountGear;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.nodes.IRevealer; import thaumcraft.api.nodes.IRevealer;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemSanguineArmour extends ItemArmor public class ItemSanguineArmour extends ItemArmor
implements ArmourUpgrade, IGoggles, IVisDiscountGear, IRevealer, IRunicArmor, IRepairable { implements ArmourUpgrade, IGoggles, IVisDiscountGear, IRevealer, IRunicArmor, IRepairable {
@@ -214,7 +214,6 @@ public class RitualEffectBiomeChanger extends RitualEffect {
boolean wantsRain = true; boolean wantsRain = true;
int biomeID = 1; int biomeID = 1;
BiomeGenBase[] biomeList = BiomeGenBase.getBiomeGenArray(); BiomeGenBase[] biomeList = BiomeGenBase.getBiomeGenArray();
int iteration = 0;
for (BiomeGenBase biome : biomeList) { for (BiomeGenBase biome : biomeList) {
if (biome == null) { if (biome == null) {
@@ -227,15 +226,13 @@ public class RitualEffectBiomeChanger extends RitualEffect {
humidity = Math.min(2.0f, Math.max(0.0f, humidity)); humidity = Math.min(2.0f, Math.max(0.0f, humidity));
if (Math.abs(rainfall - humidity) < acceptableRange && Math.abs(temperature - temp) < acceptableRange) { if (Math.abs(rainfall - humidity) < acceptableRange && Math.abs(temperature - temp) < acceptableRange) {
biomeID = iteration; biomeID = biome.biomeID;
if (biomeSkip == 0) { if (biomeSkip == 0) {
break; break;
} else { } else {
biomeSkip--; biomeSkip--;
} }
} }
iteration++;
} }
// Default to Plains if too much biome skip is used // Default to Plains if too much biome skip is used
@@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
public class Meteor { public class Meteor {
@@ -3,9 +3,6 @@ package WayofTime.alchemicalWizardry.common.tileEntity;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.util.List; import java.util.List;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
@@ -42,6 +39,8 @@ import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.compat.BloodMagicWailaPlugin; import WayofTime.alchemicalWizardry.compat.BloodMagicWailaPlugin;
import WayofTime.alchemicalWizardry.compat.IBloodMagicWailaProvider; import WayofTime.alchemicalWizardry.compat.IBloodMagicWailaProvider;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, IBloodAltar, IBloodMagicWailaProvider { public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, IBloodAltar, IBloodMagicWailaProvider {
@@ -5,9 +5,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -41,6 +38,8 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.compat.BloodMagicWailaPlugin; import WayofTime.alchemicalWizardry.compat.BloodMagicWailaPlugin;
import WayofTime.alchemicalWizardry.compat.IBloodMagicWailaProvider; import WayofTime.alchemicalWizardry.compat.IBloodMagicWailaProvider;
import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.common.eventhandler.Event;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
public class TEMasterStone extends TileEntity implements IMasterRitualStone, IBloodMagicWailaProvider { public class TEMasterStone extends TileEntity implements IMasterRitualStone, IBloodMagicWailaProvider {
@@ -9,13 +9,13 @@ import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.common.demonVillage.BuildingSchematic; import WayofTime.alchemicalWizardry.common.demonVillage.BuildingSchematic;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
public class TESchematicSaver extends TileEntity { public class TESchematicSaver extends TileEntity {
public Block targetBlock = ModBlocks.largeBloodStoneBrick; public Block targetBlock = ModBlocks.largeBloodStoneBrick;
@@ -3,9 +3,6 @@ package WayofTime.alchemicalWizardry.common.tileEntity;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@@ -24,6 +21,8 @@ import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.compat.BloodMagicWailaPlugin; import WayofTime.alchemicalWizardry.compat.BloodMagicWailaPlugin;
import WayofTime.alchemicalWizardry.compat.IBloodMagicWailaProvider; import WayofTime.alchemicalWizardry.compat.IBloodMagicWailaProvider;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
public class TETeleposer extends TEInventory implements IBloodMagicWailaProvider { public class TETeleposer extends TEInventory implements IBloodMagicWailaProvider {
@@ -2,9 +2,6 @@ package WayofTime.alchemicalWizardry.common.tileEntity;
import java.util.List; import java.util.List;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@@ -33,6 +30,8 @@ import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.compat.BloodMagicWailaPlugin; import WayofTime.alchemicalWizardry.compat.BloodMagicWailaPlugin;
import WayofTime.alchemicalWizardry.compat.IBloodMagicWailaProvider; import WayofTime.alchemicalWizardry.compat.IBloodMagicWailaProvider;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
public class TEWritingTable extends TEInventory implements ISidedInventory, IBloodMagicWailaProvider { public class TEWritingTable extends TEInventory implements ISidedInventory, IBloodMagicWailaProvider {
@@ -3,16 +3,15 @@ package WayofTime.alchemicalWizardry.common.tweaker;
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStacks; import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStacks;
import net.minecraft.item.ItemStack;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
import minetweaker.IUndoableAction; import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI; import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack; import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass; import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod; import stanhebben.zenscript.annotations.ZenMethod;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
/** /**
* MineTweaker3 Alchemy Recipe Handler by joshie * * MineTweaker3 Alchemy Recipe Handler by joshie *
@@ -2,16 +2,15 @@ package WayofTime.alchemicalWizardry.common.tweaker;
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
import net.minecraft.item.ItemStack;
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe;
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
import minetweaker.IUndoableAction; import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI; import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack; import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass; import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod; import stanhebben.zenscript.annotations.ZenMethod;
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe;
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
/** /**
* MineTweaker3 Binding Recipe Handler by joshie * * MineTweaker3 Binding Recipe Handler by joshie *
@@ -2,17 +2,16 @@ package WayofTime.alchemicalWizardry.common.tweaker;
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
import net.minecraft.item.ItemStack;
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe;
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry;
import minetweaker.IUndoableAction; import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI; import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack; import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.Optional; import stanhebben.zenscript.annotations.Optional;
import stanhebben.zenscript.annotations.ZenClass; import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod; import stanhebben.zenscript.annotations.ZenMethod;
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe;
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry;
/** /**
* MineTweaker3 Blood Altar Recipe Handler by joshie * * MineTweaker3 Blood Altar Recipe Handler by joshie *
@@ -7,19 +7,18 @@ import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.IRecipe;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe; import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
/** /**
* MineTweaker3 Blood Orb Recipe Handler by joshie * * MineTweaker3 Blood Orb Recipe Handler by joshie *
@@ -4,17 +4,16 @@ import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
import java.util.Iterator; import java.util.Iterator;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm; import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
/** /**
* MineTweaker3 Falling Tower Paradigm Handler by hilburn * * MineTweaker3 Falling Tower Paradigm Handler by hilburn *
@@ -1,19 +1,18 @@
package WayofTime.alchemicalWizardry.common.tweaker; package WayofTime.alchemicalWizardry.common.tweaker;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.IPlantable;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry;
import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
import WayofTime.alchemicalWizardry.common.harvest.GenericItemStackHarvestHandler; import WayofTime.alchemicalWizardry.common.harvest.GenericItemStackHarvestHandler;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
/** /**
* MineTweaker3 Harvest Moon Handler by hilburn * * MineTweaker3 Harvest Moon Handler by hilburn *
@@ -4,12 +4,12 @@ import static minetweaker.api.minecraft.MineTweakerMC.getItemStack;
import java.util.ArrayList; import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import minetweaker.api.item.IIngredient; import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack; import minetweaker.api.item.IItemStack;
import minetweaker.api.oredict.IOreDictEntry; import minetweaker.api.oredict.IOreDictEntry;
import net.minecraft.item.ItemStack;
/** /**
* MineTweaker3 Helper by joshie * * MineTweaker3 Helper by joshie *
*/ */
@@ -1,7 +1,13 @@
package WayofTime.alchemicalWizardry.common.tweaker; package WayofTime.alchemicalWizardry.common.tweaker;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.versioning.ArtifactVersion;
import cpw.mods.fml.common.versioning.InvalidVersionSpecificationException;
import cpw.mods.fml.common.versioning.VersionRange;
import minetweaker.MineTweakerAPI; import minetweaker.MineTweakerAPI;
import minetweaker.MineTweakerImplementationAPI; import minetweaker.MineTweakerImplementationAPI;
import minetweaker.mc1710.MineTweakerMod;
import minetweaker.util.IEventHandler; import minetweaker.util.IEventHandler;
/** /**
@@ -17,8 +23,27 @@ public class MineTweakerIntegration {
MineTweakerAPI.registerClass(FallingTower.class); MineTweakerAPI.registerClass(FallingTower.class);
MineTweakerAPI.registerClass(HarvestMoon.class); MineTweakerAPI.registerClass(HarvestMoon.class);
MineTweakerImplementationAPI.onRollbackEvent(new HandleLateAdditionsAndRemovals());
MineTweakerImplementationAPI.onPostReload(new HandleLateAdditionsAndRemovals()); MineTweakerImplementationAPI.onPostReload(new HandleLateAdditionsAndRemovals());
// GTNH-Only features (post 3.1.0)
final ArtifactVersion mtVersion = Loader.instance().getIndexedModList().get(MineTweakerMod.MODID)
.getProcessedVersion();
try {
if (VersionRange.createFromVersionSpec("[3.2.4,)").containsVersion(mtVersion)) {
GTNHIntegration.register();
} else {
AlchemicalWizardry.logger.warn(
"Non-GTNH MineTweaker (CraftTweaker) version detected, late recipe additions and removals won't work correctly");
}
} catch (InvalidVersionSpecificationException e) {
throw new RuntimeException(e);
}
}
public static class GTNHIntegration {
public static void register() {
MineTweakerImplementationAPI.onRollbackEvent(new HandleLateAdditionsAndRemovals());
}
} }
public static class HandleLateAdditionsAndRemovals public static class HandleLateAdditionsAndRemovals
@@ -1,12 +1,12 @@
package WayofTime.alchemicalWizardry.compat; package WayofTime.alchemicalWizardry.compat;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.api.IWailaRegistrar;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.event.FMLInterModComms;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.api.IWailaRegistrar;
public class BloodMagicWailaPlugin { public class BloodMagicWailaPlugin {
@@ -2,16 +2,16 @@ package WayofTime.alchemicalWizardry.compat;
import java.util.List; import java.util.List;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class BloodMagicWailaProvider implements IWailaDataProvider { public class BloodMagicWailaProvider implements IWailaDataProvider {
@Override @Override
@@ -2,15 +2,15 @@ package WayofTime.alchemicalWizardry.compat;
import java.util.List; import java.util.List;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
public interface IBloodMagicWailaProvider { public interface IBloodMagicWailaProvider {
default void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, default void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,