Skip to content

Conversation

@sh1ftchg
Copy link

@sh1ftchg sh1ftchg commented May 17, 2025

Issue Reference

Not Applicable.

Proposed Changes

  • fixed deprecated java constants file semantics
    • this should help with code clarity
    • prevent even reflective creation of an instance
    • ... is why this practice is adopted over private final constructors
    • the implementation should be reworked in other branches but this is only solving 1.20.1
  • fixed deprecated uses
    • gradle
    • unmaintained shadow jar plugin
    • jei reference to current 1.20.1 release

Additional Context

This isn't a big thing and only improves compatibility when Forge is the mod loader despite not being a forge specific change. Fabric and others have a more java-like dependency management and won't see any real postivies except compatibility and semantic.

@sh1ftchg
Copy link
Author

Ah it also becomes compatible with development on JDK24; but that's neither here nor there.
I tested it on java 17, 21, and 24.

@LLytho
Copy link
Member

LLytho commented May 18, 2025

Hey,

as long there are no breaking things we need to fix, we have no reason to update the 1.20.1 branch. The last update was an huge improvement for AU so we decided we would do another update here.

this should help with code clarity

How?

prevent even reflective creation of an instance

You don't want to write and structure your code by having "maybe someone will use reflection" in mind. If someone wants to get into your code, they will. Especially since we have the mixin framework. By using an interface someone can just implement it.

fixed deprecated java constants file semantics
... is why this practice is adopted over private final constructors

I would strictly go against this. An Interface is there to describe how a class would look like by describing the methods. There are even a lot of discussion about "interface constant antipattern".

jei reference to current 1.20.1 release

If there is no breaking change or a new feature we need or want to rely on. Then there is no reason to update it. By updating it we also will increase the require min version of JEI which might force others to also update when there is no reason for.

only improves compatibility when Forge is the mod loader

Why is that the case?

@rlnt
Copy link
Member

rlnt commented May 18, 2025

Unnecessary changes. Won't be merged.

Being able to develop on a newer JDK is also not helpful since the game needs to run on the supported Java version anyways. In the case of 1.20, this would be Java 17.

@rlnt rlnt closed this May 18, 2025
@sh1ftchg
Copy link
Author

Unnecessary changes. Won't be merged.

Being able to develop on a newer JDK is also not helpful since the game needs to run on the supported Java version anyways. In the case of 1.20, this would be Java 17.

All good. But by the way, it all works on JDK 24 - including the game. Runs even more smoothly for me with the new GC changes.

@sh1ftchg
Copy link
Author

sh1ftchg commented May 18, 2025

Hey,

as long there are no breaking things we need to fix, we have no reason to update the 1.20.1 branch. The last update was an huge improvement for AU so we decided we would do another update here.

this should help with code clarity

How?

Less unnecessary verbosity

prevent even reflective creation of an instance

You don't want to write and structure your code by having "maybe someone will use reflection" in mind. If someone wants to get into your code, they will. Especially since we have the mixin framework. By using an interface someone can just implement it.

Isn't that what the modding community is doing almost entirely? Some beginner level bytecode patching with massive reflection style morphs.

fixed deprecated java constants file semantics
... is why this practice is adopted over private final constructors

I would strictly go against this. An Interface is there to describe how a class would look like by describing the methods. There are even a lot of discussion about "interface constant antipattern".

It's actually called the constant interface pattern. The antipattern is using it when there's no need or related use cases and having things implement it. As I stated the use case here is to prevent reflective access. However I get it. To each their own - it's not my codebase.

jei reference to current 1.20.1 release

If there is no breaking change or a new feature we need or want to rely on. Then there is no reason to update it. By updating it we also will increase the require min version of JEI which might force others to also update when there is no reason for.

Agree. I put it here just in case someone else wants it - I hate doing rework - so if It solves issues for someone it's great, if not well at least no more rework for them.

only improves compatibility when Forge is the mod loader

Why is that the case?

Honestly I didn't look into the why and how. Just got the thing to build correctly and noticed about half my issues disappeared in the modpacks I use this on when I updated the JEI version AND this mod together; just changing JEI did nothing... I don't think this mod had any issues with it but JEI might have somewhere.

Edit: To clarify I only said half because there's some parts that this mod doesnt touch that I'd need to to fix the others /sigh.

Isn't the point of this entire mod to fix compatibility issues - such strange concerns? And yes, I tested with fabric and noticed absolutely no changes. It's the strangest thing and why I speculated it only impacted forge Forge. Don't want to send people looking into a rabbit hole that's not there. Maybe it did and my tests just didn't pick them up.

Honestly it was purely a convenience fix for my gaming experience - I don't care/need this implemented lol.

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