|
* 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.
|
|
* feat(API): Implements a featured API for GT_Fluid
*** Rationale
The current implementation, which is based on the `GT_Fluid` object,
does not allow for the evolution of the functionalities, or the
variation of the fluid-related implementations in GregTech.
*** Objectives
This replacement API should free from these constraints, by providing :
1. The separation of responsibilities of the different tasks and steps:
- The definition and progressive construction of an `IGT_Fluid`,
- Registration of the `IGT_Fluid`,
- Configuration of related equipment, such as containers,
- Propagation of properties of an `IGT_Fluid` to related services
such as Materials
2. The separation of interfaces exposed to the API from their internal
implementations to allow:
- Evolve the implementations in the most transparent way possible
- To have internal GregTech implementations or outsourced
implementations coexist in its extensions.
*** Specificity of this new API
- Provides a new interface to build and interact with fluid related records
- Deprecates the old `api/objects/GT_Fluid` object and the
`common/GT_Proxy.addFluid` record methods
* fix(conversations): addresses @Glease review comments
https://github.com/GTNewHorizons/GT5-Unofficial/pull/1345#pullrequestreview-1096261703
* ./gradlew :spotlessApply
* fix(review): add review comments from @eigenraven
Added missing final qualifiers on methods parameters.
https://github.com/GTNewHorizons/GT5-Unofficial/pull/1345#pullrequestreview-1096318523
* fix(review) address remaining review comments from @eigenraven
|