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
1.20.x ForgeConfigSpec revisit #9814
base: 1.20.x
Are you sure you want to change the base?
1.20.x ForgeConfigSpec revisit #9814
Conversation
a72de36
to
d198eda
Compare
@SrRapero720, this pull request has conflicts, please resolve them for this PR to move forward. |
What is the use of FloatValue vs DoubleValue? |
5db53bd
to
1bec9d6
Compare
cast value always works even if cache is disabled, to notify primitive values for a value update ConfigValue should clean cache; then primitive cast can update again value.
i decide to stop from where i was. SUMARY
|
my first intention was add support of |
i will add some extra changes, but not hard breaking |
cb455e6
to
2d5ba40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's too many vaguely related features in this one big PR. Please split it up into smaller PRs.
As for getting ordinal on EnumValue directly for render methods, this isn't recommended for performance reasons. You should instead read the enum ordinal from the config once and store it in a static final. You can use the deferred holder class idiom to achieve this in a way that only reads the value on first use:
record MyEnumThing() {
static final int ORDINAL = ENUM.get().ordinal();
}
static int getEnumThingOrdinal() {
return MyEnumThing.ORDINAL;
}
This allows the JIT to properly inline the value from the start.
Labelled as a breaking change because this PR promotes a userdev-only error to also happen in production |
marked as draft until i have time to address everything |
@SrRapero720, this pull request has conflicts, please resolve them for this PR to move forward. |
thats a collection of changes for ForgeConfigSpec, just to enhance it with some additions