mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-15 17:44:55 +00:00
Compare commits
5
Commits
4.6.11-pre
...
4.6.14
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf6bf6846a | ||
|
|
ba6f1d6249 | ||
|
|
64e861af85 | ||
|
|
27a4d86108 | ||
|
|
afc859c6e9 |
No files matched your search
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
RUNDIR="run"
|
||||
CRASH="crash-reports"
|
||||
SERVERLOG="server.log"
|
||||
|
||||
if [[ -d $RUNDIR/$CRASH ]]; then
|
||||
echo "Crash reports detected:"
|
||||
cat $RUNDIR/$CRASH/crash*.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet "Fatal errors were detected" $SERVERLOG; 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" $SERVERLOG; then
|
||||
echo "Server force stopped:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep --quiet -Po '.+Done \(.+\)\! For help, type "help" or "\?"' $SERVERLOG; then
|
||||
echo "Server didn't finish startup:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "No crash reports detected"
|
||||
exit 0
|
||||
|
||||
+238
-178
@@ -1,4 +1,4 @@
|
||||
//version: 1678003329
|
||||
//version: 1691351470
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
@@ -6,29 +6,25 @@
|
||||
*/
|
||||
|
||||
|
||||
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.gtnewhorizons.retrofuturagradle.ObfuscationAttribute
|
||||
import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar
|
||||
import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask
|
||||
import com.gtnewhorizons.retrofuturagradle.util.Distribution
|
||||
import com.matthewprenger.cursegradle.CurseArtifact
|
||||
import com.matthewprenger.cursegradle.CurseRelation
|
||||
import com.modrinth.minotaur.dependencies.ModDependency
|
||||
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.StyledTextOutputFactory
|
||||
import org.gradle.internal.xml.XmlTransformer
|
||||
import org.jetbrains.gradle.ext.*
|
||||
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.Paths
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.zip.ZipEntry
|
||||
import java.util.zip.ZipOutputStream
|
||||
import javax.inject.Inject
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
@@ -65,22 +61,26 @@ plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' 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 '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.palantir.git-version' version '0.13.0' apply false // 0.13.0 is the last jvm8 supporting version
|
||||
id 'de.undercouch.download' version '5.3.0'
|
||||
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 '8.1.1' apply false
|
||||
id 'com.palantir.git-version' version '3.0.0' apply false
|
||||
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.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.matthewprenger.cursegradle' version '1.4.0' apply false
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.2.3'
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.24'
|
||||
}
|
||||
|
||||
print("You might want to check out './gradlew :faq' if your build fails.\n")
|
||||
|
||||
boolean settingsupdated = verifySettingsGradle()
|
||||
settingsupdated = verifyGitAttributes() || settingsupdated
|
||||
if (settingsupdated)
|
||||
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'
|
||||
}
|
||||
|
||||
@@ -115,6 +115,8 @@ propertyDefaultIfUnset("usesMixinDebug", project.usesMixins)
|
||||
propertyDefaultIfUnset("forceEnableMixins", false)
|
||||
propertyDefaultIfUnset("channel", "stable")
|
||||
propertyDefaultIfUnset("mappingsVersion", "12")
|
||||
propertyDefaultIfUnset("usesMavenPublishing", true)
|
||||
propertyDefaultIfUnset("mavenPublishUrl", "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases")
|
||||
propertyDefaultIfUnset("modrinthProjectId", "")
|
||||
propertyDefaultIfUnset("modrinthRelations", "")
|
||||
propertyDefaultIfUnset("curseForgeProjectId", "")
|
||||
@@ -132,7 +134,7 @@ propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new
|
||||
// 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(Blowdryer, "Blowdryer", Blowdryer) // Make blowdryer available in "apply from:" scripts
|
||||
project.extensions.add(com.diffplug.blowdryer.Blowdryer, "Blowdryer", com.diffplug.blowdryer.Blowdryer) // Make blowdryer available in "apply from:" scripts
|
||||
if (!disableSpotless) {
|
||||
apply plugin: 'com.diffplug.spotless'
|
||||
apply from: Blowdryer.file('spotless.gradle')
|
||||
@@ -160,6 +162,14 @@ java {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
tasks.withType(ScalaCompile).configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.jvm') {
|
||||
// If Kotlin is enabled in the project
|
||||
kotlin {
|
||||
@@ -193,6 +203,14 @@ configurations {
|
||||
canBeConsumed = 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()) {
|
||||
@@ -206,6 +224,8 @@ if (enableModernJavaSyntax.toBoolean()) {
|
||||
|
||||
dependencies {
|
||||
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') {
|
||||
transitive = false // We only care about the 1 annotation class
|
||||
}
|
||||
@@ -339,7 +359,27 @@ catch (Exception ignored) {
|
||||
String identifiedVersion
|
||||
String versionOverride = System.getenv("VERSION") ?: null
|
||||
try {
|
||||
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
|
||||
// Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty
|
||||
if (versionOverride == null) {
|
||||
def gitDetails = versionDetails()
|
||||
def isDirty = gitVersion().endsWith(".dirty") // No public API for this, isCleanTag has a different meaning
|
||||
String branchName = gitDetails.branchName ?: (System.getenv('GIT_BRANCH') ?: 'git')
|
||||
if (branchName.startsWith('origin/')) {
|
||||
branchName = branchName.minus('origin/')
|
||||
}
|
||||
branchName = branchName.replaceAll("[^a-zA-Z0-9-]+", "-") // sanitize branch names for semver
|
||||
identifiedVersion = gitDetails.lastTag ?: '${gitDetails.gitHash}'
|
||||
if (gitDetails.commitDistance > 0) {
|
||||
identifiedVersion += "-${branchName}.${gitDetails.commitDistance}+${gitDetails.gitHash}"
|
||||
if (isDirty) {
|
||||
identifiedVersion += "-dirty"
|
||||
}
|
||||
} else if (isDirty) {
|
||||
identifiedVersion += "-${branchName}+${gitDetails.gitHash}-dirty"
|
||||
}
|
||||
} else {
|
||||
identifiedVersion = versionOverride
|
||||
}
|
||||
}
|
||||
catch (Exception ignored) {
|
||||
out.style(Style.Failure).text(
|
||||
@@ -361,9 +401,13 @@ if (identifiedVersion == versionOverride) {
|
||||
|
||||
group = "com.github.GTNewHorizons"
|
||||
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
|
||||
archivesBaseName = customArchiveBaseName
|
||||
base {
|
||||
archivesName = customArchiveBaseName
|
||||
}
|
||||
} else {
|
||||
archivesBaseName = modId
|
||||
base {
|
||||
archivesName = modId
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -391,14 +435,12 @@ minecraft {
|
||||
|
||||
username = developmentEnvironmentUserName.toString()
|
||||
|
||||
lwjgl3Version = "3.3.2-SNAPSHOT"
|
||||
lwjgl3Version = "3.3.2"
|
||||
|
||||
// Enable assertions in the current mod
|
||||
extraRunJvmArguments.add("-ea:${modGroup}")
|
||||
|
||||
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
|
||||
extraTweakClasses.add("org.spongepowered.asm.launch.MixinTweaker")
|
||||
|
||||
if (usesMixinDebug.toBoolean()) {
|
||||
extraRunJvmArguments.addAll([
|
||||
"-Dmixin.debug.countInjections=true",
|
||||
@@ -449,10 +491,19 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
if (file('addon.gradle').exists()) {
|
||||
if (file('addon.gradle.kts').exists()) {
|
||||
apply from: 'addon.gradle.kts'
|
||||
} else if (file('addon.gradle').exists()) {
|
||||
apply from: 'addon.gradle'
|
||||
}
|
||||
|
||||
// File for local tweaks not commited to Git
|
||||
if (file('addon.local.gradle.kts').exists()) {
|
||||
apply from: 'addon.local.gradle.kts'
|
||||
} else if (file('addon.local.gradle').exists()) {
|
||||
apply from: 'addon.local.gradle'
|
||||
}
|
||||
|
||||
// Allow unsafe repos but warn
|
||||
repositories.configureEach { repo ->
|
||||
if (repo instanceof org.gradle.api.artifacts.repositories.UrlArtifactRepository) {
|
||||
@@ -463,7 +514,14 @@ repositories.configureEach { repo ->
|
||||
}
|
||||
}
|
||||
|
||||
apply from: 'repositories.gradle'
|
||||
if (file('repositories.gradle.kts').exists()) {
|
||||
apply from: 'repositories.gradle.kts'
|
||||
} else if (file('repositories.gradle').exists()) {
|
||||
apply from: 'repositories.gradle'
|
||||
} else {
|
||||
logger.error("Neither repositories.gradle.kts nor repositories.gradle was found, make sure you extracted the full ExampleMod template.")
|
||||
throw new RuntimeException("Missing repositories.gradle[.kts]")
|
||||
}
|
||||
|
||||
configurations {
|
||||
runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
|
||||
@@ -513,14 +571,6 @@ repositories {
|
||||
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
allowInsecureProtocol = true
|
||||
}
|
||||
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
|
||||
if (usesMixinDebug.toBoolean()) {
|
||||
maven {
|
||||
name = "Fabric Maven"
|
||||
url = "https://maven.fabricmc.net/"
|
||||
}
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name 'sonatype'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots/'
|
||||
@@ -529,13 +579,28 @@ repositories {
|
||||
}
|
||||
}
|
||||
if (includeWellKnownRepositories.toBoolean()) {
|
||||
maven {
|
||||
name "CurseMaven"
|
||||
url "https://cursemaven.com"
|
||||
content {
|
||||
exclusiveContent {
|
||||
forRepository {
|
||||
maven {
|
||||
name "CurseMaven"
|
||||
url "https://cursemaven.com"
|
||||
}
|
||||
}
|
||||
filter {
|
||||
includeGroup "curse.maven"
|
||||
}
|
||||
}
|
||||
exclusiveContent {
|
||||
forRepository {
|
||||
maven {
|
||||
name = "Modrinth"
|
||||
url = "https://api.modrinth.com/maven"
|
||||
}
|
||||
}
|
||||
filter {
|
||||
includeGroup "maven.modrinth"
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "ic2"
|
||||
url = "https://maven.ic2.player.to/"
|
||||
@@ -559,35 +624,78 @@ 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
|
||||
|
||||
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
|
||||
|
||||
dependencies {
|
||||
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('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
|
||||
annotationProcessor(mixinProviderSpec)
|
||||
if (usesMixinDebug.toBoolean()) {
|
||||
runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16')
|
||||
}
|
||||
}
|
||||
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
|
||||
implementation('com.gtnewhorizon:gtnhmixins:2.1.13')
|
||||
if (usesMixins.toBoolean()) {
|
||||
implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap))
|
||||
} else if (forceEnableMixins.toBoolean()) {
|
||||
runtimeOnlyNonPublishable(mixinProviderSpec)
|
||||
}
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
|
||||
if (usesMixins.toBoolean()) {
|
||||
dependencies {
|
||||
kapt('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
|
||||
kapt(mixinProviderSpec)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apply from: 'dependencies.gradle'
|
||||
// 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")
|
||||
}
|
||||
}
|
||||
|
||||
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
|
||||
def mixinTmpDir = buildDir.path + File.separator + 'tmp' + File.separator + 'mixins'
|
||||
def refMap = "${mixinTmpDir}" + File.separator + mixingConfigRefMap
|
||||
def mixinSrg = "${mixinTmpDir}" + File.separator + "mixins.srg"
|
||||
dependencies {
|
||||
constraints {
|
||||
def minGtnhLibVersion = "0.0.13"
|
||||
implementation("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") {
|
||||
because("fixes duplicate mod errors in java 17 configurations using old gtnhlib")
|
||||
}
|
||||
runtimeOnly("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") {
|
||||
because("fixes duplicate mod errors in java 17 configurations using old gtnhlib")
|
||||
}
|
||||
devOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") {
|
||||
because("fixes duplicate mod errors in java 17 configurations using old gtnhlib")
|
||||
}
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") {
|
||||
because("fixes duplicate mod errors in java 17 configurations using old gtnhlib")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (file('dependencies.gradle.kts').exists()) {
|
||||
apply from: 'dependencies.gradle.kts'
|
||||
} else if (file('dependencies.gradle').exists()) {
|
||||
apply from: 'dependencies.gradle'
|
||||
} else {
|
||||
logger.error("Neither dependencies.gradle.kts nor dependencies.gradle was found, make sure you extracted the full ExampleMod template.")
|
||||
throw new RuntimeException("Missing dependencies.gradle[.kts]")
|
||||
}
|
||||
|
||||
tasks.register('generateAssets') {
|
||||
group = "GTNH Buildscript"
|
||||
@@ -619,46 +727,17 @@ tasks.register('generateAssets') {
|
||||
}
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
tasks.named("reobfJar", ReobfuscatedJar).configure {
|
||||
extraSrgFiles.from(mixinSrg)
|
||||
}
|
||||
|
||||
tasks.named("processResources").configure {
|
||||
dependsOn("generateAssets")
|
||||
}
|
||||
|
||||
tasks.named("compileJava", JavaCompile).configure {
|
||||
doFirst {
|
||||
new File(mixinTmpDir).mkdirs()
|
||||
}
|
||||
options.compilerArgs += [
|
||||
"-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}",
|
||||
"-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"
|
||||
]
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
|
||||
kapt {
|
||||
correctErrorTypes = true
|
||||
javacOptions {
|
||||
option("-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}")
|
||||
option("-AoutSrgFile=$mixinSrg")
|
||||
option("-AoutRefMapFile=$refMap")
|
||||
}
|
||||
}
|
||||
tasks.configureEach { task ->
|
||||
if (task.name == "kaptKotlin") {
|
||||
task.doFirst {
|
||||
new File(mixinTmpDir).mkdirs()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tasks.named("processResources", ProcessResources).configure {
|
||||
@@ -676,7 +755,6 @@ tasks.named("processResources", ProcessResources).configure {
|
||||
}
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
from refMap
|
||||
dependsOn("compileJava", "compileScala")
|
||||
}
|
||||
}
|
||||
@@ -695,16 +773,16 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def lwjgl3ifyVersion = '1.1.35'
|
||||
def lwjgl3ifyVersion = '1.4.0'
|
||||
def asmVersion = '9.4'
|
||||
if (modId != 'lwjgl3ify') {
|
||||
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
|
||||
}
|
||||
if (modId != 'hodgepodge') {
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.40')
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.26')
|
||||
}
|
||||
|
||||
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
|
||||
java17PatchDependencies('net.minecraft:launchwrapper:1.17.2') {transitive = false}
|
||||
java17PatchDependencies("org.ow2.asm:asm:${asmVersion}")
|
||||
java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}")
|
||||
java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}")
|
||||
@@ -775,7 +853,7 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
|
||||
public boolean setEnableHotswap(boolean enable) { enableHotswap = enable }
|
||||
|
||||
@Inject
|
||||
public RunHotswappableMinecraftTask(Side side, String superTask, org.gradle.api.invocation.Gradle gradle) {
|
||||
public RunHotswappableMinecraftTask(Distribution side, String superTask, org.gradle.api.invocation.Gradle gradle) {
|
||||
super(side, gradle)
|
||||
|
||||
this.lwjglVersion = 3
|
||||
@@ -784,7 +862,7 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
|
||||
this.extraJvmArgs.addAll(project.provider(() -> enableHotswap ? project.hotswapJvmArgs : []))
|
||||
|
||||
this.classpath(project.java17PatchDependenciesCfg)
|
||||
if (side == Side.CLIENT) {
|
||||
if (side == Distribution.CLIENT) {
|
||||
this.classpath(project.minecraftTasks.lwjgl3Configuration)
|
||||
}
|
||||
// Use a raw provider instead of map to not create a dependency on the task
|
||||
@@ -793,14 +871,22 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
|
||||
!file.path.contains("2.9.4-nightly-20150209") // Remove lwjgl2
|
||||
}
|
||||
this.classpath(project.java17DependenciesCfg)
|
||||
}
|
||||
|
||||
if (!(project.usesMixins.toBoolean() || project.forceEnableMixins.toBoolean())) {
|
||||
this.extraArgs.addAll("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker")
|
||||
public void setup(Project project) {
|
||||
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 {
|
||||
setup(project)
|
||||
group = "Modded Minecraft"
|
||||
@@ -811,7 +897,7 @@ runClient17Task.configure {
|
||||
userUUID = minecraft.userUUID
|
||||
}
|
||||
|
||||
def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Side.SERVER, "runServer")
|
||||
def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Distribution.DEDICATED_SERVER, "runServer")
|
||||
runServer17Task.configure {
|
||||
setup(project)
|
||||
group = "Modded Minecraft"
|
||||
@@ -852,11 +938,6 @@ tasks.named("jar", Jar).configure {
|
||||
}
|
||||
|
||||
if (usesShadowedDependencies.toBoolean()) {
|
||||
tasks.register('relocateShadowJar', ConfigureShadowRelocation) {
|
||||
target = tasks.shadowJar
|
||||
prefix = modGroup + ".shadow"
|
||||
enabled = relocateShadowedDependencies.toBoolean()
|
||||
}
|
||||
tasks.named("shadowJar", ShadowJar).configure {
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
@@ -872,7 +953,8 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
]
|
||||
archiveClassifier.set('dev')
|
||||
if (relocateShadowedDependencies.toBoolean()) {
|
||||
dependsOn(relocateShadowJar)
|
||||
relocationPrefix = modGroup + ".shadow"
|
||||
enableRelocation = true
|
||||
}
|
||||
}
|
||||
configurations.runtimeElements.outgoing.artifacts.clear()
|
||||
@@ -946,6 +1028,9 @@ idea {
|
||||
}
|
||||
}
|
||||
runConfigurations {
|
||||
"0. Build and Test"(Gradle) {
|
||||
taskNames = ["build"]
|
||||
}
|
||||
"1. Run Client"(Gradle) {
|
||||
taskNames = ["runClient"]
|
||||
}
|
||||
@@ -1006,6 +1091,7 @@ idea {
|
||||
}
|
||||
compiler.javac {
|
||||
afterEvaluate {
|
||||
javacAdditionalOptions = "-encoding utf8"
|
||||
moduleJavacAdditionalOptions = [
|
||||
(project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ')
|
||||
]
|
||||
@@ -1064,6 +1150,14 @@ tasks.named("processIdeaSettings").configure {
|
||||
dependsOn("injectTags")
|
||||
}
|
||||
|
||||
tasks.named("ideVirtualMainClasses").configure {
|
||||
// Make IntelliJ "Build project" build the mod jars
|
||||
dependsOn("jar", "reobfJar")
|
||||
if (!disableSpotless) {
|
||||
dependsOn("spotlessCheck")
|
||||
}
|
||||
}
|
||||
|
||||
// workaround variable hiding in pom processing
|
||||
def projectConfigs = project.configurations
|
||||
|
||||
@@ -1084,12 +1178,14 @@ publishing {
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases"
|
||||
allowInsecureProtocol = true
|
||||
credentials {
|
||||
username = System.getenv("MAVEN_USER") ?: "NONE"
|
||||
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
|
||||
if (usesMavenPublishing.toBoolean()) {
|
||||
maven {
|
||||
url = mavenPublishUrl
|
||||
allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven
|
||||
credentials {
|
||||
username = System.getenv("MAVEN_USER") ?: "NONE"
|
||||
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1125,7 +1221,7 @@ if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) {
|
||||
}
|
||||
}
|
||||
if (usesMixins.toBoolean()) {
|
||||
addModrinthDep("required", "project", "gtnhmixins")
|
||||
addModrinthDep("required", "project", "unimixins")
|
||||
}
|
||||
tasks.modrinth.dependsOn(build)
|
||||
tasks.publish.dependsOn(tasks.modrinth)
|
||||
@@ -1169,7 +1265,7 @@ if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null
|
||||
}
|
||||
}
|
||||
if (usesMixins.toBoolean()) {
|
||||
addCurseForgeRelation("requiredDependency", "gtnhmixins")
|
||||
addCurseForgeRelation("requiredDependency", "unimixins")
|
||||
}
|
||||
tasks.curseforge.dependsOn(build)
|
||||
tasks.publish.dependsOn(tasks.curseforge)
|
||||
@@ -1204,7 +1300,7 @@ def addCurseForgeRelation(String type, String name) {
|
||||
|
||||
// Updating
|
||||
|
||||
def buildscriptGradleVersion = "8.0.1"
|
||||
def buildscriptGradleVersion = "8.2.1"
|
||||
|
||||
tasks.named('wrapper', Wrapper).configure {
|
||||
gradleVersion = buildscriptGradleVersion
|
||||
@@ -1236,6 +1332,23 @@ if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISA
|
||||
}
|
||||
}
|
||||
|
||||
// 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.")
|
||||
}
|
||||
}
|
||||
|
||||
static URL availableBuildScriptUrl() {
|
||||
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/build.gradle")
|
||||
}
|
||||
@@ -1293,8 +1406,14 @@ boolean isNewBuildScriptVersionAvailable() {
|
||||
|
||||
String currentBuildScript = getFile("build.gradle").getText()
|
||||
String currentBuildScriptHash = getVersionHash(currentBuildScript)
|
||||
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
|
||||
String availableBuildScriptHash = getVersionHash(availableBuildScript)
|
||||
String availableBuildScriptHash
|
||||
try {
|
||||
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
|
||||
availableBuildScriptHash = getVersionHash(availableBuildScript)
|
||||
} catch (IOException e) {
|
||||
logger.warn("Could not check for buildscript update availability: {}", e.message)
|
||||
return false
|
||||
}
|
||||
|
||||
boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
|
||||
return !isUpToDate
|
||||
@@ -1373,7 +1492,7 @@ static int replaceParams(File file, Map<String, String> params) {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Dependency Deobfuscation
|
||||
// Dependency Deobfuscation (Deprecated, use the new RFG API documented in dependencies.gradle)
|
||||
|
||||
def deobf(String sourceURL) {
|
||||
try {
|
||||
@@ -1415,11 +1534,7 @@ def deobfMaven(String repoURL, String mavenDep) {
|
||||
}
|
||||
|
||||
def deobfCurse(String curseDep) {
|
||||
try {
|
||||
return deobfMaven("https://www.cursemaven.com/", "curse.maven:$curseDep")
|
||||
} catch (Exception ignored) {
|
||||
out.style(Style.Failure).println("Failed to get $curseDep from cursemaven.")
|
||||
}
|
||||
return dependencies.rfg.deobf("curse.maven:$curseDep")
|
||||
}
|
||||
|
||||
// The method above is to be preferred. Use this method if the filename is not at the end of the URL.
|
||||
@@ -1427,34 +1542,7 @@ def deobf(String sourceURL, String rawFileName) {
|
||||
String bon2Version = "2.5.1"
|
||||
String fileName = URLDecoder.decode(rawFileName, "UTF-8")
|
||||
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 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 {
|
||||
src sourceURL
|
||||
@@ -1462,50 +1550,8 @@ def deobf(String sourceURL, String rawFileName) {
|
||||
quiet true
|
||||
overwrite false
|
||||
}
|
||||
|
||||
exec {
|
||||
commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', minecraftVersion, '--mappingsVer', mappingsVer, '--notch'
|
||||
workingDir bon2Dir
|
||||
standardOutput = new FileOutputStream("${deobfFile}.log")
|
||||
}
|
||||
|
||||
return files(deobfFile)
|
||||
return dependencies.rfg.deobf(files(obfFile))
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
def checkPropertyExists(String propertyName) {
|
||||
@@ -1532,3 +1578,17 @@ def getSecondaryArtifacts() {
|
||||
if (apiPackage) secondaryArtifacts += [apiJar]
|
||||
return secondaryArtifacts
|
||||
}
|
||||
|
||||
// For easier scripting of things that require variables defined earlier in the buildscript
|
||||
if (file('addon.late.gradle.kts').exists()) {
|
||||
apply from: 'addon.late.gradle.kts'
|
||||
} else if (file('addon.late.gradle').exists()) {
|
||||
apply from: 'addon.late.gradle'
|
||||
}
|
||||
|
||||
// File for local tweaks not commited to Git
|
||||
if (file('addon.late.local.gradle.kts').exists()) {
|
||||
apply from: 'addon.late.local.gradle.kts'
|
||||
} else if (file('addon.late.local.gradle').exists()) {
|
||||
apply from: 'addon.late.local.gradle'
|
||||
}
|
||||
+5
-7
@@ -1,12 +1,10 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.45-GTNH:dev')
|
||||
compile('com.github.GTNewHorizons:inventory-tweaks:1.5.14:api')
|
||||
compile('com.github.GTNewHorizons:BuildCraft:7.1.27:api')
|
||||
compile('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
|
||||
compile('curse.maven:cofh-lib-220333:2388748')
|
||||
|
||||
api('curse.maven:cofh-lib-220333:2388748')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.3.81-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:inventory-tweaks:1.5.16:api')
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.36:api')
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
compileOnly('curse.maven:craftguide-75557:2459320')
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -85,9 +85,6 @@ done
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# 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
|
||||
|
||||
@@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# 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"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
|
||||
@@ -1,26 +1,4 @@
|
||||
// Add any additional repositiroes for your dependencies here
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name 'GTNH Maven'
|
||||
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
|
||||
allowInsecureProtocol
|
||||
}
|
||||
maven {
|
||||
name 'ic2'
|
||||
url 'http://maven.ic2.player.to/'
|
||||
metadataSources {
|
||||
mavenPom()
|
||||
artifact()
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url 'https://cursemaven.com'
|
||||
content {
|
||||
includeGroup 'curse.maven'
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url 'https://jitpack.io'
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public class DefaultBeeModifier implements IBeeModifier {
|
||||
}
|
||||
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 1.0f;
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.util.Map;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.genetics.IClassification.EnumClassLevel;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
package forestry.api.mail;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.core.INBTTagable;
|
||||
|
||||
public interface IMailAddress extends INBTTagable {
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
|
||||
public interface ITreeGenData {
|
||||
|
||||
@@ -15,6 +15,6 @@ public class ApiaryBeeModifier extends DefaultBeeModifier {
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 0.1f;
|
||||
return -0.9f; // results in 0.1 with no frames, see BeeHousingModifier,java
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,8 @@ public class BeeHousingModifier implements IBeeModifier {
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, final float currentModifier) {
|
||||
float modifierValue = 1.0f;
|
||||
float modifierValue = 0.0f; // part of the additive production nerf, but don't worry at least you effectively
|
||||
// get +1 from `t` in `Bee.java:produceStacks`
|
||||
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
||||
modifierValue += modifier.getProductionModifier(genome, modifierValue + currentModifier);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class BeehouseBeeModifier extends DefaultBeeModifier {
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 0.25f;
|
||||
return -0.75f;// results in 0.25 with no frames, see BeeHousingModifier,java
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,19 +34,31 @@ public class EventHandlerApiculture {
|
||||
tooltip.add(StringUtil.localize("frame.tooltip.durability") + getDurabilityFormatted(durability));
|
||||
|
||||
float territory = modifier.getTerritoryModifier(null, 1.0F);
|
||||
tooltip.add(StringUtil.localize("frame.tooltip.territory") + getColorFormatted(territory));
|
||||
|
||||
tooltip.add(
|
||||
StringUtil.localize("frame.tooltip.territory")
|
||||
+ getModifierFormatted(territory, false, false));
|
||||
float mutation = modifier.getMutationModifier(null, null, 1.0F);
|
||||
tooltip.add(StringUtil.localize("frame.tooltip.mutationRate") + getColorFormatted(mutation));
|
||||
|
||||
tooltip.add(
|
||||
StringUtil.localize("frame.tooltip.mutationRate")
|
||||
+ getModifierFormatted(mutation, false, false));
|
||||
float lifespan = modifier.getLifespanModifier(null, null, 1.0F);
|
||||
tooltip.add(StringUtil.localize("frame.tooltip.lifespan") + getColorFormatted(lifespan));
|
||||
|
||||
float production = modifier.getProductionModifier(null, 1.0F);
|
||||
tooltip.add(StringUtil.localize("frame.tooltip.production") + getColorFormatted(production, true));
|
||||
|
||||
// lower lifespan is better
|
||||
tooltip.add(
|
||||
StringUtil.localize("frame.tooltip.lifespan")
|
||||
+ getModifierFormatted(lifespan, false, true));
|
||||
float production = modifier.getProductionModifier(null, 0.0F);
|
||||
tooltip.add(
|
||||
StringUtil.localize("frame.tooltip.production")
|
||||
+ getModifierFormatted(production, true, false));
|
||||
float flowering = modifier.getFloweringModifier(null, 1.0F);
|
||||
tooltip.add(
|
||||
StringUtil.localize("frame.tooltip.flowering")
|
||||
+ getModifierFormatted(flowering, false, false));
|
||||
float decay = modifier.getGeneticDecay(null, 1.0F);
|
||||
tooltip.add(StringUtil.localize("frame.tooltip.geneticDecay") + getColorFormatted(decay));
|
||||
// lower genetic decay is better
|
||||
tooltip.add(
|
||||
StringUtil.localize("frame.tooltip.geneticDecay")
|
||||
+ getModifierFormatted(decay, false, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,15 +80,27 @@ public class EventHandlerApiculture {
|
||||
return color + " " + durability;
|
||||
}
|
||||
|
||||
private static String getColorFormatted(float value, boolean additive) {
|
||||
private static String getModifierFormatted(float value, boolean additive, boolean undesireable) {
|
||||
EnumChatFormatting color;
|
||||
if (value <= 0.5F) {
|
||||
float lo_threshold = 0.5F, mid_threshold = 1.0F, hi_threshold = 2.0F;
|
||||
float discriminant = value;
|
||||
if (additive) {
|
||||
lo_threshold = -1.0F;
|
||||
mid_threshold = 0.0F;
|
||||
hi_threshold = 2.0F; // this one is the same
|
||||
if (undesireable) {
|
||||
discriminant = -value;
|
||||
}
|
||||
} else if (undesireable) {
|
||||
discriminant = 1.0F / value;
|
||||
}
|
||||
if (discriminant <= lo_threshold) {
|
||||
color = EnumChatFormatting.DARK_RED; // "bad" stat
|
||||
} else if (value < 1.0F) {
|
||||
} else if (discriminant < mid_threshold) {
|
||||
color = EnumChatFormatting.RED; // "below average" stat
|
||||
} else if (value == 1.0F) {
|
||||
} else if (discriminant == mid_threshold) {
|
||||
color = EnumChatFormatting.GOLD; // "average" stat
|
||||
} else if (value <= 2.0F) {
|
||||
} else if (discriminant <= hi_threshold) {
|
||||
color = EnumChatFormatting.GREEN; // "above average" stat
|
||||
} else {
|
||||
color = EnumChatFormatting.AQUA; // "great" stat
|
||||
@@ -84,10 +108,12 @@ public class EventHandlerApiculture {
|
||||
String formatted = color.toString();
|
||||
|
||||
// Set symbol for if this value is additive or multiplicative
|
||||
if (additive) {
|
||||
if (!additive) {
|
||||
formatted += " x";
|
||||
} else if (value >= 0.0F) {
|
||||
formatted += " +";
|
||||
} else {
|
||||
formatted += " x";
|
||||
formatted += " "; // the "-" will be applied, but we still need a space or minecraft will crash
|
||||
}
|
||||
|
||||
// trim trailing zeroes if no decimal-precision is needed
|
||||
@@ -96,8 +122,4 @@ public class EventHandlerApiculture {
|
||||
}
|
||||
return formatted + value;
|
||||
}
|
||||
|
||||
private static String getColorFormatted(float value) {
|
||||
return getColorFormatted(value, false);
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import forestry.api.genetics.IFlower;
|
||||
|
||||
final class Flower implements IFlower {
|
||||
|
||||
@@ -514,8 +514,8 @@ public class Bee extends IndividualLiving implements IBee {
|
||||
|
||||
// Bee genetic speed * beehousing * beekeeping mode
|
||||
float speed = genome.getSpeed();
|
||||
float prodModifier = beeHousingModifier.getProductionModifier(genome, 1f)
|
||||
* beeModeModifier.getProductionModifier(genome, 1f);
|
||||
float prodModifier = beeHousingModifier.getProductionModifier(genome, 0f);
|
||||
prodModifier += beeModeModifier.getProductionModifier(genome, prodModifier);
|
||||
|
||||
// / Primary Products
|
||||
for (Map.Entry<ItemStack, Float> entry : primary.getProductChances().entrySet()) {
|
||||
@@ -551,10 +551,13 @@ public class Bee extends IndividualLiving implements IBee {
|
||||
}
|
||||
|
||||
public static float getFinalChance(float chance, float beeSpeed, float productionModifier, float t) {
|
||||
if (productionModifier + t <= 0f) {
|
||||
return 0f;
|
||||
}
|
||||
chance *= 100f;
|
||||
return (float) (2.8 * Math.pow(chance, 0.52)
|
||||
* Math.pow((productionModifier + t), 0.52)
|
||||
* Math.pow(beeSpeed, 0.37)) / 100.f;
|
||||
* Math.pow(beeSpeed, 0.37)) / 100f;
|
||||
}
|
||||
|
||||
/* REPRODUCTION */
|
||||
|
||||
@@ -24,11 +24,19 @@ import forestry.api.apiculture.IBeekeepingMode;
|
||||
|
||||
public class BeekeepingMode implements IBeekeepingMode {
|
||||
|
||||
public static final IBeekeepingMode easy = new BeekeepingMode("EASY", 2.0f, 1.0f, 1.0f, false, false);
|
||||
public static final IBeekeepingMode normal = new BeekeepingMode("NORMAL", 1.0f, 1.0f, 1.0f, false, true);
|
||||
public static final IBeekeepingMode hard = new BeekeepingMode("HARD", 0.75f, 1.5f, 1.0f, false, true);
|
||||
public static final IBeekeepingMode hardcore = new BeekeepingMode("HARDCORE", 0.5f, 5.0f, 0.8f, true, true);
|
||||
public static final IBeekeepingMode insane = new BeekeepingMode("INSANE", 0.2f, 10.0f, 0.6f, true, true);
|
||||
public static final IBeekeepingMode easy = new BeekeepingMode("EASY", 2.0f, 1.0f, 0.0f, false, false);// original
|
||||
// multiplicative
|
||||
// modifier is
|
||||
// 1x
|
||||
public static final IBeekeepingMode normal = new BeekeepingMode("NORMAL", 1.0f, 1.0f, 0.0f, false, true);// orig 1x
|
||||
public static final IBeekeepingMode hard = new BeekeepingMode("HARD", 0.75f, 1.5f, 0.0f, false, true);// orig 1x;
|
||||
// this is the
|
||||
// default in
|
||||
// gtnh
|
||||
public static final IBeekeepingMode hardcore = new BeekeepingMode("HARDCORE", 0.5f, 5.0f, -0.2f, true, true);// orig
|
||||
// 0.8x
|
||||
public static final IBeekeepingMode insane = new BeekeepingMode("INSANE", 0.2f, 10.0f, -0.4f, true, true);// orig
|
||||
// 0.6x
|
||||
|
||||
private final Random rand;
|
||||
private final String name;
|
||||
@@ -93,7 +101,7 @@ public class BeekeepingMode implements IBeekeepingMode {
|
||||
public boolean isOverworked(IBee queen, IBeeHousing housing) {
|
||||
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
|
||||
|
||||
float productionModifier = beeModifier.getProductionModifier(queen.getGenome(), 1f);
|
||||
float productionModifier = beeModifier.getProductionModifier(queen.getGenome(), 0f);
|
||||
if (productionModifier > 16) {
|
||||
if (housing.getWorld().rand.nextFloat() * 100 < 0.01 * ((productionModifier * productionModifier) - 100)) {
|
||||
return true;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ItemHiveFrame extends ItemForestry implements IHiveFrame {
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return (currentModifier < 10f) ? 2f : 1f;
|
||||
return (currentModifier < 10.0f) ? 1.0f : 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class TreeBlockTypeLeaf implements ITreeBlockType {
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.init.Blocks;
|
||||
|
||||
import com.google.common.collect.HashBasedTable;
|
||||
import com.google.common.collect.Table;
|
||||
|
||||
import forestry.core.fluids.Fluids;
|
||||
|
||||
public class ItemRegistryFluids extends ItemRegistry {
|
||||
|
||||
@@ -12,13 +12,13 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
|
||||
import forestry.api.recipes.IDescriptiveRecipe;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import uristqwerty.CraftGuide.api.ItemSlot;
|
||||
import uristqwerty.CraftGuide.api.RecipeGenerator;
|
||||
import uristqwerty.CraftGuide.api.RecipeProvider;
|
||||
import uristqwerty.CraftGuide.api.RecipeTemplate;
|
||||
import uristqwerty.CraftGuide.api.SlotType;
|
||||
import forestry.api.recipes.IDescriptiveRecipe;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
|
||||
public class CraftGuideCustomRecipes implements RecipeProvider {
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.Random;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.ListMultimap;
|
||||
|
||||
import forestry.core.utils.StringUtil;
|
||||
|
||||
public class EscritoireTextSource {
|
||||
|
||||
@@ -26,6 +26,7 @@ import net.minecraft.nbt.NBTTagShort;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
|
||||
import com.google.common.collect.ForwardingList;
|
||||
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.core.access.IOwnable;
|
||||
|
||||
public abstract class PlayerUtil {
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.util.Random;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import forestry.api.recipes.ICentrifugeRecipe;
|
||||
|
||||
public class CentrifugeRecipe implements ICentrifugeRecipe {
|
||||
|
||||
@@ -11,6 +11,9 @@ package forestry.factory.recipes.craftguide;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
|
||||
import forestry.factory.blocks.BlockFactoryTesrType;
|
||||
import forestry.factory.recipes.BottlerRecipe;
|
||||
import forestry.plugins.PluginFactory;
|
||||
import uristqwerty.CraftGuide.api.ItemSlot;
|
||||
import uristqwerty.CraftGuide.api.LiquidSlot;
|
||||
import uristqwerty.CraftGuide.api.RecipeGenerator;
|
||||
@@ -18,9 +21,6 @@ import uristqwerty.CraftGuide.api.RecipeProvider;
|
||||
import uristqwerty.CraftGuide.api.RecipeTemplate;
|
||||
import uristqwerty.CraftGuide.api.Slot;
|
||||
import uristqwerty.CraftGuide.api.SlotType;
|
||||
import forestry.factory.blocks.BlockFactoryTesrType;
|
||||
import forestry.factory.recipes.BottlerRecipe;
|
||||
import forestry.plugins.PluginFactory;
|
||||
|
||||
public class CraftGuideBottler implements RecipeProvider {
|
||||
|
||||
|
||||
@@ -10,6 +10,11 @@ package forestry.factory.recipes.craftguide;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.recipes.ICarpenterRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.factory.blocks.BlockFactoryTesrType;
|
||||
import forestry.plugins.PluginFactory;
|
||||
import uristqwerty.CraftGuide.api.ItemSlot;
|
||||
import uristqwerty.CraftGuide.api.LiquidSlot;
|
||||
import uristqwerty.CraftGuide.api.RecipeGenerator;
|
||||
@@ -17,11 +22,6 @@ import uristqwerty.CraftGuide.api.RecipeProvider;
|
||||
import uristqwerty.CraftGuide.api.RecipeTemplate;
|
||||
import uristqwerty.CraftGuide.api.Slot;
|
||||
import uristqwerty.CraftGuide.api.SlotType;
|
||||
import forestry.api.recipes.ICarpenterRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.factory.blocks.BlockFactoryTesrType;
|
||||
import forestry.plugins.PluginFactory;
|
||||
|
||||
public class CraftGuideCarpenter implements RecipeProvider {
|
||||
|
||||
|
||||
@@ -14,6 +14,10 @@ import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.recipes.ICentrifugeRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.factory.blocks.BlockFactoryTesrType;
|
||||
import forestry.plugins.PluginFactory;
|
||||
import uristqwerty.CraftGuide.api.ChanceSlot;
|
||||
import uristqwerty.CraftGuide.api.ItemSlot;
|
||||
import uristqwerty.CraftGuide.api.RecipeGenerator;
|
||||
@@ -21,10 +25,6 @@ import uristqwerty.CraftGuide.api.RecipeProvider;
|
||||
import uristqwerty.CraftGuide.api.RecipeTemplate;
|
||||
import uristqwerty.CraftGuide.api.Slot;
|
||||
import uristqwerty.CraftGuide.api.SlotType;
|
||||
import forestry.api.recipes.ICentrifugeRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.factory.blocks.BlockFactoryTesrType;
|
||||
import forestry.plugins.PluginFactory;
|
||||
|
||||
public class CraftGuideCentrifuge implements RecipeProvider {
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ package forestry.factory.recipes.craftguide;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.recipes.IFabricatorRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.factory.blocks.BlockFactoryPlainType;
|
||||
import forestry.plugins.PluginFactory;
|
||||
import uristqwerty.CraftGuide.api.ItemSlot;
|
||||
import uristqwerty.CraftGuide.api.LiquidSlot;
|
||||
import uristqwerty.CraftGuide.api.RecipeGenerator;
|
||||
@@ -17,10 +21,6 @@ import uristqwerty.CraftGuide.api.RecipeProvider;
|
||||
import uristqwerty.CraftGuide.api.RecipeTemplate;
|
||||
import uristqwerty.CraftGuide.api.Slot;
|
||||
import uristqwerty.CraftGuide.api.SlotType;
|
||||
import forestry.api.recipes.IFabricatorRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.factory.blocks.BlockFactoryPlainType;
|
||||
import forestry.plugins.PluginFactory;
|
||||
|
||||
public class CraftGuideFabricator implements RecipeProvider {
|
||||
|
||||
|
||||
@@ -14,6 +14,11 @@ import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import forestry.api.fuels.FuelManager;
|
||||
import forestry.api.recipes.IFermenterRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.factory.blocks.BlockFactoryTesrType;
|
||||
import forestry.plugins.PluginFactory;
|
||||
import uristqwerty.CraftGuide.api.ItemSlot;
|
||||
import uristqwerty.CraftGuide.api.LiquidSlot;
|
||||
import uristqwerty.CraftGuide.api.RecipeGenerator;
|
||||
@@ -21,11 +26,6 @@ import uristqwerty.CraftGuide.api.RecipeProvider;
|
||||
import uristqwerty.CraftGuide.api.RecipeTemplate;
|
||||
import uristqwerty.CraftGuide.api.Slot;
|
||||
import uristqwerty.CraftGuide.api.SlotType;
|
||||
import forestry.api.fuels.FuelManager;
|
||||
import forestry.api.recipes.IFermenterRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.factory.blocks.BlockFactoryTesrType;
|
||||
import forestry.plugins.PluginFactory;
|
||||
|
||||
public class CraftGuideFermenter implements RecipeProvider {
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ package forestry.factory.recipes.craftguide;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.recipes.ISqueezerRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.factory.blocks.BlockFactoryTesrType;
|
||||
import forestry.plugins.PluginFactory;
|
||||
import uristqwerty.CraftGuide.api.ChanceSlot;
|
||||
import uristqwerty.CraftGuide.api.ItemSlot;
|
||||
import uristqwerty.CraftGuide.api.LiquidSlot;
|
||||
@@ -18,10 +22,6 @@ import uristqwerty.CraftGuide.api.RecipeProvider;
|
||||
import uristqwerty.CraftGuide.api.RecipeTemplate;
|
||||
import uristqwerty.CraftGuide.api.Slot;
|
||||
import uristqwerty.CraftGuide.api.SlotType;
|
||||
import forestry.api.recipes.ISqueezerRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.factory.blocks.BlockFactoryTesrType;
|
||||
import forestry.plugins.PluginFactory;
|
||||
|
||||
public class CraftGuideSqueezer implements RecipeProvider {
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ package forestry.factory.recipes.craftguide;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.recipes.IStillRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.factory.blocks.BlockFactoryTesrType;
|
||||
import forestry.plugins.PluginFactory;
|
||||
import uristqwerty.CraftGuide.api.ItemSlot;
|
||||
import uristqwerty.CraftGuide.api.LiquidSlot;
|
||||
import uristqwerty.CraftGuide.api.RecipeGenerator;
|
||||
@@ -17,10 +21,6 @@ import uristqwerty.CraftGuide.api.RecipeProvider;
|
||||
import uristqwerty.CraftGuide.api.RecipeTemplate;
|
||||
import uristqwerty.CraftGuide.api.Slot;
|
||||
import uristqwerty.CraftGuide.api.SlotType;
|
||||
import forestry.api.recipes.IStillRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.factory.blocks.BlockFactoryTesrType;
|
||||
import forestry.plugins.PluginFactory;
|
||||
|
||||
public class CraftGuideStill implements RecipeProvider {
|
||||
|
||||
|
||||
@@ -19,10 +19,9 @@ import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import buildcraft.api.statements.ITriggerExternal;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import buildcraft.api.statements.ITriggerExternal;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import forestry.api.mail.ILetter;
|
||||
import forestry.api.mail.IMailAddress;
|
||||
|
||||
@@ -573,6 +573,7 @@ for.frame.tooltip.territory=Territory:
|
||||
for.frame.tooltip.mutationRate=Mutation Rate:
|
||||
for.frame.tooltip.lifespan=Lifespan:
|
||||
for.frame.tooltip.production=Production:
|
||||
for.frame.tooltip.flowering=Flowering:
|
||||
for.frame.tooltip.geneticDecay=Genetic Decay:
|
||||
|
||||
item.for.fruits.cherry.name=Cherry
|
||||
|
||||
Reference in new issue
Block a user