Skip to content
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

Closed
wants to merge 4 commits into from
Closed

Conversation

Caedis
Copy link
Member

@Caedis Caedis commented Jan 29, 2024

No description provided.

@Caedis Caedis requested review from mitchej123 and a team January 29, 2024 03:07
@Caedis
Copy link
Member Author

Caedis commented Jan 29, 2024

Tested with MouseTweaks with GT5U loaded. Default for WheelTweak is true, but tested if gregtech is loaded, it was false as expected.

@Caedis
Copy link
Member Author

Caedis commented Feb 1, 2024

TODO:

  • Cache the output for classes and mod load status

.map(Config.DefaultFloat::value).orElse(boxed ? (Float) field.get(null) : field.getFloat(null));
if (field.isAnnotationPresent(Config.ModDetectedDefault.class)) {
Copy link
Contributor

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 {
Copy link
Contributor

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

Copy link
Contributor

Warning: 2 uncommitted changes
#39

Co-authored-by: GitHub GTNH Actions <>
@Caedis Caedis marked this pull request as draft April 11, 2024 19:30
@Caedis
Copy link
Member Author

Caedis commented Sep 1, 2024

Closing for now, will probably be rewritten if its still needed

@Caedis Caedis closed this Sep 1, 2024
@Caedis Caedis deleted the feat/annotations branch September 1, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants