User Tools

Site Tools


tutorial:accesswideners

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:accesswideners [2020/06/12 11:34] – Update to briefer version of access widener in build.gradle earthcomputertutorial:accesswideners [2020/06/22 14:13] – Clarify the circumstances where an access widener should and should not be used earthcomputer
Line 3: Line 3:
 Access wideners provide a way to loosen the access limits of classes, methods or fields. Access wideners are similar to the commonly known Access Transformers. Access wideners provide a way to loosen the access limits of classes, methods or fields. Access wideners are similar to the commonly known Access Transformers.
  
-Access wideners should only be used where mixin does not currently provide a means to do so.+Access wideners should **only** be used where mixin does not currently provide a means to do so
 +There are currently only 2 cases where mixins are not sufficient: 
 +  * Needing to access a private class, especially for the purpose of shadowing or accessing a field or method in a mixin. 
 +  * Being able to override final methods or subclass final classes.
  
 ===== Requirements ===== ===== Requirements =====
Line 11: Line 14:
 ===== File format ===== ===== File format =====
  
-A specific file format is used to define the access changes included in your mod. To aid IDE's you should use the `.accesswidenerfile extension.+A specific file format is used to define the access changes included in your mod. To aid IDE's you should use the ''.accesswidener'' file extension.
  
-The file must start with the following header, `namespaceshould match the mappings namespace of your mod's source code, this is usually `named` loom will remap the access widener file for you into `intermediaryalong with your mod.+The file must start with the following header, ''namespace'' should match the mappings namespace of your mod's source code, this is usually ''named''. Loom will remap the access widener file for you into ''intermediary'' along with your mod. If you use a custom ''RemapJarTask'', set ''remapAccessWidener'' property on it to ''true'' to ensure this happens.
  
 <code [enable_line_numbers="true"]> <code [enable_line_numbers="true"]>
tutorial/accesswideners.txt · Last modified: 2024/04/29 21:00 by ayutac