tutorial:mixin_accessors
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:mixin_accessors [2020/08/28 08:14] – Fix minor error siglong | tutorial:mixin_accessors [2020/08/30 10:15] – Restore old revision siglong | ||
---|---|---|---|
Line 5: | Line 5: | ||
==== Accessor ==== | ==== Accessor ==== | ||
- | '' | + | '' |
- | === Get a value from a field === | + | === Getting |
<code java> | <code java> | ||
@Mixin(MinecraftClient.class) | @Mixin(MinecraftClient.class) | ||
Line 22: | Line 22: | ||
</ | </ | ||
- | === Set a value to a field === | + | === Setting |
<code java> | <code java> | ||
@Mixin(MinecraftClient.class) | @Mixin(MinecraftClient.class) | ||
Line 37: | Line 37: | ||
</ | </ | ||
- | ==== Provider | + | ==== Invoker |
- | '' | + | '' |
<code java> | <code java> | ||
@Mixin(EndermanEntity.class) | @Mixin(EndermanEntity.class) | ||
public interface EndermanEntityInvoker { | public interface EndermanEntityInvoker { | ||
- | @Provider | + | @Invoker(" |
- | public boolean | + | public boolean |
} | } | ||
</ | </ | ||
Line 52: | Line 52: | ||
<code java> | <code java> | ||
EndermanEntity enderman = ...; | EndermanEntity enderman = ...; | ||
- | ((EndermanEntityInvoker) enderman).teleportTo(0.0D, 70.0D, 0.0D); | + | ((EndermanEntityInvoker) enderman).invokeTeleportTo(0.0D, 70.0D, 0.0D); |
</ | </ | ||
tutorial/mixin_accessors.txt · Last modified: 2022/04/29 09:54 by solidblock