Line 18:
Line 18:
As Forge is loading, it scans the jar file for the META-INF/accesstransformers.cfg file. if it's found, it is parsed according to the specification:
As Forge is loading, it scans the jar file for the META-INF/accesstransformers.cfg file. if it's found, it is parsed according to the specification:
−
<code ->NewAccessSpecifier MemberSignature # comment</code>
+
<code ->NewAccessSpecifier ClassSignature MemberSignature # comment</code>
−
A random example to understand the syntax:
+
If you're targetting a class itself, you may omit the Member Signature.<br>
+
However, it is required if you're targetting a class or field inside the class.<br>
+
<code>MemberSignature</code>s use the Java specification for parts.<br>
+
Importantly, classes are in the form <code>Lpath/to/Class;</code>, method descriptors are <code>name(parameters)return</code> and <code>V</code> is void.<br>
+
+
A couple random examples to understand the syntax:
+
+
<code>
+
public net.minecraft.world.level.chunk.PaletteResize # makes the PaletteResize class public<br>
+
protected net.minecraft.client.gui.Gui f_168667_ # COLOR_WHITE<br>
+
public net.minecraft.client.renderer.GameRenderer m_109128_(Lnet/minecraft/resources/ResourceLocation;)V # loadEffect </code>
−
<code ->public net.minecraft.world.level.chunk.PaletteResize # makes PaletteResize public</code>
If a valid entry is found on a line, Forge will look into the bytecode of the file where that member is defined, and change its access to whatever you desire it to be.
If a valid entry is found on a line, Forge will look into the bytecode of the file where that member is defined, and change its access to whatever you desire it to be.