Common interface for working with .ras (reversible-access-setter) files.
The reversible access setter files are our knock-off version of fabric's (the minecraft mod loader ecosystem) AccessWidener format. However, as is typical here at stianloader, we took that system and thought to ourselves: Isn't AW a little bit useless? Like yeah sure, AW is neat, but ultimately everything AW can do, Mixin can do more safely.
So, what can Mixin not do? Yeah, getting rid of (or adding) ACC_SYNTHETIC, ACC_DEPRECATED, ACC_ENUM, or other at first completely unremarkable access flags. Well, AW can't do that either. But RAS can!
It might sound a little bit insane to remove synthetic, deprecated, or enum flags, but if you are modding a game there will eventually come a time where these things become useful.
The core feature of RAS is that it's reversible. While AW exclusively puts the focus on what the end result is, RAS puts attention on both the initial state and the target state. This allows to apply the transformations in "reverse". This is especially required as RAS puts emphasis on compile-time flags versus runtime access flags. For example, when extending an enum ACC_ENUM should be removed at compile-time to trick the compiler into treating the class like any other, thus negating the core restrictions put on enums. However, if the enum class were to be loaded without the ACC_ENUM flag at runtime, a bunch of stuff could blow up, namely Enum#valueOf.
Allowing the reversiblity of access flags has twofold advantages, though at the end they boil down to one: Instead of having a runtime and a compiletime jar, only a compiletime jar would be required. The compiletime transformations can be applied in reverse direction before applying the runtime transformations, thus allowing to infer the runtime access flags from the compiletime access flags. This reduces the strain put on the buildsystem. Further, it also means that no mental gymnastics must be made as IDEs can't differ between compiletime-only and runtime-only dependencies well.
This project is available on maven central using the following coordinates:
<dependency>
<groupId>de.geolykt.starloader</groupId>
<artifactId>reversible-access-setter</artifactId>
<version>1.1.0</version>
<scope>compile</scope>
</dependency
The reason that it's under the de.geolykt.starloader group is a historical footnote as RAS predates the stianloader org and relocating the artifact was deemed to be a bit more labour than really needed (especially since the only person developing here is me, Geolykt who owns both namespaces).