<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://forge.gemwire.uk/index.php?action=history&amp;feed=atom&amp;title=Access_Transformers%2F1.16</id>
	<title>Access Transformers/1.16 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://forge.gemwire.uk/index.php?action=history&amp;feed=atom&amp;title=Access_Transformers%2F1.16"/>
	<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Access_Transformers/1.16&amp;action=history"/>
	<updated>2026-05-01T17:23:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Access_Transformers/1.16&amp;diff=2745&amp;oldid=prev</id>
		<title>ShrimpBot: Copy Access Transformers to MC1.16 archive</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Access_Transformers/1.16&amp;diff=2745&amp;oldid=prev"/>
		<updated>2021-07-27T04:12:04Z</updated>

		<summary type="html">&lt;p&gt;Copy &lt;a href=&quot;/wiki/Access_Transformers&quot; title=&quot;Access Transformers&quot;&gt;Access Transformers&lt;/a&gt; to MC1.16 archive&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:12, 27 July 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l44&quot; &gt;Line 44:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 44:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Step 1: Uncomment the access transformer line in your build.gradle&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Step 1: Uncomment the access transformer line in your build.gradle&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Access-transformers-uncomment-this-line-in-build-gradle.png|600px|frameless&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;/1.16&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Access-transformers-uncomment-this-line-in-build-gradle.png&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/1.16&lt;/ins&gt;|600px|frameless]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Step 2: Create a new file called &amp;quot;accesstransformer.cfg&amp;quot; in the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;src/main/resources/META-INF/&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; folder.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Step 2: Create a new file called &amp;quot;accesstransformer.cfg&amp;quot; in the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;src/main/resources/META-INF/&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; folder.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ShrimpBot</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Access_Transformers/1.16&amp;diff=2680&amp;oldid=prev</id>
		<title>ShrimpBot: Copy Access Transformers to MC1.16 archive</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Access_Transformers/1.16&amp;diff=2680&amp;oldid=prev"/>
		<updated>2021-07-27T03:57:54Z</updated>

		<summary type="html">&lt;p&gt;Copy &lt;a href=&quot;/wiki/Access_Transformers&quot; title=&quot;Access Transformers&quot;&gt;Access Transformers&lt;/a&gt; to MC1.16 archive&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Under construction}}&lt;br /&gt;
&lt;br /&gt;
Access Transformers are Forge's native way of allowing you to access (read and write) functions that have a lower-than-ideal visibility, and/or removing finality.&lt;br /&gt;
&lt;br /&gt;
== Visibility ==&lt;br /&gt;
&lt;br /&gt;
Here's a quick rundown of the visibility options offered by Java 8:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;public&amp;lt;/code&amp;gt; visible to all classes inside and outside its package&lt;br /&gt;
* &amp;lt;code&amp;gt;protected&amp;lt;/code&amp;gt; visible only to classes inside the package and subclasses&lt;br /&gt;
* &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; visible only to classes inside the package&lt;br /&gt;
* &amp;lt;code&amp;gt;private&amp;lt;/code&amp;gt; visible only to inside the class&lt;br /&gt;
&lt;br /&gt;
Additionally, there are final variants of each of these, each represented by the phrase &amp;quot;-f&amp;quot; on the end of the access specifier.&lt;br /&gt;
&lt;br /&gt;
== How It Works ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code -&amp;gt;NewAccessSpecifier MemberSignature # comment&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A random example to understand the syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code -&amp;gt;public net.minecraft.util.palette.IResizeCallback # makes IResizeCallback public&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
This startup modification means accessing is O(1) for all accesses after this initial change, which makes it a great option for performance if you're looking at something a lot&lt;br /&gt;
&lt;br /&gt;
=== Removing Finality ===&lt;br /&gt;
Access transformers can also be used to remove the '''final''' keyword on code elements. To do this, append &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; to the access specifier.&lt;br /&gt;
&lt;br /&gt;
An example of this in place:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code -&amp;gt;public-f net.minecraft.util.palette.IResizeCallback # makes IResizeCallback public&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: You can also use this to ''add'' a final keyword via &amp;lt;code&amp;gt;+f&amp;lt;/code&amp;gt;. This is never recommended however, and should be avoided at all costs unless absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
== Using Access Transformers in your mod ==&lt;br /&gt;
&lt;br /&gt;
{{Tip/Important|You should avoid using ATs if a private variable / function you're looking at has a getter or a setter. Variables are usually private for a reason.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 1: Uncomment the access transformer line in your build.gradle&lt;br /&gt;
&lt;br /&gt;
[[File:Access-transformers-uncomment-this-line-in-build-gradle.png|600px|frameless/1.16]]&lt;br /&gt;
&lt;br /&gt;
Step 2: Create a new file called &amp;quot;accesstransformer.cfg&amp;quot; in the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;src/main/resources/META-INF/&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
Step 3: Refresh the Gradle project. This can be done natively in IDEA and Eclipse.&lt;br /&gt;
&lt;br /&gt;
== When not to use Access Transformers ==&lt;br /&gt;
* Unnecessary access transformations (e.g. using ATs to make something &amp;lt;code&amp;gt;public&amp;lt;/code&amp;gt; when it's already &amp;lt;code&amp;gt;public&amp;lt;/code&amp;gt;)&lt;/div&gt;</summary>
		<author><name>ShrimpBot</name></author>
	</entry>
</feed>