Compare commits

..
1 Commits
Author SHA1 Message Date
Martin Robertzandkuba6000 19ef8fe309 Bees (#47)
* New formula

* Make production modifier globally additive

---------

Co-authored-by: kuba6000 <[email protected]>
2023-03-28 07:42:16 +02:00
134 changed files with 691 additions and 946 deletions

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
#!/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
+214 -290
View File
@@ -1,4 +1,4 @@
//version: 1702141377
//version: 1678003329
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -6,34 +6,53 @@
*/
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.Application
import org.jetbrains.gradle.ext.Gradle
import org.jetbrains.gradle.ext.*
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 {
mavenCentral()
maven {
name 'forge'
url 'https://maven.minecraftforge.net'
}
maven {
// GTNH RetroFuturaGradle and ASM Fork
name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/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()
}
}
@@ -46,26 +65,22 @@ 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 '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 '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 '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.7.2' apply false
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.26'
id 'com.gtnewhorizons.retrofuturagradle' version '1.2.3'
}
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.")
// In submodules, .git is a file pointing to the real git dir
if (project.file('.git/HEAD').isFile() || project.file('.git').isFile()) {
if (project.file('.git/HEAD').isFile()) {
apply plugin: 'com.palantir.git-version'
}
@@ -74,23 +89,6 @@ def out = services.get(StyledTextOutputFactory).create('an-output')
def projectJavaVersion = JavaLanguageVersion.of(8)
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("modId")
@@ -117,8 +115,6 @@ 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", "")
@@ -136,23 +132,12 @@ 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(com.diffplug.blowdryer.Blowdryer, "Blowdryer", com.diffplug.blowdryer.Blowdryer) // Make blowdryer available in "apply from:" scripts
project.extensions.add(Blowdryer, "Blowdryer", Blowdryer) // Make blowdryer available in "apply from:" scripts
if (!disableSpotless) {
apply plugin: 'com.diffplug.spotless'
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 scalaSourceDir = "src/main/scala/"
String kotlinSourceDir = "src/main/kotlin/"
@@ -175,14 +160,6 @@ 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 {
@@ -216,14 +193,6 @@ 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()) {
@@ -237,8 +206,6 @@ 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
}
@@ -287,7 +254,7 @@ if (apiPackage) {
}
if (accessTransformersFile) {
for (atFile in accessTransformersFile.split(" ")) {
for (atFile in accessTransformersFile.split(",")) {
String targetFile = "src/main/resources/META-INF/" + atFile.trim()
if (!getFile(targetFile).exists()) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
@@ -372,27 +339,7 @@ catch (Exception ignored) {
String identifiedVersion
String versionOverride = System.getenv("VERSION") ?: null
try {
// 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
}
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
}
catch (Exception ignored) {
out.style(Style.Failure).text(
@@ -414,13 +361,9 @@ if (identifiedVersion == versionOverride) {
group = "com.github.GTNewHorizons"
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
base {
archivesName = customArchiveBaseName
}
archivesBaseName = customArchiveBaseName
} else {
base {
archivesName = modId
}
archivesBaseName = modId
}
@@ -448,12 +391,14 @@ minecraft {
username = developmentEnvironmentUserName.toString()
lwjgl3Version = "3.3.2"
lwjgl3Version = "3.3.2-SNAPSHOT"
// 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",
@@ -504,19 +449,10 @@ sourceSets {
}
}
if (file('addon.gradle.kts').exists()) {
apply from: 'addon.gradle.kts'
} else if (file('addon.gradle').exists()) {
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) {
@@ -527,14 +463,7 @@ repositories.configureEach { repo ->
}
}
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]")
}
apply from: 'repositories.gradle'
configurations {
runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
@@ -575,12 +504,23 @@ repositories {
maven {
name 'Overmind forge repo mirror'
url 'https://gregtech.overminddl1.com/'
mavenContent {
excludeGroup("net.minecraftforge") // missing the `universal` artefact
}
}
maven {
name = "GTNH Maven"
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/'
@@ -589,34 +529,24 @@ repositories {
}
}
if (includeWellKnownRepositories.toBoolean()) {
exclusiveContent {
forRepository {
maven {
name "CurseMaven"
url "https://cursemaven.com"
}
}
filter {
maven {
name "CurseMaven"
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
maven {
name = "ic2"
url = getURL("https://maven2.ic2.player.to/", "https://maven.ic2.player.to/")
content {
includeGroup "net.industrial-craft"
url = "https://maven.ic2.player.to/"
metadataSources {
mavenPom()
artifact()
}
}
maven {
name = "ic2-mirror"
url = "https://maven2.ic2.player.to/"
metadataSources {
mavenPom()
artifact()
@@ -629,80 +559,35 @@ repositories {
}
}
def mixinProviderGroup = "io.github.legacymoddingmc"
def mixinProviderModule = "unimixins"
def mixinProviderVersion = "0.1.13"
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(mixinProviderSpec)
annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
if (usesMixinDebug.toBoolean()) {
runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16')
}
}
if (usesMixins.toBoolean()) {
implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap))
} else if (forceEnableMixins.toBoolean()) {
runtimeOnlyNonPublishable(mixinProviderSpec)
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
implementation('com.gtnewhorizon:gtnhmixins:2.1.13')
}
}
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
if (usesMixins.toBoolean()) {
dependencies {
kapt(mixinProviderSpec)
kapt('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
}
}
}
// Replace old mixin mods with unimixins
// https://docs.gradle.org/8.0.2/userguide/resolution_rules.html#sec:substitution_with_classifier
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module('com.gtnewhorizon:gtnhmixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
substitute module('com.github.GTNewHorizons:Mixingasm') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier")
apply from: 'dependencies.gradle'
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')
}
}
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'
def refMap = "${mixinTmpDir}" + File.separator + mixingConfigRefMap
def mixinSrg = "${mixinTmpDir}" + File.separator + "mixins.srg"
tasks.register('generateAssets') {
group = "GTNH Buildscript"
@@ -734,17 +619,46 @@ 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 {
@@ -762,6 +676,7 @@ tasks.named("processResources", ProcessResources).configure {
}
if (usesMixins.toBoolean()) {
from refMap
dependsOn("compileJava", "compileScala")
}
}
@@ -780,14 +695,23 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
}
dependencies {
def lwjgl3ifyVersion = '1.5.7'
def lwjgl3ifyVersion = '1.1.35'
def asmVersion = '9.4'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.40')
}
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}
}
@@ -851,7 +775,7 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
public boolean setEnableHotswap(boolean enable) { enableHotswap = enable }
@Inject
public RunHotswappableMinecraftTask(Distribution side, String superTask, org.gradle.api.invocation.Gradle gradle) {
public RunHotswappableMinecraftTask(Side side, String superTask, org.gradle.api.invocation.Gradle gradle) {
super(side, gradle)
this.lwjglVersion = 3
@@ -860,7 +784,7 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
this.extraJvmArgs.addAll(project.provider(() -> enableHotswap ? project.hotswapJvmArgs : []))
this.classpath(project.java17PatchDependenciesCfg)
if (side == Distribution.CLIENT) {
if (side == Side.CLIENT) {
this.classpath(project.minecraftTasks.lwjgl3Configuration)
}
// Use a raw provider instead of map to not create a dependency on the task
@@ -869,22 +793,14 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
!file.path.contains("2.9.4-nightly-20150209") // Remove lwjgl2
}
this.classpath(project.java17DependenciesCfg)
}
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] : []
}))
if (!(project.usesMixins.toBoolean() || project.forceEnableMixins.toBoolean())) {
this.extraArgs.addAll("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker")
}
}
}
def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient")
def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Side.CLIENT, "runClient")
runClient17Task.configure {
setup(project)
group = "Modded Minecraft"
@@ -895,7 +811,7 @@ runClient17Task.configure {
userUUID = minecraft.userUUID
}
def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Distribution.DEDICATED_SERVER, "runServer")
def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Side.SERVER, "runServer")
runServer17Task.configure {
setup(project)
group = "Modded Minecraft"
@@ -936,6 +852,11 @@ 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())
@@ -951,8 +872,7 @@ if (usesShadowedDependencies.toBoolean()) {
]
archiveClassifier.set('dev')
if (relocateShadowedDependencies.toBoolean()) {
relocationPrefix = modGroup + ".shadow"
enableRelocation = true
dependsOn(relocateShadowJar)
}
}
configurations.runtimeElements.outgoing.artifacts.clear()
@@ -1026,9 +946,6 @@ idea {
}
}
runConfigurations {
"0. Build and Test"(Gradle) {
taskNames = ["build"]
}
"1. Run Client"(Gradle) {
taskNames = ["runClient"]
}
@@ -1089,7 +1006,6 @@ idea {
}
compiler.javac {
afterEvaluate {
javacAdditionalOptions = "-encoding utf8"
moduleJavacAdditionalOptions = [
(project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ')
]
@@ -1148,14 +1064,6 @@ 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
@@ -1174,15 +1082,14 @@ publishing {
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
}
}
repositories {
if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) {
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"
}
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"
}
}
}
@@ -1218,7 +1125,7 @@ if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) {
}
}
if (usesMixins.toBoolean()) {
addModrinthDep("required", "project", "unimixins")
addModrinthDep("required", "project", "gtnhmixins")
}
tasks.modrinth.dependsOn(build)
tasks.publish.dependsOn(tasks.modrinth)
@@ -1262,7 +1169,7 @@ if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null
}
}
if (usesMixins.toBoolean()) {
addCurseForgeRelation("requiredDependency", "unimixins")
addCurseForgeRelation("requiredDependency", "gtnhmixins")
}
tasks.curseforge.dependsOn(build)
tasks.publish.dependsOn(tasks.curseforge)
@@ -1297,7 +1204,7 @@ def addCurseForgeRelation(String type, String name) {
// Updating
def buildscriptGradleVersion = "8.5"
def buildscriptGradleVersion = "8.0.1"
tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion
@@ -1329,23 +1236,6 @@ 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")
}
@@ -1403,14 +1293,8 @@ boolean isNewBuildScriptVersionAvailable() {
String currentBuildScript = getFile("build.gradle").getText()
String currentBuildScriptHash = getVersionHash(currentBuildScript)
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
}
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
String availableBuildScriptHash = getVersionHash(availableBuildScript)
boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
return !isUpToDate
@@ -1489,7 +1373,7 @@ static int replaceParams(File file, Map<String, String> params) {
return 0
}
// Dependency Deobfuscation (Deprecated, use the new RFG API documented in dependencies.gradle)
// Dependency Deobfuscation
def deobf(String sourceURL) {
try {
@@ -1531,7 +1415,11 @@ def deobfMaven(String repoURL, String mavenDep) {
}
def deobfCurse(String curseDep) {
return dependencies.rfg.deobf("curse.maven:$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.")
}
}
// The method above is to be preferred. Use this method if the filename is not at the end of the URL.
@@ -1539,7 +1427,34 @@ 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
@@ -1547,8 +1462,50 @@ def deobf(String sourceURL, String rawFileName) {
quiet true
overwrite false
}
return dependencies.rfg.deobf(files(obfFile))
exec {
commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', minecraftVersion, '--mappingsVer', mappingsVer, '--notch'
workingDir bon2Dir
standardOutput = new FileOutputStream("${deobfFile}.log")
}
return files(deobfFile)
}
def zipMappings(String zipPath, String url, String bon2Dir) {
File zipFile = new File(zipPath)
if (zipFile.exists()) {
return
}
String fieldsCache = "$bon2Dir/data/fields.csv"
String methodsCache = "$bon2Dir/data/methods.csv"
download.run {
src "${url}fields.csv"
dest fieldsCache
quiet true
}
download.run {
src "${url}methods.csv"
dest methodsCache
quiet true
}
zipFile.getParentFile().mkdirs()
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))
zos.putNextEntry(new ZipEntry("fields.csv"))
Files.copy(Paths.get(fieldsCache), zos)
zos.closeEntry()
zos.putNextEntry(new ZipEntry("methods.csv"))
Files.copy(Paths.get(methodsCache), zos)
zos.closeEntry()
zos.close()
}
// Helper methods
def checkPropertyExists(String propertyName) {
@@ -1575,36 +1532,3 @@ def getSecondaryArtifacts() {
if (apiPackage) secondaryArtifacts += [apiJar]
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'
}
+7 -5
View File
@@ -1,10 +1,12 @@
// Add your dependencies here
dependencies {
api('curse.maven:cofh-lib-220333:2388748')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.4.13-GTNH:dev')
compileOnly('com.github.GTNewHorizons:inventory-tweaks:1.6.1:api')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.38:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compile('com.github.GTNewHorizons:NotEnoughItems:2.2.7-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')
compileOnly('curse.maven:craftguide-75557:2459320')
}
+8 -100
View File
@@ -15,40 +15,22 @@ autoUpdateBuildScript = false
minecraftVersion = 1.7.10
forgeVersion = 10.13.4.1614
# Specify a MCP channel and mappings version for dependency deobfuscation and the deobfParams task.
channel = stable
mappingsVersion = 12
# Define other MCP mappings for dependency deobfuscation
remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
developmentEnvironmentUserName = Developer
# Enables using modern java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = true
# Enables injecting missing generics into the decompiled source code for a better coding experience
# Turns most publicly visible List, Map, etc. into proper List<Type>, Map<K, V> types
enableGenericInjection = true
# Generate a class with String fields for the mod id, name, version and group name named with the fields below
generateGradleTokenClass = forestry.Tags
gradleTokenModId =
gradleTokenModName =
gradleTokenVersion = VERSION
gradleTokenGroupName =
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-seperated list: Class1.java,Class2.java,Class3.java
# Define a source file of your project with:
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...])
# Leave these properties empty to skip individual token replacements
replaceGradleTokenInFile =
replaceGradleTokenInFile = Constants.java
gradleTokenModId =
gradleTokenModName =
gradleTokenVersion = GRADLETOKEN_VERSION
gradleTokenGroupName =
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
@@ -56,14 +38,11 @@ replaceGradleTokenInFile =
apiPackage = api
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
# There can be multiple files in a space-separated list.
# Example value: mymodid_at.cfg nei_at.cfg
# Example value: mymodid_at.cfg
accessTransformersFile =
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
# Adds some debug arguments like verbose output and export
usesMixinDebug = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
@@ -76,77 +55,6 @@ coreModClass =
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
forceEnableMixins = false
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required.
usesShadowedDependencies = false
# If disabled, won't remove unused classes from shaded dependencies. Some libraries use reflection to access
# their own classes, making the minimization unreliable.
minimizeShadowedDependencies = true
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories
includeWellKnownRepositories = true
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
# Authenticate with the MAVEN_USERNAME and MAVEN_PASSWORD environment variables.
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
usesMavenPublishing = true
# mavenPublishUrl = http://jenkins.usrv.eu:8081/nexus/content/repositories/releases
# Publishing to modrinth requires you to set the MODRINTH_TOKEN environment variable to your current modrinth API token.
# The project's ID on Modrinth. Can be either the slug or the ID.
# Leave this empty if you don't want to publish on Modrinth.
modrinthProjectId =
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
# Syntax: scope1-type1:name1;scope2-type2:name2;...
# Where scope can be one of [required, optional, incompatible, embedded],
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
# The project's numeric ID on CurseForge. You can find this in the About Project box.
# Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId =
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;...
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
curseForgeRelations =
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
# projects. New projects should not use this parameter.
# customArchiveBaseName =
# Optional parameter to prevent the source code from being published
# noPublishedSources =
# Uncomment this to disable spotless checks
# This should only be uncommented to keep it easier to sync with upstream/other forks.
# That is, if there is no other active fork/upstream, NEVER change this.
# disableSpotless = true
# Uncomment this to disable checkstyle checks (currently wildcard import check).
# disableCheckstyle = true
# Override the IDEA build type. Valid value is "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
# (force use delegated build).
# This is meant to be set in $HOME/.gradle/gradle.properties.
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be always native build.
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
# ideaOverrideBuildType = idea
Binary file not shown.
+1 -2
View File
@@ -1,7 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+4 -8
View File
@@ -85,6 +85,9 @@ 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
@@ -130,13 +133,10 @@ location of your Java installation."
fi
else
JAVACMD=java
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.
which java >/dev/null 2>&1 || 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
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@@ -197,10 +197,6 @@ 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
+22
View File
@@ -1,4 +1,26 @@
// 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'
}
}
-3
View File
@@ -112,9 +112,6 @@ public class Forestry {
public void postInit(FMLPostInitializationEvent event) {
PluginManager.runPostInit();
// Parse Mail Blacklist
Config.parseMailBlacklist();
// Register world generator
WorldGenerator worldGenerator = new WorldGenerator();
GameRegistry.registerWorldGenerator(worldGenerator, 0);
@@ -24,7 +24,7 @@ public class DefaultBeeModifier implements IBeeModifier {
}
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
return 0.0f;
return 1.0f;
}
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
@@ -5,12 +5,7 @@
******************************************************************************/
package forestry.api.apiculture;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
public interface IHiveFrame {
@@ -27,15 +22,4 @@ public interface IHiveFrame {
ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear);
IBeeModifier getBeeModifier();
/**
* Provides an override for the "Hold Shift" tooltip info for a frame.<br>
* Called by {@link forestry.apiculture.EventHandlerApiculture#addFrameTooltip(ItemTooltipEvent)}.
*
* @return The info to display for this frame, or null if default generated info.
*/
@Nullable
default List<String> getFrameTooltip() {
return null;
}
}
@@ -10,7 +10,6 @@ import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.common.util.ForgeDirection;
import com.mojang.authlib.GameProfile;
import forestry.api.world.ITreeGenData;
/**
@@ -34,8 +34,7 @@ public enum FarmDirection {
return SOUTH;
case WEST:
return WEST;
default:
return null;
}
return null;
}
}
@@ -11,7 +11,6 @@ import java.util.Map;
import net.minecraft.item.ItemStack;
import com.mojang.authlib.GameProfile;
import forestry.api.genetics.IClassification.EnumClassLevel;
/**
@@ -6,7 +6,6 @@
package forestry.api.mail;
import com.mojang.authlib.GameProfile;
import forestry.api.core.INBTTagable;
public interface IMailAddress extends INBTTagable {
@@ -9,7 +9,6 @@ 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.9f; // results in 0.1 with no frames, see BeeHousingModifier,java
return 0.1f;
}
}
@@ -49,8 +49,7 @@ public class BeeHousingModifier implements IBeeModifier {
@Override
public float getProductionModifier(IBeeGenome genome, final float currentModifier) {
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`
float modifierValue = 1.0f;
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.75f;// results in 0.25 with no frames, see BeeHousingModifier,java
return 0.25f;
}
@Override
@@ -1,125 +0,0 @@
package forestry.apiculture;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import forestry.api.apiculture.IBeeModifier;
import forestry.api.apiculture.IHiveFrame;
import forestry.core.proxy.Proxies;
import forestry.core.utils.StringUtil;
public class EventHandlerApiculture {
@SubscribeEvent
public void addFrameTooltip(ItemTooltipEvent event) {
ItemStack itemStack = event.itemStack;
if (itemStack != null && itemStack.getItem() instanceof IHiveFrame) {
IHiveFrame frame = (IHiveFrame) itemStack.getItem();
IBeeModifier modifier = frame.getBeeModifier();
List<String> tooltip = event.toolTip;
if (!Proxies.common.isShiftDown()) {
tooltip.add(EnumChatFormatting.ITALIC + "<" + StringUtil.localize("gui.tooltip.tmi") + ">");
} else {
if (frame.getFrameTooltip() != null) {
// use the override if it exists
tooltip.addAll(frame.getFrameTooltip());
} else {
// otherwise use the auto-generated info
int durability = itemStack.getMaxDamage();
tooltip.add(StringUtil.localize("frame.tooltip.durability") + getDurabilityFormatted(durability));
float territory = modifier.getTerritoryModifier(null, 1.0F);
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")
+ getModifierFormatted(mutation, false, false));
float lifespan = modifier.getLifespanModifier(null, null, 1.0F);
// 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);
// lower genetic decay is better
tooltip.add(
StringUtil.localize("frame.tooltip.geneticDecay")
+ getModifierFormatted(decay, false, true));
}
}
}
}
private static String getDurabilityFormatted(int durability) {
EnumChatFormatting color;
if (durability < 100) {
color = EnumChatFormatting.DARK_RED;
} else if (durability < 200) {
color = EnumChatFormatting.RED;
} else if (durability < 250) {
color = EnumChatFormatting.GOLD;
} else if (durability < 750) {
color = EnumChatFormatting.GREEN;
} else {
color = EnumChatFormatting.AQUA;
}
return color + " " + durability;
}
private static String getModifierFormatted(float value, boolean additive, boolean undesireable) {
EnumChatFormatting color;
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 (discriminant < mid_threshold) {
color = EnumChatFormatting.RED; // "below average" stat
} else if (discriminant == mid_threshold) {
color = EnumChatFormatting.GOLD; // "average" stat
} else if (discriminant <= hi_threshold) {
color = EnumChatFormatting.GREEN; // "above average" stat
} else {
color = EnumChatFormatting.AQUA; // "great" stat
}
String formatted = color.toString();
// Set symbol for if this value is additive or multiplicative
if (!additive) {
formatted += " x";
} else if (value >= 0.0F) {
formatted += " +";
} else {
formatted += " "; // the "-" will be applied, but we still need a space or minecraft will crash
}
// trim trailing zeroes if no decimal-precision is needed
if (value == (long) value) {
return formatted + (long) value;
}
return formatted + value;
}
}
@@ -12,13 +12,12 @@ import forestry.api.core.Tabs;
import forestry.apiculture.items.ItemBlockCandle;
import forestry.core.blocks.BlockBase;
import forestry.core.blocks.BlockRegistry;
import forestry.core.blocks.IMachineProperties;
import forestry.core.items.ItemBlockForestry;
public class BlockRegistryApiculture extends BlockRegistry {
public final BlockApiculture apiculture;
public final BlockBase<? extends IMachineProperties> apicultureChest;
public final BlockBase apicultureChest;
public final BlockBeehives beehives;
public final BlockCandle candle;
public final BlockStump stump;
@@ -27,7 +26,7 @@ public class BlockRegistryApiculture extends BlockRegistry {
public BlockRegistryApiculture() {
apiculture = registerBlock(new BlockApiculture(), ItemBlockForestry.class, "apiculture");
apicultureChest = registerBlock(new BlockBase<>(true), ItemBlockForestry.class, "apicultureChest");
apicultureChest = registerBlock(new BlockBase(true), ItemBlockForestry.class, "apicultureChest");
apicultureChest.setCreativeTab(Tabs.tabApiculture);
apicultureChest.setHarvestLevel("axe", 0);
@@ -14,7 +14,6 @@ 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 {
@@ -26,20 +26,7 @@ import net.minecraft.world.biome.BiomeGenBase;
import com.mojang.authlib.GameProfile;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.apiculture.FlowerManager;
import forestry.api.apiculture.IAlleleBeeEffect;
import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.apiculture.IAlleleBeeSpeciesCustom;
import forestry.api.apiculture.IApiaristTracker;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeModifier;
import forestry.api.apiculture.IBeeMutation;
import forestry.api.apiculture.IBeekeepingMode;
import forestry.api.apiculture.IJubilanceProvider;
import forestry.api.apiculture.*;
import forestry.api.core.BiomeHelper;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
@@ -527,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, 0f);
prodModifier += beeModeModifier.getProductionModifier(genome, prodModifier);
float prodModifier = beeHousingModifier.getProductionModifier(genome, 1f)
* beeModeModifier.getProductionModifier(genome, 1f);
// / Primary Products
for (Map.Entry<ItemStack, Float> entry : primary.getProductChances().entrySet()) {
@@ -564,13 +551,10 @@ 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)) / 100f;
* Math.pow(beeSpeed, 0.37)) / 100.f;
}
/* REPRODUCTION */
@@ -24,19 +24,11 @@ import forestry.api.apiculture.IBeekeepingMode;
public class BeekeepingMode implements IBeekeepingMode {
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
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);
private final Random rand;
private final String name;
@@ -101,7 +93,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(), 0f);
float productionModifier = beeModifier.getProductionModifier(queen.getGenome(), 1f);
if (productionModifier > 16) {
if (housing.getWorld().rand.nextFloat() * 100 < 0.01 * ((productionModifier * productionModifier) - 100)) {
return true;
@@ -13,13 +13,7 @@ import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.apiculture.EnumBeeType;
import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.apiculture.IAlleleBeeSpeciesCustom;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IJubilanceProvider;
import forestry.api.apiculture.*;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAlleleInteger;
import forestry.api.genetics.IAlleleTolerance;
@@ -56,7 +56,7 @@ public class ItemHiveFrame extends ItemForestry implements IHiveFrame {
@Override
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
return (currentModifier < 10.0f) ? 1.0f : 0.0f;
return (currentModifier < 10f) ? 2f : 1f;
}
@Override
@@ -414,6 +414,7 @@ public class AlvearyController extends RectangularMultiblockControllerBase
tempChange += change;
tempChange = Math.max(boundaryDown - temperature, tempChange);
tempChange = Math.min(boundaryUp - temperature, tempChange);
tempChange = (change > 0 && tempChange < 0) || (change < 0 && tempChange > 0) ? 0 : tempChange;
}
@Override
@@ -423,6 +424,7 @@ public class AlvearyController extends RectangularMultiblockControllerBase
humidChange += change;
humidChange = Math.max(boundaryDown - humidity, humidChange);
humidChange = Math.min(boundaryUp - humidity, humidChange);
humidChange = (change > 0 && humidChange < 0) || (change < 0 && humidChange > 0) ? 0 : humidChange;
}
/* GUI */
@@ -32,7 +32,7 @@ public class TileAlvearyFan extends TileAlvearyClimatiser {
@Override
public float getBoundaryDown() {
return -1f;
return 0.05f;
}
@Override
@@ -22,12 +22,12 @@ public class TileAlvearyHeater extends TileAlvearyClimatiser {
@Override
public float getChangePerTransfer() {
return 0.015f;
return 0.01f;
}
@Override
public float getBoundaryUp() {
return 3.5f;
return 2.5f;
}
@Override
@@ -56,9 +56,9 @@ public class TileAlvearyHygroregulator extends TileAlveary
this.tankManager = new TankManager(this, liquidTank);
this.recipes = new HygroregulatorRecipe[] {
new HygroregulatorRecipe(new FluidStack(water, 1), 1, +0.01f, -0.0005f),
new HygroregulatorRecipe(new FluidStack(lava, 1), 10, -0.01f, +0.0005f),
new HygroregulatorRecipe(new FluidStack(liquidIce, 1), 10, +0.02f, -0.001f) };
new HygroregulatorRecipe(new FluidStack(water, 1), 1, 0.01f, -0.005f),
new HygroregulatorRecipe(new FluidStack(lava, 1), 10, -0.01f, +0.005f),
new HygroregulatorRecipe(new FluidStack(liquidIce, 1), 10, 0.02f, -0.01f) };
}
@Override
@@ -99,7 +99,7 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
}
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SuppressWarnings("rawtypes")
public static ComponentVillageBeeHouse buildComponent(StructureVillagePieces.Start startPiece, List par1List,
Random random, int par3, int par4, int par5, int par6, int par7) {
StructureBoundingBox bbox = StructureBoundingBox
@@ -28,6 +28,7 @@ import forestry.plugins.PluginApiculture;
public abstract class HiveDecorator {
@SuppressWarnings("rawtypes")
private static final EventType EVENT_TYPE = EnumHelper
.addEnum(EventType.class, "FORESTRY_HIVES", new Class[0], new Object[0]);
@@ -168,7 +168,6 @@ public class BlockForestryLeaves extends BlockNewLeaf implements ITileEntityProv
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
@SuppressWarnings("deprecation")
ItemStack itemStack = super.getPickBlock(target, world, x, y, z);
TileLeaves leaves = getLeafTile(world, x, y, z);
NBTTagCompound leavesNBT = new NBTTagCompound();
@@ -61,7 +61,6 @@ public class BlockFruitPod extends BlockCocoa {
tile.onBlockTick();
}
@SuppressWarnings("deprecation")
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
if (!world.isRemote) {
@@ -1059,8 +1059,6 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator {
case WEST:
vanillaWoodMeta |= 1 << 2;
break;
default:
break;
}
world.setBlock(x, y, z, vanillaWoodBlock, vanillaWoodMeta, Constants.FLAG_BLOCK_SYNCH);
@@ -12,7 +12,6 @@ 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 {
@@ -35,7 +35,6 @@ public abstract class BlockForestry extends BlockContainer {
setCreativeTab(CreativeTabForestry.tabForestry);
}
@SuppressWarnings("deprecation")
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
@@ -16,6 +16,7 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import com.mojang.authlib.GameProfile;
@@ -49,22 +50,29 @@ public abstract class BlockStructure extends BlockForestry {
}
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof MultiblockTileEntityForestry<?>part)) {
if (!(tile instanceof MultiblockTileEntityForestry)) {
return false;
}
MultiblockTileEntityForestry part = (MultiblockTileEntityForestry) tile;
IMultiblockController controller = part.getMultiblockLogic().getController();
// If the player's hands are empty and they right-click on a multiblock, they get a
// multiblock-debugging message if the machine is not assembled.
if (player.getCurrentEquippedItem() == null && !controller.isAssembled()) {
String validationError = controller.getLastValidationError();
if (validationError != null) {
long tick = world.getTotalWorldTime();
if (tick > previousMessageTick + 20) {
player.addChatMessage(new ChatComponentText(validationError));
previousMessageTick = tick;
if (controller != null) {
String validationError = controller.getLastValidationError();
if (validationError != null) {
long tick = world.getTotalWorldTime();
if (tick > previousMessageTick + 20) {
player.addChatMessage(new ChatComponentText(validationError));
previousMessageTick = tick;
}
return true;
}
} else {
player.addChatMessage(
new ChatComponentText(StatCollector.translateToLocal("for.multiblock.error.notConnected")));
return true;
}
}
@@ -86,12 +94,13 @@ public abstract class BlockStructure extends BlockForestry {
return;
}
if (entityLiving instanceof EntityPlayer player) {
if (entityLiving instanceof EntityPlayer) {
TileEntity tile = world.getTileEntity(i, j, k);
if (tile instanceof MultiblockTileEntityForestry<?>tileForestry) {
if (tile instanceof MultiblockTileEntityForestry) {
EntityPlayer player = (EntityPlayer) entityLiving;
GameProfile gameProfile = player.getGameProfile();
tileForestry.setOwner(gameProfile);
((MultiblockTileEntityForestry) tile).setOwner(gameProfile);
}
}
}
@@ -2,5 +2,5 @@ package forestry.core.blocks;
public interface IItemTyped {
Enum<?> getTypeFromMeta(int meta);
Enum getTypeFromMeta(int meta);
}
@@ -109,6 +109,6 @@ public class CircuitRegistry implements ICircuitRegistry {
return null;
}
return new CircuitBoard<>(nbttagcompound);
return new CircuitBoard(nbttagcompound);
}
}
@@ -79,6 +79,7 @@ public class GuiSolderingIron extends GuiForestry<ContainerSolderingIron, ItemIn
}
}
@SuppressWarnings("unchecked")
@Override
public void initGui() {
super.initGui();
@@ -75,7 +75,7 @@ public class ItemCircuitBoard extends ItemForestryMultiPass {
public static ItemStack createCircuitboard(EnumCircuitBoardType type, ICircuitLayout layout, ICircuit[] circuits) {
ItemStack chipset = PluginCore.items.circuitboards.get(type);
saveChipset(chipset, new CircuitBoard<>(type, layout, circuits));
saveChipset(chipset, new CircuitBoard(type, layout, circuits));
return chipset;
}
@@ -164,6 +164,7 @@ public class CommandHelpers {
return false;
}
@SuppressWarnings("unchecked")
public static List<String> getListOfStringsMatchingLastWord(String[] strings, String... lastWords) {
return CommandBase.getListOfStringsMatchingLastWord(strings, lastWords);
}
@@ -26,11 +26,24 @@ public class CommandVersion extends SubCommand {
@Override
public void processSubCommand(ICommandSender sender, String[] args) {
ChatStyle style = new ChatStyle();
if (Version.isOutdated()) {
style.setColor(EnumChatFormatting.RED);
} else {
style.setColor(EnumChatFormatting.GREEN);
}
CommandHelpers.sendLocalizedChatMessage(
sender,
new ChatStyle().setColor(EnumChatFormatting.GREEN),
style,
"for.chat.version",
Version.getVersion(),
Proxies.common.getMinecraftVersion());
Proxies.common.getMinecraftVersion(),
Version.getRecommendedVersion());
if (Version.isOutdated()) {
for (String updateLine : Version.getChangelog()) {
CommandHelpers.sendChatMessage(sender, EnumChatFormatting.BLUE + updateLine);
}
}
}
}
@@ -74,7 +74,7 @@ public class RootCommand extends CommandBase implements IForestryCommand {
}
@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String[] incomplete) {
public List addTabCompletionOptions(ICommandSender sender, String[] incomplete) {
return CommandHelpers.addStandardTabCompletionOptions(this, sender, incomplete);
}
@@ -18,13 +18,11 @@ import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
import net.minecraft.item.Item;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.config.Property;
import com.google.common.collect.LinkedListMultimap;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.Forestry;
import forestry.core.fluids.Fluids;
import forestry.core.utils.Log;
@@ -99,37 +97,6 @@ public class Config {
public static GuiMailboxInfo.XPosition mailAlertXPosition = GuiMailboxInfo.XPosition.LEFT;
public static GuiMailboxInfo.YPosition mailAlertYPosition = GuiMailboxInfo.YPosition.TOP;
public static Set<Item> mailBlacklist = new HashSet<Item>();
public static String[] mailBlacklistString;
public static final String[] mailBlacklistDefault = new String[] { "arsmagica2:essenceBag", "arsmagica2:runeBag",
"betterstorage:backpack", "betterstorage:cardboardBox", "betterstorage:thaumcraftBackpack",
"Botania:baubleBox", "Botania:flowerBag", "cardboardboxes:cbCardboardBox", "dendrology:fullDrawers1",
"dendrology:fullDrawers2", "dendrology:fullDrawers4", "dendrology:halfDrawers2", "dendrology:halfDrawers4",
"DQMIIINext:ItemMahounoTutu11", "DQMIIINext:ItemOokinaFukuro", "DQMIIINext:ItemOokinaFukuroB",
"DQMIIINext:ItemOokinaFukuroG", "DQMIIINext:ItemOokinaFukuroR", "DQMIIINext:ItemOokinaFukuroY",
"ExtraUtilities:golden_bag", "HardcoreEnderExpansion:charm_pouch", "ImmersiveEngineering:toolbox",
"ironbackpacks:basicBackpack", "ironbackpacks:diamondBackpack", "ironbackpacks:goldBackpack",
"ironbackpacks:ironBackpack", "JABBA:mover", "JABBA:moverDiamond", "MagicBees:backpack.thaumaturgeT1",
"MagicBees:backpack.thaumaturgeT2", "Mekanism:CardboardBox", "MineFactoryReloaded:plastic.bag",
"OpenBlocks:devnull", "ProjectE:item.pe_alchemical_bag",
"ProjRed|Exploration:projectred.exploration.backpack", "sgs_treasure:dread_pirate_chest",
"sgs_treasure:iron_chest", "sgs_treasure:locked_wooden_chest", "sgs_treasure:obsidian_chest",
"sgs_treasure:pirate_chest", "sgs_treasure:wither_chest", "sgs_treasure:wooden_chest",
"StorageDrawers:compDrawers", "StorageDrawers:fullCustom1", "StorageDrawers:fullCustom2",
"StorageDrawers:fullCustom4", "StorageDrawers:fullDrawers1", "StorageDrawers:fullDrawers2",
"StorageDrawers:fullDrawers4", "StorageDrawers:halfCustom2", "StorageDrawers:halfCustom4",
"StorageDrawers:halfDrawers2", "StorageDrawers:halfDrawers4", "StorageDrawersBop:fullDrawers1",
"StorageDrawersBop:fullDrawers1", "StorageDrawersBop:fullDrawers2", "StorageDrawersBop:fullDrawers2",
"StorageDrawersBop:fullDrawers4", "StorageDrawersBop:fullDrawers4", "StorageDrawersBop:halfDrawers2",
"StorageDrawersBop:halfDrawers2", "StorageDrawersBop:halfDrawers4", "StorageDrawersBop:halfDrawers4",
"StorageDrawersForestry:fullDrawers1A", "StorageDrawersForestry:fullDrawers2A",
"StorageDrawersForestry:fullDrawers4A", "StorageDrawersForestry:halfDrawers2A",
"StorageDrawersForestry:halfDrawers4A", "StorageDrawersNatura:fullDrawers1",
"StorageDrawersNatura:fullDrawers2", "StorageDrawersNatura:fullDrawers4",
"StorageDrawersNatura:halfDrawers2", "StorageDrawersNatura:halfDrawers4", "Thaumcraft:FocusPouch",
"ThaumicTinkerer:ichorPouch", "thebetweenlands:lurkerSkinPouch", "ThermalExpansion:Strongbox",
"ThermalExpansion:satchel", "warpbook:warpbook", "witchery:brewbag", "WitchingGadgets:item.WG_Bag" };
// Gui tabs (Ledger)
public static int guiTabSpeed = 8;
@@ -312,11 +279,6 @@ public class Config {
"yPosition",
mailAlertYPosition,
GuiMailboxInfo.YPosition.values());
mailBlacklistString = configCommon.getStringList(
"mailBlacklist",
"restrictions",
mailBlacklistDefault,
"Items that cannot be shipped through a letter");
guiTabSpeed = configCommon.getIntLocalized("tweaks.gui.tabs", "speed", guiTabSpeed, 1, 50);
enableHints = configCommon.getBooleanLocalized("tweaks.gui.tabs", "hints", enableHints);
@@ -424,16 +386,4 @@ public class Config {
return list.split("[;]+");
}
}
public static void parseMailBlacklist() {
for (String itemName : mailBlacklistString) {
String[] nameAndID;
if (itemName.contains(":") && (nameAndID = itemName.split(":")).length == 2) {
Item item = GameRegistry.findItem(nameAndID[0], nameAndID[1]);
if (item != null) {
mailBlacklist.add(item);
}
}
}
}
}
@@ -8,7 +8,6 @@
******************************************************************************/
package forestry.core.config;
import forestry.Tags;
import forestry.api.core.IForestryConstants;
public class Constants implements IForestryConstants {
@@ -16,7 +15,7 @@ public class Constants implements IForestryConstants {
// System
public static final String MOD = "Forestry";
public static final String ID = "forestry";
public static final String VERSION = Tags.VERSION;
public static final String VERSION = "GRADLETOKEN_VERSION";
public static final String URL = "http://forestry.sengir.net/";
public static final int FLAG_BLOCK_UPDATE = 1;
@@ -25,7 +25,6 @@ public class ForestryGuiConfig extends GuiConfig {
super(parent, getConfigCategories(), Constants.MOD, true, true, Constants.MOD);
}
@SuppressWarnings("rawtypes")
private static List<IConfigElement> getConfigCategories() {
List<IConfigElement> configElements = new ArrayList<>();
@@ -33,13 +32,13 @@ public class ForestryGuiConfig extends GuiConfig {
.asList("crafting", "difficulty", "genetics", "performance", "structures", "tweaks", "world");
for (String categoryName : commonCategoryNames) {
ConfigCategory category = Config.configCommon.getCategory(categoryName);
configElements.add(new ConfigElement<>(category));
configElements.add(new ConfigElement(category));
}
List<String> fluidCategoryNames = Arrays.asList("enableFluid", "enableFluidBlock");
for (String categoryName : fluidCategoryNames) {
ConfigCategory category = Config.configFluid.getCategory(categoryName);
configElements.add(new ConfigElement<>(category));
configElements.add(new ConfigElement(category));
}
return configElements;
+146 -20
View File
@@ -8,7 +8,21 @@
******************************************************************************/
package forestry.core.config;
import forestry.Tags;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
import forestry.Forestry;
import forestry.core.proxy.Proxies;
import forestry.core.utils.Log;
/**
* With permission from pahimar.
@@ -17,51 +31,163 @@ import forestry.Tags;
*/
public class Version {
@Deprecated
public enum EnumUpdateState {
CURRENT,
OUTDATED,
CONNECTION_ERROR
}
public static final String VERSION = Tags.VERSION;
@Deprecated
public static final String BUILD_NUMBER = "";
@Deprecated
public static final String VERSION = "@VERSION@";
public static final String BUILD_NUMBER = "@BUILD_NUMBER@";
public static final String[] FAILED_CHANGELOG = new String[] {
String.format("Unable to retrieve changelog for %s", Constants.MOD) };
@Deprecated
private static final String REMOTE_VERSION_FILE = "http://bit.ly/forestryver";
private static final String REMOTE_CHANGELOG_ROOT = "https://dl.dropbox.com/u/44760587/forestry/changelog/";
public static EnumUpdateState currentVersion = EnumUpdateState.CURRENT;
private static String recommendedVersion;
private static String[] cachedChangelog = FAILED_CHANGELOG;
public static String getVersion() {
return VERSION;
return VERSION + " (" + BUILD_NUMBER + ")";
}
@Deprecated
public static boolean isOutdated() {
return false;
return currentVersion == EnumUpdateState.OUTDATED;
}
@Deprecated
public static boolean needsUpdateNoticeAndMarkAsSeen() {
return false;
if (!isOutdated()) {
return false;
}
File versionFile = new File(Forestry.instance.getConfigFolder(), Config.CATEGORY_COMMON + ".cfg");
Configuration config = new Configuration(versionFile);
Property property = config.get("version", "seen", VERSION);
property.comment = "indicates the last version the user has been informed about and will suppress further notices on it.";
String seenVersion = property.getString();
if (recommendedVersion == null || recommendedVersion.equals(seenVersion)) {
return false;
}
property.set(recommendedVersion);
config.save();
return true;
}
@Deprecated
public static String getRecommendedVersion() {
return VERSION;
return recommendedVersion;
}
@Deprecated
public static void versionCheck() {}
private static class VersionChecker extends Thread {
@Override
public void run() {
try {
String location = REMOTE_VERSION_FILE;
HttpURLConnection conn = null;
while (location != null && !location.isEmpty()) {
URL url = new URL(location);
conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty(
"User-Agent",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)");
conn.connect();
location = conn.getHeaderField("Location");
}
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
String mcVersion = Proxies.common.getMinecraftVersion();
while ((line = reader.readLine()) != null) {
if (line.startsWith(mcVersion) && line.contains(Constants.MOD)) {
String[] tokens = line.split(":");
recommendedVersion = tokens[2];
}
}
if (recommendedVersion == null) {
return;
}
int result = FMLCommonHandler.instance().findContainerFor(Forestry.instance).getProcessedVersion()
.compareTo(new DefaultArtifactVersion(recommendedVersion));
if (result >= 0) {
Log.finer(
"Using the latest version [" + VERSION
+ " (build:"
+ BUILD_NUMBER
+ ")] for Minecraft "
+ mcVersion);
currentVersion = EnumUpdateState.CURRENT;
return;
}
cachedChangelog = grabChangelog(recommendedVersion);
Log.warning(
"Using outdated version [" + VERSION
+ " (build:"
+ BUILD_NUMBER
+ ")] for Minecraft "
+ mcVersion
+ ". Consider updating.");
currentVersion = EnumUpdateState.OUTDATED;
} catch (Exception e) {
// e.printStackTrace();
Log.warning("Unable to read from remote version authority.");
currentVersion = EnumUpdateState.CONNECTION_ERROR;
}
}
}
public static void versionCheck() {
new VersionChecker().start();
}
@Deprecated
public static String[] getChangelog() {
return FAILED_CHANGELOG;
return cachedChangelog;
}
@Deprecated
public static String[] grabChangelog(String version) {
return FAILED_CHANGELOG;
try {
String location = REMOTE_CHANGELOG_ROOT + version;
HttpURLConnection conn;
do {
URL url = new URL(location);
conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty(
"User-Agent",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)");
conn.connect();
location = conn.getHeaderField("Location");
} while (location != null && !location.isEmpty());
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
ArrayList<String> changelog = new ArrayList<>();
while ((line = reader.readLine()) != null) {
if (line.startsWith("#")) {
continue;
}
if (line.isEmpty()) {
continue;
}
changelog.add(line);
}
return changelog.toArray(new String[changelog.size()]);
} catch (Exception ex) {
// ex.printStackTrace();
Log.warning("Unable to read changelog from remote site.");
}
return new String[] { String.format("Unable to retrieve changelog for %s %s", Constants.MOD, version) };
}
}
@@ -10,6 +10,7 @@ package forestry.core.fluids;
import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraftforge.common.util.ForgeDirection;
@@ -30,7 +31,7 @@ public class FakeTankManager implements ITankManager {
public void containerAdded(Container container, ICrafting player) {}
@Override
public void updateGuiData(Container container, List<ICrafting> crafters) {}
public void updateGuiData(Container container, List<EntityPlayerMP> crafters) {}
@Override
public void containerRemoved(Container container) {}
@@ -10,6 +10,7 @@ package forestry.core.fluids;
import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraftforge.fluids.FluidStack;
@@ -20,7 +21,7 @@ public interface ITankManager extends IFluidHandler {
void containerAdded(Container container, ICrafting player);
void updateGuiData(Container container, List<ICrafting> crafters);
void updateGuiData(Container container, List<EntityPlayerMP> crafters);
void containerRemoved(Container container);
@@ -17,7 +17,6 @@ import java.util.List;
import javax.annotation.Nonnull;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
@@ -135,7 +134,7 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl
return;
}
List<ICrafting> crafters = Collections.singletonList(player);
List<EntityPlayerMP> crafters = Collections.singletonList((EntityPlayerMP) player);
for (StandardTank tank : tanks) {
sendTankUpdate(container, tank, crafters);
@@ -150,13 +149,13 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl
}
@Override
public void updateGuiData(Container container, List<ICrafting> crafters) {
public void updateGuiData(Container container, List<EntityPlayerMP> crafters) {
for (StandardTank tank : tanks) {
updateGuiData(container, crafters, tank.getTankIndex());
}
}
private void updateGuiData(Container container, List<ICrafting> crafters, int tankIndex) {
private void updateGuiData(Container container, List<EntityPlayerMP> crafters, int tankIndex) {
StandardTank tank = tanks.get(tankIndex);
if (tank == null) {
return;
@@ -171,12 +170,12 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl
sendTankUpdate(container, tank, crafters);
}
private void sendTankUpdate(Container container, StandardTank tank, Iterable<ICrafting> crafters) {
private void sendTankUpdate(Container container, StandardTank tank, Iterable<EntityPlayerMP> crafters) {
int tankIndex = tank.getTankIndex();
FluidStack fluid = tank.getFluid();
IForestryPacketClient packet = new PacketTankLevelUpdate(tile, tankIndex, fluid);
for (ICrafting player : crafters) {
Proxies.net.sendToPlayer(packet, (EntityPlayer) player);
for (EntityPlayerMP player : crafters) {
Proxies.net.sendToPlayer(packet, player);
}
if (fluid == null) {
@@ -133,9 +133,8 @@ public class StandardTank extends FluidTank implements IStreamable {
case DEFAULT:
case INPUT:
return true;
default:
return false;
}
return false;
}
public boolean canBeDrainedExternally() {
@@ -143,9 +142,8 @@ public class StandardTank extends FluidTank implements IStreamable {
case DEFAULT:
case OUTPUT:
return true;
default:
return false;
}
return false;
}
public boolean canFill(Fluid fluid, int amount) {
@@ -33,7 +33,7 @@ public class AlleleHelper implements IAlleleHelper {
private static final String modId = Constants.ID;
public static AlleleHelper instance;
private final Map<Class<?>, Map<?, ? extends IAllele>> alleleMaps = new HashMap<>();
private final Map<Class, Map<?, ? extends IAllele>> alleleMaps = new HashMap<>();
public void init() {
if (PluginManager.Module.APICULTURE.isEnabled()) {
@@ -38,6 +38,7 @@ public abstract class ContainerLiquidTanks<T extends TileEntity & ILiquidTankTil
}
@Override
@SuppressWarnings("unchecked")
public void detectAndSendChanges() {
super.detectAndSendChanges();
tile.getTankManager().updateGuiData(this, crafters);
@@ -43,6 +43,7 @@ public abstract class ContainerLiquidTanksSocketed<T extends TileEntity & ILiqui
}
@Override
@SuppressWarnings("unchecked")
public void detectAndSendChanges() {
super.detectAndSendChanges();
tile.getTankManager().updateGuiData(this, crafters);
@@ -302,7 +302,7 @@ public abstract class GuiForestry<C extends Container, I extends IInventory> ext
@Optional.Method(modid = "NotEnoughItems")
public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) {
if (gui instanceof GuiForestry) {
return ((GuiForestry<?, ?>) gui).ledgerManager.ledgerOverlaps(x, y, w, h);
return ((GuiForestry) gui).ledgerManager.ledgerOverlaps(x, y, w, h);
} else {
return false;
}
@@ -94,6 +94,7 @@ public class GuiNaturalistInventory extends GuiForestry<Container, IPagedInvento
}
}
@SuppressWarnings("unchecked")
@Override
public void initGui() {
super.initGui();
@@ -70,6 +70,7 @@ public class GuiTextBox extends GuiTextField {
return text.substring(0, cursorPos) + "_" + text.substring(cursorPos);
}
@SuppressWarnings("unchecked")
private void drawScrolledSplitString(String text, int startX, int startY, int width, int textColour) {
List<String> lines = fontRendererObj.listFormattedStringToWidth(text, width);
maxLines = lines.size();
+3 -3
View File
@@ -25,7 +25,7 @@ import forestry.core.gui.tooltips.ToolTipLine;
public class GuiUtil {
public static void drawItemStack(GuiForestry<?, ?> gui, ItemStack stack, int xPos, int yPos) {
public static void drawItemStack(GuiForestry gui, ItemStack stack, int xPos, int yPos) {
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
RenderHelper.enableGUIStandardItemLighting();
@@ -50,7 +50,7 @@ public class GuiUtil {
GL11.glPopAttrib();
}
public static void drawToolTips(GuiForestry<?, ?> gui, ToolTip toolTips, int mouseX, int mouseY) {
public static void drawToolTips(GuiForestry gui, ToolTip toolTips, int mouseX, int mouseY) {
if (toolTips == null) {
return;
}
@@ -144,7 +144,7 @@ public class GuiUtil {
itemRender.zLevel = 0.0F;
}
public static void drawToolTips(GuiForestry<?, ?> gui, Collection<?> objects, int mouseX, int mouseY) {
public static void drawToolTips(GuiForestry gui, Collection<?> objects, int mouseX, int mouseY) {
for (Object obj : objects) {
if (!(obj instanceof IToolTipProvider)) {
continue;
@@ -9,8 +9,6 @@
package forestry.core.gui;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import org.lwjgl.opengl.GL11;
@@ -20,7 +18,7 @@ public class TextLayoutHelper {
private static final int LINE_HEIGHT = 12;
private final GuiForestry<? extends Container, ? extends IInventory> guiForestry;
private final GuiForestry guiForestry;
private final int defaultFontColor;
private FontRenderer fontRendererObj;
@@ -29,7 +27,7 @@ public class TextLayoutHelper {
public int column2;
public int line;
public TextLayoutHelper(GuiForestry<? extends Container, ? extends IInventory> guiForestry, FontColour fontColour) {
public TextLayoutHelper(GuiForestry guiForestry, FontColour fontColour) {
this.guiForestry = guiForestry;
this.defaultFontColor = fontColour.get("gui.screen");
}
@@ -227,10 +227,12 @@ public abstract class Ledger {
protected int drawSplitText(String string, int x, int y, int width, int color, boolean shadow) {
int originalY = y;
Minecraft minecraft = Proxies.common.getClientInstance();
List<String> strings = minecraft.fontRenderer.listFormattedStringToWidth(string, width);
for (String obj : strings) {
minecraft.fontRenderer.drawString(obj, x, y, color, shadow);
y += minecraft.fontRenderer.FONT_HEIGHT;
List strings = minecraft.fontRenderer.listFormattedStringToWidth(string, width);
for (Object obj : strings) {
if (obj instanceof String) {
minecraft.fontRenderer.drawString((String) obj, x, y, color, shadow);
y += minecraft.fontRenderer.FONT_HEIGHT;
}
}
return y - originalY;
}
@@ -11,9 +11,6 @@ package forestry.core.gui.ledgers;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import org.lwjgl.opengl.GL11;
import forestry.api.core.IErrorSource;
@@ -32,9 +29,9 @@ public class LedgerManager {
private IErrorSource errorSource;
private final int maxWidth;
public final GuiForestry<? extends Container, ? extends IInventory> gui;
public final GuiForestry gui;
public LedgerManager(GuiForestry<? extends Container, ? extends IInventory> gui, int maxWidth) {
public LedgerManager(GuiForestry gui, int maxWidth) {
this.gui = gui;
this.errorSource = FakeErrorSource.instance;
this.maxWidth = maxWidth;
@@ -39,7 +39,7 @@ public class ToolTip extends ForwardingList<ToolTipLine> {
return add(new ToolTipLine(line));
}
public boolean add(List<?> lines) {
public boolean add(List lines) {
boolean changed = false;
for (Object line : lines) {
if (line instanceof String) {
@@ -54,6 +54,7 @@ public class SocketWidget extends Widget {
private final ToolTip toolTip = new ToolTip(250) {
@SuppressWarnings("unchecked")
@Override
public void refresh() {
toolTip.clear();
@@ -12,8 +12,6 @@ import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import org.lwjgl.opengl.GL11;
@@ -22,11 +20,11 @@ import forestry.core.proxy.Proxies;
public class WidgetManager {
public final GuiForestry<? extends Container, ? extends IInventory> gui;
public final GuiForestry gui;
public final Minecraft minecraft;
protected final List<Widget> widgets = new ArrayList<>();
public WidgetManager(GuiForestry<? extends Container, ? extends IInventory> gui) {
public WidgetManager(GuiForestry gui) {
this.gui = gui;
this.minecraft = Proxies.common.getClientInstance();
}
@@ -106,7 +106,7 @@ public abstract class ItemInventory implements IInventory, IFilterSlotDelegate {
String baseUID = base.getTagCompound().getString(KEY_UID);
String comparisonUID = comparison.getTagCompound().getString(KEY_UID);
return baseUID != null && !baseUID.isEmpty() && baseUID.equals(comparisonUID);
return baseUID != null && comparisonUID != null && baseUID.equals(comparisonUID);
}
public void readFromNBT(NBTTagCompound nbt) {
@@ -12,7 +12,6 @@ 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 {
@@ -120,7 +120,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI
coord);
}
MultiblockLogic<?> logic = (MultiblockLogic<?>) part.getMultiblockLogic();
MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic();
logic.setController(this);
this.onBlockAdded(part);
@@ -138,7 +138,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI
TileEntity te = this.worldObj.getTileEntity(referenceCoord.posX, referenceCoord.posY, referenceCoord.posZ);
if (te instanceof IMultiblockComponent) {
IMultiblockComponent tePart = (IMultiblockComponent) te;
MultiblockLogic<?> teLogic = (MultiblockLogic<?>) tePart.getMultiblockLogic();
MultiblockLogic teLogic = (MultiblockLogic) tePart.getMultiblockLogic();
teLogic.forfeitMultiblockSaveDelegate();
}
@@ -219,7 +219,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI
*/
private void onDetachBlock(IMultiblockComponent part) {
// Strip out this part
MultiblockLogic<?> logic = (MultiblockLogic<?>) part.getMultiblockLogic();
MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic();
logic.setController(null);
this.onBlockRemoved(part);
logic.forfeitMultiblockSaveDelegate();
@@ -361,7 +361,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI
}
connectedParts.add(acquiredPart);
MultiblockLogic<?> logic = (MultiblockLogic<?>) acquiredPart.getMultiblockLogic();
MultiblockLogic logic = (MultiblockLogic) acquiredPart.getMultiblockLogic();
logic.setController(this);
this.onBlockAdded(acquiredPart);
}
@@ -383,7 +383,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI
.getTileEntity(referenceCoord.posX, referenceCoord.posY, referenceCoord.posZ);
if (te instanceof IMultiblockComponent) {
IMultiblockComponent part = (IMultiblockComponent) te;
MultiblockLogic<?> logic = (MultiblockLogic<?>) part.getMultiblockLogic();
MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic();
logic.forfeitMultiblockSaveDelegate();
}
}
@@ -745,7 +745,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI
continue;
}
MultiblockLogic<?> logic = (MultiblockLogic<?>) part.getMultiblockLogic();
MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic();
logic.setUnvisited();
logic.forfeitMultiblockSaveDelegate();
@@ -769,7 +769,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI
MultiblockRegistry.addDeadController(worldObj, this);
return Collections.emptySet();
} else {
MultiblockLogic<?> logic = (MultiblockLogic<?>) referencePart.getMultiblockLogic();
MultiblockLogic logic = (MultiblockLogic) referencePart.getMultiblockLogic();
logic.becomeMultiblockSaveDelegate();
}
@@ -781,7 +781,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI
while (!partsToCheck.isEmpty()) {
part = partsToCheck.removeFirst();
MultiblockLogic<?> partLogic = (MultiblockLogic<?>) part.getMultiblockLogic();
MultiblockLogic partLogic = (MultiblockLogic) part.getMultiblockLogic();
partLogic.setVisited();
List<IMultiblockComponent> nearbyParts = MultiblockUtil.getNeighboringParts(worldObj, part); // Chunk-safe
@@ -790,7 +790,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI
// client
for (IMultiblockComponent nearbyPart : nearbyParts) {
// Ignore different machines
MultiblockLogic<?> nearbyPartLogic = (MultiblockLogic<?>) nearbyPart.getMultiblockLogic();
MultiblockLogic nearbyPartLogic = (MultiblockLogic) nearbyPart.getMultiblockLogic();
if (nearbyPartLogic.getController() != this) {
continue;
}
@@ -805,7 +805,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI
// Finally, remove all parts that remain disconnected.
Set<IMultiblockComponent> removedParts = new HashSet<>();
for (IMultiblockComponent orphanCandidate : connectedParts) {
MultiblockLogic<?> logic = (MultiblockLogic<?>) orphanCandidate.getMultiblockLogic();
MultiblockLogic logic = (MultiblockLogic) orphanCandidate.getMultiblockLogic();
if (!logic.isVisited()) {
deadParts.add(orphanCandidate);
onDetachBlock(orphanCandidate);
@@ -877,7 +877,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI
}
if (theChosenOne != null) {
MultiblockLogic<?> logic = (MultiblockLogic<?>) theChosenOne.getMultiblockLogic();
MultiblockLogic logic = (MultiblockLogic) theChosenOne.getMultiblockLogic();
logic.becomeMultiblockSaveDelegate();
}
}
@@ -8,8 +8,6 @@ package forestry.core.multiblock;
*/
public class MultiblockValidationException extends Exception {
private static final long serialVersionUID = -3255564315819077747L;
public MultiblockValidationException(String reason) {
super(reason);
}
@@ -135,7 +135,7 @@ public class MultiblockWorldRegistry {
if (compatibleControllers.size() == 0) {
// FOREVER ALONE! Create and register a new controller.
// THIS IS THE ONLY PLACE WHERE NEW CONTROLLERS ARE CREATED.
MultiblockLogic<?> logic = (MultiblockLogic<?>) orphan.getMultiblockLogic();
MultiblockLogic logic = (MultiblockLogic) orphan.getMultiblockLogic();
IMultiblockControllerInternal newController = logic.createNewController(worldObj);
newController.attachBlock(orphan);
this.controllers.add(newController);
@@ -263,7 +263,7 @@ public class MultiblockWorldRegistry {
// list, and will be checked next tick to see if their chunk is still loaded.
for (IMultiblockComponent part : detachedParts) {
// Ensure parts know they're detached
MultiblockLogic<?> logic = (MultiblockLogic<?>) part.getMultiblockLogic();
MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic();
logic.assertDetached(part);
}
@@ -276,7 +276,7 @@ public class MultiblockWorldRegistry {
Set<IMultiblockControllerInternal> controllers = new HashSet<>();
IMultiblockControllerInternal bestController = null;
MultiblockLogic<?> logic = (MultiblockLogic<?>) part.getMultiblockLogic();
MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic();
Class<?> controllerClass = logic.getControllerClass();
// Look for a compatible controller in our neighboring parts.
List<IMultiblockComponent> partsToCheck = MultiblockUtil.getNeighboringParts(worldObj, part);
@@ -367,7 +367,7 @@ public class MultiblockWorldRegistry {
}
}
MultiblockLogic<?> logic = (MultiblockLogic<?>) part.getMultiblockLogic();
MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic();
logic.assertDetached(part);
}
@@ -75,7 +75,7 @@ public class DataInputStreamForestry extends DataInputStream {
public <T extends IStreamable> T readStreamable(Class<T> streamableClass) throws IOException {
if (readBoolean()) {
try {
T streamable = streamableClass.getConstructor().newInstance();
T streamable = streamableClass.newInstance();
streamable.readData(this);
return streamable;
} catch (ReflectiveOperationException e) {
@@ -46,7 +46,7 @@ public class PacketGuiEnergy extends ForestryPacket implements IForestryPacketCl
@Override
public void onPacketData(DataInputStreamForestry data, EntityPlayer player) throws IOException {
if (player.openContainer instanceof ContainerTile && player.openContainer.windowId == windowId) {
((ContainerTile<?>) player.openContainer).onGuiEnergy(value);
((ContainerTile) player.openContainer).onGuiEnergy(value);
}
}
@@ -34,7 +34,7 @@ import forestry.factory.inventory.InventoryCraftingForestry;
public abstract class RecipeUtil {
static List<IRecipe> cachedRecipes = new ArrayList<>();
static List<Object> cachedRecipes = new ArrayList<Object>();
public static void addFermenterRecipes(ItemStack resource, int fermentationValue, Fluids output) {
if (RecipeManagers.fermenterManager == null) {
@@ -183,14 +183,15 @@ public abstract class RecipeUtil {
}
List<ItemStack> matchingRecipes = new ArrayList<>();
List<Integer> matchingIndex = new ArrayList<>();
List<IRecipe> matchingRecipeMap = new ArrayList<>();
List<Integer> matchingIndex = new ArrayList();
List<Object> matchingRecipeMap = new ArrayList();
int index = 0;
if (Config.cacheWorktableRecipes) {
// Check across the whole cached recipe map
// Add each recipe to the matchingRecipes list
for (IRecipe irecipe : cachedRecipes) {
for (Object recipe : cachedRecipes) {
IRecipe irecipe = (IRecipe) recipe;
if (irecipe.matches(inventory, world)) {
ItemStack result = irecipe.getCraftingResult(inventory);
@@ -205,7 +206,8 @@ public abstract class RecipeUtil {
}
}
// Only do this if there were no cached recipes hit
for (IRecipe irecipe : CraftingManager.getInstance().getRecipeList()) {
for (Object recipe : CraftingManager.getInstance().getRecipeList()) {
IRecipe irecipe = (IRecipe) recipe;
if (irecipe.matches(inventory, world)) {
ItemStack result = irecipe.getCraftingResult(inventory);
@@ -214,8 +216,8 @@ public abstract class RecipeUtil {
if (Config.promoteWorktableRecipesToFrontOfGlobalRecipemap || Config.cacheWorktableRecipes) {
// Add to the back of the list. That way when we cycle through the list
// moving items to the front, the index locations for the following items doesn't change
matchingRecipeMap.add(irecipe);
matchingIndex.add(index);
matchingRecipeMap.add(recipe);
matchingIndex.add(new Integer(index));
}
}
}
@@ -225,7 +227,7 @@ public abstract class RecipeUtil {
if (Config.promoteWorktableRecipesToFrontOfGlobalRecipemap) {
// Only move the recipes if the last one was beyond 500 in the recipeMap (in GTNH about 57k recipes)
if (matchingIndex.get(matchingIndex.size() - 1) > 500) {
List<IRecipe> recipeMap = CraftingManager.getInstance().getRecipeList();
List recipeMap = CraftingManager.getInstance().getRecipeList();
// System.out.println( "Highest recipe found at " + matchingIndex.get(matchingIndex.size()-1) + ",
// moving " + matchingIndex.size() + " to front" );
// System.out.println( "Size of recipe map " + recipeMap.size() );
@@ -293,10 +295,12 @@ public abstract class RecipeUtil {
addRecipe(new ItemStack(item), obj);
}
@SuppressWarnings("unchecked")
public static void addRecipe(ItemStack itemstack, Object... obj) {
CraftingManager.getInstance().getRecipeList().add(new ShapedRecipeCustom(itemstack, obj));
}
@SuppressWarnings("unchecked")
public static void addPriorityRecipe(ItemStack itemStack, Object... obj) {
CraftingManager.getInstance().getRecipeList().add(0, new ShapedRecipeCustom(itemStack, obj));
}
@@ -305,6 +309,7 @@ public abstract class RecipeUtil {
addShapelessRecipe(new ItemStack(item), obj);
}
@SuppressWarnings("unchecked")
public static void addShapelessRecipe(ItemStack itemstack, Object... obj) {
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(itemstack, obj));
}
@@ -395,7 +400,7 @@ public abstract class RecipeUtil {
} else if (recipeIngredient instanceof ItemStack) {
return ItemStackUtil.isCraftingEquivalent((ItemStack) recipeIngredient, resource);
} else if (recipeIngredient instanceof Iterable) {
for (Object item : (Iterable<?>) recipeIngredient) {
for (Object item : (Iterable) recipeIngredient) {
if (checkIngredientMatch(item, resource)) {
return true;
}
@@ -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 {
@@ -35,7 +35,7 @@ public class PositionedStackAdv extends PositionedStack {
return new Rectangle(this.relx - 1, this.rely - 1, 18, 18);
}
public List<String> handleTooltip(GuiRecipe<?> guiRecipe, List<String> currenttip) {
public List<String> handleTooltip(GuiRecipe guiRecipe, List<String> currenttip) {
if (!this.tooltip.isEmpty()) {
for (String tip : this.tooltip) {
currenttip.add(tip);
@@ -109,7 +109,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements
public void loadUsageRecipes(FluidStack ingredient) {}
@Override
public List<String> handleTooltip(GuiRecipe<?> guiRecipe, List<String> currenttip, int recipe) {
public List<String> handleTooltip(GuiRecipe guiRecipe, List<String> currenttip, int recipe) {
super.handleTooltip(guiRecipe, currenttip, recipe);
CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
if (GuiContainerManager.shouldShowTooltip(guiRecipe)) {
@@ -125,7 +125,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements
}
@Override
public List<String> handleItemTooltip(GuiRecipe<?> guiRecipe, ItemStack itemStack, List<String> currenttip,
public List<String> handleItemTooltip(GuiRecipe guiRecipe, ItemStack itemStack, List<String> currenttip,
int recipe) {
super.handleItemTooltip(guiRecipe, itemStack, currenttip, recipe);
CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
@@ -139,7 +139,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements
return currenttip;
}
public List<String> provideTooltip(GuiRecipe<?> guiRecipe, List<String> currenttip, CachedBaseRecipe crecipe,
public List<String> provideTooltip(GuiRecipe guiRecipe, List<String> currenttip, CachedBaseRecipe crecipe,
Point relMouse) {
if (crecipe.getFluidTanks() != null) {
for (PositionedFluidTank tank : crecipe.getFluidTanks()) {
@@ -151,7 +151,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements
return currenttip;
}
public List<String> provideItemTooltip(GuiRecipe<?> guiRecipe, ItemStack itemStack, List<String> currenttip,
public List<String> provideItemTooltip(GuiRecipe guiRecipe, ItemStack itemStack, List<String> currenttip,
CachedBaseRecipe crecipe, Point relMouse) {
for (PositionedStack stack : crecipe.getIngredients()) {
if (stack instanceof PositionedStackAdv && ((PositionedStackAdv) stack).getRect().contains(relMouse)) {
@@ -171,7 +171,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements
}
@Override
public boolean keyTyped(GuiRecipe<?> gui, char keyChar, int keyCode, int recipe) {
public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe) {
if (keyCode == NEIClientConfig.getKeyBinding("gui.recipe")) {
if (this.transferFluidTank(gui, recipe, false)) {
return true;
@@ -185,7 +185,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements
}
@Override
public boolean mouseClicked(GuiRecipe<?> gui, int button, int recipe) {
public boolean mouseClicked(GuiRecipe gui, int button, int recipe) {
if (button == 0) {
if (this.transferFluidTank(gui, recipe, false)) {
return true;
@@ -198,7 +198,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements
return super.mouseClicked(gui, button, recipe);
}
protected boolean transferFluidTank(GuiRecipe<?> guiRecipe, int recipe, boolean usage) {
protected boolean transferFluidTank(GuiRecipe guiRecipe, int recipe, boolean usage) {
CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
Point mousepos = GuiDraw.getMousePosition();
Point offset = guiRecipe.getRecipePosition(recipe);
@@ -14,7 +14,6 @@ import java.util.Random;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ListMultimap;
import forestry.core.utils.StringUtil;
public class EscritoireTextSource {
@@ -31,7 +31,6 @@ import forestry.core.config.Constants;
import forestry.core.tiles.TileEngine;
import forestry.core.utils.vect.Vect;
@SuppressWarnings("unchecked")
public abstract class BlockUtil {
private static final int slabWoodId = OreDictionary.getOreID("slabWood");
@@ -232,14 +231,10 @@ public abstract class BlockUtil {
private static Class<? extends Block> BW_MetaGenerated_WerkstoffBlocksClass;
private static Block BWBlocks;
private static Class<? extends Block> GTBlockMachines_Class;
private static Block GTBlockMachines;
private static final boolean bw = Loader.isModLoaded("bartworks");
private static final boolean gt = Loader.isModLoaded("gregtech");
private static boolean bw = Loader.isModLoaded("bartworks");
static {
if (bw) try {
// noinspection unchecked
BW_MetaGenerated_WerkstoffBlocksClass = (Class<? extends Block>) Class
.forName("com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_WerkstoffBlocks");
BWBlocks = (Block) Class.forName("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader")
@@ -247,13 +242,6 @@ public abstract class BlockUtil {
} catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
if (gt) try {
// noinspection unchecked
GTBlockMachines_Class = (Class<? extends Block>) Class.forName("gregtech.common.blocks.GT_Block_Machines");
GTBlockMachines = (Block) Class.forName("gregtech.api.GregTech_API").getField("sBlockMachines").get(null);
} catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
}
public static ItemStack getItemStackFromBlockBelow(World world, int x, int y, int z,
@@ -272,10 +260,6 @@ public abstract class BlockUtil {
return new ItemStack(BWBlocks, 1, block.getDamageValue(world, x, y - depth, z));
}
if (gt && GTBlockMachines_Class.isInstance(block)) {
return new ItemStack(GTBlockMachines, 1, block.getDamageValue(world, x, y - depth, z));
}
return new ItemStack(block, 1, world.getBlockMetadata(x, y - depth, z));
}
}
@@ -59,11 +59,13 @@ public abstract class EntityUtil {
Log.finer("Registered entity %s (%s) with id %s.", ident, entityClass.toString(), id);
}
@SuppressWarnings("unchecked")
public static <T extends Entity> List<T> getEntitiesWithinAABB(World world, Class<T> entityClass,
AxisAlignedBB boundingBox) {
return world.getEntitiesWithinAABB(entityClass, boundingBox);
}
@SuppressWarnings("unchecked")
public static <T extends Entity> List<T> selectEntitiesWithinAABB(World world, EntitySelector<T> entitySelector,
AxisAlignedBB boundingBox) {
return world.selectEntitiesWithinAABB(entitySelector.getEntityClass(), boundingBox, entitySelector);
+1 -1
View File
@@ -123,7 +123,7 @@ public abstract class Log {
LogManager.getLogger(Constants.MOD).log(level, new MessageFormatMessage(msg, args), error);
}
public static void logErrorAPI(String mod, Throwable error, Class<?> classFile) {
public static void logErrorAPI(String mod, Throwable error, Class classFile) {
StringBuilder msg = new StringBuilder(mod);
msg.append(" API error, please update your mods. Error: ").append(error);
logThrowable(Level.ERROR, msg.toString(), 2, error);
@@ -26,7 +26,6 @@ import net.minecraft.nbt.NBTTagShort;
import net.minecraft.nbt.NBTTagString;
import com.google.common.collect.ForwardingList;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
/**
@@ -16,7 +16,6 @@ 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 {
+13 -14
View File
@@ -62,8 +62,8 @@ public abstract class SlotUtil {
return stack;
}
public static ItemStack transferStackInSlot(List<Slot> inventorySlots, EntityPlayer player, int slotIndex) {
Slot slot = inventorySlots.get(slotIndex);
public static ItemStack transferStackInSlot(List inventorySlots, EntityPlayer player, int slotIndex) {
Slot slot = (Slot) inventorySlots.get(slotIndex);
if (slot == null || !slot.getHasStack()) {
return null;
}
@@ -93,7 +93,7 @@ public abstract class SlotUtil {
return originalStack;
}
private static boolean shiftItemStack(List<Slot> inventorySlots, ItemStack stackInSlot, int slotIndex, int numSlots,
private static boolean shiftItemStack(List inventorySlots, ItemStack stackInSlot, int slotIndex, int numSlots,
boolean fromCraftingSlot) {
if (isInPlayerInventory(slotIndex)) {
if (shiftToMachineInventory(inventorySlots, stackInSlot, numSlots)) {
@@ -160,14 +160,13 @@ public abstract class SlotUtil {
slot.putStack(phantomStack);
}
private static boolean shiftItemStackToRange(List<Slot> inventorySlots, ItemStack stackToShift, int start,
int count) {
private static boolean shiftItemStackToRange(List inventorySlots, ItemStack stackToShift, int start, int count) {
boolean changed = shiftItemStackToRangeMerge(inventorySlots, stackToShift, start, count);
changed |= shiftItemStackToRangeOpenSlots(inventorySlots, stackToShift, start, count);
return changed;
}
private static boolean shiftItemStackToRangeMerge(List<Slot> inventorySlots, ItemStack stackToShift, int start,
private static boolean shiftItemStackToRangeMerge(List inventorySlots, ItemStack stackToShift, int start,
int count) {
if (stackToShift == null || !stackToShift.isStackable() || stackToShift.stackSize <= 0) {
return false;
@@ -175,7 +174,7 @@ public abstract class SlotUtil {
boolean changed = false;
for (int slotIndex = start; stackToShift.stackSize > 0 && slotIndex < start + count; slotIndex++) {
Slot slot = inventorySlots.get(slotIndex);
Slot slot = (Slot) inventorySlots.get(slotIndex);
ItemStack stackInSlot = slot.getStack();
if (stackInSlot != null && ItemStackUtil.isIdenticalItem(stackInSlot, stackToShift)) {
int resultingStackSize = stackInSlot.stackSize + stackToShift.stackSize;
@@ -196,7 +195,7 @@ public abstract class SlotUtil {
return changed;
}
private static boolean shiftItemStackToRangeOpenSlots(List<Slot> inventorySlots, ItemStack stackToShift, int start,
private static boolean shiftItemStackToRangeOpenSlots(List inventorySlots, ItemStack stackToShift, int start,
int count) {
if (stackToShift == null || stackToShift.stackSize <= 0) {
return false;
@@ -204,7 +203,7 @@ public abstract class SlotUtil {
boolean changed = false;
for (int slotIndex = start; stackToShift.stackSize > 0 && slotIndex < start + count; slotIndex++) {
Slot slot = inventorySlots.get(slotIndex);
Slot slot = (Slot) inventorySlots.get(slotIndex);
ItemStack stackInSlot = slot.getStack();
if (stackInSlot == null) {
int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit());
@@ -230,7 +229,7 @@ public abstract class SlotUtil {
return SlotUtil.isSlotInRange(slotIndex, playerInventorySize - playerHotbarSize, playerInventorySize);
}
private static boolean shiftToPlayerInventory(List<Slot> inventorySlots, ItemStack stackInSlot) {
private static boolean shiftToPlayerInventory(List inventorySlots, ItemStack stackInSlot) {
int playerHotbarStart = playerInventorySize - playerHotbarSize;
// try to merge with existing stacks, hotbar first
@@ -243,17 +242,17 @@ public abstract class SlotUtil {
return shifted;
}
private static boolean shiftToPlayerInventoryNoHotbar(List<Slot> inventorySlots, ItemStack stackInSlot) {
private static boolean shiftToPlayerInventoryNoHotbar(List inventorySlots, ItemStack stackInSlot) {
int playerHotbarStart = playerInventorySize - playerHotbarSize;
return shiftItemStackToRange(inventorySlots, stackInSlot, 0, playerHotbarStart);
}
private static boolean shiftToHotbar(List<Slot> inventorySlots, ItemStack stackInSlot) {
private static boolean shiftToHotbar(List inventorySlots, ItemStack stackInSlot) {
int playerHotbarStart = playerInventorySize - playerHotbarSize;
return shiftItemStackToRange(inventorySlots, stackInSlot, playerHotbarStart, playerHotbarSize);
}
private static boolean shiftToMachineInventory(List<Slot> inventorySlots, ItemStack stackToShift, int numSlots) {
private static boolean shiftToMachineInventory(List inventorySlots, ItemStack stackToShift, int numSlots) {
boolean success = false;
if (stackToShift.isStackable()) {
success = shiftToMachineInventory(inventorySlots, stackToShift, numSlots, true);
@@ -265,7 +264,7 @@ public abstract class SlotUtil {
}
// if mergeOnly = true, don't shift into empty slots.
private static boolean shiftToMachineInventory(List<Slot> inventorySlots, ItemStack stackToShift, int numSlots,
private static boolean shiftToMachineInventory(List inventorySlots, ItemStack stackToShift, int numSlots,
boolean mergeOnly) {
for (int machineIndex = playerInventorySize; machineIndex < numSlots; machineIndex++) {
// System.out.println("SlotUtil::shiftToMachineinventory");
@@ -51,9 +51,8 @@ public class EnergyManager implements IEnergyHandler, IStreamable {
case EXTRACT:
case BOTH:
return true;
default:
return false;
}
return false;
}
private boolean canReceive() {
@@ -61,9 +60,8 @@ public class EnergyManager implements IEnergyHandler, IStreamable {
case RECEIVE:
case BOTH:
return true;
default:
return false;
}
return false;
}
/* NBT */
@@ -67,7 +67,8 @@ public class BlockEngine extends BlockBase<BlockEngineType> {
}
@Override
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List<AxisAlignedBB> list,
@SuppressWarnings("unchecked")
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list,
Entity colliding) {
TileEngine tile = TileUtil.getTile(world, x, y, z, TileEngine.class);
if (tile == null) {
@@ -32,6 +32,7 @@ public class ContainerEngineBiogas extends ContainerLiquidTanks<TileEngineBiogas
}
@Override
@SuppressWarnings("unchecked")
public void detectAndSendChanges() {
super.detectAndSendChanges();
@@ -32,6 +32,7 @@ public class ContainerGenerator extends ContainerLiquidTanks<TileGenerator> {
}
@Override
@SuppressWarnings("unchecked")
public void detectAndSendChanges() {
super.detectAndSendChanges();
@@ -69,6 +69,7 @@ public class ContainerFabricator extends ContainerLiquidTanks<TileFabricator> im
}
@Override
@SuppressWarnings("unchecked")
public void detectAndSendChanges() {
super.detectAndSendChanges();
@@ -37,6 +37,7 @@ public class ContainerFermenter extends ContainerLiquidTanks<TileFermenter> {
}
@Override
@SuppressWarnings("unchecked")
public void detectAndSendChanges() {
super.detectAndSendChanges();
@@ -58,6 +58,7 @@ public class ContainerMoistener extends ContainerLiquidTanks<TileMoistener> impl
}
@Override
@SuppressWarnings("unchecked")
public void detectAndSendChanges() {
super.detectAndSendChanges();
@@ -34,6 +34,7 @@ public class ContainerRaintank extends ContainerLiquidTanks<TileRaintank> {
}
@Override
@SuppressWarnings("unchecked")
public void detectAndSendChanges() {
super.detectAndSendChanges();
@@ -111,6 +111,7 @@ public class GuiWorktable extends GuiForestryTitled<ContainerWorktable, TileWork
GL11.glEnable(GL11.GL_LIGHTING);
}
@SuppressWarnings("unchecked")
private void addButtons() {
buttonList.add(new GuiBetterButton(0, guiLeft + 76, guiTop + 56, StandardButtonTextureSets.LEFT_BUTTON_SMALL));
buttonList.add(new GuiBetterButton(1, guiLeft + 85, guiTop + 56, StandardButtonTextureSets.RIGHT_BUTTON_SMALL));
@@ -32,17 +32,17 @@ public class CarpenterRecipeManager implements ICarpenterManager {
private static final Set<Fluid> recipeFluids = new HashSet<>();
@Override
public void addRecipe(ItemStack box, ItemStack product, Object... materials) {
public void addRecipe(ItemStack box, ItemStack product, Object materials[]) {
addRecipe(5, null, box, product, materials);
}
@Override
public void addRecipe(int packagingTime, ItemStack box, ItemStack product, Object... materials) {
public void addRecipe(int packagingTime, ItemStack box, ItemStack product, Object materials[]) {
addRecipe(packagingTime, null, box, product, materials);
}
@Override
public void addRecipe(int packagingTime, FluidStack liquid, ItemStack box, ItemStack product, Object... materials) {
public void addRecipe(int packagingTime, FluidStack liquid, ItemStack box, ItemStack product, Object materials[]) {
ICarpenterRecipe recipe = new CarpenterRecipe(
packagingTime,
liquid,
@@ -17,7 +17,6 @@ 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,9 +11,6 @@ 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;
@@ -21,6 +18,9 @@ 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,11 +10,6 @@ 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;
@@ -22,6 +17,11 @@ 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,10 +14,6 @@ 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;
@@ -25,6 +21,10 @@ 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,10 +10,6 @@ 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;
@@ -21,6 +17,10 @@ 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,11 +14,6 @@ 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;
@@ -26,6 +21,11 @@ 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 {
Loaded 100 of 134 files, more files were not shown because too many files have changed in this diff. Show more