Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tags/faq/mixin.ytag
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Mixin is a trait/mixin and bytecode weaving framework for Java using ASM written

Mixin Wiki: <https://github.com/SpongePowered/Mixin/wiki>
Javadoc: <http://jenkins.liteloader.com/view/Other/job/Mixin/javadoc/index.html>
Fabric Wiki tutorial: <https://fabricmc.net/wiki/tutorial:mixin_introduction>
Cheatsheet: <https://github.com/2xsaiko/mixin-cheatsheet/blob/master/README.md>
MixinExtras Wiki: <https://github.com/LlamaLad7/MixinExtras/wiki/>

See also:
`!!mcdev` - An IntelliJ plugin which adds useful helpers and inspections for using mixin
`!!spongecord` - The Sponge Discord server, with official support for Mixin in the `#mixin` channel
<#807617700734042122> - The Fabric Discord support channel for Mixins, with a pinned introduction message
2 changes: 1 addition & 1 deletion tags/link/mixincs.ytag
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ type: text

---

Mixin Cheatsheet: https://github.com/2xsaiko/mixin-cheatsheet/blob/master/README.md
Mixin Cheatsheet (!! Severely Outdated !!): https://github.com/2xsaiko/mixin-cheatsheet/blob/master/README.md
7 changes: 4 additions & 3 deletions tags/snippet/accessor.ytag
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ io/github/mymod/mixin/MyClassAccess
```java
@Mixin(MyClass.class)
public interface MyClassAccess {
@Invoker void callAccess();
@Accessor int getMyField();
@Invoker void modid$callAccess();
@Accessor int modid$getMyField();
}
```
to use it
```java
public class Container {
public void slapHaykam(MyClass instance) {
((MyClassAccess)instance).callAccess();
((MyClassAccess)instance).modid$callAccess();
}
}
```
More information at <https://wiki.fabricmc.net/tutorial:mixin_accessors>
6 changes: 3 additions & 3 deletions tags/snippet/🦆.ytag
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ io/github/mymod/mixin/MyClassMixin
@Mixin(MyClass.class)
public class MyClassMixin implements MyClassAccess {
@Override
public void mymod$access() {
public void modid$access() {
System.out.println("Accessed!");
}
}
Expand All @@ -21,15 +21,15 @@ io/github/mymod/access/MyClassAccess
// The duck interface being implemented onto `MyClass`
public interface MyClassAccess {
// Make sure to prefix the method name with your mod id to prevent conflicts with other mods
void mymod$access();
void modid$access();
}
```

To use it:
```java
public class Container {
public void slapHaykam(MyClass instance) {
((MyClassAccess)instance).mymod$access(); // Will print "Accessed!"
((MyClassAccess)instance).modid$access(); // Will print "Accessed!"
}
}
```