Skip to content

Instantly share code, notes, and snippets.

View lukebemish's full-sized avatar

Luke Bemish lukebemish

View GitHub Profile

Luke's Big List of Gradle Do's and Don't's

Gradle has a lot of subtle assumptions or requirments it makes. Some of them are documented, but some are only implied through how gradle executes, and many are not obvious to someone unfamiliar with gradle. Here, I've made my best attempt to document some of these requirements/suggestions, provide some reasoning, and provide sources where they exist. In general, I've split stuff up into two categories: things that developers using gradle for their projects should know, and things that those authoring gradle plugins should know. Note that those authoring gradle plugins should also be aware of the first category.

Table of contents

@lukebemish
lukebemish / accessor_vs_at.md
Last active January 23, 2025 08:58
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