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 [2022/07/12 10:27] – external edit 127.0.0.1tutorial:accesswideners [2023/01/21 07:46] – [Access Changes] You must use both mutable and accessible to make a private field both mutable and accessible bluemeanial
Line 17: Line 17:
 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. 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''namespace'' should usually always be ''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.+The file must start with the following header''namespace'' should usually always be set to the word ''named'', and not your project namespace. 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"]>
Line 100: Line 100:
  
   * Fields have final removed   * Fields have final removed
 +
 +If you want to make a private final field both accessible //and// mutable, you need to use two directives, one for each change.
  
 ===== Specifying file location ===== ===== Specifying file location =====
  
-The access widener file location must be specified in your build.gradle and in your fabric.mod.json file. It should be stored in the resources as it needs to be included in the exported jar file.+The access widener file location must be specified in your build.gradle and in your fabric.mod.json file. It should be stored in the resources as it needs to be included in the exported jar file. (Replace "modid" in the example with your own mod ID.)
  
 Loom 0.9 or higher: Loom 0.9 or higher:
tutorial/accesswideners.txt · Last modified: 2024/06/09 05:33 by haykam