Compare commits

...
62 Commits
Author SHA1 Message Date
boubou19 50bed12f66 Cache enum .values() (#112) 2026-08-10 20:58:59 +02:00
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
2195 changed files with 2253 additions and 2266 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

+6 -6
View File
@@ -1,12 +1,12 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:ForestryMC:4.10.0:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.6.0: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.7.0-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")
}
+38 -6
View File
@@ -14,7 +14,7 @@ modId = BinnieCore
modGroup = binnie
# Whether to use modGroup as the maven publishing group.
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
# When false, com.github.GTNewHorizons is used.
useModGroupForPublishing = false
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
@@ -39,9 +39,33 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = true
# Enables 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.
@@ -96,7 +120,9 @@ 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!
@@ -151,7 +177,7 @@ 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.
@@ -172,6 +198,12 @@ curseForgeRelations =
# projects. New projects should not use this parameter.
customArchiveBaseName = binnie-mods
# 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.
+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.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+5 -9
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.
@@ -57,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/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/.
@@ -86,8 +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 -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || 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
@@ -115,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.
@@ -173,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" )
@@ -206,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
+1 -2
View File
@@ -70,11 +70,10 @@ 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
+1 -1
View File
@@ -17,5 +17,5 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
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();
}
+153 -145
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;
@@ -63,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
@@ -142,118 +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 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());
}
}
@Deprecated
public void onPlantVanilla(PlayerInteractEvent event) {
if (!BinnieCore.proxy.isSimulating(event.world)
@@ -287,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()) {
@@ -338,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,6 +24,10 @@ public enum EnumFlowerChromosome implements IChromosomeType {
SAPPINESS(IAlleleFloat.class),
STEM(IAlleleInteger.class);
/**
* 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) {
@@ -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();
}
@@ -93,7 +93,7 @@ public class BlockCeramic extends Block implements IBlockMetadata {
@Override
public void getSubBlocks(Item item, CreativeTabs tabs, List<ItemStack> itemList) {
for (EnumFlowerColor c : EnumFlowerColor.values()) {
for (EnumFlowerColor c : EnumFlowerColor.VALUES) {
itemList.add(TileEntityMetadata.getItemStack(this, c.ordinal()));
}
}
@@ -102,12 +102,12 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> itemList) {
for (EnumFlowerColor c : EnumFlowerColor.values()) {
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,6 +208,10 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
VerticalStripeBrick("verticalbrickstripe", "verticalStripedCeramicBricks"),
VerticalLargeBrick("verticalbricklarge", "largeVerticalCeramicBricks");
/**
* 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;
@@ -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() {
@@ -34,6 +34,7 @@ public class BlockStained extends Block implements IBlockMetadata {
public BlockStained() {
super(Material.glass);
setHardness(0.3f);
setCreativeTab(CreativeTabBotany.instance);
setBlockName("stained");
}
@@ -123,7 +124,7 @@ public class BlockStained extends Block implements IBlockMetadata {
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> itemList) {
for (EnumFlowerColor c : EnumFlowerColor.values()) {
for (EnumFlowerColor c : EnumFlowerColor.VALUES) {
itemList.add(TileEntityMetadata.getItemStack(this, c.ordinal()));
}
}
@@ -16,7 +16,7 @@ public class CeramicColor implements IDesignMaterial {
static {
CeramicColor.map = new LinkedHashMap<>();
for (EnumFlowerColor c : EnumFlowerColor.values()) {
for (EnumFlowerColor c : EnumFlowerColor.VALUES) {
CeramicColor.map.put(c, new CeramicColor(c));
}
}
Loaded 100 of 2195 files, more files were not shown because too many files have changed in this diff. Show more