Skip to content

Instantly share code, notes, and snippets.

@TheGlitch76
Last active December 22, 2020 19:29
Show Gist options
  • Save TheGlitch76/5ae4773148aeba897ffc568940a9691a to your computer and use it in GitHub Desktop.
Save TheGlitch76/5ae4773148aeba897ffc568940a9691a to your computer and use it in GitHub Desktop.

Mixin style proposals

Mixin is a powerful bytecode manipluation tool, but despite Mumfrey's best attmepts to not let you shoot yourself in the foot, Mixin's defaults can cause all sorts of tiny, hard to catch problems to crop up in the kind of transformations common in Minecraft modding.

Ordinals

By default, Mixin has an ordinal of -1. This means that every instance of an @At injection point is matched.

Unless you are explicitly trying to target every instance, an ordinal must be provided.

If your ordinal is greater than 1 you must use a slice. The slice may have a higher ordinal than 1, but should use a point that is both as close to your injection point as possible and has the smallest ordinal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment