mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-15 01:24:59 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f133a5e2a | ||
|
|
0135b39309 | ||
|
|
2bcd3bb46c | ||
|
|
646988aae8 | ||
|
|
331c8a8c7b | ||
|
|
68ab1b98bd | ||
|
|
9140f84d57 | ||
|
|
bf23ca2317 | ||
|
|
0e4f38b3d1 | ||
|
|
eeb29cd7f0 |
No files matched your search
+21
-39
@@ -1,4 +1,4 @@
|
||||
//version: 1699290261
|
||||
//version: 1704751096
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
@@ -28,27 +28,11 @@ import java.util.concurrent.TimeUnit
|
||||
|
||||
buildscript {
|
||||
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
|
||||
url "https://nexus.gtnewhorizons.com/repository/public/"
|
||||
}
|
||||
maven {
|
||||
name 'sonatype'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots/'
|
||||
}
|
||||
maven {
|
||||
name 'Scala CI dependencies'
|
||||
url 'https://repo1.maven.org/maven2/'
|
||||
}
|
||||
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
@@ -64,12 +48,12 @@ plugins {
|
||||
id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle
|
||||
id '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 'de.undercouch.download' version '5.5.0'
|
||||
id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle
|
||||
id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version
|
||||
id 'com.modrinth.minotaur' version '2.+' apply false
|
||||
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.24'
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.27'
|
||||
}
|
||||
|
||||
print("You might want to check out './gradlew :faq' if your build fails.\n")
|
||||
@@ -133,7 +117,7 @@ propertyDefaultIfUnset("forceEnableMixins", false)
|
||||
propertyDefaultIfUnset("channel", "stable")
|
||||
propertyDefaultIfUnset("mappingsVersion", "12")
|
||||
propertyDefaultIfUnset("usesMavenPublishing", true)
|
||||
propertyDefaultIfUnset("mavenPublishUrl", "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases")
|
||||
propertyDefaultIfUnset("mavenPublishUrl", "https://nexus.gtnewhorizons.com/repository/releases/")
|
||||
propertyDefaultIfUnset("modrinthProjectId", "")
|
||||
propertyDefaultIfUnset("modrinthRelations", "")
|
||||
propertyDefaultIfUnset("curseForgeProjectId", "")
|
||||
@@ -302,7 +286,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)
|
||||
@@ -588,13 +572,15 @@ afterEvaluate {
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name 'Overmind forge repo mirror'
|
||||
url 'https://gregtech.overminddl1.com/'
|
||||
name = "GTNH Maven"
|
||||
url = "https://nexus.gtnewhorizons.com/repository/public/"
|
||||
// Links for convenience:
|
||||
// Simple HTML browsing: https://nexus.gtnewhorizons.com/service/rest/repository/browse/releases/
|
||||
// Rich web UI browsing: https://nexus.gtnewhorizons.com/#browse/browse:releases
|
||||
}
|
||||
maven {
|
||||
name = "GTNH Maven"
|
||||
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
allowInsecureProtocol = true
|
||||
name 'Overmind forge repo mirror'
|
||||
url 'https://gregtech.overminddl1.com/'
|
||||
}
|
||||
maven {
|
||||
name 'sonatype'
|
||||
@@ -628,7 +614,7 @@ repositories {
|
||||
}
|
||||
maven {
|
||||
name = "ic2"
|
||||
url = getURL("https://maven.ic2.player.to/", "https://maven2.ic2.player.to/")
|
||||
url = getURL("https://maven2.ic2.player.to/", "https://maven.ic2.player.to/")
|
||||
content {
|
||||
includeGroup "net.industrial-craft"
|
||||
}
|
||||
@@ -687,6 +673,8 @@ configurations.all {
|
||||
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")
|
||||
|
||||
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')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -793,12 +781,12 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def lwjgl3ifyVersion = '1.5.1'
|
||||
def lwjgl3ifyVersion = '1.5.7'
|
||||
if (modId != 'lwjgl3ify') {
|
||||
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
|
||||
}
|
||||
if (modId != 'hodgepodge') {
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.17')
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.4.4')
|
||||
}
|
||||
|
||||
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
|
||||
@@ -973,8 +961,7 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar))
|
||||
configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar))
|
||||
tasks.named("jar", Jar) {
|
||||
enabled = false
|
||||
finalizedBy(tasks.shadowJar)
|
||||
archiveClassifier.set('dev-preshadow')
|
||||
}
|
||||
tasks.named("reobfJar", ReobfuscatedJar) {
|
||||
inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile}))
|
||||
@@ -983,11 +970,6 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
|
||||
skip()
|
||||
}
|
||||
for (runTask in ["runClient", "runServer", "runClient17", "runServer17"]) {
|
||||
tasks.named(runTask).configure {
|
||||
dependsOn("shadowJar")
|
||||
}
|
||||
}
|
||||
}
|
||||
ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar
|
||||
ext.publishableObfJar = tasks.reobfJar
|
||||
@@ -1191,7 +1173,7 @@ publishing {
|
||||
if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) {
|
||||
maven {
|
||||
url = mavenPublishUrl
|
||||
allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven
|
||||
allowInsecureProtocol = mavenPublishUrl.startsWith("http://")
|
||||
credentials {
|
||||
username = System.getenv("MAVEN_USER") ?: "NONE"
|
||||
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
|
||||
@@ -1310,7 +1292,7 @@ def addCurseForgeRelation(String type, String name) {
|
||||
|
||||
// Updating
|
||||
|
||||
def buildscriptGradleVersion = "8.2.1"
|
||||
def buildscriptGradleVersion = "8.5"
|
||||
|
||||
tasks.named('wrapper', Wrapper).configure {
|
||||
gradleVersion = buildscriptGradleVersion
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
|
||||
dependencies {
|
||||
api('curse.maven:cofh-lib-220333:2388748')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.3.81-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:inventory-tweaks:1.5.16:api')
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.36:api')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.3-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')
|
||||
compileOnly('curse.maven:craftguide-75557:2459320')
|
||||
}
|
||||
+100
-8
@@ -15,22 +15,40 @@ 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
|
||||
|
||||
# Define a source file of your project with:
|
||||
# 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
|
||||
# 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 = Constants.java
|
||||
gradleTokenModId =
|
||||
gradleTokenModName =
|
||||
gradleTokenVersion = GRADLETOKEN_VERSION
|
||||
gradleTokenGroupName =
|
||||
replaceGradleTokenInFile =
|
||||
|
||||
# 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.
|
||||
@@ -38,11 +56,14 @@ gradleTokenGroupName =
|
||||
apiPackage = api
|
||||
|
||||
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
||||
# Example value: mymodid_at.cfg
|
||||
# There can be multiple files in a space-separated list.
|
||||
# Example value: mymodid_at.cfg nei_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!
|
||||
@@ -55,6 +76,77 @@ coreModClass =
|
||||
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||
containsMixinsAndOrCoreModOnly = false
|
||||
|
||||
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
|
||||
# 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
|
||||
# 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
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -83,7 +83,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -130,10 +131,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -198,11 +202,11 @@ 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
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
|
||||
+4
-5
@@ -4,10 +4,9 @@ pluginManagement {
|
||||
maven {
|
||||
// RetroFuturaGradle
|
||||
name "GTNH Maven"
|
||||
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
allowInsecureProtocol = true
|
||||
url "https://nexus.gtnewhorizons.com/repository/public/"
|
||||
mavenContent {
|
||||
includeGroup("com.gtnewhorizons.retrofuturagradle")
|
||||
includeGroupByRegex("com\\.gtnewhorizons\\..+")
|
||||
}
|
||||
}
|
||||
gradlePluginPortal()
|
||||
@@ -17,8 +16,8 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.diffplug.blowdryerSetup' version '1.6.0'
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
|
||||
id 'com.diffplug.blowdryerSetup' version '1.7.1'
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' // Provides java toolchains
|
||||
}
|
||||
|
||||
blowdryerSetup {
|
||||
|
||||
@@ -34,7 +34,8 @@ public enum FarmDirection {
|
||||
return SOUTH;
|
||||
case WEST:
|
||||
return WEST;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -12,12 +12,13 @@ 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 apicultureChest;
|
||||
public final BlockBase<? extends IMachineProperties> apicultureChest;
|
||||
public final BlockBeehives beehives;
|
||||
public final BlockCandle candle;
|
||||
public final BlockStump stump;
|
||||
@@ -26,7 +27,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);
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
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,7 +28,6 @@ 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,6 +168,7 @@ 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,6 +61,7 @@ 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,6 +1059,8 @@ 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);
|
||||
|
||||
@@ -35,6 +35,7 @@ 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,7 +16,6 @@ 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;
|
||||
@@ -50,29 +49,22 @@ public abstract class BlockStructure extends BlockForestry {
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (!(tile instanceof MultiblockTileEntityForestry)) {
|
||||
if (!(tile instanceof MultiblockTileEntityForestry<?>part)) {
|
||||
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()) {
|
||||
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;
|
||||
String validationError = controller.getLastValidationError();
|
||||
if (validationError != null) {
|
||||
long tick = world.getTotalWorldTime();
|
||||
if (tick > previousMessageTick + 20) {
|
||||
player.addChatMessage(new ChatComponentText(validationError));
|
||||
previousMessageTick = tick;
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(
|
||||
new ChatComponentText(StatCollector.translateToLocal("for.multiblock.error.notConnected")));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -94,13 +86,12 @@ public abstract class BlockStructure extends BlockForestry {
|
||||
return;
|
||||
}
|
||||
|
||||
if (entityLiving instanceof EntityPlayer) {
|
||||
if (entityLiving instanceof EntityPlayer player) {
|
||||
TileEntity tile = world.getTileEntity(i, j, k);
|
||||
|
||||
if (tile instanceof MultiblockTileEntityForestry) {
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
if (tile instanceof MultiblockTileEntityForestry<?>tileForestry) {
|
||||
GameProfile gameProfile = player.getGameProfile();
|
||||
((MultiblockTileEntityForestry) tile).setOwner(gameProfile);
|
||||
tileForestry.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,7 +79,6 @@ 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,7 +164,6 @@ public class CommandHelpers {
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static List<String> getListOfStringsMatchingLastWord(String[] strings, String... lastWords) {
|
||||
return CommandBase.getListOfStringsMatchingLastWord(strings, lastWords);
|
||||
}
|
||||
|
||||
@@ -26,24 +26,11 @@ 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,
|
||||
style,
|
||||
new ChatStyle().setColor(EnumChatFormatting.GREEN),
|
||||
"for.chat.version",
|
||||
Version.getVersion(),
|
||||
Proxies.common.getMinecraftVersion(),
|
||||
Version.getRecommendedVersion());
|
||||
if (Version.isOutdated()) {
|
||||
for (String updateLine : Version.getChangelog()) {
|
||||
CommandHelpers.sendChatMessage(sender, EnumChatFormatting.BLUE + updateLine);
|
||||
}
|
||||
}
|
||||
Proxies.common.getMinecraftVersion());
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class RootCommand extends CommandBase implements IForestryCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List addTabCompletionOptions(ICommandSender sender, String[] incomplete) {
|
||||
public List<String> addTabCompletionOptions(ICommandSender sender, String[] incomplete) {
|
||||
return CommandHelpers.addStandardTabCompletionOptions(this, sender, incomplete);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.core.config;
|
||||
|
||||
import forestry.Tags;
|
||||
import forestry.api.core.IForestryConstants;
|
||||
|
||||
public class Constants implements IForestryConstants {
|
||||
@@ -15,7 +16,7 @@ public class Constants implements IForestryConstants {
|
||||
// System
|
||||
public static final String MOD = "Forestry";
|
||||
public static final String ID = "forestry";
|
||||
public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
public static final String VERSION = Tags.VERSION;
|
||||
public static final String URL = "http://forestry.sengir.net/";
|
||||
|
||||
public static final int FLAG_BLOCK_UPDATE = 1;
|
||||
|
||||
@@ -25,6 +25,7 @@ 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<>();
|
||||
|
||||
@@ -32,13 +33,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;
|
||||
|
||||
@@ -8,21 +8,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.core.config;
|
||||
|
||||
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;
|
||||
import forestry.Tags;
|
||||
|
||||
/**
|
||||
* With permission from pahimar.
|
||||
@@ -31,163 +17,51 @@ import forestry.core.utils.Log;
|
||||
*/
|
||||
public class Version {
|
||||
|
||||
@Deprecated
|
||||
public enum EnumUpdateState {
|
||||
CURRENT,
|
||||
OUTDATED,
|
||||
CONNECTION_ERROR
|
||||
}
|
||||
|
||||
public static final String VERSION = "@VERSION@";
|
||||
public static final String BUILD_NUMBER = "@BUILD_NUMBER@";
|
||||
public static final String VERSION = Tags.VERSION;
|
||||
@Deprecated
|
||||
public static final String BUILD_NUMBER = "";
|
||||
@Deprecated
|
||||
public static final String[] FAILED_CHANGELOG = new String[] {
|
||||
String.format("Unable to retrieve changelog for %s", Constants.MOD) };
|
||||
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/";
|
||||
@Deprecated
|
||||
public static EnumUpdateState currentVersion = EnumUpdateState.CURRENT;
|
||||
private static String recommendedVersion;
|
||||
private static String[] cachedChangelog = FAILED_CHANGELOG;
|
||||
|
||||
public static String getVersion() {
|
||||
return VERSION + " (" + BUILD_NUMBER + ")";
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isOutdated() {
|
||||
return currentVersion == EnumUpdateState.OUTDATED;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean needsUpdateNoticeAndMarkAsSeen() {
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static String getRecommendedVersion() {
|
||||
return recommendedVersion;
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
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 void versionCheck() {}
|
||||
|
||||
@Deprecated
|
||||
public static String[] getChangelog() {
|
||||
return cachedChangelog;
|
||||
return FAILED_CHANGELOG;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static String[] grabChangelog(String version) {
|
||||
|
||||
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) };
|
||||
return FAILED_CHANGELOG;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ 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;
|
||||
@@ -31,7 +30,7 @@ public class FakeTankManager implements ITankManager {
|
||||
public void containerAdded(Container container, ICrafting player) {}
|
||||
|
||||
@Override
|
||||
public void updateGuiData(Container container, List<EntityPlayerMP> crafters) {}
|
||||
public void updateGuiData(Container container, List<ICrafting> crafters) {}
|
||||
|
||||
@Override
|
||||
public void containerRemoved(Container container) {}
|
||||
|
||||
@@ -10,7 +10,6 @@ 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;
|
||||
@@ -21,7 +20,7 @@ public interface ITankManager extends IFluidHandler {
|
||||
|
||||
void containerAdded(Container container, ICrafting player);
|
||||
|
||||
void updateGuiData(Container container, List<EntityPlayerMP> crafters);
|
||||
void updateGuiData(Container container, List<ICrafting> crafters);
|
||||
|
||||
void containerRemoved(Container container);
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ 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;
|
||||
@@ -134,7 +135,7 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl
|
||||
return;
|
||||
}
|
||||
|
||||
List<EntityPlayerMP> crafters = Collections.singletonList((EntityPlayerMP) player);
|
||||
List<ICrafting> crafters = Collections.singletonList(player);
|
||||
|
||||
for (StandardTank tank : tanks) {
|
||||
sendTankUpdate(container, tank, crafters);
|
||||
@@ -149,13 +150,13 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateGuiData(Container container, List<EntityPlayerMP> crafters) {
|
||||
public void updateGuiData(Container container, List<ICrafting> crafters) {
|
||||
for (StandardTank tank : tanks) {
|
||||
updateGuiData(container, crafters, tank.getTankIndex());
|
||||
}
|
||||
}
|
||||
|
||||
private void updateGuiData(Container container, List<EntityPlayerMP> crafters, int tankIndex) {
|
||||
private void updateGuiData(Container container, List<ICrafting> crafters, int tankIndex) {
|
||||
StandardTank tank = tanks.get(tankIndex);
|
||||
if (tank == null) {
|
||||
return;
|
||||
@@ -170,12 +171,12 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl
|
||||
sendTankUpdate(container, tank, crafters);
|
||||
}
|
||||
|
||||
private void sendTankUpdate(Container container, StandardTank tank, Iterable<EntityPlayerMP> crafters) {
|
||||
private void sendTankUpdate(Container container, StandardTank tank, Iterable<ICrafting> crafters) {
|
||||
int tankIndex = tank.getTankIndex();
|
||||
FluidStack fluid = tank.getFluid();
|
||||
IForestryPacketClient packet = new PacketTankLevelUpdate(tile, tankIndex, fluid);
|
||||
for (EntityPlayerMP player : crafters) {
|
||||
Proxies.net.sendToPlayer(packet, player);
|
||||
for (ICrafting player : crafters) {
|
||||
Proxies.net.sendToPlayer(packet, (EntityPlayer) player);
|
||||
}
|
||||
|
||||
if (fluid == null) {
|
||||
|
||||
@@ -133,8 +133,9 @@ public class StandardTank extends FluidTank implements IStreamable {
|
||||
case DEFAULT:
|
||||
case INPUT:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean canBeDrainedExternally() {
|
||||
@@ -142,8 +143,9 @@ 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,7 +38,6 @@ public abstract class ContainerLiquidTanks<T extends TileEntity & ILiquidTankTil
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
tile.getTankManager().updateGuiData(this, crafters);
|
||||
|
||||
@@ -43,7 +43,6 @@ 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,7 +94,6 @@ public class GuiNaturalistInventory extends GuiForestry<Container, IPagedInvento
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
@@ -70,7 +70,6 @@ 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();
|
||||
|
||||
@@ -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,6 +9,8 @@
|
||||
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;
|
||||
|
||||
@@ -18,7 +20,7 @@ public class TextLayoutHelper {
|
||||
|
||||
private static final int LINE_HEIGHT = 12;
|
||||
|
||||
private final GuiForestry guiForestry;
|
||||
private final GuiForestry<? extends Container, ? extends IInventory> guiForestry;
|
||||
private final int defaultFontColor;
|
||||
private FontRenderer fontRendererObj;
|
||||
|
||||
@@ -27,7 +29,7 @@ public class TextLayoutHelper {
|
||||
public int column2;
|
||||
public int line;
|
||||
|
||||
public TextLayoutHelper(GuiForestry guiForestry, FontColour fontColour) {
|
||||
public TextLayoutHelper(GuiForestry<? extends Container, ? extends IInventory> guiForestry, FontColour fontColour) {
|
||||
this.guiForestry = guiForestry;
|
||||
this.defaultFontColor = fontColour.get("gui.screen");
|
||||
}
|
||||
|
||||
@@ -227,12 +227,10 @@ 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 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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
return y - originalY;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@ 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;
|
||||
@@ -29,9 +32,9 @@ public class LedgerManager {
|
||||
private IErrorSource errorSource;
|
||||
private final int maxWidth;
|
||||
|
||||
public final GuiForestry gui;
|
||||
public final GuiForestry<? extends Container, ? extends IInventory> gui;
|
||||
|
||||
public LedgerManager(GuiForestry gui, int maxWidth) {
|
||||
public LedgerManager(GuiForestry<? extends Container, ? extends IInventory> 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,7 +54,6 @@ public class SocketWidget extends Widget {
|
||||
|
||||
private final ToolTip toolTip = new ToolTip(250) {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void refresh() {
|
||||
toolTip.clear();
|
||||
|
||||
@@ -12,6 +12,8 @@ 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;
|
||||
|
||||
@@ -20,11 +22,11 @@ import forestry.core.proxy.Proxies;
|
||||
|
||||
public class WidgetManager {
|
||||
|
||||
public final GuiForestry gui;
|
||||
public final GuiForestry<? extends Container, ? extends IInventory> gui;
|
||||
public final Minecraft minecraft;
|
||||
protected final List<Widget> widgets = new ArrayList<>();
|
||||
|
||||
public WidgetManager(GuiForestry gui) {
|
||||
public WidgetManager(GuiForestry<? extends Container, ? extends IInventory> gui) {
|
||||
this.gui = gui;
|
||||
this.minecraft = Proxies.common.getClientInstance();
|
||||
}
|
||||
|
||||
@@ -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,6 +8,8 @@ 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.newInstance();
|
||||
T streamable = streamableClass.getConstructor().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<Object> cachedRecipes = new ArrayList<Object>();
|
||||
static List<IRecipe> cachedRecipes = new ArrayList<>();
|
||||
|
||||
public static void addFermenterRecipes(ItemStack resource, int fermentationValue, Fluids output) {
|
||||
if (RecipeManagers.fermenterManager == null) {
|
||||
@@ -183,15 +183,14 @@ public abstract class RecipeUtil {
|
||||
}
|
||||
|
||||
List<ItemStack> matchingRecipes = new ArrayList<>();
|
||||
List<Integer> matchingIndex = new ArrayList();
|
||||
List<Object> matchingRecipeMap = new ArrayList();
|
||||
List<Integer> matchingIndex = new ArrayList<>();
|
||||
List<IRecipe> matchingRecipeMap = new ArrayList<>();
|
||||
int index = 0;
|
||||
|
||||
if (Config.cacheWorktableRecipes) {
|
||||
// Check across the whole cached recipe map
|
||||
// Add each recipe to the matchingRecipes list
|
||||
for (Object recipe : cachedRecipes) {
|
||||
IRecipe irecipe = (IRecipe) recipe;
|
||||
for (IRecipe irecipe : cachedRecipes) {
|
||||
|
||||
if (irecipe.matches(inventory, world)) {
|
||||
ItemStack result = irecipe.getCraftingResult(inventory);
|
||||
@@ -206,8 +205,7 @@ public abstract class RecipeUtil {
|
||||
}
|
||||
}
|
||||
// Only do this if there were no cached recipes hit
|
||||
for (Object recipe : CraftingManager.getInstance().getRecipeList()) {
|
||||
IRecipe irecipe = (IRecipe) recipe;
|
||||
for (IRecipe irecipe : CraftingManager.getInstance().getRecipeList()) {
|
||||
|
||||
if (irecipe.matches(inventory, world)) {
|
||||
ItemStack result = irecipe.getCraftingResult(inventory);
|
||||
@@ -216,8 +214,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(recipe);
|
||||
matchingIndex.add(new Integer(index));
|
||||
matchingRecipeMap.add(irecipe);
|
||||
matchingIndex.add(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,7 +225,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 recipeMap = CraftingManager.getInstance().getRecipeList();
|
||||
List<IRecipe> 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() );
|
||||
@@ -295,12 +293,10 @@ 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));
|
||||
}
|
||||
@@ -309,7 +305,6 @@ 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));
|
||||
}
|
||||
@@ -400,7 +395,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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -31,6 +31,7 @@ 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");
|
||||
|
||||
@@ -59,13 +59,11 @@ 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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -62,8 +62,8 @@ public abstract class SlotUtil {
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static ItemStack transferStackInSlot(List inventorySlots, EntityPlayer player, int slotIndex) {
|
||||
Slot slot = (Slot) inventorySlots.get(slotIndex);
|
||||
public static ItemStack transferStackInSlot(List<Slot> inventorySlots, EntityPlayer player, int slotIndex) {
|
||||
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 inventorySlots, ItemStack stackInSlot, int slotIndex, int numSlots,
|
||||
private static boolean shiftItemStack(List<Slot> inventorySlots, ItemStack stackInSlot, int slotIndex, int numSlots,
|
||||
boolean fromCraftingSlot) {
|
||||
if (isInPlayerInventory(slotIndex)) {
|
||||
if (shiftToMachineInventory(inventorySlots, stackInSlot, numSlots)) {
|
||||
@@ -160,13 +160,14 @@ public abstract class SlotUtil {
|
||||
slot.putStack(phantomStack);
|
||||
}
|
||||
|
||||
private static boolean shiftItemStackToRange(List inventorySlots, ItemStack stackToShift, int start, int count) {
|
||||
private static boolean shiftItemStackToRange(List<Slot> 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 inventorySlots, ItemStack stackToShift, int start,
|
||||
private static boolean shiftItemStackToRangeMerge(List<Slot> inventorySlots, ItemStack stackToShift, int start,
|
||||
int count) {
|
||||
if (stackToShift == null || !stackToShift.isStackable() || stackToShift.stackSize <= 0) {
|
||||
return false;
|
||||
@@ -174,7 +175,7 @@ public abstract class SlotUtil {
|
||||
|
||||
boolean changed = false;
|
||||
for (int slotIndex = start; stackToShift.stackSize > 0 && slotIndex < start + count; slotIndex++) {
|
||||
Slot slot = (Slot) inventorySlots.get(slotIndex);
|
||||
Slot slot = inventorySlots.get(slotIndex);
|
||||
ItemStack stackInSlot = slot.getStack();
|
||||
if (stackInSlot != null && ItemStackUtil.isIdenticalItem(stackInSlot, stackToShift)) {
|
||||
int resultingStackSize = stackInSlot.stackSize + stackToShift.stackSize;
|
||||
@@ -195,7 +196,7 @@ public abstract class SlotUtil {
|
||||
return changed;
|
||||
}
|
||||
|
||||
private static boolean shiftItemStackToRangeOpenSlots(List inventorySlots, ItemStack stackToShift, int start,
|
||||
private static boolean shiftItemStackToRangeOpenSlots(List<Slot> inventorySlots, ItemStack stackToShift, int start,
|
||||
int count) {
|
||||
if (stackToShift == null || stackToShift.stackSize <= 0) {
|
||||
return false;
|
||||
@@ -203,7 +204,7 @@ public abstract class SlotUtil {
|
||||
|
||||
boolean changed = false;
|
||||
for (int slotIndex = start; stackToShift.stackSize > 0 && slotIndex < start + count; slotIndex++) {
|
||||
Slot slot = (Slot) inventorySlots.get(slotIndex);
|
||||
Slot slot = inventorySlots.get(slotIndex);
|
||||
ItemStack stackInSlot = slot.getStack();
|
||||
if (stackInSlot == null) {
|
||||
int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit());
|
||||
@@ -229,7 +230,7 @@ public abstract class SlotUtil {
|
||||
return SlotUtil.isSlotInRange(slotIndex, playerInventorySize - playerHotbarSize, playerInventorySize);
|
||||
}
|
||||
|
||||
private static boolean shiftToPlayerInventory(List inventorySlots, ItemStack stackInSlot) {
|
||||
private static boolean shiftToPlayerInventory(List<Slot> inventorySlots, ItemStack stackInSlot) {
|
||||
int playerHotbarStart = playerInventorySize - playerHotbarSize;
|
||||
|
||||
// try to merge with existing stacks, hotbar first
|
||||
@@ -242,17 +243,17 @@ public abstract class SlotUtil {
|
||||
return shifted;
|
||||
}
|
||||
|
||||
private static boolean shiftToPlayerInventoryNoHotbar(List inventorySlots, ItemStack stackInSlot) {
|
||||
private static boolean shiftToPlayerInventoryNoHotbar(List<Slot> inventorySlots, ItemStack stackInSlot) {
|
||||
int playerHotbarStart = playerInventorySize - playerHotbarSize;
|
||||
return shiftItemStackToRange(inventorySlots, stackInSlot, 0, playerHotbarStart);
|
||||
}
|
||||
|
||||
private static boolean shiftToHotbar(List inventorySlots, ItemStack stackInSlot) {
|
||||
private static boolean shiftToHotbar(List<Slot> inventorySlots, ItemStack stackInSlot) {
|
||||
int playerHotbarStart = playerInventorySize - playerHotbarSize;
|
||||
return shiftItemStackToRange(inventorySlots, stackInSlot, playerHotbarStart, playerHotbarSize);
|
||||
}
|
||||
|
||||
private static boolean shiftToMachineInventory(List inventorySlots, ItemStack stackToShift, int numSlots) {
|
||||
private static boolean shiftToMachineInventory(List<Slot> inventorySlots, ItemStack stackToShift, int numSlots) {
|
||||
boolean success = false;
|
||||
if (stackToShift.isStackable()) {
|
||||
success = shiftToMachineInventory(inventorySlots, stackToShift, numSlots, true);
|
||||
@@ -264,7 +265,7 @@ public abstract class SlotUtil {
|
||||
}
|
||||
|
||||
// if mergeOnly = true, don't shift into empty slots.
|
||||
private static boolean shiftToMachineInventory(List inventorySlots, ItemStack stackToShift, int numSlots,
|
||||
private static boolean shiftToMachineInventory(List<Slot> inventorySlots, ItemStack stackToShift, int numSlots,
|
||||
boolean mergeOnly) {
|
||||
for (int machineIndex = playerInventorySize; machineIndex < numSlots; machineIndex++) {
|
||||
// System.out.println("SlotUtil::shiftToMachineinventory");
|
||||
|
||||
@@ -51,8 +51,9 @@ public class EnergyManager implements IEnergyHandler, IStreamable {
|
||||
case EXTRACT:
|
||||
case BOTH:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean canReceive() {
|
||||
@@ -60,8 +61,9 @@ public class EnergyManager implements IEnergyHandler, IStreamable {
|
||||
case RECEIVE:
|
||||
case BOTH:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* NBT */
|
||||
|
||||
@@ -67,8 +67,7 @@ public class BlockEngine extends BlockBase<BlockEngineType> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list,
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List<AxisAlignedBB> list,
|
||||
Entity colliding) {
|
||||
TileEngine tile = TileUtil.getTile(world, x, y, z, TileEngine.class);
|
||||
if (tile == null) {
|
||||
|
||||
@@ -32,7 +32,6 @@ public class ContainerEngineBiogas extends ContainerLiquidTanks<TileEngineBiogas
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ public class ContainerGenerator extends ContainerLiquidTanks<TileGenerator> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ public class ContainerFabricator extends ContainerLiquidTanks<TileFabricator> im
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ public class ContainerFermenter extends ContainerLiquidTanks<TileFermenter> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ public class ContainerMoistener extends ContainerLiquidTanks<TileMoistener> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ public class ContainerRaintank extends ContainerLiquidTanks<TileRaintank> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
|
||||
@@ -111,7 +111,6 @@ 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,
|
||||
|
||||
@@ -85,7 +85,7 @@ public class NEIHandlerCarpenter extends RecipeHandlerBase {
|
||||
continue;
|
||||
} else if (item instanceof ItemStack[] && ((ItemStack[]) item).length == 0) {
|
||||
continue;
|
||||
} else if (item instanceof List && ((List) item).size() == 0) {
|
||||
} else if (item instanceof List && ((List<?>) item).size() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ public class NEIHandlerFabricator extends RecipeHandlerBase {
|
||||
continue;
|
||||
} else if (item instanceof ItemStack[] && ((ItemStack[]) item).length == 0) {
|
||||
continue;
|
||||
} else if (item instanceof List && ((List) item).size() == 0) {
|
||||
} else if (item instanceof List && ((List<?>) item).size() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ public class NEIHandlerFabricator extends RecipeHandlerBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
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) {
|
||||
super.provideItemTooltip(guiRecipe, itemStack, currenttip, crecipe, relMouse);
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class TileCarpenter extends TilePowered
|
||||
|
||||
private final FilteredTank resourceTank;
|
||||
private final TankManager tankManager;
|
||||
private final InventoryAdapterTile craftingInventory;
|
||||
private final InventoryAdapterTile<?> craftingInventory;
|
||||
private final InventoryCraftResult craftPreviewInventory;
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -56,7 +56,7 @@ public class TileFabricator extends TilePowered
|
||||
|
||||
private static final int MAX_HEAT = 5000;
|
||||
|
||||
private final InventoryAdapterTile craftingInventory;
|
||||
private final InventoryAdapterTile<?> craftingInventory;
|
||||
private final TankManager tankManager;
|
||||
private final FilteredTank moltenTank;
|
||||
private int heat = 0;
|
||||
|
||||
@@ -38,7 +38,7 @@ import forestry.factory.recipes.RecipeMemory;
|
||||
public class TileWorktable extends TileBase implements ICrafterWorktable {
|
||||
|
||||
private final RecipeMemory recipeMemory;
|
||||
private final InventoryAdapterTile craftingDisplay;
|
||||
private final InventoryAdapterTile<?> craftingDisplay;
|
||||
private MemorizedRecipe currentRecipe;
|
||||
private long savedTick = 0;
|
||||
private long savedSystemTimeExpiration = 0;
|
||||
|
||||
@@ -71,6 +71,7 @@ public class BlockFarm extends BlockStructure {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
ArrayList<ItemStack> drops = getDrops(world, x, y, z, 0, 0);
|
||||
|
||||
@@ -42,7 +42,6 @@ public class CircuitFarmLogic extends Circuit {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void onInsertion(int slot, Object tile) {
|
||||
IFarmHousing housing = getCircuitable(tile);
|
||||
if (housing == null) {
|
||||
|
||||
@@ -89,6 +89,7 @@ public class ItemButterflyGE extends ItemGE {
|
||||
return butterfly.getDisplayName();
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) {
|
||||
super.addInformation(itemstack, player, list, flag);
|
||||
|
||||
@@ -97,7 +97,7 @@ public class LetterProperties {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
public static void getSubItems(Item item, CreativeTabs tab, @SuppressWarnings("rawtypes") List list) {
|
||||
for (State state : State.values()) {
|
||||
for (Size size : Size.values()) {
|
||||
int meta = encodeMeta(state, size);
|
||||
|
||||
@@ -43,7 +43,6 @@ public class GuiCatalogue extends GuiForestry<ContainerCatalogue, IInventory> {
|
||||
this.ySize = 192;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ItemLetter extends ItemWithGui {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, @SuppressWarnings("rawtypes") List list) {
|
||||
LetterProperties.getSubItems(item, tab, list);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.tiles.MachineDefinition;
|
||||
import forestry.factory.recipes.FabricatorRecipe;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Plugin(
|
||||
pluginID = "Arboriculture",
|
||||
name = "Arboriculture",
|
||||
|
||||
@@ -26,7 +26,6 @@ import forestry.api.fuels.FermenterFuel;
|
||||
import forestry.api.fuels.FuelManager;
|
||||
import forestry.api.fuels.MoistenerFuel;
|
||||
import forestry.api.fuels.RainSubstrate;
|
||||
import forestry.api.recipes.ICraftingProvider;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.apiculture.items.ItemRegistryApiculture;
|
||||
import forestry.core.blocks.BlockCoreType;
|
||||
@@ -78,7 +77,7 @@ public class PluginFactory extends ForestryPlugin {
|
||||
protected void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
RecipeManagers.craftingProviders = ImmutableList.<ICraftingProvider>of(
|
||||
RecipeManagers.craftingProviders = ImmutableList.of(
|
||||
RecipeManagers.carpenterManager = new CarpenterRecipeManager(),
|
||||
RecipeManagers.centrifugeManager = new CentrifugeRecipeManager(),
|
||||
RecipeManagers.fabricatorManager = new FabricatorRecipeManager(),
|
||||
@@ -95,7 +94,7 @@ public class PluginFactory extends ForestryPlugin {
|
||||
protected void disabledSetupAPI() {
|
||||
super.disabledSetupAPI();
|
||||
|
||||
RecipeManagers.craftingProviders = ImmutableList.<ICraftingProvider>of(
|
||||
RecipeManagers.craftingProviders = ImmutableList.of(
|
||||
RecipeManagers.carpenterManager = new DummyManagers.DummyCarpenterManager(),
|
||||
RecipeManagers.centrifugeManager = new DummyManagers.DummyCentrifugeManager(),
|
||||
RecipeManagers.fabricatorManager = new DummyManagers.DummyFabricatorManager(),
|
||||
|
||||
@@ -164,6 +164,8 @@ public class PluginFluids extends ForestryPlugin {
|
||||
|
||||
public static class MissingFluidException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = -5764238838259167615L;
|
||||
|
||||
public MissingFluidException(String tag) {
|
||||
super("Fluid '" + tag + "' was not found. Please check your configs.");
|
||||
}
|
||||
|
||||
@@ -131,7 +131,6 @@ public class PluginLepidopterology extends ForestryPlugin {
|
||||
config.save();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
CraftingManager.getInstance().getRecipeList().add(new MatingRecipe());
|
||||
|
||||
@@ -100,7 +100,7 @@ public class PluginStorage extends ForestryPlugin {
|
||||
public static ItemRegistryStorage items;
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
protected void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
@@ -149,7 +149,7 @@ public class PluginStorage extends ForestryPlugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
protected void disabledSetupAPI() {
|
||||
BackpackManager.backpackItems = new ArrayList[6];
|
||||
BackpackManager.backpackItems[0] = minerItems;
|
||||
@@ -186,12 +186,12 @@ public class PluginStorage extends ForestryPlugin {
|
||||
config.save();
|
||||
|
||||
BackpackDefinition forester = (BackpackDefinition) BackpackManager.definitions.get("forester");
|
||||
forester.addValidBlockClasses(Arrays.<Class>asList(IPlantable.class, IGrowable.class, IShearable.class));
|
||||
forester.addValidItemClasses(Arrays.<Class>asList(IPlantable.class, IGrowable.class));
|
||||
forester.addValidBlockClasses(Arrays.asList(IPlantable.class, IGrowable.class, IShearable.class));
|
||||
forester.addValidItemClasses(Arrays.asList(IPlantable.class, IGrowable.class));
|
||||
|
||||
BackpackDefinition builder = (BackpackDefinition) BackpackManager.definitions.get("builder");
|
||||
builder.addValidBlockClasses(
|
||||
Arrays.<Class>asList(
|
||||
Arrays.asList(
|
||||
BlockStairs.class,
|
||||
BlockFence.class,
|
||||
BlockFenceGate.class,
|
||||
|
||||
@@ -33,8 +33,8 @@ public class BackpackDefinition implements IBackpackDefinition {
|
||||
|
||||
private final Set<String> validItemStacks = new HashSet<>();
|
||||
private final Set<Integer> validOreIds = new HashSet<>();
|
||||
private final Set<Class> validItemClasses = new HashSet<>();
|
||||
private final Set<Class> validBlockClasses = new HashSet<>();
|
||||
private final Set<Class<?>> validItemClasses = new HashSet<>();
|
||||
private final Set<Class<?>> validBlockClasses = new HashSet<>();
|
||||
|
||||
public BackpackDefinition(String name, int primaryColor) {
|
||||
this(name, primaryColor, 0xffffff);
|
||||
@@ -125,26 +125,26 @@ public class BackpackDefinition implements IBackpackDefinition {
|
||||
}
|
||||
}
|
||||
|
||||
public void addValidItemClass(Class itemClass) {
|
||||
public void addValidItemClass(Class<?> itemClass) {
|
||||
if (itemClass != null) {
|
||||
validItemClasses.add(itemClass);
|
||||
}
|
||||
}
|
||||
|
||||
public void addValidItemClasses(List<Class> itemClasses) {
|
||||
for (Class itemClass : itemClasses) {
|
||||
public void addValidItemClasses(List<Class<?>> itemClasses) {
|
||||
for (Class<?> itemClass : itemClasses) {
|
||||
addValidItemClass(itemClass);
|
||||
}
|
||||
}
|
||||
|
||||
public void addValidBlockClass(Class blockClass) {
|
||||
public void addValidBlockClass(Class<?> blockClass) {
|
||||
if (blockClass != null) {
|
||||
validBlockClasses.add(blockClass);
|
||||
}
|
||||
}
|
||||
|
||||
public void addValidBlockClasses(List<Class> blockClasses) {
|
||||
for (Class blockClass : blockClasses) {
|
||||
public void addValidBlockClasses(List<Class<?>> blockClasses) {
|
||||
for (Class<?> blockClass : blockClasses) {
|
||||
addValidBlockClass(blockClass);
|
||||
}
|
||||
}
|
||||
@@ -157,11 +157,11 @@ public class BackpackDefinition implements IBackpackDefinition {
|
||||
return validOreIds;
|
||||
}
|
||||
|
||||
public Set<Class> getValidBlockClasses() {
|
||||
public Set<Class<?>> getValidBlockClasses() {
|
||||
return validBlockClasses;
|
||||
}
|
||||
|
||||
public Set<Class> getValidItemClasses() {
|
||||
public Set<Class<?>> getValidItemClasses() {
|
||||
return validItemClasses;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ public class BackpackDefinition implements IBackpackDefinition {
|
||||
}
|
||||
}
|
||||
|
||||
for (Class itemClass : validItemClasses) {
|
||||
for (Class<?> itemClass : validItemClasses) {
|
||||
if (itemClass.isInstance(item)) {
|
||||
validItemStacks.add(itemStackStringWild);
|
||||
return true;
|
||||
@@ -206,7 +206,7 @@ public class BackpackDefinition implements IBackpackDefinition {
|
||||
|
||||
Block block = Block.getBlockFromItem(item);
|
||||
if (block != null) {
|
||||
for (Class blockClass : validBlockClasses) {
|
||||
for (Class<?> blockClass : validBlockClasses) {
|
||||
if (blockClass.isInstance(block)) {
|
||||
validItemStacks.add(itemStackStringWild);
|
||||
return true;
|
||||
|
||||
@@ -328,8 +328,9 @@ public class ItemBackpack extends ItemWithGui {
|
||||
return new GuiBackpack(new ContainerBackpack(player, ContainerBackpack.Size.DEFAULT, heldItem));
|
||||
case T2:
|
||||
return new GuiBackpackT2(new ContainerBackpack(player, ContainerBackpack.Size.T2, heldItem));
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -343,7 +344,8 @@ public class ItemBackpack extends ItemWithGui {
|
||||
return new ContainerBackpack(player, ContainerBackpack.Size.DEFAULT, heldItem);
|
||||
case T2:
|
||||
return new ContainerBackpack(player, ContainerBackpack.Size.T2, heldItem);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ for.chat.command.forestry.plugins.info.format=Format: /%s <Plugin-Name>
|
||||
|
||||
for.chat.help=Gib '%s' für Hilfe ein.
|
||||
for.chat.plugins.error=Keine Informationen für das Plugin %s verfügbar.
|
||||
for.chat.version=Forestry %1$s für Minecraft %2$s (Aktuell: %3$s).
|
||||
for.chat.version=Forestry %1$s für Minecraft %2$s.
|
||||
|
||||
for.circuit.dampener.1=Feuerdämpfer
|
||||
for.circuit.dampener.1.description.1=Reduziert maximalen Output auf 10 RF/t
|
||||
|
||||
@@ -36,7 +36,7 @@ for.chat.command.forestry.plugins.info.format=Format: /%s <plugin-name>
|
||||
|
||||
for.chat.help=Type '%s' for help.
|
||||
for.chat.plugins.error=No information available for plugin %s.
|
||||
for.chat.version=Forestry %1$s for Minecraft %2$s (Latest: %3$s).
|
||||
for.chat.version=Forestry %1$s for Minecraft %2$s.
|
||||
|
||||
for.circuit.dampener.1=Fire Dampener
|
||||
for.circuit.dampener.1.description.1=Reduces maximum output to 10 RF/t
|
||||
|
||||
@@ -36,7 +36,7 @@ for.chat.command.forestry.plugins.info.format=Format: /%s <nom-module>
|
||||
|
||||
for.chat.help=Tapez '%s' pour l'aide.
|
||||
for.chat.plugins.error=Pas d'information sur le module %s.
|
||||
for.chat.version=Forestry %1$s pour Minecraft %2$s (Dernier: %3$s).
|
||||
for.chat.version=Forestry %1$s pour Minecraft %2$s.
|
||||
|
||||
for.circuit.dampener.1=Clapet coupe-feu
|
||||
for.circuit.dampener.1.description.1=Limite la sortie à 10 RF/t maximum
|
||||
|
||||
@@ -35,7 +35,7 @@ for.chat.command.forestry.plugins.info.format=Format: /%s <plugin-name>
|
||||
for.chat.help='%s'에 관한 도움.
|
||||
for.chat.memorizednote=내용을 완전히 외우고 당신은 비밀이 새어나가는걸 막기 위해 이 종이를 버렸습니다.
|
||||
for.chat.plugins.error=해당 플러그인[ %s ]에 관한 정보가 존재하지 않습니다.
|
||||
for.chat.version=마인크래프트 %2$s버전 포레스트리 %1$s버전이 나왔습니다.(최신 버전: %3$s).
|
||||
for.chat.version=마인크래프트 %2$s버전 포레스트리 %1$s버전이 나왔습니다.
|
||||
|
||||
for.circuit.dampener.1=과열완충
|
||||
for.circuit.dampener.1.description.1=10 RF/t만큼 최대출력 감소
|
||||
|
||||
@@ -35,7 +35,7 @@ for.chat.command.forestry.plugins.info.format=Formato: /%s <plugin-name>
|
||||
for.chat.help=Digite '%s' para obter ajuda.
|
||||
for.chat.memorizednote=Você memorizá a nota e descartará papel amassado.
|
||||
for.chat.plugins.error=Não há informações disponíveis para o ´plugin´ %s.
|
||||
for.chat.version=Forestry %1$s para Minecraft %2$s (Mais recente: %3$s).
|
||||
for.chat.version=Forestry %1$s para Minecraft %2$s.
|
||||
|
||||
for.circuit.dampener.1=Regulador de Tiragem
|
||||
for.circuit.dampener.1.description.1=Reduz a saída máxima para 10 RF/t
|
||||
|
||||
@@ -36,7 +36,7 @@ for.chat.command.forestry.plugins.info.format=Формат: /%s <plugin-name>
|
||||
|
||||
for.chat.help=Напишите '%s' для помощи.
|
||||
for.chat.plugins.error=Нет информации для плагина %s.
|
||||
for.chat.version=Forestry %1$s для Minecraft %2$s (Последняя: %3$s).
|
||||
for.chat.version=Forestry %1$s для Minecraft %2$s.
|
||||
|
||||
for.circuit.dampener.1=Демпфер огня
|
||||
for.circuit.dampener.1.description.1=Понижает максимальную выходную мощность до 10 RF/тик
|
||||
|
||||
@@ -35,7 +35,7 @@ for.chat.command.forestry.plugins.info.format=Формат: /%s <plugin-name>
|
||||
for.chat.help=Напишите '%s' для помощи.
|
||||
for.chat.memorizednote=Вы запоминаете записку и избавляетесь от мятого клочка бумаги.
|
||||
for.chat.plugins.error=Нет информации для плагина %s.
|
||||
for.chat.version=Forestry %1$s для Minecraft %2$s (Последняя: %3$s).
|
||||
for.chat.version=Forestry %1$s для Minecraft %2$s.
|
||||
|
||||
for.circuit.dampener.1=Демпфер огня
|
||||
for.circuit.dampener.1.description.1=Уменьшает максимальную выходную мощность до 10 RF/тик
|
||||
|
||||
@@ -36,7 +36,7 @@ for.chat.command.forestry.plugins.info.format=格式: /%s <plugin-name>
|
||||
|
||||
for.chat.help=输入‘%s’查看帮助。
|
||||
for.chat.plugins.error=拓展%s并无可查看信息。
|
||||
for.chat.version=林业%1$s适用于Minecraft%2$s(最新版本:%3$s)。
|
||||
for.chat.version=林业%1$s适用于Minecraft%2$s。
|
||||
|
||||
for.circuit.dampener.1=阻尼
|
||||
for.circuit.dampener.1.description.1=最大输出减少到10RF/t
|
||||
|
||||
@@ -36,7 +36,7 @@ for.chat.command.forestry.plugins.info.format=格式: /%s <plugin-name>
|
||||
|
||||
for.chat.help=輸入'%s'檢視說明。
|
||||
for.chat.plugins.error=插件%s沒有說明可顯示。
|
||||
for.chat.version=林業%1$s適用於Minecraft%2$s (最新版本: %3$s)。
|
||||
for.chat.version=林業%1$s適用於Minecraft%2$s。
|
||||
|
||||
for.circuit.dampener.1=阻尼
|
||||
for.circuit.dampener.1.description.1=最大輸出減少到10 RF/t
|
||||
|
||||
Reference in new issue
Block a user