diff options
author | Léa Gris <lea.gris@noiraude.net> | 2022-10-01 11:01:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-01 11:01:53 +0200 |
commit | 51a41123b0ccdf10cb7b311f8d87d250f78d1b89 (patch) | |
tree | 92b545c7768232ee09c89e39281aebff30c470f2 /src/main/java/gregtech/api/interfaces/tileentity/IUpgradableMachine.java | |
parent | ad7f7b95550d8a27cc5cddc8c419898d8d836713 (diff) | |
download | GT5-Unofficial-51a41123b0ccdf10cb7b311f8d87d250f78d1b89.tar.gz GT5-Unofficial-51a41123b0ccdf10cb7b311f8d87d250f78d1b89.tar.bz2 GT5-Unofficial-51a41123b0ccdf10cb7b311f8d87d250f78d1b89.zip |
refactor(fluid_api): fluent interface (#1407)
* refactor(fluid_api): fluent interface
Improves the initial construction model into a fluent interface.
See: https://java-design-patterns.com/patterns/fluentinterface/
This change provides the built and saved states of a GT_Fluid,
with their own interface, so that: object state validations are
performed at build time, rather than causing an `IllegalStateException`
to be thrown at runtime, with the previous implementation.
This also allows the IDE to display and check the applicable methods
for the GT_Fluid object's state, as it moves through the call chain.
* hotfix off-by-one in FluidState.fromValue
* minor: deduplicate buildAndRegister action
* fix(withIconsFrom): needs dependency management
Cracked fluid Icons were copied too early from non-cracked fluid
within the `IGT_FluidBuilder`'s implementation.
At this stage, the source Fluid has not registered its own icons yet,
so the Cracked fluid got null Icons (fallback to Error checkerboard).
This commit delegates the copy of the source fluid's Icons, to the
`run` Icons texture's registration task; ensuring the source Fluid
runs its own Icons textures registration before copying them,
as a light-weight dependency management.
Diffstat (limited to 'src/main/java/gregtech/api/interfaces/tileentity/IUpgradableMachine.java')
0 files changed, 0 insertions, 0 deletions