Compare commits

...
19 Commits
Author SHA1 Message Date
Martin Robertz 29814550bb update deps+bs 2024-01-25 10:42:36 +01:00
ghostflyby 15769b9ee9 fix no tooltip in some Gui (#42) 2024-01-24 21:44:37 +01:00
Martin Robertz 1253271111 update bs+deps 2024-01-11 22:55:32 +01:00
Raven Szewczyk d18be7848d [ci skip] upgraded build system 2024-01-08 21:24:08 +00:00
Martin Robertz ef4dd3710a update gradle+bs+deps 2023-12-11 11:41:14 +01:00
ghostflyby 190693ad68 Fix double layers tooltip with NEI (#41)
* Fix double layers tooltip with nei

* Remove wildcard imports
2023-12-11 08:43:58 +01:00
Martin Robertz 3dc2806b36 update bs+deps 2023-11-15 10:13:07 +01:00
Pelotrio a609f5dce5 Optimized flower color enumeration array retrieval (#40) 2023-11-15 00:19:42 +00:00
Martin Robertz 00c214ee5d update deps 2023-10-21 12:22:30 +02:00
miozune e497b9505a Optimize PlankType$ExtraBiomesPlank.getStack() (#39) 2023-10-21 10:55:44 +02:00
Martin Robertz b5ac446e55 update bs+deps 2023-10-11 23:14:28 +02:00
ghostflyby c00e1b39da NEI item manager overlay integration (#38)
* New: NEI item manager overly integration

* update buildscript

* apply spotless

* Making nei really optional

* Fix wildcard

* Stream chain simplify

* Fix: NPE when events outside the Gui

* Fix: drag and mouse event

* Fix: call mouse event
2023-10-11 14:35:28 +09:00
Lyfts 6e6e806476 fix incubator for real this time (#37) 2023-09-06 19:48:53 +02:00
miozuneandMartin Robertz ef877e2f7d Fix NPE with Lumbermill (#35)
* Remove outdated script

* updateBuildScript

* Update dependencies

* Fix NPE with Lumbermill

---------

Co-authored-by: Martin Robertz <[email protected]>
2023-08-19 12:34:10 +02:00
miozune 669aee5ba6 Fix typo: cooper -> copper (#34) 2023-08-12 15:31:22 +02:00
Martin Robertz ef468097d0 update bs+deps 2023-07-18 20:37:11 +02:00
hacatu 22f2eebbd3 Fix Additive Production (#33)
* Fix production modifiers to be additive, fix circuit tooltips for mutation and boolean modifiers

* Chocolate frames have left the building

kuba told me to kill them

* Bruhhhhhhhhhhhh
2023-07-18 20:36:09 +02:00
Maxim f658e9ec57 Fixed the stimulator accepting stacks with a size higher than 1 (#32) 2023-06-16 16:24:18 +02:00
Maxim ddf93bc425 Fix localization of secret species count (#31) 2023-06-14 19:03:59 +02:00
48 changed files with 607 additions and 275 deletions

No files matched your search

-33
View File
@@ -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
+7 -1
View File
@@ -26,7 +26,13 @@ whitelist.json
*.iml *.iml
*.ipr *.ipr
*.iws *.iws
src/main/resources/mixins.*.json src/main/resources/mixins.*([!.]).json
*.bat *.bat
*.DS_Store *.DS_Store
!gradlew.bat !gradlew.bat
.factorypath
addon.local.gradle
addon.local.gradle.kts
addon.late.local.gradle
addon.late.local.gradle.kts
layout.json
+233 -119
View File
@@ -1,4 +1,4 @@
//version: 1684218858 //version: 1705357285
/* /*
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.
@@ -28,27 +28,11 @@ import java.util.concurrent.TimeUnit
buildscript { buildscript {
repositories { repositories {
mavenCentral()
maven {
name 'forge'
url 'https://maven.minecraftforge.net'
}
maven { maven {
// GTNH RetroFuturaGradle and ASM Fork // GTNH RetroFuturaGradle and ASM Fork
name "GTNH Maven" name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" url "https://nexus.gtnewhorizons.com/repository/public/"
allowInsecureProtocol = true
} }
maven {
name 'sonatype'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
name 'Scala CI dependencies'
url 'https://repo1.maven.org/maven2/'
}
mavenLocal() mavenLocal()
} }
} }
@@ -64,12 +48,12 @@ plugins {
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 '8.1.1' apply false id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
id 'com.palantir.git-version' version '3.0.0' apply false id 'com.palantir.git-version' version '3.0.0' apply false
id 'de.undercouch.download' version '5.4.0' id 'de.undercouch.download' version '5.5.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.13.0' apply false // 6.13.0 is the last jvm8 supporting version 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.3.14' id 'com.gtnewhorizons.retrofuturagradle' version '1.3.27'
} }
print("You might want to check out './gradlew :faq' if your build fails.\n") print("You might want to check out './gradlew :faq' if your build fails.\n")
@@ -89,6 +73,23 @@ def out = services.get(StyledTextOutputFactory).create('an-output')
def projectJavaVersion = JavaLanguageVersion.of(8) def projectJavaVersion = JavaLanguageVersion.of(8)
boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false
boolean disableCheckstyle = project.hasProperty("disableCheckstyle") ? project.disableCheckstyle.toBoolean() : false
final String CHECKSTYLE_CONFIG = """
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<!-- Use CHECKSTYLE:OFF and CHECKSTYLE:ON comments to suppress checkstyle lints in a block -->
<module name="SuppressionCommentFilter"/>
<module name="AvoidStarImport">
<!-- Allow static wildcard imports for cases like Opcodes and LWJGL classes, these don't get created accidentally by the IDE -->
<property name="allowStaticMemberImports" value="true"/>
</module>
</module>
</module>
"""
checkPropertyExists("modName") checkPropertyExists("modName")
checkPropertyExists("modId") checkPropertyExists("modId")
@@ -115,10 +116,13 @@ propertyDefaultIfUnset("usesMixinDebug", project.usesMixins)
propertyDefaultIfUnset("forceEnableMixins", false) propertyDefaultIfUnset("forceEnableMixins", false)
propertyDefaultIfUnset("channel", "stable") propertyDefaultIfUnset("channel", "stable")
propertyDefaultIfUnset("mappingsVersion", "12") propertyDefaultIfUnset("mappingsVersion", "12")
propertyDefaultIfUnset("usesMavenPublishing", true)
propertyDefaultIfUnset("mavenPublishUrl", "https://nexus.gtnewhorizons.com/repository/releases/")
propertyDefaultIfUnset("modrinthProjectId", "") propertyDefaultIfUnset("modrinthProjectId", "")
propertyDefaultIfUnset("modrinthRelations", "") propertyDefaultIfUnset("modrinthRelations", "")
propertyDefaultIfUnset("curseForgeProjectId", "") propertyDefaultIfUnset("curseForgeProjectId", "")
propertyDefaultIfUnset("curseForgeRelations", "") propertyDefaultIfUnset("curseForgeRelations", "")
propertyDefaultIfUnset("versionPattern", "")
propertyDefaultIfUnset("minimizeShadowedDependencies", true) propertyDefaultIfUnset("minimizeShadowedDependencies", true)
propertyDefaultIfUnset("relocateShadowedDependencies", true) propertyDefaultIfUnset("relocateShadowedDependencies", true)
// Deprecated properties (kept for backwards compat) // Deprecated properties (kept for backwards compat)
@@ -138,6 +142,17 @@ if (!disableSpotless) {
apply from: Blowdryer.file('spotless.gradle') apply from: Blowdryer.file('spotless.gradle')
} }
if (!disableCheckstyle) {
apply plugin: 'checkstyle'
tasks.named("checkstylePatchedMc") { enabled = false }
tasks.named("checkstyleMcLauncher") { enabled = false }
tasks.named("checkstyleIdeVirtualMain") { enabled = false }
tasks.named("checkstyleInjectedTags") { enabled = false }
checkstyle {
config = resources.text.fromString(CHECKSTYLE_CONFIG)
}
}
String javaSourceDir = "src/main/java/" String javaSourceDir = "src/main/java/"
String scalaSourceDir = "src/main/scala/" String scalaSourceDir = "src/main/scala/"
String kotlinSourceDir = "src/main/kotlin/" String kotlinSourceDir = "src/main/kotlin/"
@@ -272,7 +287,7 @@ if (apiPackage) {
} }
if (accessTransformersFile) { if (accessTransformersFile) {
for (atFile in accessTransformersFile.split(",")) { for (atFile in accessTransformersFile.split(" ")) {
String targetFile = "src/main/resources/META-INF/" + atFile.trim() String targetFile = "src/main/resources/META-INF/" + atFile.trim()
if (!getFile(targetFile).exists()) { if (!getFile(targetFile).exists()) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
@@ -356,8 +371,31 @@ catch (Exception ignored) {
// Pulls version first from the VERSION env and then git tag // Pulls version first from the VERSION env and then git tag
String identifiedVersion String identifiedVersion
String versionOverride = System.getenv("VERSION") ?: null String versionOverride = System.getenv("VERSION") ?: null
boolean checkVersion = false
try { 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 {
checkVersion = true
}
} else {
identifiedVersion = versionOverride
}
} }
catch (Exception ignored) { catch (Exception ignored) {
out.style(Style.Failure).text( out.style(Style.Failure).text(
@@ -375,13 +413,19 @@ ext {
if (identifiedVersion == versionOverride) { if (identifiedVersion == versionOverride) {
out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7') out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7')
} else if (checkVersion && versionPattern && !(identifiedVersion ==~ versionPattern)) {
throw new GradleException("Invalid version: '$identifiedVersion' does not match version pattern '$versionPattern'")
} }
group = "com.github.GTNewHorizons" group = "com.github.GTNewHorizons"
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
archivesBaseName = customArchiveBaseName base {
archivesName = customArchiveBaseName
}
} else { } else {
archivesBaseName = modId base {
archivesName = modId
}
} }
@@ -390,18 +434,31 @@ minecraft {
for (f in replaceGradleTokenInFile.split(',')) { for (f in replaceGradleTokenInFile.split(',')) {
tagReplacementFiles.add f tagReplacementFiles.add f
} }
out.style(Style.Info).text('replaceGradleTokenInFile is deprecated! Consider using generateGradleTokenClass.').println()
} }
if (gradleTokenModId) { if (gradleTokenModId) {
injectedTags.put gradleTokenModId, modId if (replaceGradleTokenInFile) {
injectedTags.put gradleTokenModId, modId
} else {
out.style(Style.Failure).text('gradleTokenModId is deprecated! The field will no longer be generated.').println()
}
} }
if (gradleTokenModName) { if (gradleTokenModName) {
injectedTags.put gradleTokenModName, modName if (replaceGradleTokenInFile) {
injectedTags.put gradleTokenModName, modName
} else {
out.style(Style.Failure).text('gradleTokenModName is deprecated! The field will no longer be generated.').println()
}
} }
if (gradleTokenVersion) { if (gradleTokenVersion) {
injectedTags.put gradleTokenVersion, modVersion injectedTags.put gradleTokenVersion, modVersion
} }
if (gradleTokenGroupName) { if (gradleTokenGroupName) {
injectedTags.put gradleTokenGroupName, modGroup if (replaceGradleTokenInFile) {
injectedTags.put gradleTokenGroupName, modGroup
} else {
out.style(Style.Failure).text('gradleTokenGroupName is deprecated! The field will no longer be generated.').println()
}
} }
if (enableGenericInjection.toBoolean()) { if (enableGenericInjection.toBoolean()) {
injectMissingGenerics.set(true) injectMissingGenerics.set(true)
@@ -465,10 +522,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' 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 // Allow unsafe repos but warn
repositories.configureEach { repo -> repositories.configureEach { repo ->
if (repo instanceof org.gradle.api.artifacts.repositories.UrlArtifactRepository) { if (repo instanceof org.gradle.api.artifacts.repositories.UrlArtifactRepository) {
@@ -479,7 +545,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 { configurations {
runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable) runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
@@ -518,16 +591,15 @@ afterEvaluate {
repositories { repositories {
maven { maven {
name 'Overmind forge repo mirror' name = "GTNH Maven"
url 'https://gregtech.overminddl1.com/' url = "https://nexus.gtnewhorizons.com/repository/public/"
mavenContent { // Links for convenience:
excludeGroup("net.minecraftforge") // missing the `universal` artefact // Simple HTML browsing: https://nexus.gtnewhorizons.com/service/rest/repository/browse/releases/
} // Rich web UI browsing: https://nexus.gtnewhorizons.com/#browse/browse:releases
} }
maven { maven {
name = "GTNH Maven" name 'Overmind forge repo mirror'
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" url 'https://gregtech.overminddl1.com/'
allowInsecureProtocol = true
} }
maven { maven {
name 'sonatype' name 'sonatype'
@@ -537,24 +609,34 @@ repositories {
} }
} }
if (includeWellKnownRepositories.toBoolean()) { if (includeWellKnownRepositories.toBoolean()) {
maven { exclusiveContent {
name "CurseMaven" forRepository {
url "https://cursemaven.com" maven {
content { name "CurseMaven"
url "https://cursemaven.com"
}
}
filter {
includeGroup "curse.maven" includeGroup "curse.maven"
} }
} }
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
maven { maven {
name = "ic2" name = "ic2"
url = "https://maven.ic2.player.to/" url = getURL("https://maven2.ic2.player.to/", "https://maven.ic2.player.to/")
metadataSources { content {
mavenPom() includeGroup "net.industrial-craft"
artifact()
} }
}
maven {
name = "ic2-mirror"
url = "https://maven2.ic2.player.to/"
metadataSources { metadataSources {
mavenPom() mavenPom()
artifact() artifact()
@@ -569,11 +651,13 @@ repositories {
def mixinProviderGroup = "io.github.legacymoddingmc" def mixinProviderGroup = "io.github.legacymoddingmc"
def mixinProviderModule = "unimixins" def mixinProviderModule = "unimixins"
def mixinProviderVersion = "0.1.7.1" def mixinProviderVersion = "0.1.13"
def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}" def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
ext.mixinProviderSpec = mixinProviderSpec ext.mixinProviderSpec = mixinProviderSpec
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
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')
@@ -585,7 +669,7 @@ dependencies {
} }
} }
if (usesMixins.toBoolean()) { if (usesMixins.toBoolean()) {
implementation(mixinProviderSpec) implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap))
} else if (forceEnableMixins.toBoolean()) { } else if (forceEnableMixins.toBoolean()) {
runtimeOnlyNonPublishable(mixinProviderSpec) runtimeOnlyNonPublishable(mixinProviderSpec)
} }
@@ -608,15 +692,37 @@ configurations.all {
substitute module('com.github.GTNewHorizons:SpongePoweredMixin') 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('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") substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier")
substitute module('org.scala-lang:scala-library:2.11.1') using module('org.scala-lang:scala-library:2.11.5') because('To allow mixing with Java 8 targets')
} }
} }
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")
}
}
}
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json' if (file('dependencies.gradle.kts').exists()) {
def mixinTmpDir = buildDir.path + File.separator + 'tmp' + File.separator + 'mixins' apply from: 'dependencies.gradle.kts'
def refMap = "${mixinTmpDir}" + File.separator + mixingConfigRefMap } else if (file('dependencies.gradle').exists()) {
def mixinSrg = "${mixinTmpDir}" + File.separator + "mixins.srg" 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') { tasks.register('generateAssets') {
group = "GTNH Buildscript" group = "GTNH Buildscript"
@@ -648,46 +754,17 @@ tasks.register('generateAssets') {
} }
if (usesMixins.toBoolean()) { if (usesMixins.toBoolean()) {
tasks.named("reobfJar", ReobfuscatedJar).configure {
extraSrgFiles.from(mixinSrg)
}
tasks.named("processResources").configure { tasks.named("processResources").configure {
dependsOn("generateAssets") dependsOn("generateAssets")
} }
tasks.named("compileJava", JavaCompile).configure { tasks.named("compileJava", JavaCompile).configure {
doFirst {
new File(mixinTmpDir).mkdirs()
}
options.compilerArgs += [ 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 // Elan: from what I understand they are just some linter configs so you get some warning on how to properly code
"-XDenableSunApiLintControl", "-XDenableSunApiLintControl",
"-XDignore.symbol.file" "-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 { tasks.named("processResources", ProcessResources).configure {
@@ -705,7 +782,6 @@ tasks.named("processResources", ProcessResources).configure {
} }
if (usesMixins.toBoolean()) { if (usesMixins.toBoolean()) {
from refMap
dependsOn("compileJava", "compileScala") dependsOn("compileJava", "compileScala")
} }
} }
@@ -724,23 +800,14 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
} }
dependencies { dependencies {
def lwjgl3ifyVersion = '1.3.5' def lwjgl3ifyVersion = '1.5.7'
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.2.13') java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.4.4')
} }
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
java17PatchDependencies("org.ow2.asm:asm:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-analysis:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-util:${asmVersion}")
java17PatchDependencies('org.ow2.asm:asm-deprecated:7.1')
java17PatchDependencies("org.apache.commons:commons-lang3:3.12.0")
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
} }
@@ -913,8 +980,7 @@ if (usesShadowedDependencies.toBoolean()) {
configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar))
configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar))
tasks.named("jar", Jar) { tasks.named("jar", Jar) {
enabled = false archiveClassifier.set('dev-preshadow')
finalizedBy(tasks.shadowJar)
} }
tasks.named("reobfJar", ReobfuscatedJar) { tasks.named("reobfJar", ReobfuscatedJar) {
inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile})) inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile}))
@@ -923,11 +989,6 @@ if (usesShadowedDependencies.toBoolean()) {
javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) { javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
skip() skip()
} }
for (runTask in ["runClient", "runServer", "runClient17", "runServer17"]) {
tasks.named(runTask).configure {
dependsOn("shadowJar")
}
}
} }
ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar
ext.publishableObfJar = tasks.reobfJar ext.publishableObfJar = tasks.reobfJar
@@ -979,6 +1040,9 @@ idea {
} }
} }
runConfigurations { runConfigurations {
"0. Build and Test"(Gradle) {
taskNames = ["build"]
}
"1. Run Client"(Gradle) { "1. Run Client"(Gradle) {
taskNames = ["runClient"] taskNames = ["runClient"]
} }
@@ -1098,6 +1162,14 @@ tasks.named("processIdeaSettings").configure {
dependsOn("injectTags") 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 // workaround variable hiding in pom processing
def projectConfigs = project.configurations def projectConfigs = project.configurations
@@ -1116,14 +1188,15 @@ publishing {
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
} }
} }
repositories { repositories {
maven { if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) {
url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases" maven {
allowInsecureProtocol = true url = mavenPublishUrl
credentials { allowInsecureProtocol = mavenPublishUrl.startsWith("http://")
username = System.getenv("MAVEN_USER") ?: "NONE" credentials {
password = System.getenv("MAVEN_PASSWORD") ?: "NONE" username = System.getenv("MAVEN_USER") ?: "NONE"
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
}
} }
} }
} }
@@ -1238,7 +1311,7 @@ def addCurseForgeRelation(String type, String name) {
// Updating // Updating
def buildscriptGradleVersion = "8.1.1" def buildscriptGradleVersion = "8.5"
tasks.named('wrapper', Wrapper).configure { tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion gradleVersion = buildscriptGradleVersion
@@ -1276,12 +1349,14 @@ tasks.register('faq') {
description = 'Prints frequently asked questions about building a project' description = 'Prints frequently asked questions about building a project'
doLast { doLast {
print("If your build fails to fetch dependencies, they might have been deleted and replaced by newer " + print("If your build fails to fetch dependencies, run './gradlew updateDependencies'. " +
"versions.\nCheck if the versions you try to fetch are still on the distributing sites.\n" + "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, " + "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" + "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 " + "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 currentBuildScript = getFile("build.gradle").getText()
String currentBuildScriptHash = getVersionHash(currentBuildScript) String currentBuildScriptHash = getVersionHash(currentBuildScript)
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText() String availableBuildScriptHash
String availableBuildScriptHash = getVersionHash(availableBuildScript) 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 boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
return !isUpToDate return !isUpToDate
@@ -1508,3 +1589,36 @@ def getSecondaryArtifacts() {
if (apiPackage) secondaryArtifacts += [apiJar] if (apiPackage) secondaryArtifacts += [apiJar]
return secondaryArtifacts return secondaryArtifacts
} }
def getURL(String main, String fallback) {
return pingURL(main, 10000) ? main : fallback
}
// credit: https://stackoverflow.com/a/3584332
def pingURL(String url, int timeout) {
url = url.replaceFirst("^https", "http") // Otherwise an exception may be thrown on invalid SSL certificates.
try {
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection()
connection.setConnectTimeout(timeout)
connection.setReadTimeout(timeout)
connection.setRequestMethod("HEAD")
int responseCode = connection.getResponseCode()
return 200 <= responseCode && responseCode <= 399
} catch (IOException ignored) {
return false
}
}
// 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 -5
View File
@@ -1,12 +1,12 @@
// Add your dependencies here // Add your dependencies here
dependencies { dependencies {
implementation('com.github.GTNewHorizons:GTNHLib:0.0.13:dev') api('com.github.GTNewHorizons:ForestryMC:4.8.2:dev')
compile('com.github.GTNewHorizons:ForestryMC:4.6.7:dev') implementation('com.github.GTNewHorizons:GTNHLib:0.2.1:dev')
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.21-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.28:api') devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.4-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev') compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly('curse.maven:cofh-lib-220333:2388748') compileOnly("curse.maven:extrabiomesxl-60041:2273301")
} }
Binary file not shown.
+2 -1
View File
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
Vendored
+17 -12
View File
@@ -83,10 +83,8 @@ done
# This is normally unused # This is normally unused
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && 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. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@@ -133,10 +131,13 @@ location of your Java installation."
fi fi
else else
JAVACMD=java JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
@@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045 # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
@@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045 # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac
@@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done done
fi fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
# shell script including quotes and variable substitutions, so put them in DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded. # Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \
-22
View File
@@ -1,26 +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/'
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'
}
} }
+4 -5
View File
@@ -4,10 +4,9 @@ pluginManagement {
maven { maven {
// RetroFuturaGradle // RetroFuturaGradle
name "GTNH Maven" name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" url "https://nexus.gtnewhorizons.com/repository/public/"
allowInsecureProtocol = true
mavenContent { mavenContent {
includeGroup("com.gtnewhorizons.retrofuturagradle") includeGroupByRegex("com\\.gtnewhorizons\\..+")
} }
} }
gradlePluginPortal() gradlePluginPortal()
@@ -17,8 +16,8 @@ pluginManagement {
} }
plugins { plugins {
id 'com.diffplug.blowdryerSetup' version '1.6.0' id 'com.diffplug.blowdryerSetup' version '1.7.1'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' // Provides java toolchains
} }
blowdryerSetup { blowdryerSetup {
@@ -88,7 +88,7 @@ public class ItemInsulatedTube extends Item {
enum Material { enum Material {
Copper(0xe3b78e, "cooper"), Copper(0xe3b78e, "copper"),
Tin(0xe1eef4, "tin"), Tin(0xe1eef4, "tin"),
Bronze(0xddc276, "bronze"), Bronze(0xddc276, "bronze"),
Iron(0xd8d8d8, "iron"); Iron(0xd8d8d8, "iron");
@@ -92,6 +92,7 @@ public enum EnumFlowerColor implements IFlowerColor {
YELLOW("yellow", 0xffff00), YELLOW("yellow", 0xffff00),
YELLOW_GREEN("yellowGreen", 0x9acd32); YELLOW_GREEN("yellowGreen", 0x9acd32);
private static final EnumFlowerColor[] ALL_VALUES = values();
private int color; private int color;
private int colorDis; private int colorDis;
private String name; private String name;
@@ -2963,7 +2964,7 @@ public enum EnumFlowerColor implements IFlowerColor {
} }
public static EnumFlowerColor get(int i) { public static EnumFlowerColor get(int i) {
return values()[Math.max(0, i) % values().length]; return ALL_VALUES[Math.max(0, i) % ALL_VALUES.length];
} }
@Override @Override
+2
View File
@@ -12,6 +12,7 @@ public class Mods {
public static Mod forestry; public static Mod forestry;
public static Mod ic2; public static Mod ic2;
public static Mod botania; public static Mod botania;
public static Mod extraBiomes;
private static Item findItem(String modId, String name) { private static Item findItem(String modId, String name) {
Item stack = GameRegistry.findItem(modId, name); Item stack = GameRegistry.findItem(modId, name);
@@ -41,6 +42,7 @@ public class Mods {
Mods.forestry = new Mod("Forestry"); Mods.forestry = new Mod("Forestry");
Mods.ic2 = new Mod("IC2"); Mods.ic2 = new Mod("IC2");
Mods.botania = new Mod("Botania"); Mods.botania = new Mod("Botania");
Mods.extraBiomes = new Mod("ExtrabiomesXL");
} }
public static class Mod { public static class Mod {
@@ -54,7 +54,7 @@ public class PageBreeder extends ControlPage<DatabaseTab> {
this, this,
155.0f, 155.0f,
I18N.localise( I18N.localise(
"binniecore.gui.database.species.secretCount", "binniecore.gui.database.species.secretsCount",
system.discoveredSecretCount, system.discoveredSecretCount,
system.totalSecretCount)); system.totalSecretCount));
} }
@@ -30,6 +30,8 @@ import binnie.core.craftgui.events.EventMouse;
import binnie.core.craftgui.geometry.IArea; import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.geometry.IBorder; import binnie.core.craftgui.geometry.IBorder;
import binnie.core.craftgui.geometry.IPoint; import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.minecraft.control.ControlSlotBase;
import binnie.core.nei.NEIHook;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -76,6 +78,8 @@ public class GuiCraftGUI extends GuiContainer {
@Override @Override
public void drawScreen(int mouseX, int mouseY, float par3) { public void drawScreen(int mouseX, int mouseY, float par3) {
NEIHook.preDraw();
window.setMousePosition(mouseX - (int) window.getPosition().x(), mouseY - (int) window.getPosition().y()); window.setMousePosition(mouseX - (int) window.getPosition().x(), mouseY - (int) window.getPosition().y());
drawDefaultBackground(); drawDefaultBackground();
@@ -89,6 +93,9 @@ public class GuiCraftGUI extends GuiContainer {
window.render(); window.render();
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting();
NEIHook.renderObjects(window, mouseX, mouseY);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f);
@@ -109,10 +116,13 @@ public class GuiCraftGUI extends GuiContainer {
} else { } else {
tooltip.setType(Tooltip.Type.STANDARD); tooltip.setType(Tooltip.Type.STANDARD);
window.getTooltip(tooltip); window.getTooltip(tooltip);
NEIHook.renderToolTips(mouseX, mouseY);
} }
if (tooltip.exists()) { if (tooltip.exists()) {
renderTooltip(new IPoint(mouseX, mouseY), tooltip); renderTooltip(new IPoint(mouseX, mouseY), tooltip);
} else {
NEIHook.renderToolTips(mouseX, mouseY);
} }
zLevel = 0.0f; zLevel = 0.0f;
GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHTING);
@@ -219,6 +229,8 @@ public class GuiCraftGUI extends GuiContainer {
@Override @Override
protected void mouseClicked(int x, int y, int button) { protected void mouseClicked(int x, int y, int button) {
NEIHook.mouseClicked(x, y, button);
IWidget origin = window; IWidget origin = window;
if (window.getMousedOverWidget() != null) { if (window.getMousedOverWidget() != null) {
origin = window.getMousedOverWidget(); origin = window.getMousedOverWidget();
@@ -228,6 +240,8 @@ public class GuiCraftGUI extends GuiContainer {
@Override @Override
protected void keyTyped(char c, int key) { protected void keyTyped(char c, int key) {
NEIHook.lastKeyTyped(key, c);
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && window.getFocusedWidget() == null)) { if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && window.getFocusedWidget() == null)) {
mc.thePlayer.closeScreen(); mc.thePlayer.closeScreen();
} }
@@ -241,6 +255,7 @@ public class GuiCraftGUI extends GuiContainer {
if (button != -1) { if (button != -1) {
window.callEvent(new EventMouse.Up(origin, x, y, button)); window.callEvent(new EventMouse.Up(origin, x, y, button));
} }
NEIHook.mouseUp(x, y, button);
} }
@Override @Override
@@ -250,6 +265,8 @@ public class GuiCraftGUI extends GuiContainer {
if (dWheel != 0) { if (dWheel != 0) {
window.callEvent(new EventMouse.Wheel(window, dWheel)); window.callEvent(new EventMouse.Wheel(window, dWheel));
} }
NEIHook.handleMouseWheel();
} }
@Override @Override
@@ -506,4 +523,13 @@ public class GuiCraftGUI extends GuiContainer {
GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_TEXTURE_2D);
} }
public ItemStack getStackUnderMouse(int x, int y) {
for (IWidget widget : window.calculateMousedOverWidgets()) {
if (widget instanceof ControlSlotBase && widget.isVisible()) {
return ((ControlSlotBase) widget).getItemStack();
}
}
return null;
}
} }
@@ -29,6 +29,7 @@ import binnie.core.craftgui.minecraft.control.ControlHelp;
import binnie.core.craftgui.minecraft.control.ControlInfo; import binnie.core.craftgui.minecraft.control.ControlInfo;
import binnie.core.craftgui.minecraft.control.ControlPowerSystem; import binnie.core.craftgui.minecraft.control.ControlPowerSystem;
import binnie.core.craftgui.minecraft.control.ControlSlot; import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.minecraft.control.ControlSlotBase;
import binnie.core.craftgui.minecraft.control.ControlUser; import binnie.core.craftgui.minecraft.control.ControlUser;
import binnie.core.craftgui.minecraft.control.EnumHighlighting; import binnie.core.craftgui.minecraft.control.EnumHighlighting;
import binnie.core.craftgui.renderer.Renderer; import binnie.core.craftgui.renderer.Renderer;
@@ -40,6 +41,7 @@ import binnie.core.machines.Machine;
import binnie.core.machines.inventory.IInventoryMachine; import binnie.core.machines.inventory.IInventoryMachine;
import binnie.core.machines.network.INetwork; import binnie.core.machines.network.INetwork;
import binnie.core.machines.power.PowerSystem; import binnie.core.machines.power.PowerSystem;
import binnie.core.nei.NEIHook;
import binnie.core.network.packet.MessageCraftGUI; import binnie.core.network.packet.MessageCraftGUI;
import binnie.core.resource.BinnieResource; import binnie.core.resource.BinnieResource;
import binnie.core.resource.ResourceType; import binnie.core.resource.ResourceType;
@@ -118,6 +120,9 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
if (!widget.calculateIsMouseOver()) { if (!widget.calculateIsMouseOver()) {
continue; continue;
} }
if (NEIHook.enabled && widget instanceof ControlSlotBase) {
return;
}
if (widget instanceof ITooltip) { if (widget instanceof ITooltip) {
((ITooltip) widget).getTooltip(tooltip); ((ITooltip) widget).getTooltip(tooltip);
if (tooltip.exists()) { if (tooltip.exists()) {
@@ -13,6 +13,7 @@ import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.geometry.IPoint; import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.minecraft.Window; import binnie.core.craftgui.minecraft.Window;
import binnie.core.craftgui.resource.minecraft.CraftGUITexture; import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
import binnie.core.nei.NEIHook;
public abstract class ControlSlotBase extends Control implements ITooltip { public abstract class ControlSlotBase extends Control implements ITooltip {
@@ -60,6 +61,7 @@ public abstract class ControlSlotBase extends Control implements ITooltip {
@Override @Override
public void getTooltip(Tooltip tooltip) { public void getTooltip(Tooltip tooltip) {
if (NEIHook.enabled) return;
ItemStack item = getItemStack(); ItemStack item = getItemStack();
if (item == null) { if (item == null) {
return; return;
@@ -16,24 +16,40 @@ public class BeeModifierLogic {
} }
public float getModifier(EnumBeeModifier modifier, float currentModifier) { public float getModifier(EnumBeeModifier modifier, float currentModifier) {
if (!modifiers.containsKey(modifier)) { if (modifier == EnumBeeModifier.PRODUCTION) {
return 1.0f; if (!modifiers.containsKey(modifier)) {
} return 0.0f;
}
Float[] values = modifiers.get(modifier); Float[] values = modifiers.get(modifier);
float mult = values[0]; float offset = values[0], max = values[1];
float max = values[1]; if (offset < 0) {// negative modifiers should always apply
if (max >= 1.0f) { return offset;
if (max <= currentModifier) { }
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 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) { public boolean getModifier(EnumBeeBooleanModifier modifier) {
@@ -1,8 +1,15 @@
package binnie.core.genetics; package binnie.core.genetics;
import binnie.core.util.I18N;
public enum EnumBeeBooleanModifier { public enum EnumBeeBooleanModifier {
SEALED, SEALED,
SELF_LIGHTED, SELF_LIGHTED,
SUNLIGHT_STIMULATED, SUNLIGHT_STIMULATED,
HELLISH HELLISH;
public String getName() {
return I18N.localise("binniecore.beebooleanmodifier." + name().toLowerCase());
}
} }
@@ -122,7 +122,7 @@ public class TransferRequest {
|| ((IInventorySlots) destination).getSlot(slot) == null || ((IInventorySlots) destination).getSlot(slot) == null
|| !((IInventorySlots) destination).getSlot(slot).isRecipe()) { || !((IInventorySlots) destination).getSlot(slot).isRecipe()) {
if (destination.getStackInSlot(slot) != null) { if (destination.getStackInSlot(slot) != null) {
if (item.isStackable()) { if (item.isStackable() && destination.getInventoryStackLimit() > 1) {
ItemStack merged = destination.getStackInSlot(slot).copy(); ItemStack merged = destination.getStackInSlot(slot).copy();
ItemStack[] newStacks = mergeStacks(item.copy(), merged.copy()); ItemStack[] newStacks = mergeStacks(item.copy(), merged.copy());
item = newStacks[0]; item = newStacks[0];
@@ -149,7 +149,16 @@ public class TransferRequest {
if (destination.getStackInSlot(slot) == null) { if (destination.getStackInSlot(slot) == null) {
insertedSlots.add(new TransferSlot(slot, destination)); insertedSlots.add(new TransferSlot(slot, destination));
if (doAdd) { if (doAdd) {
destination.setInventorySlotContents(slot, item.copy()); ItemStack movedStack = item.copy();
if (movedStack.stackSize > destination.getInventoryStackLimit()) {
movedStack.stackSize = destination.getInventoryStackLimit();
}
item.stackSize -= movedStack.stackSize;
destination.setInventorySlotContents(slot, movedStack);
if (item.stackSize <= 0) {
item = null;
}
return item;
} }
return null; return null;
} }
@@ -0,0 +1,49 @@
package binnie.core.nei;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import binnie.core.craftgui.minecraft.GuiCraftGUI;
import codechicken.nei.guihook.IContainerObjectHandler;
import cpw.mods.fml.common.Optional;
@Optional.Interface(
iface = "codechicken.nei.guihook.IContainerObjectHandler",
modid = "NotEnoughItems",
striprefs = true)
public final class ContainerObjectHandler implements IContainerObjectHandler {
@Override
public void guiTick(GuiContainer gui) {
}
@Override
public void refresh(GuiContainer gui) {
}
@Override
public void load(GuiContainer gui) {
}
@Override
public ItemStack getStackUnderMouse(GuiContainer gui, int mousex, int mousey) {
if (gui instanceof GuiCraftGUI) {
return ((GuiCraftGUI) gui).getStackUnderMouse(mousex, mousey);
} else {
return null;
}
}
@Override
public boolean objectUnderMouse(GuiContainer gui, int mousex, int mousey) {
return false;
}
@Override
public boolean shouldShowTooltip(GuiContainer gui) {
return true;
}
}
+107
View File
@@ -0,0 +1,107 @@
package binnie.core.nei;
import org.lwjgl.opengl.GL11;
import binnie.core.craftgui.minecraft.Window;
import codechicken.nei.guihook.GuiContainerManager;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public final class NEIHook {
public static boolean enabled = false;
static {
if (Loader.isModLoaded("NotEnoughItems")) {
enabled = true;
addHandler();
}
}
@Optional.Method(modid = "NotEnoughItems")
private static void addHandler() {
GuiContainerManager.addObjectHandler(new ContainerObjectHandler());
}
@Optional.Method(modid = "NotEnoughItems")
private static GuiContainerManager getManager() {
return GuiContainerManager.getManager();
}
@Optional.Method(modid = "NotEnoughItems")
private static void preDrawImpl() {
GuiContainerManager manager = getManager();
if (manager != null) manager.preDraw();
}
public static void preDraw() {
if (enabled) preDrawImpl();
}
@Optional.Method(modid = "NotEnoughItems")
private static void renderObjectsImpl(Window window, int mouseX, int mouseY) {
GL11.glPushMatrix();
GL11.glTranslatef(window.x(), window.y(), 0.0f);
GuiContainerManager manager = getManager();
if (manager != null) manager.renderObjects(mouseX, mouseY);
GL11.glTranslatef(-window.x(), -window.y(), 0.0f);
GL11.glPopMatrix();
}
public static void renderObjects(Window window, int mouseX, int mouseY) {
if (enabled) renderObjectsImpl(window, mouseX, mouseY);
}
@Optional.Method(modid = "NotEnoughItems")
private static void renderToolTipsImpl(int mouseX, int mouseY) {
GuiContainerManager manager = getManager();
if (manager != null) manager.renderToolTips(mouseX, mouseY);
}
public static void renderToolTips(int mouseX, int mouseY) {
if (enabled) renderToolTipsImpl(mouseX, mouseY);
}
@Optional.Method(modid = "NotEnoughItems")
private static void mouseClickedImpl(int x, int y, int button) {
GuiContainerManager manager = getManager();
if (manager != null) manager.mouseClicked(x, y, button);
}
public static void mouseClicked(int x, int y, int button) {
if (enabled) mouseClickedImpl(x, y, button);
}
@Optional.Method(modid = "NotEnoughItems")
private static void lastKeyTypedImpl(int k, char c) {
GuiContainerManager manager = getManager();
if (manager != null) manager.lastKeyTyped(k, c);
}
public static void lastKeyTyped(int k, char c) {
if (enabled) lastKeyTypedImpl(k, c);
}
@Optional.Method(modid = "NotEnoughItems")
private static void handleMouseWheelImpl() {
GuiContainerManager manager = getManager();
if (manager != null) manager.handleMouseWheel();
}
public static void handleMouseWheel() {
if (enabled) handleMouseWheelImpl();
}
@Optional.Method(modid = "NotEnoughItems")
private static void mouseUpImpl(int mouseX, int mouseY, int button) {
GuiContainerManager manager = getManager();
if (manager != null) manager.mouseUp(mouseX, mouseY, button);
}
public static void mouseUp(int mouseX, int mouseY, int button) {
if (enabled) mouseUpImpl(mouseX, mouseY, button);
}
}
+5 -1
View File
@@ -2,7 +2,11 @@ package binnie.core.nei;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.*; import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidBlock;
import net.minecraftforge.fluids.IFluidContainerItem;
public class NEIUtils { public class NEIUtils {
@@ -1,6 +1,7 @@
package binnie.core.nei; package binnie.core.nei;
import java.awt.*; import java.awt.Point;
import java.awt.Rectangle;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@@ -1,6 +1,6 @@
package binnie.core.nei; package binnie.core.nei;
import java.awt.*; import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -1,6 +1,7 @@
package binnie.core.nei; package binnie.core.nei;
import java.awt.*; import java.awt.Point;
import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -33,7 +33,7 @@ public class ComponentBeeModifier extends MachineComponent implements IBeeModifi
@Override @Override
public float getProductionModifier(IBeeGenome genome, float currentModifier) { public float getProductionModifier(IBeeGenome genome, float currentModifier) {
return 1.0f; return 0.0f;
} }
@Override @Override
@@ -36,17 +36,17 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
public static void init() { public static void init() {
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.25f); EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.25f);
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.PRODUCTION, 1.5f, 5.0f); EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.5f, 2.0f);// was 1.5x lim 5.0x
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.TERRITORY, 0.5f, 0.1f); 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.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.MUTATION, 1.5f, 5.0f);
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.5f); 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.Soul.setMaxDamage(80);
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.LIFESPAN, 1.5f, 5.0f); 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.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); EnumHiveFrame.Debug.logic.setModifier(EnumBeeModifier.LIFESPAN, 1.0E-4f, 1.0E-4f);
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -152,7 +152,7 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
@Override @Override
public float getProductionModifier(IBeeGenome genome, float currentModifier) { public float getProductionModifier(IBeeGenome genome, float currentModifier) {
if (getBeeModifier() == null) { if (getBeeModifier() == null) {
return 1.0f; return 0.0f;
} }
return getBeeModifier().getProductionModifier(genome, currentModifier); return getBeeModifier().getProductionModifier(genome, currentModifier);
} }
@@ -72,7 +72,7 @@ public class FrameComponentModifier extends ComponentBeeModifier implements IBee
public float getProductionModifier(IBeeGenome genome, float currentModifier) { public float getProductionModifier(IBeeGenome genome, float currentModifier) {
IHiveFrame frame = getHiveFrame(); IHiveFrame frame = getHiveFrame();
if (frame == null) { if (frame == null) {
return 1.0f; return 0.0f;
} }
return frame.getBeeModifier().getProductionModifier(genome, currentModifier); return frame.getBeeModifier().getProductionModifier(genome, currentModifier);
} }
@@ -20,15 +20,17 @@ public enum CircuitType implements IBeeModifier {
Territory(2, 10); Territory(2, 10);
static { static {
CircuitType.LowVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 1.5f, 5.0f); CircuitType.LowVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.5f, 5.0f);
CircuitType.HighVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 2.5f, 10.0f); CircuitType.HighVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 1.5f, 10.0f);
CircuitType.Plant.logic.setModifier(EnumBeeModifier.FLOWERING, 1.5f, 5.0f); CircuitType.Plant.logic.setModifier(EnumBeeModifier.FLOWERING, 1.5f, 5.0f);
CircuitType.Death.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.8f, 0.2f); CircuitType.Death.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.8f, 0.2f);
CircuitType.Life.logic.setModifier(EnumBeeModifier.LIFESPAN, 1.5f, 5.0f); CircuitType.Life.logic.setModifier(EnumBeeModifier.LIFESPAN, 1.5f, 5.0f);
CircuitType.Nether.logic.setModifier(EnumBeeBooleanModifier.HELLISH); CircuitType.Nether.logic.setModifier(EnumBeeBooleanModifier.HELLISH);
CircuitType.Mutation.logic.setModifier(EnumBeeModifier.MUTATION, 1.5f, 5.0f); 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.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); CircuitType.Territory.logic.setModifier(EnumBeeModifier.TERRITORY, 1.5f, 5.0f);
for (CircuitType type : values()) { for (CircuitType type : values()) {
type.logic.setModifier(EnumBeeModifier.GENETIC_DECAY, 1.5f, 10.0f); type.logic.setModifier(EnumBeeModifier.GENETIC_DECAY, 1.5f, 10.0f);
@@ -48,18 +50,34 @@ public enum CircuitType implements IBeeModifier {
public void createCircuit(ICircuitLayout layout) { public void createCircuit(ICircuitLayout layout) {
StimulatorCircuit circuit = new StimulatorCircuit(this, layout); StimulatorCircuit circuit = new StimulatorCircuit(this, layout);
for (EnumBeeModifier modifier : EnumBeeModifier.values()) { for (EnumBeeBooleanModifier modifier : EnumBeeBooleanModifier.values()) {
float mod = logic.getModifier(modifier, 1.0f); if (logic.getModifier(modifier)) {
if (mod == 1.0f) { circuit.addTooltipString("Enables " + modifier.getName());
continue;
} }
}
if (mod > 1.0f) { for (EnumBeeModifier modifier : EnumBeeModifier.values()) {
int increase = (int) ((mod - 1.0f) * 100.0f); if (modifier == EnumBeeModifier.PRODUCTION) {
circuit.addTooltipString("Increases " + modifier.getName() + " by " + increase + "%"); 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 { } else {
int decrease = (int) ((1.0f - mod) * 100.0f); float mod = logic.getModifier(modifier, 1.0f);
circuit.addTooltipString("Decreases " + modifier.getName() + " by " + decrease + "%"); 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 + "%");
}
} }
} }
} }
@@ -18,7 +18,13 @@ public class StimulatorAlvearyPackage extends AlvearyMachine.AlvearyPackage impl
@Override @Override
public void createMachine(Machine machine) { public void createMachine(Machine machine) {
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyStimulator); new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyStimulator);
ComponentInventorySlots inventory = new ComponentInventorySlots(machine); ComponentInventorySlots inventory = new ComponentInventorySlots(machine) {
@Override
public int getInventoryStackLimit() {
return 1;
}
};
inventory.addSlot(AlvearyStimulator.SLOT_CIRCUIT, "circuit"); inventory.addSlot(AlvearyStimulator.SLOT_CIRCUIT, "circuit");
inventory.getSlot(AlvearyStimulator.SLOT_CIRCUIT).setValidator(new CircuitSlotValidator()); inventory.getSlot(AlvearyStimulator.SLOT_CIRCUIT).setValidator(new CircuitSlotValidator());
new ComponentPowerReceptor(machine); new ComponentPowerReceptor(machine);
@@ -100,13 +100,14 @@ public class StimulatorModifierComponent extends ComponentBeeModifier implements
@Override @Override
public float getProductionModifier(IBeeGenome genome, float currentModifier) { 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) { if (!powered) {
return mod; return mod;
} }
for (IBeeModifier beeMod : modifiers) { for (IBeeModifier beeMod : modifiers) {
mod *= beeMod.getProductionModifier(genome, mod); mod += beeMod.getProductionModifier(genome, mod);
} }
return mod; return mod;
} }
@@ -4,7 +4,9 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import binnie.extrabees.genetics.requirements.*; import binnie.extrabees.genetics.requirements.DummyMutationCondition;
import binnie.extrabees.genetics.requirements.IMutationRequirement;
import binnie.extrabees.genetics.requirements.RequirementPerson;
import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.IAlleleBeeSpecies; import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeGenome;
@@ -8,13 +8,12 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import com.google.common.base.Optional;
import binnie.core.Mods; import binnie.core.Mods;
import binnie.core.block.TileEntityMetadata; import binnie.core.block.TileEntityMetadata;
import binnie.core.util.I18N; import binnie.core.util.I18N;
import binnie.extratrees.ExtraTrees; import binnie.extratrees.ExtraTrees;
import binnie.extratrees.api.CarpentryManager; import binnie.extratrees.api.CarpentryManager;
import extrabiomes.api.Stuff;
public class PlankType { public class PlankType {
@@ -267,13 +266,10 @@ public class PlankType {
@Override @Override
public ItemStack getStack() { public ItemStack getStack() {
try { if (!Mods.extraBiomes.active()) {
Class clss = Class.forName("extrabiomes.api.Stuff");
Block block = (Block) ((Optional) clss.getField("planks").get(null)).get();
return new ItemStack(block, 1, ordinal());
} catch (Exception e) {
return null; return null;
} }
return Stuff.planks.transform(block -> new ItemStack(block, 1, ordinal())).orNull();
} }
@Override @Override
@@ -8,6 +8,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import binnie.core.Mods;
import binnie.core.block.TileEntityMetadata; import binnie.core.block.TileEntityMetadata;
import binnie.extratrees.ExtraTrees; import binnie.extratrees.ExtraTrees;
import binnie.extratrees.api.CarpentryManager; import binnie.extratrees.api.CarpentryManager;
@@ -17,6 +18,8 @@ import binnie.extratrees.block.decor.FenceType;
public class WoodManager { public class WoodManager {
private static List<IPlankType> allPlankTypes;
public static IPlankType getPlankType(int index) { public static IPlankType getPlankType(int index) {
IDesignMaterial wood = CarpentryManager.carpentryInterface.getWoodMaterial(index); IDesignMaterial wood = CarpentryManager.carpentryInterface.getWoodMaterial(index);
if (wood instanceof IPlankType) { if (wood instanceof IPlankType) {
@@ -97,16 +100,18 @@ public class WoodManager {
} }
public static List<IPlankType> getAllPlankTypes() { public static List<IPlankType> getAllPlankTypes() {
if (allPlankTypes != null) {
return allPlankTypes;
}
List<IPlankType> list = new ArrayList<>(); List<IPlankType> list = new ArrayList<>();
Collections.addAll(list, PlankType.ExtraTreePlanks.values()); Collections.addAll(list, PlankType.ExtraTreePlanks.values());
Collections.addAll(list, PlankType.ForestryPlanks.values()); Collections.addAll(list, PlankType.ForestryPlanks.values());
for (IPlankType type : PlankType.ExtraBiomesPlank.values()) { if (Mods.extraBiomes.active()) {
if (type.getStack() != null) { Collections.addAll(list, PlankType.ExtraBiomesPlank.values());
list.add(type);
}
} }
Collections.addAll(list, PlankType.VanillaPlanks.values()); Collections.addAll(list, PlankType.VanillaPlanks.values());
allPlankTypes = list;
return list; return list;
} }
@@ -29,19 +29,18 @@ public class Lumbermill {
public static Map<ItemStack, ItemStack> recipes = new HashMap<>(); public static Map<ItemStack, ItemStack> recipes = new HashMap<>();
public static ItemStack getPlankProduct(ItemStack item) { public static ItemStack getPlankProduct(ItemStack item) {
ItemStack stack = null;
if (Lumbermill.recipes.isEmpty()) { if (Lumbermill.recipes.isEmpty()) {
calculateLumbermillProducts(); calculateLumbermillProducts();
} }
for (Map.Entry<ItemStack, ItemStack> entry : Lumbermill.recipes.entrySet()) { for (Map.Entry<ItemStack, ItemStack> entry : Lumbermill.recipes.entrySet()) {
if (entry.getKey().isItemEqual(item)) { if (entry.getKey().isItemEqual(item)) {
stack = entry.getValue().copy(); ItemStack stack = entry.getValue().copy();
break; stack.stackSize = 6;
return stack;
} }
} }
stack.stackSize = 6; return null;
return stack;
} }
public static void calculateLumbermillProducts() { public static void calculateLumbermillProducts() {
@@ -1,6 +1,6 @@
package binnie.extratrees.nei; package binnie.extratrees.nei;
import java.awt.*; import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -1,6 +1,6 @@
package binnie.genetics.nei; package binnie.genetics.nei;
import java.awt.*; import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei; package binnie.genetics.nei;
import java.awt.*; import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei; package binnie.genetics.nei;
import java.awt.*; import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei; package binnie.genetics.nei;
import java.awt.*; import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei; package binnie.genetics.nei;
import java.awt.*; import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -182,7 +182,12 @@ binniecore.beemodifier.mutation=Mutation
binniecore.beemodifier.lifespan=Lifespan binniecore.beemodifier.lifespan=Lifespan
binniecore.beemodifier.production=Production binniecore.beemodifier.production=Production
binniecore.beemodifier.flowering=Flowering 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.species=Species Discovered
binniecore.gui.breedingmessage.branch=Branch Discovered binniecore.gui.breedingmessage.branch=Branch Discovered
@@ -182,7 +182,7 @@ binniecore.beemodifier.mutation=Мутация
binniecore.beemodifier.lifespan=Время жизни binniecore.beemodifier.lifespan=Время жизни
binniecore.beemodifier.production=Продукция binniecore.beemodifier.production=Продукция
binniecore.beemodifier.flowering=Цветы binniecore.beemodifier.flowering=Цветы
binniecore.beemodifier.geneticdecay=Склонность к вырождению binniecore.beemodifier.genetic_decay=Склонность к вырождению
binniecore.gui.breedingmessage.species=Видов обнаружено binniecore.gui.breedingmessage.species=Видов обнаружено
binniecore.gui.breedingmessage.branch=Семейств обнаружено binniecore.gui.breedingmessage.branch=Семейств обнаружено
@@ -182,7 +182,7 @@ binniecore.beemodifier.mutation=变异
binniecore.beemodifier.lifespan=寿命 binniecore.beemodifier.lifespan=寿命
binniecore.beemodifier.production=产物 binniecore.beemodifier.production=产物
binniecore.beemodifier.flowering=授粉速度 binniecore.beemodifier.flowering=授粉速度
binniecore.beemodifier.geneticdecay=基因衰变 binniecore.beemodifier.genetic_decay=基因衰变
binniecore.gui.breedingmessage.species=已发现品种 binniecore.gui.breedingmessage.species=已发现品种
binniecore.gui.breedingmessage.branch=已发现分支 binniecore.gui.breedingmessage.branch=已发现分支
@@ -366,7 +366,7 @@ for.binnie.circuit.garden.damp.neutral=Garden (Damp, Neutral)
for.binnie.circuit.garden.damp.alkaline=Garden (Damp, Alkaline) for.binnie.circuit.garden.damp.alkaline=Garden (Damp, Alkaline)
botany.tube.name=Insulated Tube botany.tube.name=Insulated Tube
botany.tube.cooper=Cooper botany.tube.copper=Copper
botany.tube.tin=Tin botany.tube.tin=Tin
botany.tube.bronze=Bronze botany.tube.bronze=Bronze
botany.tube.iron=Iron botany.tube.iron=Iron
@@ -366,7 +366,7 @@ for.binnie.circuit.garden.damp.neutral=Сад (влажный, нейтраль
for.binnie.circuit.garden.damp.alkaline=Сад (влажный, щелочной) for.binnie.circuit.garden.damp.alkaline=Сад (влажный, щелочной)
botany.tube.name=изолирующая лампа botany.tube.name=изолирующая лампа
botany.tube.cooper=Медная botany.tube.copper=Медная
botany.tube.tin=Оловяная botany.tube.tin=Оловяная
botany.tube.bronze=Бронзовая botany.tube.bronze=Бронзовая
botany.tube.iron=Железная botany.tube.iron=Железная
@@ -364,7 +364,7 @@ for.binnie.circuit.garden.damp.neutral=花土(潮湿,中性)
for.binnie.circuit.garden.damp.alkaline=花土(潮湿,碱性) for.binnie.circuit.garden.damp.alkaline=花土(潮湿,碱性)
botany.tube.name=恒温管 botany.tube.name=恒温管
botany.tube.cooper=铜 botany.tube.copper=铜
botany.tube.tin=锡 botany.tube.tin=锡
botany.tube.bronze=青铜 botany.tube.bronze=青铜
botany.tube.iron=铁 botany.tube.iron=铁