Compare commits

..
1 Commits
Author SHA1 Message Date
bombcar c9941de0ad add a name for butterflyGE
(cherry picked from commit eeb29cd7f0)
2023-12-20 21:31:37 +01:00
460 changed files with 3233 additions and 3233 deletions

No files matched your search

+2 -2
View File
@@ -3,9 +3,9 @@ name: Build and test
on:
pull_request:
branches: [ master, main, release/** ]
branches: [ master, main ]
push:
branches: [ master, main, release/** ]
branches: [ master, main ]
jobs:
build-and-test:
-17
View File
@@ -1,17 +0,0 @@
name: Optimize images
on:
pull_request:
branches: [ master, main, release/** ]
paths:
- "**/*.png"
push:
branches: [ master, main, release/** ]
paths:
- "**/*.png"
jobs:
optimize-images:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
secrets: inherit
-1
View File
@@ -30,4 +30,3 @@ src/main/resources/mixins.*.json
*.bat
*.DS_Store
!gradlew.bat
layout.json
+29
View File
@@ -0,0 +1,29 @@
How to submit a bug report to Forestry
====================================
Please make sure the bug has not already been reported by [searching the issues](https://github.com/ForestryMC/ForestryMC/issues?q=is%3Aissue).
If you can, see if the bug still happens with the latest unstable build.
[The latest unstable builds are available here](http://jenkins.ic2.player.to/job/Forestry_Dev/)
For crashes, you must post a link to the full crash report.
[gist.github.com](gist.github.com) or [pastebin.com](www.pastebin.com) are good places to upload them.
Full crash reports are located in [the minecraft data folder](http://hopper.minecraft.net/help/finding-minecraft-data-folder/), in "crash-reports".
Thank you for reporting bugs!
How to contribute to Forestry
====================================
### Contributor License Agreement
Before pull requests can be accepted, the contributor needs to sign a contributor license agreement. (Essentially giving a license for using his code and/or media and for re-licensing it, for details read the agreement linked below.)
### How do I sign?
To keep the hassle for everyone involved to a minimum, Forestry uses CLAHub to manage the agreements. To get started, <a href="https://www.clahub.com/agreements/ForestryMC/ForestryMC">sign the Contributor License Agreement</a>.
### Why is this needed?
Without CLAs it at some point becomes essentially impossible to change the license of a project which accepts contributions from third parties. Without an explicit agreement every contributor would still own the copyright to his code. So as long as it (or parts of it) remain in the code base, he would have to agree to every license change. If enough time has passed, there may be dozens, perhaps even hundreds of contributors involved and it will be very hard to track down each and every one of them and get them to agree on a new license.
This would make it impossible to change the license to a more permissive one at a later date, so the code would be locked into CC BY-NC-ND 3.0 until it passes into the public domain about a hundred years from now. This situation is to be avoided and that’s why you are being bothered with this CLA.
+12 -2
View File
@@ -3,9 +3,17 @@ Forestry
### What is it?
This is the GTNH fork of Forestry for 1.7.10. Do not report any issues to the original Forestry team. This fork is maintained by the GTNH team and is not supported by the original Forestry team.
Forestry is a modification for the game Minecraft and known primarily for its farms and bees.
### Homepage
[Wiki](http://forestry.sengir.net/)
[Latest Builds for 1.7.10](http://jenkins.ic2.player.to/job/Forestry_Dev/)
[IRC #forestry on esper.net](http://webchat.esper.net/?nick=ForestryGithub...&channels=forestry&prompt=1)
For those interested in developement, you can also visit #forestry-dev.
### Building
@@ -23,6 +31,8 @@ Beware of ugly code.
Bugfixes are generally welcome. If you want to contribute something which changes game mechanics, please talk to someone with commit privileges first. Nothing is more frustrating than putting a lot of work and effort into a new game mechanic and then having the PR rejected because it doesn’t fit gameplay-wise.
**If you submit a PR you must accept the [Contributor License Agreement](https://cla-assistant.io/ForestryMC/ForestryMC). There is no way around that, since otherwise changing the license later - even to something more permissive! - , becomes close to impossible.**
### License & Copyright
Forestry is (c) 2011 - 2014 SirSengir and licensed under LGPL v3. See the LICENSE.txt for all the gory details or go to http://www.gnu.org/licenses/lgpl-3.0.txt for more information. Forestry also contains code contributed by CovertJaguar, Player, MysteriousAges, Binnie, RichardG, cpw, the GTNH Team, and others.
Forestry is (c) 2011 - 2014 SirSengir and licensed under LGPL v3. See the LICENSE.txt for all the gory details or go to http://www.gnu.org/licenses/lgpl-3.0.txt for more information. Forestry also contains code contributed by CovertJaguar, Player, MysteriousAges, Binnie, RichardG, cpw and others.
+1621 -3
View File
File diff suppressed because it is too large. Load diff
+3 -6
View File
@@ -1,13 +1,10 @@
// Add your dependencies here
dependencies {
api("com.github.GTNewHorizons:GTNHLib:0.9.54:dev")
api('curse.maven:cofh-lib-220333:2388748')
compileOnlyApi('com.github.GTNewHorizons:Angelica:2.1.19:api')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.107-GTNH:dev')
compileOnly('com.github.GTNewHorizons:inventory-tweaks:1.7.1:api')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.57:api')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.3.81-GTNH:dev')
compileOnly('com.github.GTNewHorizons:inventory-tweaks:1.5.16:api')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.36:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly('curse.maven:craftguide-75557:2459320')
devOnlyNonPublishable('net.xonich.mc:NoHotbarNeeded:0.0.3:dev')
}
+24 -202
View File
@@ -1,238 +1,60 @@
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
# LOCAL to test local config updates.
gtnh.settings.blowdryerTag = 0.2.0
# Human-readable mod name, available for mcmod.info population.
modName = Forestry
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
# Conventionally lowercase.
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
modId = Forestry
# Root package of the mod, used to find various classes in other properties,
# mcmod.info substitution, enabling assertions in run tasks, etc.
modGroup = forestry
# Whether to use modGroup as the maven publishing group.
# When false, com.github.GTNewHorizons is used.
useModGroupForPublishing = false
# WHY is there no version field?
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
# Will update your build.gradle automatically whenever an update is available
autoUpdateBuildScript = false
# Version of Minecraft to target
minecraftVersion = 1.7.10
# Version of Minecraft Forge to target
forgeVersion = 10.13.4.1614
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
channel = stable
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
mappingsVersion = 12
# Defines other MCP mappings for dependency deobfuscation.
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Select a default username for testing your mod. You can always override this per-run by running
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
developmentEnvironmentUserName = Developer
# Enables modern Java syntax support. Valid values:
# - false: No modern syntax, Java 8 only
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
# - modern: Native modern Java bytecode, no downgrading
enableModernJavaSyntax = jabel
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
# and should *not* be used in most situations. -1 disables this.
# forceToolchainVersion = -1
# Target JVM version for JVM Downgrader bytecode downgrading.
# Only used when enableModernJavaSyntax = jvmDowngrader
# downgradeTargetVersion = 8
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
# Classes will be available in META-INF/versions/N/ for each version N in this list.
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
# jvmDowngraderMultiReleaseVersions = 21,25
# Specifies how JVM Downgrader API stubs are provided. Options:
# - shade: Shade minimized stubs into the jar
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
# - external: Another dependency provides stubs (no constraint, no warning)
# - (empty): Warning reminding you to configure stubs
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
# jvmDowngraderStubsProvider =
# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = true
# Generate a class with a String field for the mod version named as defined below.
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
generateGradleTokenClass = forestry.Tags
# Name of the token containing the project's current version to generate/replace.
gradleTokenVersion = VERSION
# [DEPRECATED] Mod ID replacement token.
gradleTokenModId =
# [DEPRECATED] Mod name replacement token.
gradleTokenModName =
# [DEPRECATED] Mod Group replacement token.
gradleTokenGroupName =
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
# Define a source file of your project with:
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...]).
# Leave these properties empty to skip individual token replacements.
replaceGradleTokenInFile =
# version in @Mod([...], version = VERSION, [...])
# Leave these properties empty to skip individual token replacements
replaceGradleTokenInFile = Constants.java
gradleTokenModId =
gradleTokenModName =
gradleTokenVersion = GRADLETOKEN_VERSION
gradleTokenGroupName =
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
apiPackage = api
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
# There can be multiple files in a space-separated list.
# Example value: mymodid_at.cfg nei_at.cfg
accessTransformersFile = forestry_at.cfg
# Example value: mymodid_at.cfg
accessTransformersFile =
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
# Mixin classes will have access to "main" classes, but not the other way around.
separateMixinSourceSet =
# Adds some debug arguments like verbose output and class 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. The package must exist or
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
# it must match with this or the build will fail.
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage =
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
coreModClass =
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
forceEnableMixins = false
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
# responsibility to check the license and request permission for distribution if required.
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required.
usesShadowedDependencies = false
# If disabled, won't remove unused classes from shadowed 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 CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
# list of strings, with the acceptable keys being(case does not matter):
# cursemaven
# modrinth
excludeWellKnownRepositories =
# 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_USER 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
# Maven repository to publish the mod to.
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/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 to 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: UniMixins 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: UniMixins is automatically set as a required dependency if usesMixins = true.
curseForgeRelations =
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
# projects. New projects should not use this parameter.
# customArchiveBaseName =
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
# runClientWorkingDirectory = run/client
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
# runServerWorkingDirectory = run/server
# Optional parameter to have the build automatically fail if an illegal version is used.
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
# The check is ONLY performed if the version is a git tag.
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
# versionPattern =
# Uncomment to prevent the source code from being published.
# noPublishedSources = true
# 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 values are: "" (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 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
# Whether IDEA should run spotless checks when pressing the Build button.
# This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true
# Non-GTNH properties
org.gradle.configuration-cache = true
org.gradle.parallel = true
-12
View File
@@ -1,12 +0,0 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
toolchainVersion=25
Binary file not shown.
+1 -2
View File
@@ -1,7 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+15 -18
View File
@@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright © 2015 the original authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,8 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -57,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -85,8 +83,7 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -114,6 +111,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -132,13 +130,10 @@ location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@@ -146,7 +141,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=SC2039,SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -154,7 +149,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=SC2039,SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -171,6 +166,7 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
@@ -202,15 +198,16 @@ 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 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.
# 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.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
Vendored
+12 -13
View File
@@ -13,8 +13,6 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@@ -45,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
@@ -59,21 +57,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
-1
View File
@@ -1,5 +1,4 @@
// Add any additional repositiroes for your dependencies here
repositories {
mavenLocal()
}
+10 -5
View File
@@ -4,10 +4,10 @@ pluginManagement {
maven {
// RetroFuturaGradle
name "GTNH Maven"
url "https://nexus.gtnewhorizons.com/repository/public/"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
mavenContent {
includeGroup("com.gtnewhorizons")
includeGroupByRegex("com\\.gtnewhorizons\\..+")
includeGroup("com.gtnewhorizons.retrofuturagradle")
}
}
gradlePluginPortal()
@@ -17,7 +17,12 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
id 'com.diffplug.blowdryerSetup' version '1.6.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
}
blowdryerSetup {
repoSubfolder 'gtnhShared'
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
//devLocal '.' // Use this when testing config updates locally
}
+1 -7
View File
@@ -15,7 +15,6 @@ import net.minecraft.item.Item;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.ModAPIManager;
@@ -57,8 +56,7 @@ import forestry.plugins.PluginManager;
name = Constants.MOD,
version = Constants.VERSION,
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
dependencies = "required-after:Forge@[10.13.4.1566,);" + "required-after:gtnhlib@[0.9.41,);"
+ "after:Buildcraft|Core@[6.1.7,);"
dependencies = "required-after:Forge@[10.13.4.1566,);" + "after:Buildcraft|Core@[6.1.7,);"
+ "after:ExtrabiomesXL;"
+ "after:BiomesOPlenty;"
+ "after:IC2@[2.0.140,);"
@@ -81,15 +79,11 @@ public class Forestry {
public static PacketHandler packetHandler;
public static boolean isDreamcraftLoaded;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
checkForCoFHLib();
packetHandler = new PacketHandler();
isDreamcraftLoaded = Loader.isModLoaded("dreamcraft");
// Register event handler
EventHandlerCore eventHandlerCore = new EventHandlerCore();
MinecraftForge.EVENT_BUS.register(eventHandlerCore);
@@ -84,12 +84,7 @@ public enum EnumBeeChromosome implements IChromosomeType {
*/
EFFECT(IAlleleBeeEffect.class);
final Class<? extends IAllele> clss;
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final EnumBeeChromosome[] VALUES = values();
Class<? extends IAllele> clss;
EnumBeeChromosome(Class<? extends IAllele> clss) {
this.clss = clss;
@@ -17,12 +17,9 @@ public enum EnumBeeType implements ISpeciesType {
LARVAE,
NONE;
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final EnumBeeType[] VALUES = values();
private final String name;
String name;
EnumBeeType() {
this.name = this.toString().toLowerCase(Locale.ENGLISH);
@@ -31,8 +28,4 @@ public enum EnumBeeType implements ISpeciesType {
public String getName() {
return name;
}
public static EnumBeeType fromOrdinal(int ordinal) {
return VALUES[ordinal];
}
}
@@ -1,20 +0,0 @@
package forestry.api.apiculture;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public interface IArmorApiaristMulti extends IArmorApiarist {
/**
* Called to determine how many pieces an armor "counts for". For instance, if this returns 4, the single piece will
* act as full protection.
*
* @param entity Entity being attacked
* @param armor Armor item
* @param cause Optional cause of attack, such as a bee effect identifier
* @return Amount of effective protected slots
*/
default int getProtectionCount(EntityLivingBase entity, ItemStack armor, String cause) {
return 1;
}
}
@@ -73,14 +73,9 @@ public enum EnumTreeChromosome implements IChromosomeType {
/**
* Determines if the tree can burn.
*/
FIREPROOF(IAlleleBoolean.class);
FIREPROOF(IAlleleBoolean.class),;
final Class<? extends IAllele> clss;
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final EnumTreeChromosome[] VALUES = values();
Class<? extends IAllele> clss;
EnumTreeChromosome(Class<? extends IAllele> clss) {
this.clss = clss;
@@ -17,14 +17,9 @@ public enum EnumHumidity {
NORMAL("Normal"),
DAMP("Damp");
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final EnumHumidity[] VALUES = values();
public final String name;
EnumHumidity(String name) {
private EnumHumidity(String name) {
this.name = name;
}
@@ -27,15 +27,10 @@ public enum EnumTemperature {
HOT("Hot", "habitats/desert"),
HELLISH("Hellish", "habitats/nether");
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final EnumTemperature[] VALUES = values();
public final String name;
public final String iconIndex;
EnumTemperature(String name, String iconIndex) {
private EnumTemperature(String name, String iconIndex) {
this.name = name;
this.iconIndex = iconIndex;
}
@@ -12,15 +12,11 @@ public interface IClimateControlled {
/**
* Change the temperature, but not lower than boundaryDown or higher than boundaryUp.
*
* When used in an alveary the change applies a 20x stronger effect
*/
void addTemperatureChange(float change, float boundaryDown, float boundaryUp);
/**
* Change the humidity, but not lower than boundaryDown or higher than boundaryUp.
*
* When used in an alveary the change applies a 20x stronger effect
*/
void addHumidityChange(float change, float boundaryDown, float boundaryUp);
}
@@ -16,11 +16,6 @@ public enum FarmDirection {
private final ForgeDirection forgeDirection;
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final FarmDirection[] VALUES = values();
FarmDirection(ForgeDirection forgeDirection) {
this.forgeDirection = forgeDirection;
}
@@ -30,16 +25,16 @@ public enum FarmDirection {
}
public static FarmDirection getFarmDirection(ForgeDirection forgeDirection) {
return switch (forgeDirection) {
case NORTH -> NORTH;
case EAST -> EAST;
case SOUTH -> SOUTH;
case WEST -> WEST;
default -> null;
};
}
public static FarmDirection fromOrdinal(int ordinal) {
return VALUES[ordinal];
switch (forgeDirection) {
case NORTH:
return NORTH;
case EAST:
return EAST;
case SOUTH:
return SOUTH;
case WEST:
return WEST;
}
return null;
}
}
@@ -9,37 +9,33 @@ import net.minecraft.item.ItemStack;
public class RainSubstrate {
public enum WeatherState {
CLEAR,
RAIN,
STORM
}
/**
* Rain substrate capable of activating the rainmaker.
*/
public ItemStack item;
/**
* Duration of the weather event triggered by this substrate in Minecraft ticks.
* Duration of the rain shower triggered by this substrate in Minecraft ticks.
*/
public int duration;
/**
* Speed of activation sequence triggered.
*/
public float speed;
/**
* The type of weather triggered.
*/
public WeatherState weather;
public RainSubstrate(ItemStack item, float speed, WeatherState weather) {
this(item, 0, speed, weather);
public boolean reverse;
public RainSubstrate(ItemStack item, int duration, float speed) {
this(item, duration, speed, false);
}
public RainSubstrate(ItemStack item, int duration, float speed, WeatherState weather) {
public RainSubstrate(ItemStack item, float speed) {
this(item, 0, speed, true);
}
public RainSubstrate(ItemStack item, int duration, float speed, boolean reverse) {
this.item = item;
this.duration = duration;
this.speed = speed;
this.weather = weather;
this.reverse = reverse;
}
}
@@ -52,8 +52,4 @@ public interface IIndividual extends INBTTagable {
IIndividual copy();
boolean isPureBred(IChromosomeType chromosomeType);
default void addLore(List<String> text) {}
default void addDiscoveredBy(List<String> text) {}
}
@@ -77,12 +77,7 @@ public enum EnumButterflyChromosome implements IChromosomeType {
*/
TERRITORY(IAlleleArea.class),;
final Class<? extends IAllele> clss;
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final EnumButterflyChromosome[] VALUES = values();
Class<? extends IAllele> clss;
EnumButterflyChromosome(Class<? extends IAllele> clss) {
this.clss = clss;
@@ -49,14 +49,6 @@ public interface IAlvearyComponent<T extends IMultiblockLogicAlveary> extends IM
* @param alveary the climate controlled alveary
*/
void changeClimate(int tickCount, IClimateControlled alveary);
/**
* Get the priority of this climatiser. Called when alveary is constructed.
* {@link #changeClimate(int, IClimateControlled)} are run in descending priority.
*/
default int getPriority() {
return 0;
}
}
/**
@@ -1,40 +0,0 @@
package forestry.api.multiblock;
import java.util.Collection;
import net.minecraft.item.ItemStack;
public interface IFarmFertilizerRegistry {
/**
* Gets a list of all fertilizer stacks in the registry.
*
* @return The current fertilizer registry.
*/
Collection<ItemStack> getFertilizers();
/**
* Adds a new fertilizer to the registry.
*
* @apiNote The stack size doesn't matter it always consumes 1.
* @apiNote You can use OreDictionary.WILDCARD_VALUE to specific that any meta of the item will be ok.
*
* @param itemstack The item to add to the registry.
*/
void addFertilizer(ItemStack itemstack);
/**
* Removes a fertilizer from the fretilizer registry.
*
* @param itemstack The item to remove from the registry.
*/
void removeFertilizer(ItemStack itemstack);
/**
* Checks if an item is a usable multi-farm fertilizer.
*
* @param itemstack - The stack to check with.
* @return True if the item is a fertilizer item.
*/
boolean isFertilizer(ItemStack itemstack);
}
@@ -9,8 +9,6 @@ import net.minecraft.util.ChunkCoordinates;
import com.mojang.authlib.GameProfile;
import forestry.core.inventory.IInventoryAdapter;
/**
* Basic interface for a multiblock machine component. Implemented by TileEntities.
*/
@@ -47,15 +45,4 @@ public interface IMultiblockComponent {
* Called when the machine is broken for game reasons, e.g. a player removed a block or an explosion occurred.
*/
void onMachineBroken();
/**
* A component with a separate inventory, like the Alveary Swarmer or Alveary Sieve.
*/
interface HasInventory {
/**
* Called when this part is destroyed to drop its contents.
*/
IInventoryAdapter getInternalInventory();
}
}
@@ -8,6 +8,4 @@ package forestry.api.multiblock;
public class MultiblockManager {
public static IMultiblockLogicFactory logicFactory;
public static IFarmFertilizerRegistry farmFertilizerRegistry;
}
@@ -15,20 +15,26 @@ import net.minecraft.item.ItemStack;
import forestry.api.apiculture.IArmorApiarist;
import forestry.api.apiculture.IArmorApiaristHelper;
import forestry.api.apiculture.IArmorApiaristMulti;
public class ArmorApiaristHelper implements IArmorApiaristHelper {
@Override
public boolean isArmorApiarist(ItemStack stack, EntityLivingBase entity, String cause, boolean doProtect) {
if (stack == null) {
return false;
}
if (stack == null || !(stack.getItem() instanceof IArmorApiarist armor)) return false;
Item item = stack.getItem();
if (!(item instanceof IArmorApiarist)) {
return false;
}
IArmorApiarist armorApiarist = (IArmorApiarist) item;
try {
return armor.protectEntity(entity, stack, cause, doProtect);
return armorApiarist.protectEntity(entity, stack, cause, doProtect);
} catch (Throwable ignored) { // protectEntity is new to the API and may not be implemented by the armor
if (entity instanceof EntityPlayer) {
return armor.protectPlayer((EntityPlayer) entity, stack, cause, doProtect);
return armorApiarist.protectPlayer((EntityPlayer) entity, stack, cause, doProtect);
} else {
return true; // fallback on assuming IArmorApiarist will protect the entity
}
@@ -42,13 +48,11 @@ public class ArmorApiaristHelper implements IArmorApiaristHelper {
for (int i = 1; i <= 4; i++) {
ItemStack armorItem = entity.getEquipmentInSlot(i);
if (isArmorApiarist(armorItem, entity, cause, doProtect)) {
Item item = armorItem.getItem();
if (item instanceof IArmorApiaristMulti am) count += am.getProtectionCount(entity, armorItem, cause);
else count++;
count++;
}
}
return Math.min(count, 4);
return count;
}
@Override
@@ -115,7 +115,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
Stack<ItemStack> spawnCopy = new Stack<>();
if (spawn.size() < 128) spawnCopy.addAll(spawn);
else for (int b = 0; b < 128; ++b) spawnCopy.add(spawn.get(b));
else for (byte b = 0; b < 128; ++b) spawnCopy.add(spawn.get(b));
NBTTagList nbttaglist = new NBTTagList();
while (!spawnCopy.isEmpty() && spawnCopy.size() <= 128) {
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
@@ -8,10 +8,7 @@
******************************************************************************/
package forestry.apiculture;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeType;
@@ -76,27 +73,4 @@ public class InventoryBeeHousing extends InventoryAdapterRestricted implements I
public final boolean addProduct(ItemStack product, boolean all) {
return InventoryUtil.tryAddStack(this, product, SLOT_PRODUCT_1, SLOT_PRODUCT_COUNT, all, true);
}
public void dumpInventoryIntoWorld(World world, ChunkCoordinates coordinates) {
if (world.isRemote) {
return;
}
for (int i = 0; i < SLOT_PRODUCT_COUNT; i++) {
ItemStack stack = getStackInSlot(i);
if (stack == null) {
continue;
}
setInventorySlotContents(i, null);
EntityItem entityitem = new EntityItem(
world,
coordinates.posX + 0.5,
coordinates.posY + 0.5,
coordinates.posZ + 0.5,
stack);
entityitem.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entityitem);
}
}
}
@@ -97,7 +97,7 @@ public class BlockAlveary extends BlockStructure {
/* TILE ENTITY CREATION */
@Override
public TileEntity createTileEntity(World world, int metadata) {
if (metadata < 0 || metadata >= Type.VALUES.length) {
if (metadata < 0 || metadata > Type.VALUES.length) {
return null;
}
@@ -12,13 +12,12 @@ import forestry.api.core.Tabs;
import forestry.apiculture.items.ItemBlockCandle;
import forestry.core.blocks.BlockBase;
import forestry.core.blocks.BlockRegistry;
import forestry.core.blocks.IMachineProperties;
import forestry.core.items.ItemBlockForestry;
public class BlockRegistryApiculture extends BlockRegistry {
public final BlockApiculture apiculture;
public final BlockBase<? extends IMachineProperties> apicultureChest;
public final BlockBase apicultureChest;
public final BlockBeehives beehives;
public final BlockCandle candle;
public final BlockStump stump;
@@ -27,7 +26,7 @@ public class BlockRegistryApiculture extends BlockRegistry {
public BlockRegistryApiculture() {
apiculture = registerBlock(new BlockApiculture(), ItemBlockForestry.class, "apiculture");
apicultureChest = registerBlock(new BlockBase<>(true), ItemBlockForestry.class, "apicultureChest");
apicultureChest = registerBlock(new BlockBase(true), ItemBlockForestry.class, "apicultureChest");
apicultureChest.setCreativeTab(Tabs.tabApiculture);
apicultureChest.setHarvestLevel("axe", 0);
@@ -38,7 +38,7 @@ public class CommandBeeGive extends SubCommand {
setPermLevel(PermLevel.ADMIN);
List<String> beeTypeStrings = new ArrayList<>();
for (EnumBeeType type : EnumBeeType.VALUES) {
for (EnumBeeType type : EnumBeeType.values()) {
if (type == EnumBeeType.NONE) {
continue;
}
@@ -166,7 +166,7 @@ public class CommandBeeGive extends SubCommand {
}
private static EnumBeeType getBeeType(String beeTypeName) {
for (EnumBeeType beeType : EnumBeeType.VALUES) {
for (EnumBeeType beeType : EnumBeeType.values()) {
if (beeType.getName().equalsIgnoreCase(beeTypeName)) {
return beeType;
}
@@ -213,7 +213,6 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
private static boolean isAcceptedFlower(String flowerType, Set<Block> acceptedBlocks, Set<Flower> acceptedFlowers,
World world, int x, int y, int z) {
if (!world.blockExists(x, y, z)) return false;
Block block = world.getBlock(x, y, z);
final int meta;
@@ -24,7 +24,7 @@ public class GrowthRuleDirtGrass implements IFlowerGrowthRule {
@Override
public boolean growFlower(IFlowerRegistry flowerRegistry, String flowerType, World world, IIndividual individual,
int x, int y, int z) {
if (!world.blockExists(x, y, z) || !world.isAirBlock(x, y, z)) {
if (!world.isAirBlock(x, y, z)) {
return false;
}
@@ -39,7 +39,7 @@ public class GrowthRuleDirtGrass implements IFlowerGrowthRule {
@Override
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) {
if (!world.blockExists(x, y, z) || !world.isAirBlock(x, y, z)) {
if (!world.isAirBlock(x, y, z)) {
return false;
}
@@ -34,10 +34,6 @@ public class GrowthRuleFlowerPot implements IFlowerGrowthRule {
}
private static boolean growFlower(String flowerType, World world, int x, int y, int z) {
if (!world.blockExists(x, y, z)) {
return false;
}
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof TileEntityFlowerPot)) {
return false;
@@ -8,9 +8,6 @@
******************************************************************************/
package forestry.apiculture.genetics;
import static forestry.core.utils.MathUtil.safeAdd;
import static forestry.core.utils.MathUtil.safeMultiply;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -18,8 +15,6 @@ import java.util.Map;
import java.util.Random;
import java.util.Set;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -378,36 +373,6 @@ public class Bee extends IndividualLiving implements IBee {
return suitableBiomes;
}
@Override
public void addLore(List<String> text) {
IAlleleBeeSpecies primary = genome.getPrimary();
String descTokens[] = primary.getDescription().split("\\|");
if (descTokens.length > 0) {
String speciesLore = descTokens[0];
if (!speciesLore.isEmpty() && !speciesLore.contains("for.description")) {
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
String formattedLore = EnumChatFormatting.GOLD + speciesLore;
List<String> formattedLoreList = fontRenderer.listFormattedStringToWidth(formattedLore, 200);
text.addAll(formattedLoreList);
}
}
}
@Override
public void addDiscoveredBy(List<String> text) {
IAlleleBeeSpecies primary = genome.getPrimary();
String descTokens[] = primary.getDescription().split("\\|");
if (descTokens.length > 2) {
String discoveredBy = descTokens[2];
if (!discoveredBy.isEmpty()) {
text.add("");
text.add("Discovered by " + EnumChatFormatting.ITALIC + discoveredBy);
}
}
}
@Override
public void addTooltip(List<String> list) {
@@ -573,7 +538,7 @@ public class Bee extends IndividualLiving implements IBee {
}
// / Secondary Products
for (Map.Entry<ItemStack, Float> entry : secondary.getProductChances().entrySet()) {
if (housing.getWorld().rand.nextFloat() < getFinalChance(entry.getValue() / 2f, speed, prodModifier, 1f)) {
if (housing.getWorld().rand.nextFloat() < getFinalChance(entry.getValue() / 2, speed, prodModifier, 1f)) {
products.add(entry.getKey().copy());
}
}
@@ -734,9 +699,9 @@ public class Bee extends IndividualLiving implements IBee {
// boost chance for researched mutations
if (breedingTracker.isResearched(beeMutation)) {
float mutationBoost = safeMultiply(chance, Config.researchMutationBoostMultiplier - 1.0f);
float mutationBoost = chance * (Config.researchMutationBoostMultiplier - 1.0f);
mutationBoost = Math.min(Config.maxResearchMutationBoostPercent, mutationBoost);
chance = safeAdd(chance, mutationBoost);
chance += mutationBoost;
}
if (chance > world.rand.nextFloat() * 100) {
@@ -773,9 +738,6 @@ public class Bee extends IndividualLiving implements IBee {
for (int i = 0; i < 20; i++) {
Vect randomPos = Vect.getRandomPositionInArea(random, area);
Vect blockPos = Vect.add(housingPos, randomPos, offset);
if (!world.blockExists(blockPos.x, blockPos.y, blockPos.z)) {
continue;
}
TileEntity tile = world.getTileEntity(blockPos.x, blockPos.y, blockPos.z);
if (tile instanceof IPollinatable) {
@@ -148,7 +148,7 @@ public enum BeeBranchDefinition implements IBranchDefinition {
private static IAllele[] getDefaultTemplate() {
if (defaultTemplate == null) {
defaultTemplate = new IAllele[EnumBeeChromosome.VALUES.length];
defaultTemplate = new IAllele[EnumBeeChromosome.values().length];
AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST);
AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER);
@@ -331,7 +331,7 @@ public enum BeeDefinition implements IBeeDefinition {
@Override
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SIMMERING, 1), 0.55f)
.addProduct(PluginCore.items.getAsh(), 0.15f).setTemperature(EnumTemperature.HELLISH)
.addProduct(PluginCore.items.ash.getItemStack(), 0.15f).setTemperature(EnumTemperature.HELLISH)
.setHumidity(EnumHumidity.ARID);
}
@@ -102,7 +102,7 @@ public class BeeHelper extends SpeciesRoot implements IBeeRoot {
IBee bee = (IBee) individual;
Item beeItem;
switch (EnumBeeType.fromOrdinal(type)) {
switch (EnumBeeType.VALUES[type]) {
case QUEEN:
beeItem = PluginApiculture.items.beeQueenGE;
// ensure a queen is always mated
@@ -353,7 +353,7 @@ public class BeeHelper extends SpeciesRoot implements IBeeRoot {
@Override
public IChromosomeType[] getKaryotype() {
return EnumBeeChromosome.VALUES;
return EnumBeeChromosome.values();
}
@Override
@@ -8,8 +8,6 @@
******************************************************************************/
package forestry.apiculture.genetics;
import static forestry.core.utils.MathUtil.safeMultiply;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
@@ -51,8 +49,8 @@ public class BeeMutation extends Mutation implements IBeeMutationCustom {
IBeeModifier beeHousingModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
IBeeModifier beeModeModifier = BeeManager.beeRoot.getBeekeepingMode(world).getBeeModifier();
processedChance = safeMultiply(processedChance, beeHousingModifier.getMutationModifier(genome0, genome1, 1.0F));
processedChance = safeMultiply(processedChance, beeModeModifier.getMutationModifier(genome0, genome1, 1.0F));
processedChance *= beeHousingModifier.getMutationModifier(genome0, genome1, processedChance);
processedChance *= beeModeModifier.getMutationModifier(genome0, genome1, processedChance);
return processedChance;
}
@@ -8,6 +8,8 @@
******************************************************************************/
package forestry.apiculture.genetics;
import java.util.Locale;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
@@ -20,23 +22,24 @@ import forestry.core.render.TextureManager;
public class DefaultBeeIconProvider implements IBeeIconProvider {
public static final DefaultBeeIconProvider instance = new DefaultBeeIconProvider();
private static final IIcon[][] icons = new IIcon[EnumBeeType.VALUES.length][3];
private DefaultBeeIconProvider() {}
private static final IIcon[][] icons = new IIcon[EnumBeeType.values().length][3];
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register) {
String beeIconDir = "bees/default/";
IIcon body1 = TextureManager.registerTex(register, beeIconDir + "body1");
for (int i = 0; i < EnumBeeType.VALUES.length; i++) {
EnumBeeType beeType = EnumBeeType.VALUES[i];
for (int i = 0; i < EnumBeeType.values().length; i++) {
EnumBeeType beeType = EnumBeeType.values()[i];
if (beeType == EnumBeeType.NONE) {
continue;
}
String beeTypeNameBase = beeIconDir + beeType.getName();
String beeTypeNameBase = beeIconDir + beeType.toString().toLowerCase(Locale.ENGLISH);
icons[i][0] = TextureManager.registerTex(register, beeTypeNameBase + ".outline");
if (beeType == EnumBeeType.LARVAE) {
@@ -13,7 +13,6 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
@@ -22,7 +21,7 @@ import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IEffectData;
import forestry.apiculture.multiblock.AlvearyController;
import forestry.apiculture.blocks.BlockAlveary;
import forestry.core.utils.DamageSourceForestry;
import forestry.core.utils.vect.Vect;
@@ -37,13 +36,8 @@ public class AlleleEffectRadioactive extends AlleleEffectThrottled {
@Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
harmEntities(genome, housing);
if (isMobGriefingEnabled(housing)) destroyEnvironment(genome, housing);
return storedData;
}
private boolean isMobGriefingEnabled(IBeeHousing housing) {
return housing.getWorld().getGameRules().getGameRuleBooleanValue("mobGriefing");
return destroyEnvironment(genome, storedData, housing);
}
private void harmEntities(IBeeGenome genome, IBeeHousing housing) {
@@ -62,7 +56,7 @@ public class AlleleEffectRadioactive extends AlleleEffectThrottled {
}
}
private static void destroyEnvironment(IBeeGenome genome, IBeeHousing housing) {
private static IEffectData destroyEnvironment(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
World world = housing.getWorld();
Random rand = world.rand;
@@ -71,66 +65,43 @@ public class AlleleEffectRadioactive extends AlleleEffectThrottled {
Vect offset = area.multiply(-1 / 2.0f);
Vect posHousing = new Vect(housing.getCoordinates());
boolean isAlveary = housing instanceof AlvearyController;
for (int i = 0; i < 20; i++) {
Vect randomPos = Vect.getRandomPositionInArea(rand, area);
Vect posBlock = randomPos.add(posHousing).add(offset);
Vect posBlock = randomPos.add(posHousing);
posBlock = posBlock.add(offset);
// Don't destroy blocks in the protected 3x3x4 area if housing is an Alveary.
// Stops the bee destroying itself. Silly behaviour.
if (isInAlvearyProtectedArea(posHousing, posBlock)) {
if (posBlock.y <= 1 || posBlock.y >= housing.getWorld().getActualHeight()) {
continue;
}
// Don't destroy the block directly below the bee.
if (isAlveary) {
if (posBlock.y == posHousing.y - 3) {
continue;
}
} else {
if (posBlock.y == posHousing.y - 1) {
continue;
}
// Don't destroy ourselves or blocks below us.
if (posBlock.x == posHousing.x && posBlock.z == posHousing.z && posBlock.y <= posHousing.y) {
continue;
}
if (world.isAirBlock(posBlock.x, posBlock.y, posBlock.z)) {
continue;
}
Block block = world.getBlock(posBlock.x, posBlock.y, posBlock.z);
// Never delete a tile entity. Allows far too much griefing and abuse otherwise.
if (block instanceof BlockAlveary) {
continue;
}
TileEntity tile = world.getTileEntity(posBlock.x, posBlock.y, posBlock.z);
if (tile != null) {
if (tile instanceof IBeeHousing) {
continue;
}
// Don't let us delete blocks that are not supposed to be breakable by players.
if (block.getBlockHardness(world, posBlock.x, posBlock.y, posBlock.z) < 0) {
continue;
}
// Some mods might use this logic? Idk, just a safety check. Might stop griefing.
EntityPlayer player = world.func_152378_a(housing.getOwner().getId());
if (player == null || !world.canMineBlock(player, posHousing.x, posHousing.y, posHousing.z)) {
continue;
}
world.setBlockToAir(posBlock.x, posBlock.y, posBlock.z);
break;
}
}
private static boolean isInAlvearyProtectedArea(Vect posHousing, Vect posBlock) {
// Alveary protection area is a 3x3x4 area centered on the top middle, down one block.
int startX = posHousing.x - 1;
int endX = posHousing.x + 1;
int startZ = posHousing.z - 1;
int endZ = posHousing.z + 1;
int startY = posHousing.y - 2;
int endY = posHousing.y + 1;
return posBlock.x >= startX && posBlock.x <= endX
&& posBlock.z >= startZ
&& posBlock.z <= endZ
&& posBlock.y >= startY
&& posBlock.y <= endY;
return storedData;
}
}
@@ -27,10 +27,6 @@ public abstract class AlleleEffectThrottled extends AlleleEffect {
this.requiresWorkingQueen = requiresWorking;
}
public int getThrottle() {
return throttle;
}
@Override
public boolean isCombinable() {
return isCombinable;
@@ -15,7 +15,6 @@ import forestry.api.core.Tabs;
import forestry.apiculture.gui.GuiBeealyzer;
import forestry.apiculture.inventory.ItemInventoryBeealyzer;
import forestry.core.gui.ContainerAlyzer;
import forestry.core.inventory.ItemLocation;
import forestry.core.items.ItemWithGui;
public class ItemBeealyzer extends ItemWithGui {
@@ -25,13 +24,13 @@ public class ItemBeealyzer extends ItemWithGui {
}
@Override
public Object getGui(EntityPlayer player, ItemStack heldItem, int data, ItemLocation loc) {
public Object getGui(EntityPlayer player, ItemStack heldItem, int data) {
ItemInventoryBeealyzer inventory = new ItemInventoryBeealyzer(player, heldItem);
return new GuiBeealyzer(player, inventory);
}
@Override
public Object getContainer(EntityPlayer player, ItemStack heldItem, int data, ItemLocation loc) {
public Object getContainer(EntityPlayer player, ItemStack heldItem, int data) {
ItemInventoryBeealyzer inventory = new ItemInventoryBeealyzer(player, heldItem);
return new ContainerAlyzer(inventory, player);
}
@@ -29,7 +29,6 @@ import forestry.apiculture.gui.ContainerHabitatLocator;
import forestry.apiculture.gui.GuiHabitatLocator;
import forestry.apiculture.inventory.ItemInventoryHabitatLocator;
import forestry.apiculture.render.TextureHabitatLocator;
import forestry.core.inventory.ItemLocation;
import forestry.core.items.ItemWithGui;
import forestry.core.utils.StringUtil;
@@ -72,8 +71,9 @@ public class ItemHabitatLocator extends ItemWithGui {
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) {
BiomeGenBase currentBiome = player.worldObj.getBiomeGenForCoords((int) player.posX, (int) player.posZ);
EnumTemperature temperature = EnumTemperature
.getFromBiome(currentBiome, (int) player.posX, (int) player.posY, (int) player.posZ);
float temperatureValue = currentBiome
.getFloatTemperature((int) player.posX, (int) player.posY, (int) player.posZ);
EnumTemperature temperature = EnumTemperature.getFromValue(temperatureValue);
EnumHumidity humidity = EnumHumidity.getFromValue(currentBiome.rainfall);
list.add(StringUtil.localize("gui.currentBiome") + ": " + currentBiome.biomeName);
@@ -82,12 +82,12 @@ public class ItemHabitatLocator extends ItemWithGui {
}
@Override
public Object getGui(EntityPlayer player, ItemStack heldItem, int data, ItemLocation loc) {
public Object getGui(EntityPlayer player, ItemStack heldItem, int data) {
return new GuiHabitatLocator(player, new ItemInventoryHabitatLocator(player, heldItem));
}
@Override
public Object getContainer(EntityPlayer player, ItemStack heldItem, int data, ItemLocation loc) {
public Object getContainer(EntityPlayer player, ItemStack heldItem, int data) {
return new ContainerHabitatLocator(player, new ItemInventoryHabitatLocator(player, heldItem));
}
}
@@ -15,7 +15,6 @@ import forestry.api.core.Tabs;
import forestry.apiculture.gui.ContainerImprinter;
import forestry.apiculture.gui.GuiImprinter;
import forestry.apiculture.inventory.ItemInventoryImprinter;
import forestry.core.inventory.ItemLocation;
import forestry.core.items.ItemWithGui;
public class ItemImprinter extends ItemWithGui {
@@ -25,12 +24,12 @@ public class ItemImprinter extends ItemWithGui {
}
@Override
public Object getGui(EntityPlayer player, ItemStack heldItem, int data, ItemLocation loc) {
public Object getGui(EntityPlayer player, ItemStack heldItem, int data) {
return new GuiImprinter(player.inventory, new ItemInventoryImprinter(player, heldItem));
}
@Override
public Object getContainer(EntityPlayer player, ItemStack heldItem, int data, ItemLocation loc) {
public Object getContainer(EntityPlayer player, ItemStack heldItem, int data) {
return new ContainerImprinter(player.inventory, new ItemInventoryImprinter(player, heldItem));
}
}
@@ -9,10 +9,8 @@
package forestry.apiculture.multiblock;
import java.io.IOException;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
@@ -61,9 +59,7 @@ public class AlvearyController extends RectangularMultiblockControllerBase
// PARTS
private final Set<IBeeModifier> beeModifiers = new HashSet<>();
private final Set<IBeeListener> beeListeners = new HashSet<>();
private final Set<IAlvearyComponent.Climatiser> climatisers = new TreeSet<>(
Comparator.comparingInt(IAlvearyComponent.Climatiser::getPriority).thenComparingInt(Object::hashCode)
.reversed());
private final Set<IAlvearyComponent.Climatiser> climatisers = new HashSet<>();
private final Set<IAlvearyComponent.Active> activeComponents = new HashSet<>();
// CLIENT
@@ -111,14 +107,6 @@ public class AlvearyController extends RectangularMultiblockControllerBase
this.readFromNBT(data);
}
@Override
public void detachBlock(IMultiblockComponent part, boolean chunkUnloading) {
if (!chunkUnloading) {
inventory.dumpInventoryIntoWorld(this.worldObj, part.getCoordinates());
}
super.detachBlock(part, chunkUnloading);
}
@Override
protected void onBlockAdded(IMultiblockComponent newPart) {
if (newPart instanceof IAlvearyComponent) {
@@ -245,25 +233,26 @@ public class AlvearyController extends RectangularMultiblockControllerBase
beekeepingLogic.doWork();
}
tempChange = 0;
humidChange = 0;
for (IAlvearyComponent.Climatiser climatiser : climatisers) {
climatiser.changeClimate(tickCount, this);
}
tempChange = equalizeChange(tempChange);
humidChange = equalizeChange(humidChange);
return canWork;
}
private float applyChange(float base, float currentChange, float extraChange, float boundaryDown,
float boundaryUp) {
float boundedNewChange = Math.round(
(Math.max(boundaryDown, Math.min(base + currentChange + (extraChange * 20), boundaryUp)) - base) * 100)
/ 100.0f;
if (extraChange > 0) {
return Math.max(currentChange, boundedNewChange);
} else {
return Math.min(currentChange, boundedNewChange);
private static float equalizeChange(float change) {
if (change == 0) {
return 0;
}
change *= 0.95f;
if (change <= 0.001f && change >= -0.001f) {
change = 0;
}
return change;
}
@Override
@@ -362,13 +351,12 @@ public class AlvearyController extends RectangularMultiblockControllerBase
@Override
public float getExactTemperature() {
ChunkCoordinates coords = getReferenceCoord();
return Math.round((getBiome().getFloatTemperature(coords.posX, coords.posY, coords.posZ) + tempChange) * 100)
/ 100.0f;
return getBiome().getFloatTemperature(coords.posX, coords.posY, coords.posZ) + tempChange;
}
@Override
public float getExactHumidity() {
return Math.round((getBiome().rainfall + humidChange) * 100) / 100.0f;
return getBiome().rainfall + humidChange;
}
@Override
@@ -422,13 +410,19 @@ public class AlvearyController extends RectangularMultiblockControllerBase
ChunkCoordinates coordinates = getCoordinates();
float temperature = getBiome().getFloatTemperature(coordinates.posX, coordinates.posY, coordinates.posZ);
tempChange = applyChange(temperature, tempChange, change, boundaryDown, boundaryUp);
tempChange += change;
tempChange = Math.max(boundaryDown - temperature, tempChange);
tempChange = Math.min(boundaryUp - temperature, tempChange);
}
@Override
public void addHumidityChange(float change, float boundaryDown, float boundaryUp) {
float humidity = getBiome().rainfall;
humidChange = applyChange(humidity, humidChange, change, boundaryDown, boundaryUp);
humidChange += change;
humidChange = Math.max(boundaryDown - humidity, humidChange);
humidChange = Math.min(boundaryUp - humidity, humidChange);
}
/* GUI */
@@ -19,7 +19,6 @@ import net.minecraftforge.fluids.IFluidHandler;
import forestry.api.core.IClimateControlled;
import forestry.api.multiblock.IAlvearyComponent;
import forestry.api.multiblock.IMultiblockComponent;
import forestry.apiculture.blocks.BlockAlveary;
import forestry.apiculture.gui.ContainerAlvearyHygroregulator;
import forestry.apiculture.gui.GuiAlvearyHygroregulator;
@@ -32,8 +31,8 @@ import forestry.core.fluids.tanks.FilteredTank;
import forestry.core.inventory.IInventoryAdapter;
import forestry.core.tiles.ILiquidTankTile;
public class TileAlvearyHygroregulator extends TileAlveary implements IInventory, ILiquidTankTile, IFluidHandler,
IAlvearyComponent.Climatiser, IMultiblockComponent.HasInventory {
public class TileAlvearyHygroregulator extends TileAlveary
implements IInventory, ILiquidTankTile, IFluidHandler, IAlvearyComponent.Climatiser {
private final HygroregulatorRecipe[] recipes;
@@ -57,9 +56,9 @@ public class TileAlvearyHygroregulator extends TileAlveary implements IInventory
this.tankManager = new TankManager(this, liquidTank);
this.recipes = new HygroregulatorRecipe[] {
new HygroregulatorRecipe(new FluidStack(water, 1), 1, +0.01f, -0.005f),
new HygroregulatorRecipe(new FluidStack(lava, 1), 10, -0.01f, +0.005f),
new HygroregulatorRecipe(new FluidStack(liquidIce, 1), 10, +0.02f, -0.01f) };
new HygroregulatorRecipe(new FluidStack(water, 1), 1, +0.01f, -0.0005f),
new HygroregulatorRecipe(new FluidStack(lava, 1), 10, -0.01f, +0.0005f),
new HygroregulatorRecipe(new FluidStack(liquidIce, 1), 10, +0.02f, -0.001f) };
}
@Override
@@ -112,11 +111,6 @@ public class TileAlvearyHygroregulator extends TileAlveary implements IInventory
}
}
@Override
public int getPriority() {
return 100;
}
/* SAVING & LOADING */
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
@@ -18,7 +18,6 @@ import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.ISpeciesRoot;
import forestry.api.multiblock.IAlvearyComponent;
import forestry.api.multiblock.IMultiblockComponent;
import forestry.apiculture.blocks.BlockAlveary;
import forestry.apiculture.gui.ContainerAlvearySieve;
import forestry.apiculture.gui.GuiAlvearySieve;
@@ -26,8 +25,7 @@ import forestry.apiculture.inventory.InventoryAlvearySieve;
import forestry.core.inventory.IInventoryAdapter;
import forestry.core.inventory.watchers.ISlotPickupWatcher;
public class TileAlvearySieve extends TileAlveary
implements IAlvearyComponent.BeeListener, IMultiblockComponent.HasInventory {
public class TileAlvearySieve extends TileAlveary implements IAlvearyComponent.BeeListener {
private final IBeeListener beeListener;
private final InventoryAlvearySieve inventory;
@@ -8,9 +8,8 @@
******************************************************************************/
package forestry.apiculture.multiblock;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Map.Entry;
import java.util.Stack;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
@@ -22,7 +21,6 @@ import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeType;
import forestry.api.apiculture.IBee;
import forestry.api.multiblock.IAlvearyComponent;
import forestry.api.multiblock.IMultiblockComponent;
import forestry.apiculture.blocks.BlockAlveary;
import forestry.apiculture.gui.ContainerAlvearySwarmer;
import forestry.apiculture.gui.GuiAlvearySwarmer;
@@ -38,11 +36,10 @@ import forestry.core.proxy.Proxies;
import forestry.core.tiles.IActivatable;
import forestry.core.utils.ItemStackUtil;
public class TileAlvearySwarmer extends TileAlveary
implements ISidedInventory, IActivatable, IAlvearyComponent.Active, IMultiblockComponent.HasInventory {
public class TileAlvearySwarmer extends TileAlveary implements ISidedInventory, IActivatable, IAlvearyComponent.Active {
private final InventorySwarmer inventory;
private final Deque<ItemStack> pendingSpawns = new ArrayDeque<>();
private final Stack<ItemStack> pendingSpawns = new Stack<>();
private boolean active;
public TileAlvearySwarmer() {
@@ -15,14 +15,11 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import forestry.apiculture.blocks.BlockCandle;
import forestry.apiculture.tiles.TileCandle;
import forestry.core.proxy.Proxies;
@ThreadSafeISBRH(perThread = false)
public class RenderCandleBlock implements ISimpleBlockRenderingHandler {
@Override
@@ -61,7 +58,7 @@ public class RenderCandleBlock implements ISimpleBlockRenderingHandler {
IIcon iconB = block.getTextureFromPassAndLit(1, isLit);
int colour = tileCandle.getColour();
final Tessellator tessellator = Tessellator.instance;
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(world.getLightBrightnessForSkyBlocks(x, y, z, block.getLightValue(world, x, y, z)));
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
double d0 = 0.4000000059604645D;
@@ -90,7 +87,7 @@ public class RenderCandleBlock implements ISimpleBlockRenderingHandler {
private static void renderCandleAtAngle(IIcon icon, double x, double y, double z, double par8, double par10,
int colour) {
final Tessellator tessellator = Tessellator.instance;
Tessellator tessellator = Tessellator.instance;
double minU = icon.getMinU();
double minV = icon.getMinV();
double maxU = icon.getMaxU();
@@ -99,7 +99,7 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
}
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SuppressWarnings("rawtypes")
public static ComponentVillageBeeHouse buildComponent(StructureVillagePieces.Start startPiece, List par1List,
Random random, int par3, int par4, int par5, int par6, int par7) {
StructureBoundingBox bbox = StructureBoundingBox
@@ -28,6 +28,7 @@ import forestry.plugins.PluginApiculture;
public abstract class HiveDecorator {
@SuppressWarnings("rawtypes")
private static final EventType EVENT_TYPE = EnumHelper
.addEnum(EventType.class, "FORESTRY_HIVES", new Class[0], new Object[0]);
@@ -0,0 +1,145 @@
package forestry.arboriculture;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLeaves;
import net.minecraft.world.World;
/** Based on vanilla leaf decay, but accepts leaves that are connected further from a trunk */
public abstract class LeafDecayHelper {
private static final short SUSTAINS_LEAVES = 0;
private static final short NOT_SUSTAINS_LEAVES = -1;
private static final short IS_LEAVES = -2;
private static int[] leafDecayValues;
public static void leafDecay(BlockLeaves leaves, World world, int x, int y, int z) {
if (world.isRemote) {
return;
}
int leafMeta = world.getBlockMetadata(x, y, z);
if ((leafMeta & 8) != 0 && (leafMeta & 4) == 0) {
byte radius = 4;
byte yArrayMult = 32;
int xArrayMult = yArrayMult * yArrayMult;
int arrayOffset = yArrayMult / 2;
if (leafDecayValues == null) {
leafDecayValues = new int[yArrayMult * yArrayMult * yArrayMult];
}
int radius1 = radius + 1;
if (world.checkChunksExist(x - radius1, y - radius1, z - radius1, x + radius1, y + radius1, z + radius1)) {
for (int xOffset = -radius; xOffset <= radius; ++xOffset) {
for (int yOffset = -radius; yOffset <= radius; ++yOffset) {
for (int zOffset = -radius; zOffset <= radius; ++zOffset) {
Block block = world.getBlock(x + xOffset, y + yOffset, z + zOffset);
if (!block.canSustainLeaves(world, x + xOffset, y + yOffset, z + zOffset)) {
if (block.isLeaves(world, x + xOffset, y + yOffset, z + zOffset)) {
leafDecayValues[(xOffset + arrayOffset) * xArrayMult
+ (yOffset + arrayOffset) * yArrayMult
+ zOffset
+ arrayOffset] = IS_LEAVES;
} else {
leafDecayValues[(xOffset + arrayOffset) * xArrayMult
+ (yOffset + arrayOffset) * yArrayMult
+ zOffset
+ arrayOffset] = NOT_SUSTAINS_LEAVES;
}
} else {
leafDecayValues[(xOffset + arrayOffset) * xArrayMult
+ (yOffset + arrayOffset) * yArrayMult
+ zOffset
+ arrayOffset] = SUSTAINS_LEAVES;
}
}
}
}
for (int sustainedValue = 1; sustainedValue <= 8; ++sustainedValue) {
for (int xOffset = -radius; xOffset <= radius; ++xOffset) {
for (int yOffset = -radius; yOffset <= radius; ++yOffset) {
for (int zOffset = -radius; zOffset <= radius; ++zOffset) {
if (leafDecayValues[(xOffset + arrayOffset) * xArrayMult
+ (yOffset + arrayOffset) * yArrayMult
+ zOffset
+ arrayOffset] == sustainedValue - 1) {
if (leafDecayValues[(xOffset + arrayOffset - 1) * xArrayMult
+ (yOffset + arrayOffset) * yArrayMult
+ zOffset
+ arrayOffset] == IS_LEAVES) {
leafDecayValues[(xOffset + arrayOffset - 1) * xArrayMult
+ (yOffset + arrayOffset) * yArrayMult
+ zOffset
+ arrayOffset] = sustainedValue;
}
if (leafDecayValues[(xOffset + arrayOffset + 1) * xArrayMult
+ (yOffset + arrayOffset) * yArrayMult
+ zOffset
+ arrayOffset] == IS_LEAVES) {
leafDecayValues[(xOffset + arrayOffset + 1) * xArrayMult
+ (yOffset + arrayOffset) * yArrayMult
+ zOffset
+ arrayOffset] = sustainedValue;
}
if (leafDecayValues[(xOffset + arrayOffset) * xArrayMult
+ (yOffset + arrayOffset - 1) * yArrayMult
+ zOffset
+ arrayOffset] == IS_LEAVES) {
leafDecayValues[(xOffset + arrayOffset) * xArrayMult
+ (yOffset + arrayOffset - 1) * yArrayMult
+ zOffset
+ arrayOffset] = sustainedValue;
}
if (leafDecayValues[(xOffset + arrayOffset) * xArrayMult
+ (yOffset + arrayOffset + 1) * yArrayMult
+ zOffset
+ arrayOffset] == IS_LEAVES) {
leafDecayValues[(xOffset + arrayOffset) * xArrayMult
+ (yOffset + arrayOffset + 1) * yArrayMult
+ zOffset
+ arrayOffset] = sustainedValue;
}
if (leafDecayValues[(xOffset + arrayOffset) * xArrayMult
+ (yOffset + arrayOffset) * yArrayMult
+ (zOffset + arrayOffset - 1)] == IS_LEAVES) {
leafDecayValues[(xOffset + arrayOffset) * xArrayMult
+ (yOffset + arrayOffset) * yArrayMult
+ (zOffset + arrayOffset - 1)] = sustainedValue;
}
if (leafDecayValues[(xOffset + arrayOffset) * xArrayMult
+ (yOffset + arrayOffset) * yArrayMult
+ zOffset
+ arrayOffset
+ 1] == IS_LEAVES) {
leafDecayValues[(xOffset + arrayOffset) * xArrayMult
+ (yOffset + arrayOffset) * yArrayMult
+ zOffset
+ arrayOffset
+ 1] = sustainedValue;
}
}
}
}
}
}
}
int sustainValue = leafDecayValues[(arrayOffset * xArrayMult) + (arrayOffset * yArrayMult) + arrayOffset];
if (sustainValue >= 0) {
world.setBlockMetadataWithNotify(x, y, z, leafMeta & -9, 4); // stop trying to decay
} else {
leaves.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
world.setBlockToAir(x, y, z);
}
}
}
}
@@ -34,7 +34,6 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import com.gtnewhorizon.gtnhlib.blocks.util.BFSLeafDecay;
import com.mojang.authlib.GameProfile;
import cpw.mods.fml.relauncher.Side;
@@ -49,6 +48,7 @@ import forestry.api.core.Tabs;
import forestry.api.lepidopterology.ButterflyManager;
import forestry.api.lepidopterology.EnumFlutterType;
import forestry.api.lepidopterology.IButterfly;
import forestry.arboriculture.LeafDecayHelper;
import forestry.arboriculture.genetics.TreeDefinition;
import forestry.arboriculture.items.ItemBlockLeaves;
import forestry.arboriculture.render.TextureLeaves;
@@ -168,7 +168,6 @@ public class BlockForestryLeaves extends BlockNewLeaf implements ITileEntityProv
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
@SuppressWarnings("deprecation")
ItemStack itemStack = super.getPickBlock(target, world, x, y, z);
TileLeaves leaves = getLeafTile(world, x, y, z);
NBTTagCompound leavesNBT = new NBTTagCompound();
@@ -230,12 +229,7 @@ public class BlockForestryLeaves extends BlockNewLeaf implements ITileEntityProv
return;
}
if (!world.isRemote) {
final int meta = world.getBlockMetadata(x, y, z);
if ((meta & 8) != 0 && (meta & 4) == 0) {
BFSLeafDecay.handleDecayChecked(this, world, x, y, z, meta, 4);
}
}
LeafDecayHelper.leafDecay(this, world, x, y, z);
// check leaves tile again because they can decay in super.updateTick
if (tileLeaves.isInvalid()) {
@@ -36,32 +36,31 @@ public class BlockFruitPod extends BlockCocoa {
}
public static TileFruitPod getPodTile(IBlockAccess world, int x, int y, int z) {
final TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileFruitPod) {
return (TileFruitPod) tile;
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof TileFruitPod)) {
return null;
}
return null;
return (TileFruitPod) tile;
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if (!world.checkChunksExist(x - 1, y, z - 1, x + 1, y, z + 1)) {
return;
}
if (!canBlockStay(world, x, y, z)) {
final int meta = world.getBlockMetadata(x, y, z);
this.dropBlockAsItem(world, x, y, z, meta, 0);
dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
world.setBlockToAir(x, y, z);
return;
}
final TileFruitPod tile = getPodTile(world, x, y, z);
if (tile != null) {
tile.onBlockTick();
TileFruitPod tile = getPodTile(world, x, y, z);
if (tile == null) {
return;
}
tile.onBlockTick();
}
@SuppressWarnings("deprecation")
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
if (!world.isRemote) {
@@ -16,8 +16,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -72,7 +72,7 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(int side, int meta) {
return IconProviderWood.getPlankIcon(EnumWoodType.VALUES[meta]);
return IconProviderWood.getPlankIcon(EnumWoodType.LARCH);
}
@Override
@@ -84,8 +84,7 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp
@Override
protected ItemStack createStackedBlock(int meta) {
Item item = Item.getItemFromBlock(this);
return item != null ? new ItemStack(item, 2, 0) : null;
return new ItemStack(Blocks.wooden_slab, 2, meta & 7);
}
@Override
@@ -108,18 +107,6 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp
return new TileWood();
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
// Special case for double slabs placed by building mods (e.g., MatterManipulator)
if (stack == null) return;
int damage = stack.getItemDamage();
if (damage < 0 || damage >= EnumWoodType.VALUES.length) return;
TileWood tile = TileWood.getWoodTile(world, x, y, z);
if (tile != null) {
tile.setWoodType(EnumWoodType.VALUES[damage]);
}
}
/* PROPERTIES */
@Override
public final ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
@@ -16,8 +16,6 @@ import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
@@ -300,36 +298,6 @@ public class Tree extends Individual implements ITree, IPlantable {
return plantTypes;
}
@Override
public void addLore(List<String> text) {
IAlleleTreeSpecies primary = genome.getPrimary();
String descTokens[] = primary.getDescription().split("\\|");
if (descTokens.length > 0) {
String speciesLore = descTokens[0];
if (!speciesLore.isEmpty() && !speciesLore.contains("for.description")) {
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
String formattedLore = EnumChatFormatting.GOLD + speciesLore;
List<String> formattedLoreList = fontRenderer.listFormattedStringToWidth(formattedLore, 200);
text.addAll(formattedLoreList);
}
}
}
@Override
public void addDiscoveredBy(List<String> text) {
IAlleleTreeSpecies primary = genome.getPrimary();
String descTokens[] = primary.getDescription().split("\\|");
if (descTokens.length > 2) {
String discoveredBy = descTokens[2];
if (!discoveredBy.isEmpty()) {
text.add("");
text.add("Discovered by " + EnumChatFormatting.ITALIC + discoveredBy);
}
}
}
@Override
public void addTooltip(List<String> list) {
@@ -82,7 +82,7 @@ public enum TreeBranchDefinition implements IBranchDefinition {
@Override
public IAllele[] getTemplate() {
if (defaultTemplate == null) {
defaultTemplate = new IAllele[EnumTreeChromosome.VALUES.length];
defaultTemplate = new IAllele[EnumTreeChromosome.values().length];
AlleleHelper.instance.set(defaultTemplate, EnumTreeChromosome.FRUITS, AlleleFruit.fruitNone);
AlleleHelper.instance.set(defaultTemplate, EnumTreeChromosome.GROWTH, AlleleGrowth.growthLightLevel);
@@ -1059,8 +1059,6 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator {
case WEST:
vanillaWoodMeta |= 1 << 2;
break;
default:
break;
}
world.setBlock(x, y, z, vanillaWoodBlock, vanillaWoodMeta, Constants.FLAG_BLOCK_SYNCH);
@@ -1148,14 +1146,6 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator {
return species.getUID();
}
public EnumWoodType getWoodType() {
return woodType;
}
public ItemStack getVanillaWood() {
return vanillaWood;
}
@Override
public final ITreeGenome getGenome() {
return genome;
@@ -389,7 +389,7 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot {
@Override
public IChromosomeType[] getKaryotype() {
return EnumTreeChromosome.VALUES;
return EnumTreeChromosome.values();
}
@Override
@@ -26,7 +26,6 @@ public class ItemRegistryArboriculture extends ItemRegistry {
OreDictionary.registerOre("treeSapling", sapling.getWildcard());
pollenFertile = registerItem(new ItemGermlingGE(EnumGermlingType.POLLEN), "pollenFertile");
OreDictionary.registerOre("itemPollenFertile", pollenFertile.getWildcard());
treealyzer = registerItem(new ItemTreealyzer(), "treealyzer");
grafter = registerItem(new ItemGrafter(4), "grafter");
grafterProven = registerItem(new ItemGrafter(149), "grafterProven");
@@ -15,7 +15,6 @@ import forestry.api.core.Tabs;
import forestry.arboriculture.gui.GuiTreealyzer;
import forestry.arboriculture.inventory.ItemInventoryTreealyzer;
import forestry.core.gui.ContainerAlyzer;
import forestry.core.inventory.ItemLocation;
import forestry.core.items.ItemWithGui;
public class ItemTreealyzer extends ItemWithGui {
@@ -25,12 +24,12 @@ public class ItemTreealyzer extends ItemWithGui {
}
@Override
public Object getGui(EntityPlayer player, ItemStack heldItem, int data, ItemLocation loc) {
public Object getGui(EntityPlayer player, ItemStack heldItem, int data) {
return new GuiTreealyzer(player, new ItemInventoryTreealyzer(player, heldItem));
}
@Override
public Object getContainer(EntityPlayer player, ItemStack heldItem, int data, ItemLocation loc) {
public Object getContainer(EntityPlayer player, ItemStack heldItem, int data) {
return new ContainerAlyzer(new ItemInventoryTreealyzer(player, heldItem), player);
}
}
@@ -15,14 +15,11 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import forestry.arboriculture.blocks.BlockFruitPod;
import forestry.arboriculture.tiles.TileFruitPod;
import forestry.plugins.PluginArboriculture;
@ThreadSafeISBRH(perThread = false)
public class RenderFruitPodBlock implements ISimpleBlockRenderingHandler {
@Override
@@ -40,7 +37,7 @@ public class RenderFruitPodBlock implements ISimpleBlockRenderingHandler {
maturity = pod.getMaturity();
}
final Tessellator tessellator = Tessellator.instance;
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(blockPod.getMixedBrightnessForBlock(world, x, y, z));
tessellator.setColorOpaque_F(1.0f, 1.0f, 1.0f);
int metadata = world.getBlockMetadata(x, y, z);
@@ -14,8 +14,6 @@ import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
import forestry.arboriculture.blocks.BlockForestryLeaves;
import forestry.arboriculture.tiles.TileLeaves;
import forestry.core.render.RenderOverlayBlock;
@@ -24,7 +22,6 @@ import forestry.plugins.PluginArboriculture;
/**
* Ugly but serviceable renderer for leaves, taking fruits into account.
*/
@ThreadSafeISBRH(perThread = false)
public class RenderLeavesBlock extends RenderOverlayBlock {
@Override
@@ -15,8 +15,6 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import forestry.api.arboriculture.EnumGermlingType;
import forestry.api.arboriculture.IAlleleTreeSpecies;
@@ -24,9 +22,10 @@ import forestry.arboriculture.blocks.BlockSapling;
import forestry.arboriculture.tiles.TileSapling;
import forestry.plugins.PluginArboriculture;
@ThreadSafeISBRH(perThread = false)
public class RenderSaplingBlock implements ISimpleBlockRenderingHandler {
private static int renderLayer = 0;
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {}
@@ -46,8 +45,10 @@ public class RenderSaplingBlock implements ISimpleBlockRenderingHandler {
IAlleleTreeSpecies species = tile.getTree().getGenome().getPrimary();
renderCrossedSquares(species, world, block, x, y, z, 0);
renderCrossedSquares(species, world, block, x, y, z, 1);
renderCrossedSquares(species, world, block, x, y, z);
renderLayer = 1;
renderCrossedSquares(species, world, block, x, y, z);
renderLayer = 0;
return true;
}
@@ -62,9 +63,9 @@ public class RenderSaplingBlock implements ISimpleBlockRenderingHandler {
}
private static boolean renderCrossedSquares(IAlleleTreeSpecies species, IBlockAccess world, Block block, int x,
int y, int z, int renderLayer) {
int y, int z) {
final Tessellator tess = Tessellator.instance;
Tessellator tess = Tessellator.instance;
tess.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
int colourMultiplier = species.getGermlingColour(EnumGermlingType.SAPLING, renderLayer);
@@ -80,14 +81,14 @@ public class RenderSaplingBlock implements ISimpleBlockRenderingHandler {
}
tess.setColorOpaque_F(r, g, b);
drawCrossedSquares(species, x, y, z, 1.0f, renderLayer);
drawCrossedSquares(species, x, y, z, 1.0f);
return true;
}
private static void drawCrossedSquares(IAlleleTreeSpecies species, double par3, double par5, double par7, float mod,
int renderLayer) {
private static void drawCrossedSquares(IAlleleTreeSpecies species, double par3, double par5, double par7,
float mod) {
final Tessellator tess = Tessellator.instance;
Tessellator tess = Tessellator.instance;
IIcon icon = species.getGermlingIcon(EnumGermlingType.SAPLING, renderLayer);
double d3 = (double) icon.getMinU();
@@ -95,7 +95,8 @@ public class TileWood extends TileEntity implements IStreamable {
EnumWoodType woodType = wood.getWoodType();
int amount = 1;
if (block instanceof BlockSlab blockSlab) {
if (block instanceof BlockSlab) {
BlockSlab blockSlab = (BlockSlab) block;
if (blockSlab.isDoubleSlab()) {
amount = 2;
block = PluginArboriculture.blocks.slabs;
@@ -103,7 +104,6 @@ public class TileWood extends TileEntity implements IStreamable {
}
ItemStack itemStack = new ItemStack(block, amount);
if (itemStack.getItem() == null) return null;
ItemBlockWood.saveToItemStack(woodType, itemStack);
return itemStack;
}
@@ -113,7 +113,11 @@ public final class AccessHandler implements IAccessHandler {
if (!isOwner(player)) {
return false;
}
setAccess(player.worldObj, access.next());
int ordinal = (access.ordinal() + 1) % EnumAccess.values().length;
EnumAccess newAccess = EnumAccess.values()[ordinal];
setAccess(player.worldObj, newAccess);
return true;
}
@@ -152,7 +156,7 @@ public final class AccessHandler implements IAccessHandler {
public void readData(DataInputStreamForestry data) throws IOException {
byte accessOrdinal = data.readByte();
if (accessOrdinal >= 0) {
access = EnumAccess.fromOrdinal(accessOrdinal);
access = EnumAccess.values()[accessOrdinal];
GameProfile owner = new GameProfile(new UUID(data.readLong(), data.readLong()), data.readUTF());
setOwner(owner);
}
@@ -160,7 +164,8 @@ public final class AccessHandler implements IAccessHandler {
@Override
public void readFromNBT(NBTTagCompound data) {
access = EnumAccess.fromOrdinal(data.getInteger("Access"));
access = EnumAccess.values()[data.getInteger("Access")];
if (data.hasKey("owner")) {
owner = NBTUtil.func_152459_a(data.getCompoundTag("owner"));
}
@@ -8,15 +8,22 @@
******************************************************************************/
package forestry.core.access;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public enum EnumAccess {
SHARED("gui.rule.shared"),
VIEWABLE("gui.rule.restricted"),
PRIVATE("gui.rule.private");
private static final EnumAccess[] VALUES = values();
private final String name;
@SideOnly(Side.CLIENT)
private IIcon icon;
EnumAccess(String name) {
this.name = name;
}
@@ -24,13 +31,4 @@ public enum EnumAccess {
public String getName() {
return this.name;
}
public EnumAccess next() {
int ordinal = (this.ordinal() + 1) % VALUES.length;
return VALUES[ordinal];
}
public static EnumAccess fromOrdinal(int ordinal) {
return VALUES[ordinal];
}
}
@@ -35,7 +35,6 @@ public abstract class BlockForestry extends BlockContainer {
setCreativeTab(CreativeTabForestry.tabForestry);
}
@SuppressWarnings("deprecation")
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
@@ -8,8 +8,6 @@
******************************************************************************/
package forestry.core.blocks;
import static forestry.Forestry.isDreamcraftLoaded;
import java.util.ArrayList;
import java.util.List;
@@ -54,7 +52,7 @@ public class BlockResourceOre extends Block {
public void dropBlockAsItemWithChance(World world, int x, int y, int z, int metadata, float par6, int par7) {
super.dropBlockAsItemWithChance(world, x, y, z, metadata, par6, par7);
if (metadata == 0 && !isDreamcraftLoaded) {
if (metadata == 0) {
this.dropXpOnBlockBreak(world, x, y, z, MathHelper.getRandomIntegerInRange(world.rand, 1, 4));
}
}
@@ -63,7 +61,7 @@ public class BlockResourceOre extends Block {
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> drops = new ArrayList<>();
if (metadata == ResourceType.APATITE.ordinal() && !isDreamcraftLoaded) {
if (metadata == ResourceType.APATITE.ordinal()) {
int fortuneModifier = world.rand.nextInt(fortune + 2) - 1;
if (fortuneModifier < 0) {
fortuneModifier = 0;
@@ -84,26 +84,31 @@ public class BlockSoil extends Block implements IItemTyped {
}
@Override
public void updateTick(World world, int x, int y, int z, Random random) {
public void updateTick(World world, int i, int j, int k, Random random) {
if (world.isRemote) {
return;
}
int meta = world.getBlockMetadata(x, y, z);
int meta = world.getBlockMetadata(i, j, k);
SoilType type = getTypeFromMeta(meta);
if (type == SoilType.HUMUS) {
if (world.checkChunksExist(x - 1, y + 1, z - 1, x + 1, y + 1, z + 1)) {
if (isEnrooted(world, x, y, z)) {
degradeSoil(world, x, y, z);
}
}
updateTickHumus(world, i, j, k);
} else if (type == SoilType.BOG_EARTH) {
if (world.checkChunksExist(x - 2, y, z - 2, x + 2, y, z + 2)) {
if (isMoistened(world, x, y, z)) {
matureBog(world, x, y, z);
}
}
updateTickBogEarth(world, i, j, k);
}
}
private static void updateTickHumus(World world, int i, int j, int k) {
if (isEnrooted(world, i, j, k)) {
degradeSoil(world, i, j, k);
}
}
private static void updateTickBogEarth(World world, int i, int j, int k) {
if (isMoistened(world, i, j, k)) {
matureBog(world, i, j, k);
}
}
@@ -117,6 +122,7 @@ public class BlockSoil extends Block implements IItemTyped {
}
}
}
return false;
}
@@ -150,6 +156,7 @@ public class BlockSoil extends Block implements IItemTyped {
}
private static boolean isMoistened(World world, int x, int y, int z) {
for (int i = -2; i < 3; i++) {
for (int j = -2; j < 3; j++) {
Block block = world.getBlock(x + i, y, z + j);
@@ -158,6 +165,7 @@ public class BlockSoil extends Block implements IItemTyped {
}
}
}
return false;
}
@@ -16,6 +16,7 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import com.mojang.authlib.GameProfile;
@@ -49,22 +50,29 @@ public abstract class BlockStructure extends BlockForestry {
}
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof MultiblockTileEntityForestry<?>part)) {
if (!(tile instanceof MultiblockTileEntityForestry)) {
return false;
}
MultiblockTileEntityForestry part = (MultiblockTileEntityForestry) tile;
IMultiblockController controller = part.getMultiblockLogic().getController();
// If the player's hands are empty and they right-click on a multiblock, they get a
// multiblock-debugging message if the machine is not assembled.
if (player.getCurrentEquippedItem() == null && !controller.isAssembled()) {
String validationError = controller.getLastValidationError();
if (validationError != null) {
long tick = world.getTotalWorldTime();
if (tick > previousMessageTick + 20) {
player.addChatMessage(new ChatComponentText(validationError));
previousMessageTick = tick;
if (controller != null) {
String validationError = controller.getLastValidationError();
if (validationError != null) {
long tick = world.getTotalWorldTime();
if (tick > previousMessageTick + 20) {
player.addChatMessage(new ChatComponentText(validationError));
previousMessageTick = tick;
}
return true;
}
} else {
player.addChatMessage(
new ChatComponentText(StatCollector.translateToLocal("for.multiblock.error.notConnected")));
return true;
}
}
@@ -86,12 +94,13 @@ public abstract class BlockStructure extends BlockForestry {
return;
}
if (entityLiving instanceof EntityPlayer player) {
if (entityLiving instanceof EntityPlayer) {
TileEntity tile = world.getTileEntity(i, j, k);
if (tile instanceof MultiblockTileEntityForestry<?>tileForestry) {
if (tile instanceof MultiblockTileEntityForestry) {
EntityPlayer player = (EntityPlayer) entityLiving;
GameProfile gameProfile = player.getGameProfile();
tileForestry.setOwner(gameProfile);
((MultiblockTileEntityForestry) tile).setOwner(gameProfile);
}
}
}
@@ -116,12 +125,6 @@ public abstract class BlockStructure extends BlockForestry {
InventoryUtil.dropSockets((ISocketable) tile, world, x, y, z);
}
}
if (tile instanceof IMultiblockComponent.HasInventory) {
IMultiblockComponent.HasInventory hasInventory = (IMultiblockComponent.HasInventory) tile;
InventoryUtil.dropInventory(hasInventory.getInternalInventory(), world, x, y, z);
}
}
super.breakBlock(world, x, y, z, block, meta);
}
@@ -2,5 +2,5 @@ package forestry.core.blocks;
public interface IItemTyped {
Enum<?> getTypeFromMeta(int meta);
Enum getTypeFromMeta(int meta);
}
@@ -71,7 +71,7 @@ public class CircuitBoard<T> implements ICircuitBoard {
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
type = EnumCircuitBoardType.VALUES[nbttagcompound.getShort("T")];
type = EnumCircuitBoardType.values()[nbttagcompound.getShort("T")];
// Layout
if (nbttagcompound.hasKey("LY")) {
@@ -109,6 +109,6 @@ public class CircuitRegistry implements ICircuitRegistry {
return null;
}
return new CircuitBoard<>(nbttagcompound);
return new CircuitBoard(nbttagcompound);
}
}
@@ -15,11 +15,6 @@ public enum EnumCircuitBoardType {
REFINED((short) 3, 0x191919, 0xc9c9c9),
INTRICATE((short) 4, 0x191919, 0xe2cb6b);
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final EnumCircuitBoardType[] VALUES = values();
private final short sockets;
private final int primaryColor;
private final int secondaryColor;
@@ -63,7 +63,7 @@ public class GuiSolderingIron extends GuiForestry<ContainerSolderingIron, ItemIn
try {
ICircuitSocketType socketType = layout.getSocketType();
if (CircuitSocketType.FARM.equals(socketType)) {
FarmDirection farmDirection = FarmDirection.fromOrdinal(i);
FarmDirection farmDirection = FarmDirection.values()[i];
String farmDirectionString = farmDirection.toString().toLowerCase(Locale.ENGLISH);
String localizedDirection = StringUtil.localize("gui.solder." + farmDirectionString);
fontRendererObj.drawString(
@@ -79,6 +79,7 @@ public class GuiSolderingIron extends GuiForestry<ContainerSolderingIron, ItemIn
}
}
@SuppressWarnings("unchecked")
@Override
public void initGui() {
super.initGui();
@@ -50,7 +50,7 @@ public class ItemCircuitBoard extends ItemForestryMultiPass {
@Override
public int getColorFromItemStack(ItemStack itemstack, int pass) {
EnumCircuitBoardType type = EnumCircuitBoardType.VALUES[itemstack.getItemDamage()];
EnumCircuitBoardType type = EnumCircuitBoardType.values()[itemstack.getItemDamage()];
if (pass == 0) {
return type.getPrimaryColor();
} else {
@@ -60,7 +60,7 @@ public class ItemCircuitBoard extends ItemForestryMultiPass {
@Override
public String getUnlocalizedName(ItemStack stack) {
EnumCircuitBoardType type = EnumCircuitBoardType.VALUES[stack.getItemDamage()];
EnumCircuitBoardType type = EnumCircuitBoardType.values()[stack.getItemDamage()];
return "item.for.circuitboard." + type.toString().toLowerCase(Locale.ENGLISH);
}
@@ -75,7 +75,7 @@ public class ItemCircuitBoard extends ItemForestryMultiPass {
public static ItemStack createCircuitboard(EnumCircuitBoardType type, ICircuitLayout layout, ICircuit[] circuits) {
ItemStack chipset = PluginCore.items.circuitboards.get(type);
saveChipset(chipset, new CircuitBoard<>(type, layout, circuits));
saveChipset(chipset, new CircuitBoard(type, layout, circuits));
return chipset;
}
@@ -164,6 +164,7 @@ public class CommandHelpers {
return false;
}
@SuppressWarnings("unchecked")
public static List<String> getListOfStringsMatchingLastWord(String[] strings, String... lastWords) {
return CommandBase.getListOfStringsMatchingLastWord(strings, lastWords);
}
@@ -26,11 +26,24 @@ public class CommandVersion extends SubCommand {
@Override
public void processSubCommand(ICommandSender sender, String[] args) {
ChatStyle style = new ChatStyle();
if (Version.isOutdated()) {
style.setColor(EnumChatFormatting.RED);
} else {
style.setColor(EnumChatFormatting.GREEN);
}
CommandHelpers.sendLocalizedChatMessage(
sender,
new ChatStyle().setColor(EnumChatFormatting.GREEN),
style,
"for.chat.version",
Version.getVersion(),
Proxies.common.getMinecraftVersion());
Proxies.common.getMinecraftVersion(),
Version.getRecommendedVersion());
if (Version.isOutdated()) {
for (String updateLine : Version.getChangelog()) {
CommandHelpers.sendChatMessage(sender, EnumChatFormatting.BLUE + updateLine);
}
}
}
}
@@ -74,7 +74,7 @@ public class RootCommand extends CommandBase implements IForestryCommand {
}
@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String[] incomplete) {
public List addTabCompletionOptions(ICommandSender sender, String[] incomplete) {
return CommandHelpers.addStandardTabCompletionOptions(this, sender, incomplete);
}
@@ -137,7 +137,6 @@ public class Config {
public static boolean enableHints = true;
public static final LinkedListMultimap<String, String> hints = LinkedListMultimap.create();
public static boolean enableEnergyStat = true;
public static boolean showBackpackDurability = true;
public static boolean isStructureEnabled(String uid) {
return !Config.disabledStructures.contains(uid);
@@ -302,9 +301,6 @@ public class Config {
configCommon.moveProperty("tweaks.gui", "mail.alert", "tweaks.gui.mail.alert");
configCommon.renameProperty("tweaks.gui.mail.alert", "mail.alert", "enabled");
showBackpackDurability = configCommon
.getBooleanLocalized("tweaks.gui", "showBackpackDurability", showBackpackDurability);
mailAlertEnabled = configCommon.getBooleanLocalized("tweaks.gui.mail.alert", "enabled", mailAlertEnabled);
mailAlertXPosition = configCommon.getEnumLocalized(
"tweaks.gui.mail.alert",
@@ -8,7 +8,6 @@
******************************************************************************/
package forestry.core.config;
import forestry.Tags;
import forestry.api.core.IForestryConstants;
public class Constants implements IForestryConstants {
@@ -16,7 +15,7 @@ public class Constants implements IForestryConstants {
// System
public static final String MOD = "Forestry";
public static final String ID = "forestry";
public static final String VERSION = Tags.VERSION;
public static final String VERSION = "GRADLETOKEN_VERSION";
public static final String URL = "http://forestry.sengir.net/";
public static final int FLAG_BLOCK_UPDATE = 1;
@@ -109,7 +108,6 @@ public class Constants implements IForestryConstants {
public static final int MACHINE_MAX_ENERGY = 5000;
public static final int RAINMAKER_RAIN_DURATION_IODINE = 10000;
public static final int RAINMAKER_RAIN_DURATION_PHOSPHORICIODINE = 10000;
public static final int STILL_DESTILLATION_DURATION = 100;
public static final int STILL_DESTILLATION_INPUT = 10;
@@ -25,7 +25,6 @@ public class ForestryGuiConfig extends GuiConfig {
super(parent, getConfigCategories(), Constants.MOD, true, true, Constants.MOD);
}
@SuppressWarnings("rawtypes")
private static List<IConfigElement> getConfigCategories() {
List<IConfigElement> configElements = new ArrayList<>();
@@ -33,13 +32,13 @@ public class ForestryGuiConfig extends GuiConfig {
.asList("crafting", "difficulty", "genetics", "performance", "structures", "tweaks", "world");
for (String categoryName : commonCategoryNames) {
ConfigCategory category = Config.configCommon.getCategory(categoryName);
configElements.add(new ConfigElement<>(category));
configElements.add(new ConfigElement(category));
}
List<String> fluidCategoryNames = Arrays.asList("enableFluid", "enableFluidBlock");
for (String categoryName : fluidCategoryNames) {
ConfigCategory category = Config.configFluid.getCategory(categoryName);
configElements.add(new ConfigElement<>(category));
configElements.add(new ConfigElement(category));
}
return configElements;
+146 -20
View File
@@ -8,7 +8,21 @@
******************************************************************************/
package forestry.core.config;
import forestry.Tags;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
import forestry.Forestry;
import forestry.core.proxy.Proxies;
import forestry.core.utils.Log;
/**
* With permission from pahimar.
@@ -17,51 +31,163 @@ import forestry.Tags;
*/
public class Version {
@Deprecated
public enum EnumUpdateState {
CURRENT,
OUTDATED,
CONNECTION_ERROR
}
public static final String VERSION = Tags.VERSION;
@Deprecated
public static final String BUILD_NUMBER = "";
@Deprecated
public static final String VERSION = "@VERSION@";
public static final String BUILD_NUMBER = "@BUILD_NUMBER@";
public static final String[] FAILED_CHANGELOG = new String[] {
String.format("Unable to retrieve changelog for %s", Constants.MOD) };
@Deprecated
private static final String REMOTE_VERSION_FILE = "http://bit.ly/forestryver";
private static final String REMOTE_CHANGELOG_ROOT = "https://dl.dropbox.com/u/44760587/forestry/changelog/";
public static EnumUpdateState currentVersion = EnumUpdateState.CURRENT;
private static String recommendedVersion;
private static String[] cachedChangelog = FAILED_CHANGELOG;
public static String getVersion() {
return VERSION;
return VERSION + " (" + BUILD_NUMBER + ")";
}
@Deprecated
public static boolean isOutdated() {
return false;
return currentVersion == EnumUpdateState.OUTDATED;
}
@Deprecated
public static boolean needsUpdateNoticeAndMarkAsSeen() {
return false;
if (!isOutdated()) {
return false;
}
File versionFile = new File(Forestry.instance.getConfigFolder(), Config.CATEGORY_COMMON + ".cfg");
Configuration config = new Configuration(versionFile);
Property property = config.get("version", "seen", VERSION);
property.comment = "indicates the last version the user has been informed about and will suppress further notices on it.";
String seenVersion = property.getString();
if (recommendedVersion == null || recommendedVersion.equals(seenVersion)) {
return false;
}
property.set(recommendedVersion);
config.save();
return true;
}
@Deprecated
public static String getRecommendedVersion() {
return VERSION;
return recommendedVersion;
}
@Deprecated
public static void versionCheck() {}
private static class VersionChecker extends Thread {
@Override
public void run() {
try {
String location = REMOTE_VERSION_FILE;
HttpURLConnection conn = null;
while (location != null && !location.isEmpty()) {
URL url = new URL(location);
conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty(
"User-Agent",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)");
conn.connect();
location = conn.getHeaderField("Location");
}
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
String mcVersion = Proxies.common.getMinecraftVersion();
while ((line = reader.readLine()) != null) {
if (line.startsWith(mcVersion) && line.contains(Constants.MOD)) {
String[] tokens = line.split(":");
recommendedVersion = tokens[2];
}
}
if (recommendedVersion == null) {
return;
}
int result = FMLCommonHandler.instance().findContainerFor(Forestry.instance).getProcessedVersion()
.compareTo(new DefaultArtifactVersion(recommendedVersion));
if (result >= 0) {
Log.finer(
"Using the latest version [" + VERSION
+ " (build:"
+ BUILD_NUMBER
+ ")] for Minecraft "
+ mcVersion);
currentVersion = EnumUpdateState.CURRENT;
return;
}
cachedChangelog = grabChangelog(recommendedVersion);
Log.warning(
"Using outdated version [" + VERSION
+ " (build:"
+ BUILD_NUMBER
+ ")] for Minecraft "
+ mcVersion
+ ". Consider updating.");
currentVersion = EnumUpdateState.OUTDATED;
} catch (Exception e) {
// e.printStackTrace();
Log.warning("Unable to read from remote version authority.");
currentVersion = EnumUpdateState.CONNECTION_ERROR;
}
}
}
public static void versionCheck() {
new VersionChecker().start();
}
@Deprecated
public static String[] getChangelog() {
return FAILED_CHANGELOG;
return cachedChangelog;
}
@Deprecated
public static String[] grabChangelog(String version) {
return FAILED_CHANGELOG;
try {
String location = REMOTE_CHANGELOG_ROOT + version;
HttpURLConnection conn;
do {
URL url = new URL(location);
conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty(
"User-Agent",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)");
conn.connect();
location = conn.getHeaderField("Location");
} while (location != null && !location.isEmpty());
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
ArrayList<String> changelog = new ArrayList<>();
while ((line = reader.readLine()) != null) {
if (line.startsWith("#")) {
continue;
}
if (line.isEmpty()) {
continue;
}
changelog.add(line);
}
return changelog.toArray(new String[changelog.size()]);
} catch (Exception ex) {
// ex.printStackTrace();
Log.warning("Unable to read changelog from remote site.");
}
return new String[] { String.format("Unable to retrieve changelog for %s %s", Constants.MOD, version) };
}
}
@@ -14,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.minecart.MinecartInteractEvent;
@@ -28,7 +29,6 @@ import forestry.core.gui.GuiHandler;
import forestry.core.gui.IGuiHandlerEntity;
import forestry.core.gui.IHintSource;
import forestry.core.tiles.ITitled;
import forestry.core.utils.StringUtil;
public abstract class EntityMinecartForestry extends EntityMinecart
implements ITitled, IRestrictedAccess, IHintSource, IGuiHandlerEntity {
@@ -111,7 +111,7 @@ public abstract class EntityMinecartForestry extends EntityMinecart
@Override
public String getCommandSenderName() {
return StringUtil.localizeGuiTitle(getUnlocalizedTitle());
return StatCollector.translateToLocal(getUnlocalizedTitle());
}
/* ITitled */
@@ -193,7 +193,7 @@ public class BlockForestryFluid extends BlockFluidClassic {
super.updateTick(world, x, y, z, rand);
// Start fires if the fluid is lava-like
if (getMaterial() == Material.lava && world.checkChunksExist(x - 4, y, z - 4, x + 4, y, z + 4)) {
if (getMaterial() == Material.lava) {
int rangeUp = rand.nextInt(3);
for (int i = 0; i < rangeUp; ++i) {
@@ -10,6 +10,7 @@ package forestry.core.fluids;
import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraftforge.common.util.ForgeDirection;
@@ -30,7 +31,7 @@ public class FakeTankManager implements ITankManager {
public void containerAdded(Container container, ICrafting player) {}
@Override
public void updateGuiData(Container container, List<ICrafting> crafters) {}
public void updateGuiData(Container container, List<EntityPlayerMP> crafters) {}
@Override
public void containerRemoved(Container container) {}
@@ -10,6 +10,7 @@ package forestry.core.fluids;
import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraftforge.fluids.FluidStack;
@@ -20,7 +21,7 @@ public interface ITankManager extends IFluidHandler {
void containerAdded(Container container, ICrafting player);
void updateGuiData(Container container, List<ICrafting> crafters);
void updateGuiData(Container container, List<EntityPlayerMP> crafters);
void containerRemoved(Container container);
@@ -17,7 +17,6 @@ import java.util.List;
import javax.annotation.Nonnull;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
@@ -135,7 +134,7 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl
return;
}
List<ICrafting> crafters = Collections.singletonList(player);
List<EntityPlayerMP> crafters = Collections.singletonList((EntityPlayerMP) player);
for (StandardTank tank : tanks) {
sendTankUpdate(container, tank, crafters);
@@ -150,13 +149,13 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl
}
@Override
public void updateGuiData(Container container, List<ICrafting> crafters) {
public void updateGuiData(Container container, List<EntityPlayerMP> crafters) {
for (StandardTank tank : tanks) {
updateGuiData(container, crafters, tank.getTankIndex());
}
}
private void updateGuiData(Container container, List<ICrafting> crafters, int tankIndex) {
private void updateGuiData(Container container, List<EntityPlayerMP> crafters, int tankIndex) {
StandardTank tank = tanks.get(tankIndex);
if (tank == null) {
return;
@@ -171,12 +170,12 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl
sendTankUpdate(container, tank, crafters);
}
private void sendTankUpdate(Container container, StandardTank tank, Iterable<ICrafting> crafters) {
private void sendTankUpdate(Container container, StandardTank tank, Iterable<EntityPlayerMP> crafters) {
int tankIndex = tank.getTankIndex();
FluidStack fluid = tank.getFluid();
IForestryPacketClient packet = new PacketTankLevelUpdate(tile, tankIndex, fluid);
for (ICrafting player : crafters) {
Proxies.net.sendToPlayer(packet, (EntityPlayer) player);
for (EntityPlayerMP player : crafters) {
Proxies.net.sendToPlayer(packet, player);
}
if (fluid == null) {
@@ -133,9 +133,8 @@ public class StandardTank extends FluidTank implements IStreamable {
case DEFAULT:
case INPUT:
return true;
default:
return false;
}
return false;
}
public boolean canBeDrainedExternally() {
@@ -143,9 +142,8 @@ public class StandardTank extends FluidTank implements IStreamable {
case DEFAULT:
case OUTPUT:
return true;
default:
return false;
}
return false;
}
public boolean canFill(Fluid fluid, int amount) {
@@ -202,8 +202,7 @@ public abstract class Genome implements IGenome {
private static IChromosome[] getChromosomes(NBTTagCompound genomeNBT, ISpeciesRoot speciesRoot) {
NBTTagList chromosomesNBT = genomeNBT.getTagList("Chromosomes", 10);
IAllele[] defaultTemplate = speciesRoot.getDefaultTemplate();
IChromosome[] chromosomes = new IChromosome[defaultTemplate.length];
IChromosome[] chromosomes = new IChromosome[speciesRoot.getDefaultTemplate().length];
for (int i = 0; i < chromosomesNBT.tagCount(); i++) {
NBTTagCompound chromosomeNBT = chromosomesNBT.getCompoundTagAt(i);
@@ -214,7 +213,7 @@ public abstract class Genome implements IGenome {
chromosomes[chromosomeOrdinal] = chromosome;
if (Config.clearInvalidChromosomes) {
IAllele template = defaultTemplate[chromosomeOrdinal];
IAllele template = speciesRoot.getDefaultTemplate()[chromosomeOrdinal];
Class<? extends IAllele> chromosomeClass = speciesRoot.getKaryotype()[chromosomeOrdinal]
.getAlleleClass();
if (chromosome.overrideInvalidAlleles(template, chromosomeClass)) {
@@ -72,12 +72,6 @@ public abstract class ItemGE extends ItemForestry {
if (individual.isAnalyzed()) {
if (Proxies.common.isShiftDown()) {
individual.addTooltip(list);
individual.addDiscoveredBy(list);
if (Proxies.common.isCtrlDown()) {
individual.addLore(list);
} else {
list.add(EnumChatFormatting.ITALIC + "<" + StringUtil.localize("gui.tooltip.tml") + ">");
}
} else {
list.add(EnumChatFormatting.ITALIC + "<" + StringUtil.localize("gui.tooltip.tmi") + ">");
}
@@ -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()) {
Loaded 100 of 460 files, more files were not shown because too many files have changed in this diff. Show more