tutorial:mixin_redirectors_methods
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorial:mixin_redirectors_methods [2020/08/17 01:09] – case user11681 | tutorial:mixin_redirectors_methods [2021/01/15 04:20] (current) – Fix instance method example - removed "static" modifier & rename class obw | ||
|---|---|---|---|
| Line 17: | Line 17: | ||
| <code java [enable_line_numbers=true]> | <code java [enable_line_numbers=true]> | ||
| - | @Mixin(ItemStack.class) | + | @Mixin(SimpleInventory.class) |
| - | class ItemStackMixin | + | abstract |
| @Redirect(method = " | @Redirect(method = " | ||
| at = @At(value = " | at = @At(value = " | ||
| Line 35: | Line 35: | ||
| <code java [enable_line_numbers=true]> | <code java [enable_line_numbers=true]> | ||
| @Mixin(Entity.class) | @Mixin(Entity.class) | ||
| - | class ItemStackMixin | + | abstract |
| @Redirect(method = " | @Redirect(method = " | ||
| at = @At(value = " | at = @At(value = " | ||
| - | private | + | private ItemEntity replaceDroppedItem(Entity droppingEntity, |
| return droppingEntity.dropItem(item == Items.DIAMOND ? Items.AIR : item, yOffset); | return droppingEntity.dropItem(item == Items.DIAMOND ? Items.AIR : item, yOffset); | ||
| } | } | ||
| Line 52: | Line 52: | ||
| <code java [enable_line_numbers=true]> | <code java [enable_line_numbers=true]> | ||
| @Mixin(MinecraftClient.class) | @Mixin(MinecraftClient.class) | ||
| - | class MinecraftClientMixin { | + | abstract |
| @Redirect(method = " | @Redirect(method = " | ||
| at = @At(value = " | at = @At(value = " | ||
tutorial/mixin_redirectors_methods.1597626568.txt.gz · Last modified: 2020/08/17 01:09 by user11681