User Tools

Site Tools


tutorial:accesswidening

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
tutorial:accesswidening [2025/12/05 16:37] cassiancctutorial:accesswidening [2026/01/09 15:07] (current) – Make accessor mentions link to accessor mixins page gauntrecluse
Line 3: Line 3:
 Access widening provides a way to loosen the access limits of classes, methods or fields. This includes making them public, or making them extendable (subclassable). Access widening provides a way to loosen the access limits of classes, methods or fields. This includes making them public, or making them extendable (subclassable).
  
-Access widening may be used instead of accessor mixins, and there are currently 2 cases where the functionality provided by mixin is not sufficient:+Access widening may be used instead of [[tutorial:mixin_accessors|accessor mixins]], and there are currently 2 cases where the functionality provided by mixin is not sufficient:
   * Needing to access a (package) private class, especially for the purpose of shadowing or accessing a field or method in a mixin.   * Needing to access a (package) 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.   * Being able to override final methods or subclass final classes.
Line 12: Line 12:
 As with other types of class tweaking, in order for access widening changes to show up in the decompiled source, run the ''genSources'' gradle task and then reload the gradle project in your IDE. As with other types of class tweaking, in order for access widening changes to show up in the decompiled source, run the ''genSources'' gradle task and then reload the gradle project in your IDE.
  
-Note: Unlike accessor mixins, class tweaking only works on Minecraft code, and not on other mods.+Note: Unlike [[tutorial:mixin_accessors|accessor mixins]], class tweaking only works on Minecraft code, and not on other mods.
  
 ===== File format ===== ===== File format =====
tutorial/accesswidening.txt · Last modified: 2026/01/09 15:07 by gauntrecluse