IC2: Add converter for reactor components to get stored heat. #126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With coolant cells and other heat storing items, there is no uniform way in game to extract the heat stored in these items. To do so, would require parsing the NBT of the item stack, which is difficult enough as is, but would also require reading different NBT tags depending on the mod the item came from. To resolve this problem, this PR adds in a converter which will get the stored heat of any item implementing
IReactorComponent
.The way the PR works may be jank and not work with some components. There may exist cases where the stored heat and max heat of a component are dependent on the reactor context, which this converter does not provide when trying to get the stored heat.