generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Item Attribute Modifiers and Other New APIs #8
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
(Merge and release when wiki is updated)
This update adds a new experimental item attribute modifiers datapack API, as well as a new temperature effect and some new APIs.
thermoo:sequence
temperature effectHeartOverlayRenderEvent
for rendering temperature overlays on the health barItem Attribute Modifiers
Item attribute modifiers have been ported from Frostiful. They allow datapacks to modify the default attributes of items easily. This is particularly useful for mod pack developers who want to add attributes to non-Thermoo based modded armors. It allows for attributes to be applied to items based on both tags and item IDs.
The major enhancement it makes over Frostiful is that these datapacks can be applied server side and, provided clients have Thermoo installed, will sync automatically so that they will actually appear on the tooltip in multiplayer. The previous system did not do this, and so often times the tooltip would not show modified attributes, which may have led to some confusion.
This feature is still experimental and could change or even be removed in future versions of Thermoo. A particular issue is that it could cause some lag issues when there are a lot of attribute modifiers defined by the datapack and a lot of item stacks are created at once. Furthermore, MC 1.20.5's changes to item stack NBT may make this almost entirely redundant or broken. Proceed with caution!
Here is an example item attribute modifier JSON file:
Temperature Unit API
This is a new java and command API that allows users to convert between temperature-points-per-tick values and ambient temperature values in normal temperature units (like Celsius, Fahrenheit, etc). By default, it converts based in Celsius and with 0 -1 temp/tick = 5C -14C, temp/tick = 15C - 24C, 1 temp/tick = 25C - 34C, etc. You can adjust how this works using the
settings
parameter. You can visualize how to convert Celsius to temperature per tick using this Desmos graph: https://www.desmos.com/calculator/z1tqbiol9l. In the red line, the x-axis is ambient temperature in Celsius, and the y-axis is temperature per tick. In the blue line, its the opposite: the x-axis is temperature per tick and the y-axis is ambient temperature in Celsius.Sequence Temperature Effect
Added a new meta temperature effect:
thermoo:sequence
.Config consists of a single field -
children
- which is a list of other temperature effects. Each temperature effect is applied in order.Heart Overlay Event
The new
HeartOverlayRenderEvent.AFTER_HEALTH_BAR
event is a new client-side-only event that is meant to unify the code for temperature overlays in Frostiful and Scorchful. This new event comes with support for Colorful Hearts and Overflowing Bars, but this may be moved to a separate mod in the future that focuses more on compatibility patches for Thermoo.Seasons integration API
A new API for providing better compatibility with Seasons mods like Fabric Seasons and Serene Seasons. Currently, only Fabric Seasons is supported, however this will be removed from Thermoo in the future and moved to a dedicated patches mod. You can access seasons through the
ThermooSeasons
class.