Compare commits

...
2 Commits
13 changed files with 203 additions and 61 deletions

No files matched your search

+116 -21
View File
@@ -1,4 +1,4 @@
//version: 1684218858
//version: 1689409577
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -69,7 +69,7 @@ plugins {
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.3.14'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.19'
}
print("You might want to check out './gradlew :faq' if your build fails.\n")
@@ -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", "")
@@ -357,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(
@@ -465,10 +487,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) {
@@ -479,7 +510,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)
@@ -611,7 +649,32 @@ configurations.all {
}
}
apply from: 'dependencies.gradle'
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]")
}
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
def mixinTmpDir = buildDir.path + File.separator + 'tmp' + File.separator + 'mixins'
@@ -724,13 +787,13 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
}
dependencies {
def lwjgl3ifyVersion = '1.3.5'
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.2.13')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.19')
}
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
@@ -979,6 +1042,9 @@ idea {
}
}
runConfigurations {
"0. Build and Test"(Gradle) {
taskNames = ["build"]
}
"1. Run Client"(Gradle) {
taskNames = ["runClient"]
}
@@ -1098,6 +1164,11 @@ tasks.named("processIdeaSettings").configure {
dependsOn("injectTags")
}
tasks.named("ideVirtualMainClasses").configure {
// Make IntelliJ "Build project" build the mod jars
dependsOn("jar", "reobfJar", "spotlessCheck")
}
// workaround variable hiding in pom processing
def projectConfigs = project.configurations
@@ -1118,12 +1189,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"
}
}
}
}
@@ -1276,12 +1349,14 @@ tasks.register('faq') {
description = 'Prints frequently asked questions about building a project'
doLast {
print("If your build fails to fetch dependencies, they might have been deleted and replaced by newer " +
"versions.\nCheck if the versions you try to fetch are still on the distributing sites.\n" +
"The links can be found in repositories.gradle and build.gradle:repositories, " +
"not build.gradle:buildscript.repositories - this one is for gradle plugin metadata.\n\n" +
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.")
"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.")
}
}
@@ -1342,8 +1417,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
@@ -1508,3 +1589,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'
}
+3 -3
View File
@@ -2,10 +2,10 @@
dependencies {
implementation('com.github.GTNewHorizons:GTNHLib:0.0.13:dev')
compile('com.github.GTNewHorizons:ForestryMC:4.6.7:dev')
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.21-GTNH:dev')
compile('com.github.GTNewHorizons:ForestryMC:4.6.12-pre:dev')
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.73-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.28:api')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.34:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly('curse.maven:cofh-lib-220333:2388748')
@@ -16,24 +16,40 @@ public class BeeModifierLogic {
}
public float getModifier(EnumBeeModifier modifier, float currentModifier) {
if (!modifiers.containsKey(modifier)) {
return 1.0f;
}
Float[] values = modifiers.get(modifier);
float mult = values[0];
float max = values[1];
if (max >= 1.0f) {
if (max <= currentModifier) {
if (modifier == EnumBeeModifier.PRODUCTION) {
if (!modifiers.containsKey(modifier)) {
return 0.0f;
}
Float[] values = modifiers.get(modifier);
float offset = values[0], max = values[1];
if (offset < 0) {// negative modifiers should always apply
return offset;
}
if (currentModifier >= max) {// don't decrease modifiers already over the max, just skip increasing it
return 0.0f;
}
return Math.min(offset, max - currentModifier);
} else {
if (!modifiers.containsKey(modifier)) {
return 1.0f;
}
return Math.min(max / currentModifier, mult);
Float[] values = modifiers.get(modifier);
float mult = values[0];
float max = values[1];
if (max >= 1.0f) {
if (max <= currentModifier) {
return 1.0f;
}
return Math.min(max / currentModifier, mult);
}
if (max >= currentModifier) {
return 1.0f;
}
return Math.max(max / currentModifier, mult);
}
if (max >= currentModifier) {
return 1.0f;
}
return Math.max(max / currentModifier, mult);
}
public boolean getModifier(EnumBeeBooleanModifier modifier) {
@@ -1,8 +1,15 @@
package binnie.core.genetics;
import binnie.core.util.I18N;
public enum EnumBeeBooleanModifier {
SEALED,
SELF_LIGHTED,
SUNLIGHT_STIMULATED,
HELLISH
HELLISH;
public String getName() {
return I18N.localise("binniecore.beebooleanmodifier." + name().toLowerCase());
}
}
@@ -33,7 +33,7 @@ public class ComponentBeeModifier extends MachineComponent implements IBeeModifi
@Override
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
return 1.0f;
return 0.0f;
}
@Override
@@ -39,14 +39,14 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.PRODUCTION, 1.5f, 5.0f);
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.TERRITORY, 0.5f, 0.1f);
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.5f);
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.75f, 0.5f);
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.PRODUCTION, -0.25f, 0.0f);// was 0.75x lim 0.5x
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.MUTATION, 1.5f, 5.0f);
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.5f);
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.25f, 0.1f);
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.PRODUCTION, -0.75f, 0.0f);// was 0.25x lim 0.1x
EnumHiveFrame.Soul.setMaxDamage(80);
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.LIFESPAN, 1.5f, 5.0f);
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.MUTATION, 0.5f, 0.2f);
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.75f, 0.2f);
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.PRODUCTION, -0.25f, 0.0f);// was 0.75x lim 0.2x
EnumHiveFrame.Debug.logic.setModifier(EnumBeeModifier.LIFESPAN, 1.0E-4f, 1.0E-4f);
GameRegistry.addRecipe(
@@ -152,7 +152,7 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
@Override
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
if (getBeeModifier() == null) {
return 1.0f;
return 0.0f;
}
return getBeeModifier().getProductionModifier(genome, currentModifier);
}
@@ -72,7 +72,7 @@ public class FrameComponentModifier extends ComponentBeeModifier implements IBee
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
IHiveFrame frame = getHiveFrame();
if (frame == null) {
return 1.0f;
return 0.0f;
}
return frame.getBeeModifier().getProductionModifier(genome, currentModifier);
}
@@ -28,7 +28,9 @@ public enum CircuitType implements IBeeModifier {
CircuitType.Nether.logic.setModifier(EnumBeeBooleanModifier.HELLISH);
CircuitType.Mutation.logic.setModifier(EnumBeeModifier.MUTATION, 1.5f, 5.0f);
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.TERRITORY, 0.4f, 0.1f);
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.9f, 0.5f);
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.PRODUCTION, -0.1f, 0.0f);// was 0.9x, now -0.1. limit
// was 0.5x, now it's 0, but
// currently ignored
CircuitType.Territory.logic.setModifier(EnumBeeModifier.TERRITORY, 1.5f, 5.0f);
for (CircuitType type : values()) {
type.logic.setModifier(EnumBeeModifier.GENETIC_DECAY, 1.5f, 10.0f);
@@ -48,18 +50,34 @@ public enum CircuitType implements IBeeModifier {
public void createCircuit(ICircuitLayout layout) {
StimulatorCircuit circuit = new StimulatorCircuit(this, layout);
for (EnumBeeModifier modifier : EnumBeeModifier.values()) {
float mod = logic.getModifier(modifier, 1.0f);
if (mod == 1.0f) {
continue;
for (EnumBeeBooleanModifier modifier : EnumBeeBooleanModifier.values()) {
if (logic.getModifier(modifier)) {
circuit.addTooltipString("Enables " + modifier.getName());
}
if (mod > 1.0f) {
int increase = (int) ((mod - 1.0f) * 100.0f);
circuit.addTooltipString("Increases " + modifier.getName() + " by " + increase + "%");
}
for (EnumBeeModifier modifier : EnumBeeModifier.values()) {
if (modifier == EnumBeeModifier.PRODUCTION) {
float mod = logic.getModifier(modifier, 0.0f);
if (mod == 0.0f) {
continue;
}
if (mod > 0.0f) {
circuit.addTooltipString("Increases " + modifier.getName() + " by +" + mod);
} else {
circuit.addTooltipString("Increases " + modifier.getName() + " by " + mod);
}
} else {
int decrease = (int) ((1.0f - mod) * 100.0f);
circuit.addTooltipString("Decreases " + modifier.getName() + " by " + decrease + "%");
float mod = logic.getModifier(modifier, 1.0f);
if (mod == 1.0f) {
continue;
}
if (mod > 1.0f) {
int increase = (int) ((mod - 1.0f) * 100.0f);
circuit.addTooltipString("Increases " + modifier.getName() + " by " + increase + "%");
} else {
int decrease = (int) ((1.0f - mod) * 100.0f);
circuit.addTooltipString("Decreases " + modifier.getName() + " by " + decrease + "%");
}
}
}
}
@@ -100,13 +100,14 @@ public class StimulatorModifierComponent extends ComponentBeeModifier implements
@Override
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
float mod = 1.0f;
float mod = 0.0f;// production modifiers are now additive, and the "base" value of 1 comes in forestry's
// Bee.java and BeeKeepingMode.java
if (!powered) {
return mod;
}
for (IBeeModifier beeMod : modifiers) {
mod *= beeMod.getProductionModifier(genome, mod);
mod += beeMod.getProductionModifier(genome, mod);
}
return mod;
}
@@ -182,7 +182,12 @@ binniecore.beemodifier.mutation=Mutation
binniecore.beemodifier.lifespan=Lifespan
binniecore.beemodifier.production=Production
binniecore.beemodifier.flowering=Flowering
binniecore.beemodifier.geneticdecay=Genetic Decay
binniecore.beemodifier.genetic_decay=Genetic Decay
binniecore.beebooleanmodifier.sealed=Rain Protection
binniecore.beebooleanmodifier.self_lighted=Self Lighting
binniecore.beebooleanmodifier.sunlight_stimulated=Sunlight Stimulation
binniecore.beebooleanmodifier.hellish=Hellish Emulation
binniecore.gui.breedingmessage.species=Species Discovered
binniecore.gui.breedingmessage.branch=Branch Discovered
@@ -182,7 +182,7 @@ binniecore.beemodifier.mutation=Мутация
binniecore.beemodifier.lifespan=Время жизни
binniecore.beemodifier.production=Продукция
binniecore.beemodifier.flowering=Цветы
binniecore.beemodifier.geneticdecay=Склонность к вырождению
binniecore.beemodifier.genetic_decay=Склонность к вырождению
binniecore.gui.breedingmessage.species=Видов обнаружено
binniecore.gui.breedingmessage.branch=Семейств обнаружено
@@ -182,7 +182,7 @@ binniecore.beemodifier.mutation=变异
binniecore.beemodifier.lifespan=寿命
binniecore.beemodifier.production=产物
binniecore.beemodifier.flowering=授粉速度
binniecore.beemodifier.geneticdecay=基因衰变
binniecore.beemodifier.genetic_decay=基因衰变
binniecore.gui.breedingmessage.species=已发现品种
binniecore.gui.breedingmessage.branch=已发现分支