Compare commits

..
78 Commits
Author SHA1 Message Date
attempt0 0d6d7ff9aa Don't interact with energy net on client side (#111) 2026-08-09 18:17:36 +02:00
Eldrinn-Elantey 0b7ae46d2e Move Paint.NET art sources out of packaged resources (#108) 2026-08-04 22:04:19 +00:00
Dream Master a0cfcc9da6 update+bs+deps+gradle 2026-08-04 11:45:48 +07:00
Algent 171c5b29f6 Improve compartment inventory and GUI performance (#109) 2026-08-03 14:56:47 +07:00
Jordan Rey b5ad490947 fix: multiple issues with genetics machines liquid storage (#103) 2026-07-29 16:37:33 +07:00
__felix__ 00051c4594 fix loader check for gt6 compat (#107) 2026-07-29 16:37:04 +07:00
Ranzu d913e245ed Implement ColorUtils (#106) 2026-07-20 01:25:22 -04:00
Ranzu f253dfc5dc Rename "Gingko" to "Ginkgo" (#105) 2026-07-18 15:41:11 +02:00
Arcadia_Blues 6582ea3e56 Fix unintentional item combining for blocks missing setHasSubtypes(true) (#98) 2026-06-25 04:31:30 +00:00
Martin Robertz bb96e7deae update+gradle+bs+deps 2026-06-23 16:32:55 +02:00
Pxx500andgithub-actions[bot] 7643d11e14 Fix fluids racing to registration (#99)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-23 13:18:28 +00:00
Matej Dipčár 4eb26e9d77 Fix ComponentTankContainer draining wrong fluid when specific fluid requested (#97) 2026-05-25 19:06:36 +02:00
Eldrinn-ElanteyandAlexdoru 2b1843b74d fix CraftGUI.render going null on GUI open/reopen (#96)
Co-authored-by: Alexdoru <[email protected]>
2026-05-22 14:30:15 +02:00
Alexdoru 0b312261db fix world client leak caused by static CraftGUI (#95) 2026-05-18 19:05:50 +02:00
tiffit bd0746583a Only send NEI keybinds when no widget is focused (#94) 2026-05-10 20:44:56 +02:00
Ranzu b4143fb0ef Fixed Compartment help tooltip display (#93) 2026-05-09 14:21:17 +02:00
77c47e9071 fix isolator consumption chance config source (#87)
Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: UltraProdigy <[email protected]>
2026-05-04 01:00:00 +00:00
Max Shen f27b66c53f Fix concurrent modification exception (#92) 2026-05-03 20:43:05 -04:00
brandynandMartin Robertz ad16588e3b Fix ceramic tiles + Add config option to disable compartments (#83)
Co-authored-by: Martin Robertz <[email protected]>
2026-04-30 19:02:55 +02:00
Alexdoru 5acbd0b977 fix world client leak in RendererMachine (#90) 2026-04-09 20:29:55 +00:00
Martin Robertz 7e22128279 update+gradle+deps+bs 2026-04-07 18:54:15 +02:00
TweksTYandUltraProdigy 65e11fa564 Fix Genetics machines' VFX incorrectly appearing at 0;0;0 coordinates (#89)
Co-authored-by: UltraProdigy <[email protected]>
2026-03-20 23:56:15 -04:00
DarkShadow44andMartin Robertz 355c85598e Move out larvae from splicer even when no serum is present anymore (#76)
Co-authored-by: Martin Robertz <[email protected]>
2026-03-20 23:33:14 -04:00
UltraProdigy 63232799bc Optimize Images & Workflow (#88) 2026-03-08 09:28:38 +01:00
Alexdoru a48f59e0ed Cache frequent Enum#values() calls (#86) 2026-03-04 16:15:04 +01:00
Guillaume MercierandCaedis 84d462d8d5 CropsNH Integration/IC2 Depreciation (#82)
Co-authored-by: Caedis <[email protected]>
2026-02-28 20:55:58 +01:00
Casey Primozic b32f2a210c Fix incorrect integer division in getRipeningStage (#85) 2026-02-18 02:20:41 -06:00
Caedis c988aa9870 Cache inventory size in compartments (#84) 2026-02-09 14:29:52 +03:00
ah-OOG-ah 6ba66123eb Yeet reflective item parsing (#75) 2026-01-27 22:29:12 -05:00
Ranzu 1d0568388a Added title localization and inventory slot texture (#81) 2026-01-07 18:37:36 +01:00
TweksTY 3968cc320e Fix the inability to mutate a bee that requires a certain block as a base using alveary if the bottom center block of your alveary is any alveary block from Extra Bees (#80) 2026-01-07 12:29:12 +01:00
DarkShadow44 ed1daa1e96 Mark sequence as not repairable (#79) 2025-12-13 20:58:30 +01:00
Alexdoru ffcc5f7102 [Memory-opti:runtime allocations] Reduce amount of NBTTagCompound created in TileEntityMetadata#getItemStack (#77) 2025-12-01 23:35:01 +01:00
Martin Robertz 4c619fd3b2 update 2025-10-01 18:48:17 +02:00
Glease 341fea50ba fix batched updates does not call window and machine packet listeners (#74) 2025-09-28 10:52:47 +02:00
Julia e6c67df077 Fix Slot Registration Crash (#73) 2025-09-25 15:46:12 +02:00
d24088ea4b Fix metadata error when using Scooporator MX200 Turbo (#69)
Co-authored-by: Wilhelm Schuster <[email protected]>
Co-authored-by: boubou19 <[email protected]>
2025-09-24 23:44:33 +02:00
Julia a2a57d1656 Batch Actions and Defer Registration of Slots (#72) 2025-09-24 23:25:39 +02:00
Julia 2e36fbcfcc Extract Magic String Constants in ContainerCraftGUI (#70) 2025-09-24 17:46:47 +02:00
Martin Robertz bd5bd5c153 update 2025-09-24 17:37:45 +02:00
Julia f324cb53db Fix Inventory List Crash (#71) 2025-09-24 17:29:33 +02:00
Julia c6815bebdf Cleanup ContainerCraftGUI (#68) 2025-09-23 17:46:40 -07:00
Julia 7ffa516892 Change recieve -> receive (#67) 2025-09-23 14:26:33 -07:00
Julia 311d618d53 Cleanup BinnieCorePacketID.java (#66) 2025-09-23 12:54:21 -07:00
Dream Master 9795aad66f update 2025-09-05 16:05:56 +02:00
Matthew Bentham ea7e2d7de4 Fix mutator not accepting items listed on the wiki (#65) 2025-09-05 09:44:41 +02:00
boubou19andAlexdoru 39f86c8b0c Speed up forge event registration (#64)
Co-authored-by: Alexdoru <[email protected]>
2025-07-18 22:22:10 +00:00
TotallyNotOndre 5b551eb8ec "fix" compartment tab name input field (#63) 2025-07-15 19:39:33 +02:00
Martin Robertz f497114579 update 2025-07-08 12:11:02 +02:00
Alexdoru ea547df4d0 Properly apply hunger effect (#62) 2025-07-07 21:42:49 +02:00
Ruling-0 39c9f1f6c6 Remove mutator mutation chance cap (#61) 2025-05-25 17:30:06 +02:00
Maya 4000763323 update 2025-05-07 10:39:29 -05:00
czerwonogrodzki 59e98dd290 Extend Lab Stand GUI width by 80 units (#60) 2025-05-07 10:38:14 -05:00
Maya c1ec3e5c8e Fix stained block hardness (#59) 2025-04-09 01:22:18 -05:00
Maya ac4b21b05e update 2025-04-08 14:24:47 -05:00
Niclas Klugmann 0e0ded5cc0 Revert 5x multiplier removal (#58) 2025-04-08 14:23:05 -05:00
Martin Robertz a1f54e7500 update 2025-01-16 21:59:06 +01:00
Astatine5985andMaya 5f1b5daa24 Isolator crash fix revision (#56)
Co-authored-by: Maya <[email protected]>
2025-01-16 16:50:35 +00:00
Martin Robertz 8d0fa2ebb5 update 2024-12-30 21:12:54 +01:00
glowredman 0db05cb60c Add Localization, Fix Carpentry Hammer / Master Carpentry Hammer Names being reverse (#57) 2024-12-30 21:11:13 +01:00
0265d70a53 Yeet custom config in favor of NHLib (#53)
Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: Maya <[email protected]>
2024-12-29 12:37:43 -06:00
Martin Robertz 32b7efcd15 update 2024-12-22 01:17:03 +01:00
Guillaume Mercier 7059206cb0 prevent npe and log bad requests (#55) 2024-12-21 10:35:14 -06:00
Martin Robertz 54c702e935 update 2024-11-13 07:12:13 +01:00
Ryan Nasers a3aa358627 Fixing Waila showing incorrect blocks for logs (#54) 2024-11-12 22:04:26 +01:00
ah-OOG-ah f0f14bb278 Minor cleanups (#50)
* Finalize, minor alloc reduction

Also enable Jabel and generic injection

* Update dependencies.gradle

* Clean up Machine a bit

* spotless

more enhanced instanceof

* Update ModuleMachine.java

* More clen

* WARN: Removed exception catching

* Many, many tiny patches + birthday fix

* Spotless

* Spotless again

* Fix getLow and clamp tolerance value

* Revert event -> ignored on unused event parameters

* Rename instanceof variables

* Update Machine.java

* Use StringBuilder

* Cache getStack()

* Oops, Jabel can't handle that

* Spotless

* Spotless again

My IDE was fighting with it

* Remove unused elements + scream test success
2024-09-26 16:59:20 +02:00
Martin Robertz 6b4f3eb1c7 update 2024-09-15 14:30:24 +02:00
Ryan Nasers f74f9e4967 Should be fixed (#49) 2024-09-15 11:07:23 +02:00
Dream Master 12643d1b98 update 2024-08-09 20:41:23 +07:00
Ethryan 5bf4224f03 don't let players eat fluids anymore (#48) 2024-08-09 19:54:49 +07:00
Martin Robertz 5a1030bde4 update 2024-05-31 19:00:50 +02:00
Martin Robertz 948876ffcd Dev (#47)
* Update settings.gradle

* Update gradle-wrapper.properties

* Update dependencies.gradle
2024-05-31 11:23:46 +02:00
chochem 83142abde9 fix division by zero (#46) 2024-05-31 10:38:45 +02:00
Martin Robertz 79cda2e4fd update 2024-03-29 23:42:27 +01:00
DrParadox7 5409309b36 Flower Butterfly Spawns inherits Forestry's configs constraints (#45) 2024-03-29 23:41:24 +01:00
Martin Robertz 1a6e6b3c2c update 2024-02-18 10:54:02 +01:00
Jason Mitchell e5dfcc7942 No more restriction by player name (#44)
* Remove the ability to lock a bee to a specific person, and instead give them acknowledgement.

* Restrict to feb 29th - effectively not allowed unless you're a real chad :trollface: and still gives mentions to the people
2024-02-17 16:27:57 -08:00
Raven Szewczyk ea78ca8069 [ci skip] upgraded build system 2024-02-04 19:57:04 +00:00
2395 changed files with 3555 additions and 5764 deletions

No files matched your search

+1
View File
@@ -32,6 +32,7 @@
*.[dD][lL][lL] binary
*.[dD][yY][lL][iI][bB] binary
*.[pP][sS][dD] binary
*.[pP][dD][nN] binary
*.[tT][tT][fF] binary
*.[oO][tT][fF] binary
+17
View File
@@ -0,0 +1,17 @@
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
Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

+2 -1621
View File
File diff suppressed because it is too large. Load diff
+6 -6
View File
@@ -1,12 +1,12 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:ForestryMC:4.8.2:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.2.1:dev')
api('com.github.GTNewHorizons:ForestryMC:4.11.32:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.11.35:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.4-GTNH:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.118-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.63:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
}
+158 -39
View File
@@ -1,65 +1,135 @@
# 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 = Binnie Core
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
# Conventionally lowercase.
modId = BinnieCore
# Root package of the mod, used to find various classes in other properties,
# mcmod.info substitution, enabling assertions in run tasks, etc.
modGroup = binnie
# 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/
# Whether to use modGroup as the maven publishing group.
# When false, com.github.GTNewHorizons is used.
useModGroupForPublishing = false
# Will update your build.gradle automatically whenever an update is available
# Updates your build.gradle and settings.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 a MCP channel and mappings version for dependency deobfuscation and the deobfParams task.
# 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
# Define other MCP mappings for dependency deobfuscation
remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Defines other MCP mappings for dependency deobfuscation.
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
# 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.
developmentEnvironmentUserName = Developer
# Define a source file of your project with:
# 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 = binnie.core.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
# 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 = BinnieCore.java
gradleTokenModId =
gradleTokenModName =
gradleTokenVersion = GRADLETOKEN_VERSION
gradleTokenGroupName =
# version in @Mod([...], version = VERSION, [...]).
# Leave these properties empty to skip individual token replacements.
replaceGradleTokenInFile =
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# 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 =
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
# Example value: mymodid_at.cfg
# There can be multiple files in a space-separated list.
# Example value: mymodid_at.cfg nei_at.cfg
accessTransformersFile =
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
# Adds some debug arguments like verbose output and export
# 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. You may only place Mixins in this package or the build will fail!
# 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.
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
@@ -67,15 +137,38 @@ containsMixinsAndOrCoreModOnly = false
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
forceEnableMixins = false
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required.
# 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.
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
# Publishing to modrinth requires you to set the MODRINTH_TOKEN environment variable to your current modrinth API token.
# 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 on Modrinth.
# 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.
@@ -84,12 +177,11 @@ modrinthProjectId =
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
# 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 =
@@ -99,18 +191,45 @@ curseForgeProjectId =
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
curseForgeRelations =
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
# 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 = binnie-mods
# Optional parameter to prevent the source code from being published
# noPublishedSources =
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
# runClientWorkingDirectory = run/client
# Uncomment this to disable spotless checks
# 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
# 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
+12
View File
@@ -0,0 +1,12 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1df82b76031285ef2e6a4f59ffe9299d/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/c7d5be6a02945ac2e045048ee54a7d32/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/643f404f769811f5f265fd66f7af5d89/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/38256085a73e137cb4937ea9c4807fec/redirect
toolchainVersion=25
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+7 -8
View File
@@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015 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,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,7 @@ done
# 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 "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -112,7 +114,6 @@ 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.
@@ -170,7 +171,6 @@ 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" )
@@ -203,15 +203,14 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * 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.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
Vendored
+13 -12
View File
@@ -13,6 +13,8 @@
@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 ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
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.
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
goto fail
@@ -57,22 +59,21 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
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.
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
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%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
+2 -8
View File
@@ -6,6 +6,7 @@ pluginManagement {
name "GTNH Maven"
url "https://nexus.gtnewhorizons.com/repository/public/"
mavenContent {
includeGroup("com.gtnewhorizons")
includeGroupByRegex("com\\.gtnewhorizons\\..+")
}
}
@@ -16,12 +17,5 @@ pluginManagement {
}
plugins {
id 'com.diffplug.blowdryerSetup' version '1.7.1'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' // Provides java toolchains
}
blowdryerSetup {
repoSubfolder 'gtnhShared'
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
//devLocal '.' // Use this when testing config updates locally
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.27'
}
-4
View File
@@ -5,19 +5,15 @@ import java.util.List;
import binnie.core.ManagerBase;
import binnie.core.genetics.ManagerGenetics;
import binnie.core.item.ManagerItem;
import binnie.core.liquid.ManagerLiquid;
import binnie.core.machines.ManagerMachine;
import binnie.core.mod.config.ManagerConfig;
import binnie.core.resource.ManagerResource;
public final class Binnie {
public static List<ManagerBase> Managers = new ArrayList<>();
public static ManagerGenetics Genetics = new ManagerGenetics();
public static ManagerConfig Configuration = new ManagerConfig();
public static ManagerLiquid Liquid = new ManagerLiquid();
public static ManagerMachine Machine = new ManagerMachine();
public static ManagerItem Item = new ManagerItem();
public static ManagerResource Resource = new ManagerResource();
}
+155 -158
View File
@@ -6,6 +6,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.BonemealEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.world.BlockEvent;
@@ -39,6 +40,7 @@ import binnie.botany.network.PacketID;
import binnie.botany.proxy.Proxy;
import binnie.core.AbstractMod;
import binnie.core.BinnieCore;
import binnie.core.Tags;
import binnie.core.gui.IBinnieGUID;
import binnie.core.item.ItemMisc;
import binnie.core.network.BinniePacketHandler;
@@ -53,12 +55,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
@Mod(
modid = "Botany",
name = "Botany",
version = BinnieCore.VERSION,
useMetadata = true,
dependencies = "after:BinnieCore")
@Mod(modid = "Botany", name = "Botany", version = Tags.VERSION, useMetadata = true, dependencies = "after:BinnieCore")
public class Botany extends AbstractMod {
@Mod.Instance("Botany")
@@ -67,35 +64,41 @@ public class Botany extends AbstractMod {
@SidedProxy(clientSide = "binnie.botany.proxy.ProxyClient", serverSide = "binnie.botany.proxy.ProxyServer")
public static Proxy proxy;
// Genetics module
public static BlockFlower flower;
public static Item seed;
public static ItemFlower flowerItem;
public static Item pollen;
public static Item seed;
public static ItemDictionary database;
// Gardening module
public static BlockPlant plant;
public static ItemTrowel trowelWood;
public static ItemTrowel trowelStone;
public static ItemTrowel trowelIron;
public static ItemTrowel trowelDiamond;
public static ItemTrowel trowelGold;
public static BlockSoil soil;
public static BlockSoil loam;
public static BlockSoil flowerbed;
public static BlockSoil soilNoWeed;
public static BlockSoil loamNoWeed;
public static BlockSoil flowerbedNoWeed;
public static ItemInsulatedTube insulatedTube;
public static BlockCeramic ceramic;
public static BlockStained stained;
public static BlockCeramicPatterned ceramicTile;
public static BlockCeramicBrick ceramicBrick;
public static ItemSoilMeter soilMeter;
public static ItemInsulatedTube insulatedTube;
public static ItemTrowel trowelWood;
public static ItemTrowel trowelStone;
public static ItemTrowel trowelIron;
public static ItemTrowel trowelDiamond;
public static ItemTrowel trowelGold;
public static ItemMisc misc;
public static ItemFlower flowerItem;
public static ItemPigment pigment;
public static ItemClay clay;
public static BlockCeramic ceramic;
public static BlockCeramicPatterned ceramicTile;
public static BlockStained stained;
public static BlockCeramicBrick ceramicBrick;
public Botany() {
Botany.instance = this;
MinecraftForge.EVENT_BUS.register(new EventHandler());
}
@Mod.EventHandler
@@ -121,11 +124,6 @@ public class Botany extends AbstractMod {
return BotanyGUI.values();
}
@Override
public Class<?>[] getConfigs() {
return new Class[0];
}
@Override
public IPacketID[] getPacketIDs() {
return PacketID.values();
@@ -151,120 +149,6 @@ public class Botany extends AbstractMod {
return PacketHandler.class;
}
@SubscribeEvent
public void onShearFlower(PlayerInteractEvent event) {
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
return;
}
if (event.entityPlayer != null && event.entityPlayer.getHeldItem() != null
&& event.entityPlayer.getHeldItem().getItem() == Items.shears) {
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
if (tile instanceof TileEntityFlower) {
TileEntityFlower flower = (TileEntityFlower) tile;
flower.onShear();
event.entityPlayer.getHeldItem().damageItem(1, event.entityPlayer);
}
}
if (event.entityPlayer != null && event.entityPlayer.getHeldItem() != null
&& event.entityPlayer.getHeldItem().getItem() == Botany.pollen) {
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
if (tile instanceof TileEntityFlower) {
TileEntityFlower flower = (TileEntityFlower) tile;
IFlower pollen = BotanyCore.getFlowerRoot().getMember(event.entityPlayer.getHeldItem());
if (pollen != null && flower.canMateWith(pollen)) {
flower.mateWith(pollen);
if (!event.entityPlayer.capabilities.isCreativeMode) {
ItemStack heldItem = event.entityPlayer.getHeldItem();
heldItem.stackSize--;
}
}
}
}
}
@SubscribeEvent
public void onFertiliseSoil(PlayerInteractEvent event) {
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK || event.world == null) {
return;
}
if (event.entityPlayer == null || event.entityPlayer.getHeldItem() == null) {
return;
}
int y = event.y;
Block block = event.world.getBlock(event.x, y, event.z);
if (block == null || !Gardening.isSoil(block)) {
block = event.world.getBlock(event.x, --y, event.z);
}
if (block == null || !Gardening.isSoil(block)) {
return;
}
IBlockSoil soil = (IBlockSoil) block;
if (Gardening.isNutrientFertiliser(event.entityPlayer.getHeldItem())
&& soil.getType(event.world, event.x, y, event.z) != EnumSoilType.FLOWERBED) {
EnumSoilType type = soil.getType(event.world, event.x, y, event.z);
int next = Math.min(type.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
if (soil.fertilise(event.world, event.x, y, event.z, EnumSoilType.values()[next])
&& !event.entityPlayer.capabilities.isCreativeMode) {
ItemStack heldItem = event.entityPlayer.getHeldItem();
heldItem.stackSize--;
return;
}
}
if (Gardening.isAcidFertiliser(event.entityPlayer.getHeldItem())
&& soil.getPH(event.world, event.x, y, event.z) != EnumAcidity.ACID) {
EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
int next = Math.max(pH.ordinal() - Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 0);
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.values()[next])
&& !event.entityPlayer.capabilities.isCreativeMode) {
ItemStack heldItem2 = event.entityPlayer.getHeldItem();
heldItem2.stackSize--;
return;
}
}
if (Gardening.isAlkalineFertiliser(event.entityPlayer.getHeldItem())
&& soil.getPH(event.world, event.x, y, event.z) != EnumAcidity.ALKALINE) {
EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
int next = Math.min(pH.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.values()[next])
&& !event.entityPlayer.capabilities.isCreativeMode) {
ItemStack heldItem3 = event.entityPlayer.getHeldItem();
heldItem3.stackSize--;
return;
}
}
if (Gardening.isWeedkiller(event.entityPlayer.getHeldItem())
&& Gardening.addWeedKiller(event.world, event.x, y, event.z)
&& !event.entityPlayer.capabilities.isCreativeMode) {
ItemStack heldItem4 = event.entityPlayer.getHeldItem();
heldItem4.stackSize--;
}
}
@SubscribeEvent
public void plantVanilla(BlockEvent.PlaceEvent event) {
World world = event.world;
int x = event.x;
int y = event.y;
int z = event.z;
Block block = world.getBlock(x, y - 1, z);
if (!(block instanceof IBlockSoil)) {
return;
}
IFlower flower = BotanyCore.getFlowerRoot().getConversion(event.itemInHand);
if (flower != null) {
Gardening.plant(world, x, y, z, flower, event.player.getGameProfile());
}
}
@Deprecated
public void onPlantVanilla(PlayerInteractEvent event) {
if (!BinnieCore.proxy.isSimulating(event.world)
@@ -298,27 +182,6 @@ public class Botany extends AbstractMod {
}
}
@SubscribeEvent
public void onBonemeal(BonemealEvent event) {
Block block = event.world.getBlock(event.x, event.y, event.z);
if (Gardening.isSoil(block)) {
IBlockSoil soil = (IBlockSoil) block;
if (soil.fertilise(event.world, event.x, event.y, event.z, EnumSoilType.LOAM)) {
event.setResult(Event.Result.ALLOW);
}
}
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
if (tile instanceof TileEntityFlower && ((TileEntityFlower) tile).onBonemeal()) {
event.setResult(Event.Result.ALLOW);
}
}
@Override
public boolean isActive() {
return BinnieCore.isBotanyActive();
}
@Mod.EventHandler
public void onIMC(FMLInterModComms.IMCEvent event) {
for (FMLInterModComms.IMCMessage message : event.getMessages()) {
@@ -349,4 +212,138 @@ public class Botany extends AbstractMod {
super(Botany.instance);
}
}
public static class EventHandler {
@SubscribeEvent
public void onShearFlower(PlayerInteractEvent event) {
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
return;
}
if (event.entityPlayer != null && event.entityPlayer.getHeldItem() != null
&& event.entityPlayer.getHeldItem().getItem() == Items.shears) {
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
if (tile instanceof TileEntityFlower tileFlower) {
tileFlower.onShear();
event.entityPlayer.getHeldItem().damageItem(1, event.entityPlayer);
}
}
if (event.entityPlayer != null && event.entityPlayer.getHeldItem() != null
&& event.entityPlayer.getHeldItem().getItem() == Botany.pollen) {
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
if (tile instanceof TileEntityFlower tileFlower) {
IFlower pollen = BotanyCore.getFlowerRoot().getMember(event.entityPlayer.getHeldItem());
if (pollen != null && tileFlower.canMateWith(pollen)) {
tileFlower.mateWith(pollen);
if (!event.entityPlayer.capabilities.isCreativeMode) {
ItemStack heldItem = event.entityPlayer.getHeldItem();
heldItem.stackSize--;
}
}
}
}
}
@SubscribeEvent
public void onFertiliseSoil(PlayerInteractEvent event) {
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK || event.world == null) {
return;
}
if (event.entityPlayer == null || event.entityPlayer.getHeldItem() == null) {
return;
}
int y = event.y;
Block block = event.world.getBlock(event.x, y, event.z);
if (!Gardening.isSoil(block)) {
block = event.world.getBlock(event.x, --y, event.z);
}
if (!Gardening.isSoil(block)) {
return;
}
IBlockSoil soil = (IBlockSoil) block;
if (Gardening.isNutrientFertiliser(event.entityPlayer.getHeldItem())
&& soil.getType(event.world, event.x, y, event.z) != EnumSoilType.FLOWERBED) {
EnumSoilType type = soil.getType(event.world, event.x, y, event.z);
int next = Math
.min(type.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
if (soil.fertilise(event.world, event.x, y, event.z, EnumSoilType.VALUES[next])
&& !event.entityPlayer.capabilities.isCreativeMode) {
ItemStack heldItem = event.entityPlayer.getHeldItem();
heldItem.stackSize--;
return;
}
}
if (Gardening.isAcidFertiliser(event.entityPlayer.getHeldItem())
&& soil.getPH(event.world, event.x, y, event.z) != EnumAcidity.ACID) {
EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
int next = Math
.max(pH.ordinal() - Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 0);
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.VALUES[next])
&& !event.entityPlayer.capabilities.isCreativeMode) {
ItemStack heldItem2 = event.entityPlayer.getHeldItem();
heldItem2.stackSize--;
return;
}
}
if (Gardening.isAlkalineFertiliser(event.entityPlayer.getHeldItem())
&& soil.getPH(event.world, event.x, y, event.z) != EnumAcidity.ALKALINE) {
EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
int next = Math
.min(pH.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.VALUES[next])
&& !event.entityPlayer.capabilities.isCreativeMode) {
ItemStack heldItem3 = event.entityPlayer.getHeldItem();
heldItem3.stackSize--;
return;
}
}
if (Gardening.isWeedkiller(event.entityPlayer.getHeldItem())
&& Gardening.addWeedKiller(event.world, event.x, y, event.z)
&& !event.entityPlayer.capabilities.isCreativeMode) {
ItemStack heldItem4 = event.entityPlayer.getHeldItem();
heldItem4.stackSize--;
}
}
@SubscribeEvent
public void plantVanilla(BlockEvent.PlaceEvent event) {
World world = event.world;
int x = event.x;
int y = event.y;
int z = event.z;
Block block = world.getBlock(x, y - 1, z);
if (!(block instanceof IBlockSoil)) {
return;
}
IFlower flower = BotanyCore.getFlowerRoot().getConversion(event.itemInHand);
if (flower != null) {
Gardening.plant(world, x, y, z, flower, event.player.getGameProfile());
}
}
@SubscribeEvent
public void onBonemeal(BonemealEvent event) {
Block block = event.world.getBlock(event.x, event.y, event.z);
if (Gardening.isSoil(block)) {
IBlockSoil soil = (IBlockSoil) block;
if (soil.fertilise(event.world, event.x, event.y, event.z, EnumSoilType.LOAM)) {
event.setResult(Event.Result.ALLOW);
}
}
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
if (tile instanceof TileEntityFlower && ((TileEntityFlower) tile).onBonemeal()) {
event.setResult(Event.Result.ALLOW);
}
}
}
}
@@ -6,6 +6,11 @@ public enum EnumAcidity {
NEUTRAL,
ALKALINE;
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final EnumAcidity[] VALUES = values();
public String getID() {
return name().toLowerCase();
}
@@ -24,7 +24,11 @@ public enum EnumFlowerChromosome implements IChromosomeType {
SAPPINESS(IAlleleFloat.class),
STEM(IAlleleInteger.class);
private Class<? extends IAllele> cls;
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final EnumFlowerChromosome[] VALUES = values();
private final Class<? extends IAllele> cls;
EnumFlowerChromosome(Class<? extends IAllele> cls) {
this.cls = cls;
@@ -7,7 +7,7 @@ public enum EnumFlowerStage {
POLLEN("Pollen"),
NONE("NONE");
protected String name;
private final String name;
EnumFlowerStage(String name) {
this.name = name;
@@ -6,6 +6,11 @@ public enum EnumMoisture {
NORMAL,
DAMP;
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final EnumMoisture[] VALUES = values();
public String getID() {
return name().toLowerCase();
}
@@ -6,6 +6,11 @@ public enum EnumSoilType {
LOAM,
FLOWERBED;
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final EnumSoilType[] VALUES = values();
public String getID() {
return name().toLowerCase();
}
@@ -81,7 +81,7 @@ public class BlockCeramic extends Block implements IBlockMetadata {
}
@Override
public void addBlockTooltip(ItemStack stack, List tooltip) {
public void addBlockTooltip(ItemStack stack, List<String> tooltip) {
int meta = TileEntityMetadata.getItemDamage(stack);
tooltip.add(EnumChatFormatting.GRAY + EnumFlowerColor.get(meta).getName());
}
@@ -92,8 +92,8 @@ public class BlockCeramic extends Block implements IBlockMetadata {
}
@Override
public void getSubBlocks(Item item, CreativeTabs tabs, List itemList) {
for (EnumFlowerColor c : EnumFlowerColor.values()) {
public void getSubBlocks(Item item, CreativeTabs tabs, List<ItemStack> itemList) {
for (EnumFlowerColor c : EnumFlowerColor.VALUES) {
itemList.add(TileEntityMetadata.getItemStack(this, c.ordinal()));
}
}
@@ -90,7 +90,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
}
@Override
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
public void addBlockTooltip(ItemStack itemStack, List<String> tooltip) {
int meta = TileEntityMetadata.getItemDamage(itemStack);
getType(meta).addTooltip(tooltip);
}
@@ -101,13 +101,13 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
}
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List itemList) {
for (EnumFlowerColor c : EnumFlowerColor.values()) {
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> itemList) {
for (EnumFlowerColor c : EnumFlowerColor.VALUES) {
BlockType type = new BlockType(c, c, TileType.Tile);
itemList.add(TileEntityMetadata.getItemStack(this, type.ordinal()));
}
for (TileType type2 : TileType.values()) {
for (TileType type2 : TileType.VALUES) {
if (type2.canDouble()) {
itemList.add(new BlockType(EnumFlowerColor.BROWN, EnumFlowerColor.GOLD, type2).getStack(1));
}
@@ -130,13 +130,13 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
@Override
public IIcon getIcon(int side, int meta) {
return getType(meta).getIcon(MultipassBlockRenderer.getLayer());
return TileType.get(meta >>> 16 & 0xFF).icons[MultipassBlockRenderer.getLayer()];
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister register) {
for (TileType type : TileType.values()) {
for (TileType type : TileType.VALUES) {
for (int i = 0; i < 3; ++i) {
type.icons[i] = Botany.proxy.getIcon(register, "ceramic." + type.id + "." + i);
}
@@ -167,6 +167,9 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
@Override
@SideOnly(Side.CLIENT)
public int getRenderColor(int meta) {
if (!MultipassBlockRenderer.isRendering()) {
return EnumFlowerColor.get(meta & 0xFF).getColor(false);
}
return colorMultiplier(meta);
}
@@ -177,14 +180,14 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
@Override
public int colorMultiplier(int meta) {
BlockType type = getType(meta);
if (MultipassBlockRenderer.getLayer() == 0) {
int layer = MultipassBlockRenderer.getLayer();
if (layer == 0) {
return 0xffffff;
}
if (MultipassBlockRenderer.getLayer() == 1) {
return type.color1.getColor(false);
if (layer == 1) {
return EnumFlowerColor.get(meta & 0xFF).getColor(false);
}
return type.color2.getColor(false);
return EnumFlowerColor.get(meta >>> 8 & 0xFF).getColor(false);
}
@Override
@@ -205,9 +208,13 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
VerticalStripeBrick("verticalbrickstripe", "verticalStripedCeramicBricks"),
VerticalLargeBrick("verticalbricklarge", "largeVerticalCeramicBricks");
protected String id;
protected String name;
protected IIcon[] icons;
/**
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
*/
public static final TileType[] VALUES = values();
private final String id;
private final String name;
private final IIcon[] icons;
TileType(String id, String name) {
icons = new IIcon[3];
@@ -216,7 +223,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
}
public static TileType get(int id) {
return values()[id % values().length];
return VALUES[id % VALUES.length];
}
public boolean canDouble() {
@@ -224,32 +231,15 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
}
public ItemStack getRecipe(List<ItemStack> stacks) {
switch (this) {
case Tile:
return getTileRecipe(stacks);
case Split:
return getSplitRecipe(stacks);
case Chequered:
return getChequeredRecipe(stacks);
case Mixed:
return getMixedRecipe(stacks);
case LargeBrick:
return getLargeBrickRecipe(stacks);
case Brick:
case StripeBrick:
return getBrickRecipe(stacks);
case VerticalLargeBrick:
case VerticalBrick:
case VerticalStripeBrick:
return getVerticalBrickRecipe(stacks);
}
return null;
return switch (this) {
case Tile -> getTileRecipe(stacks);
case Split -> getSplitRecipe(stacks);
case Chequered -> getChequeredRecipe(stacks);
case Mixed -> getMixedRecipe(stacks);
case LargeBrick -> getLargeBrickRecipe(stacks);
case Brick, StripeBrick -> getBrickRecipe(stacks);
case VerticalLargeBrick, VerticalBrick, VerticalStripeBrick -> getVerticalBrickRecipe(stacks);
};
}
private ItemStack getTileRecipe(List<ItemStack> stacks) {
@@ -541,7 +531,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
return I18N.localise("botany." + type.name);
}
public void addTooltip(List tooltip) {
public void addTooltip(List<String> tooltip) {
String name = color1.getName();
if (type.canDouble() && color2 != color1) {
name = I18N.localise("botany.colour.double", name, color2.getName());
Loaded 100 of 2395 files, more files were not shown because too many files have changed in this diff. Show more