-
Notifications
You must be signed in to change notification settings - Fork 9
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
ModDetectedDefault config annotation #26
Conversation
Tested with MouseTweaks with GT5U loaded. Default for WheelTweak is true, but tested if gregtech is loaded, it was false as expected. |
TODO:
|
.map(Config.DefaultFloat::value).orElse(boxed ? (Float) field.get(null) : field.getFloat(null)); | ||
if (field.isAnnotationPresent(Config.ModDetectedDefault.class)) { |
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.
This seems repeated amongst all of the cases - would be nice to turn it into a function/class helper that could be used in the chain above...
val newDefault = Optional.ofNullable(field.getAnnotation(Config.ModDetectedDefault.class)) | ||
.map(f -> { | ||
if (!f.coremod().isEmpty()) { | ||
try { |
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.
I'd think caching these in a fastutils 2Boolean would be a good idea
Warning: 2 uncommitted changes |
Co-authored-by: GitHub GTNH Actions <>
Closing for now, will probably be rewritten if its still needed |
No description provided.