User Tools

Site Tools


tutorial:mixin_redirectors_methods

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revisionBoth sides next revision
tutorial:mixin_redirectors_methods [2020/08/17 00:58] – created user11681tutorial:mixin_redirectors_methods [2020/08/17 01:08] – case user11681
Line 1: Line 1:
-====== redirecting methods ======+====== Redirecting methods ======
  
 Method redirectors can use the following [[https://github.com/SpongePowered/Mixin/wiki/Injection-Point-Reference|injection point references]]: Method redirectors can use the following [[https://github.com/SpongePowered/Mixin/wiki/Injection-Point-Reference|injection point references]]:
 +
   * ''INVOKE''; and   * ''INVOKE''; and
   * ''INVOKE_STRING''.   * ''INVOKE_STRING''.
Line 14: Line 15:
  
 redirecting the ''ItemStack::fromTag(ListTag)'' call in ''SimpleInventory::readTags'' to return ''null'': redirecting the ''ItemStack::fromTag(ListTag)'' call in ''SimpleInventory::readTags'' to return ''null'':
 +
 <code java [enable_line_numbers=true]> <code java [enable_line_numbers=true]>
 @Mixin(ItemStack.class) @Mixin(ItemStack.class)
Line 30: Line 32:
  
 redirecting the ''Entity::dropItem(ItemConvertible, int)'' call in ''Entity::dropItem(ItemConvertible)'' to remove diamonds instead of dropping them by replacing them with air: redirecting the ''Entity::dropItem(ItemConvertible, int)'' call in ''Entity::dropItem(ItemConvertible)'' to remove diamonds instead of dropping them by replacing them with air:
 +
 <code java [enable_line_numbers=true]> <code java [enable_line_numbers=true]>
 @Mixin(Entity.class) @Mixin(Entity.class)
Line 46: Line 49:
  
 redirecting the ''Profiler::push'' invocation with ''"tick"'' passed to it in ''MinecraftClient::render'' in order to modify the ''location'' passed in the said invocation: redirecting the ''Profiler::push'' invocation with ''"tick"'' passed to it in ''MinecraftClient::render'' in order to modify the ''location'' passed in the said invocation:
 +
 <code java [enable_line_numbers=true]> <code java [enable_line_numbers=true]>
 @Mixin(MinecraftClient.class) @Mixin(MinecraftClient.class)
Line 59: Line 63:
 } }
 </code> </code>
 +
tutorial/mixin_redirectors_methods.txt · Last modified: 2021/01/15 04:20 by obw