Skip to content

Instantly share code, notes, and snippets.

View lukebemish's full-sized avatar

Luke Bemish lukebemish

View GitHub Profile
@lukebemish
lukebemish / accessor_vs_at.md
Last active January 2, 2024 20:09
Accessor/Invoke mixins vs AWs/ATs - Which to pick and which is safer?

Accessor/Invoke mixins vs AWs/ATs - Which to pick?

You have realized, for some reason or another, that you need access to something in the vanilla code base that has a big old "private", "final", "protected", or simply conspicuous lack of "public" on it. This generally speaking isn't great, but modding frameworks (Fabric/Quilt and [Neo]Forge) provide several ways to get at private values - there are a special sort of mixin, known as "accessors", which are generally speaking safer than normal mixins and can "access" otherwise private stuff (plus doing a few more things... I'll get to that), and then there are access wideners (fabric/quilt) and access transformers ([neo]forge), which are basically a big file you list things you want transformed in; forgegradle or loom them transforms the things the way you want in your development environment and at runtime. This short gist is written as a primer on the different options, the differences between them, which you should use when, and how to be as certain as