<?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=Tinted_Textures</id>
	<title>Tinted Textures - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://forge.gemwire.uk/index.php?action=history&amp;feed=atom&amp;title=Tinted_Textures"/>
	<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Tinted_Textures&amp;action=history"/>
	<updated>2026-05-01T18:30:07Z</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=Tinted_Textures&amp;diff=2979&amp;oldid=prev</id>
		<title>Paint Ninja: Add Groovy language code examples</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Tinted_Textures&amp;diff=2979&amp;oldid=prev"/>
		<updated>2021-11-17T16:56:43Z</updated>

		<summary type="html">&lt;p&gt;Add Groovy language code examples&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 16:56, 17 November 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-l8&quot; &gt;Line 8:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&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;=== Creating Color Handlers ===&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;=== Creating Color Handlers ===&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;div&gt;&amp;lt;code&amp;gt;BlockColor&amp;lt;/code&amp;gt;s need to be registered to the &amp;lt;code&amp;gt;BlockColors&amp;lt;/code&amp;gt; instance of the game. &amp;lt;code&amp;gt;BlockColors&amp;lt;/code&amp;gt; can be acquired through &amp;lt;code&amp;gt;ColorHandlerEvent$Block&amp;lt;/code&amp;gt;, and an &amp;lt;code&amp;gt;BlockColor&amp;lt;/code&amp;gt; can be registered by &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockColors#register&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Note that this does not cause the &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt; for the given block to be colored. &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt; are items and need to colored with an &amp;lt;code&amp;gt;ItemColor&amp;lt;/code&amp;gt;.&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;&amp;lt;code&amp;gt;BlockColor&amp;lt;/code&amp;gt;s need to be registered to the &amp;lt;code&amp;gt;BlockColors&amp;lt;/code&amp;gt; instance of the game. &amp;lt;code&amp;gt;BlockColors&amp;lt;/code&amp;gt; can be acquired through &amp;lt;code&amp;gt;ColorHandlerEvent$Block&amp;lt;/code&amp;gt;, and an &amp;lt;code&amp;gt;BlockColor&amp;lt;/code&amp;gt; can be registered by &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockColors#register&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Note that this does not cause the &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt; for the given block to be colored. &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt; are items and need to colored with an &amp;lt;code&amp;gt;ItemColor&amp;lt;/code&amp;gt;.&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;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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;syntaxhighlight lang&lt;/del&gt;=&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;java&amp;quot;&amp;gt;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{Template:Tabs/Code_Snippets&lt;/ins&gt;&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;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;public void registerBlockColors(ColorHandlerEvent.Block event){&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;|java&lt;/ins&gt;=public void registerBlockColors(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;final &lt;/ins&gt;ColorHandlerEvent.Block event) {&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;div&gt;     event.getBlockColors().register(myBlockColor, coloredBlock1, coloredBlock2, ...);&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;     event.getBlockColors().register(myBlockColor, coloredBlock1, coloredBlock2, ...);&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;div&gt;}&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;}&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;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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;|groovy=void registerBlockColors(final ColorHandlerEvent.Block event) {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;    event.blockColors.register(myBlockColor, coloredBlock1, coloredBlock2, ...);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;|}}&lt;/ins&gt;&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;div&gt;&amp;lt;code&amp;gt;ItemColor&amp;lt;/code&amp;gt;s need to be registered to the &amp;lt;code&amp;gt;ItemColors&amp;lt;/code&amp;gt; instance of the game. &amp;lt;code&amp;gt;ItemColors&amp;lt;/code&amp;gt; can be acquired through &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ColorHandlerEvent$Item&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, and an &amp;lt;code&amp;gt;ItemColor&amp;lt;/code&amp;gt; can be registered by &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ItemColors#register&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. This method is overloaded to also take &amp;lt;code&amp;gt;Block&amp;lt;/code&amp;gt;s, which simply registers the color handler for the item &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block#asItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (i.e. the block’s &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt;).&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;&amp;lt;code&amp;gt;ItemColor&amp;lt;/code&amp;gt;s need to be registered to the &amp;lt;code&amp;gt;ItemColors&amp;lt;/code&amp;gt; instance of the game. &amp;lt;code&amp;gt;ItemColors&amp;lt;/code&amp;gt; can be acquired through &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ColorHandlerEvent$Item&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, and an &amp;lt;code&amp;gt;ItemColor&amp;lt;/code&amp;gt; can be registered by &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ItemColors#register&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. This method is overloaded to also take &amp;lt;code&amp;gt;Block&amp;lt;/code&amp;gt;s, which simply registers the color handler for the item &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block#asItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (i.e. the block’s &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt;).&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;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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;syntaxhighlight lang&lt;/del&gt;=&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;java&amp;quot;&amp;gt;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{Template:Tabs/Code_Snippets&lt;/ins&gt;&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;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;public void registerItemColors(ColorHandlerEvent.Item event){&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;|java&lt;/ins&gt;=public void registerItemColors(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;final &lt;/ins&gt;ColorHandlerEvent.Item event) {&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;div&gt;     event.getItemColors().register(myItemColor, coloredItem1, coloredItem2, ...);&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;     event.getItemColors().register(myItemColor, coloredItem1, coloredItem2, ...);&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;div&gt;}&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;}&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;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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;|groovy=void registerBlockColors(final ColorHandlerEvent.Item event) {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;    event.itemColors.register(myItemColor, coloredItem1, coloredItem2, ...);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;|}}&lt;/ins&gt;&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;div&gt;This registration must be done client-side, in the initialization phase.&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;This registration must be done client-side, in the initialization phase.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Paint Ninja</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Tinted_Textures&amp;diff=2861&amp;oldid=prev</id>
		<title>ChampionAsh5357: Update to 1.17</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Tinted_Textures&amp;diff=2861&amp;oldid=prev"/>
		<updated>2021-08-02T17:51:25Z</updated>

		<summary type="html">&lt;p&gt;Update to 1.17&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 17:51, 2 August 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-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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;Many blocks and items in vanilla change their texture color depending on where they are, such as grass. Models support specifying “tint indices” on faces, which are integers that can then be handled by &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IBlockColor&lt;/del&gt;&amp;lt;/code&amp;gt;s and &amp;lt;code&amp;gt;IItemColor&amp;lt;/code&amp;gt;s. See the wiki for information on how tint indices are defined in vanilla models.&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;Many blocks and items in vanilla change their texture color depending on where they are, such as grass. Models support specifying “tint indices” on faces, which are integers that can then be handled by &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;BlockColor&lt;/ins&gt;&amp;lt;/code&amp;gt;s and &amp;lt;code&amp;gt;IItemColor&amp;lt;/code&amp;gt;s. See the wiki for information on how tint indices are defined in vanilla models.&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;=== &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IBlockColor &lt;/del&gt;/ &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IItemColor &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;=== &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;BlockColor &lt;/ins&gt;/ &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ItemColor &lt;/ins&gt;===&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;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;Both of these are single-method interfaces. &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IBlockColor&lt;/del&gt;&amp;lt;/code&amp;gt; takes &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;an &lt;/del&gt;&amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IBlockState&lt;/del&gt;&amp;lt;/code&amp;gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;an &lt;/del&gt;(&amp;lt;code&amp;gt;nullable&amp;lt;/code&amp;gt;) &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IBlockDisplayReader&lt;/del&gt;&amp;lt;/code&amp;gt;, and a (&amp;lt;code&amp;gt;nullable&amp;lt;/code&amp;gt;) &amp;lt;code&amp;gt;BlockPos&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IItemColor&lt;/del&gt;&amp;lt;/code&amp;gt; takes an &amp;lt;code&amp;gt;ItemStack&amp;lt;/code&amp;gt;. Both of them take a parameter &amp;lt;code&amp;gt;tintIndex&amp;lt;/code&amp;gt;, which is the tint index of the face being colored. Both of them return an &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;, a color multiplier. This int is treated as four unsigned bytes, alpha, red, green, and blue, in that order, from most significant byte to least. For each pixel in the tinted face, the value of each color channel is &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;(int)((float)base * multiplier / 255)&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt; is the original value for the channel, and &amp;lt;code&amp;gt;multiplier&amp;lt;/code&amp;gt; is the associated byte from the color multiplier. Note that blocks do not use the alpha channel. For example, the grass texture, untinted, looks white and gray. The &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IBlockColor&lt;/del&gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IItemColor&lt;/del&gt;&amp;lt;/code&amp;gt; for grass return color multipliers with low red and blue components, but high alpha and green components, (at least in warm biomes) so when the multiplication is performed, the green is brought out and the red/blue diminished.&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;Both of these are single-method interfaces. &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;BlockColor&lt;/ins&gt;&amp;lt;/code&amp;gt; takes &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;a &lt;/ins&gt;&amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;BlockState&lt;/ins&gt;&amp;lt;/code&amp;gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;a &lt;/ins&gt;(&amp;lt;code&amp;gt;nullable&amp;lt;/code&amp;gt;) &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;BlockAndTintGetter&lt;/ins&gt;&amp;lt;/code&amp;gt;, and a (&amp;lt;code&amp;gt;nullable&amp;lt;/code&amp;gt;) &amp;lt;code&amp;gt;BlockPos&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ItemColor&lt;/ins&gt;&amp;lt;/code&amp;gt; takes an &amp;lt;code&amp;gt;ItemStack&amp;lt;/code&amp;gt;. Both of them take a parameter &amp;lt;code&amp;gt;tintIndex&amp;lt;/code&amp;gt;, which is the tint index of the face being colored. Both of them return an &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;, a color multiplier. This int is treated as four unsigned bytes, alpha, red, green, and blue, in that order, from most significant byte to least. For each pixel in the tinted face, the value of each color channel is &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;(int)((float)base * multiplier / 255)&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt; is the original value for the channel, and &amp;lt;code&amp;gt;multiplier&amp;lt;/code&amp;gt; is the associated byte from the color multiplier. Note that blocks do not use the alpha channel. For example, the grass texture, untinted, looks white and gray. The &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;BlockColor&lt;/ins&gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ItemColor&lt;/ins&gt;&amp;lt;/code&amp;gt; for grass return color multipliers with low red and blue components, but high alpha and green components, (at least in warm biomes) so when the multiplication is performed, the green is brought out and the red/blue diminished.&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;If an item inherits from the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;builtin/generated&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; model, each layer (“layer0”, “layer1”, etc.) has a tint index corresponding to its layer index. For blocks, the “particle” layer is index 0.&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;If an item inherits from the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;builtin/generated&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; model, each layer (“layer0”, “layer1”, etc.) has a tint index corresponding to its layer index. For blocks, the “particle” layer is index 0.&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;=== Creating Color Handlers ===&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;=== Creating Color Handlers ===&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;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;&amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IBlockColor&lt;/del&gt;&amp;lt;/code&amp;gt;s need to be registered to the &amp;lt;code&amp;gt;BlockColors&amp;lt;/code&amp;gt; instance of the game. &amp;lt;code&amp;gt;BlockColors&amp;lt;/code&amp;gt; can be acquired through &amp;lt;code&amp;gt;ColorHandlerEvent$Block&amp;lt;/code&amp;gt;, and an &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IBlockColor&lt;/del&gt;&amp;lt;/code&amp;gt; can be registered by &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockColors#register&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Note that this does not cause the &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt; for the given block to be colored. &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt; are items and need to colored with an &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IItemColor&lt;/del&gt;&amp;lt;/code&amp;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;&amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;BlockColor&lt;/ins&gt;&amp;lt;/code&amp;gt;s need to be registered to the &amp;lt;code&amp;gt;BlockColors&amp;lt;/code&amp;gt; instance of the game. &amp;lt;code&amp;gt;BlockColors&amp;lt;/code&amp;gt; can be acquired through &amp;lt;code&amp;gt;ColorHandlerEvent$Block&amp;lt;/code&amp;gt;, and an &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;BlockColor&lt;/ins&gt;&amp;lt;/code&amp;gt; can be registered by &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockColors#register&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Note that this does not cause the &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt; for the given block to be colored. &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt; are items and need to colored with an &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ItemColor&lt;/ins&gt;&amp;lt;/code&amp;gt;.&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;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&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;&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&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;div&gt;public void registerBlockColors(ColorHandlerEvent.Block event){&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;public void registerBlockColors(ColorHandlerEvent.Block event){&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;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;     event.getBlockColors().register(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;myIBlockColor&lt;/del&gt;, coloredBlock1, coloredBlock2, ...);&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;     event.getBlockColors().register(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;myBlockColor&lt;/ins&gt;, coloredBlock1, coloredBlock2, ...);&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;div&gt;}&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;}&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;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&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;&amp;lt;/syntaxhighlight&amp;gt;&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;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;&amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IItemColor&lt;/del&gt;&amp;lt;/code&amp;gt;s need to be registered to the &amp;lt;code&amp;gt;ItemColors&amp;lt;/code&amp;gt; instance of the game. &amp;lt;code&amp;gt;ItemColors&amp;lt;/code&amp;gt; can be acquired through &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ColorHandlerEvent$Item&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;()&lt;/del&gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, and an &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IItemColor&lt;/del&gt;&amp;lt;/code&amp;gt; can be registered by &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ItemColors#register&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. This method is overloaded to also take &amp;lt;code&amp;gt;Block&amp;lt;/code&amp;gt;s, which simply registers the color handler for the item &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block#asItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (i.e. the block’s &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;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;&amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ItemColor&lt;/ins&gt;&amp;lt;/code&amp;gt;s need to be registered to the &amp;lt;code&amp;gt;ItemColors&amp;lt;/code&amp;gt; instance of the game. &amp;lt;code&amp;gt;ItemColors&amp;lt;/code&amp;gt; can be acquired through &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ColorHandlerEvent$Item&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, and an &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ItemColor&lt;/ins&gt;&amp;lt;/code&amp;gt; can be registered by &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ItemColors#register&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. This method is overloaded to also take &amp;lt;code&amp;gt;Block&amp;lt;/code&amp;gt;s, which simply registers the color handler for the item &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block#asItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (i.e. the block’s &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt;).&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;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&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;&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&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;div&gt;public void registerItemColors(ColorHandlerEvent.Item event){&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;public void registerItemColors(ColorHandlerEvent.Item event){&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;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;     event.getItemColors().register(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;myIItemColor&lt;/del&gt;, coloredItem1, coloredItem2, ...);&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;     event.getItemColors().register(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;myItemColor&lt;/ins&gt;, coloredItem1, coloredItem2, ...);&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;div&gt;}&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;}&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;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&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;&amp;lt;/syntaxhighlight&amp;gt;&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;div&gt;This registration must be done client-side, in the initialization phase.&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;This registration must be done client-side, in the initialization phase.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ChampionAsh5357</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Tinted_Textures&amp;diff=2656&amp;oldid=prev</id>
		<title>Ferri Arnus: /* IBlockColor / IItemColor */</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Tinted_Textures&amp;diff=2656&amp;oldid=prev"/>
		<updated>2021-06-29T22:23:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;IBlockColor / IItemColor&lt;/span&gt;&lt;/span&gt;&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 22:23, 29 June 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-l4&quot; &gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&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;Both of these are single-method interfaces. &amp;lt;code&amp;gt;IBlockColor&amp;lt;/code&amp;gt; takes an &amp;lt;code&amp;gt;IBlockState&amp;lt;/code&amp;gt;, an (&amp;lt;code&amp;gt;nullable&amp;lt;/code&amp;gt;) &amp;lt;code&amp;gt;IBlockDisplayReader&amp;lt;/code&amp;gt;, and a (&amp;lt;code&amp;gt;nullable&amp;lt;/code&amp;gt;) &amp;lt;code&amp;gt;BlockPos&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;IItemColor&amp;lt;/code&amp;gt; takes an &amp;lt;code&amp;gt;ItemStack&amp;lt;/code&amp;gt;. Both of them take a parameter &amp;lt;code&amp;gt;tintIndex&amp;lt;/code&amp;gt;, which is the tint index of the face being colored. Both of them return an &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;, a color multiplier. This int is treated as four unsigned bytes, alpha, red, green, and blue, in that order, from most significant byte to least. For each pixel in the tinted face, the value of each color channel is &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;(int)((float)base * multiplier / 255)&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt; is the original value for the channel, and &amp;lt;code&amp;gt;multiplier&amp;lt;/code&amp;gt; is the associated byte from the color multiplier. Note that blocks do not use the alpha channel. For example, the grass texture, untinted, looks white and gray. The &amp;lt;code&amp;gt;IBlockColor&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;IItemColor&amp;lt;/code&amp;gt; for grass return color multipliers with low red and blue components, but high alpha and green components, (at least in warm biomes) so when the multiplication is performed, the green is brought out and the red/blue diminished.&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;Both of these are single-method interfaces. &amp;lt;code&amp;gt;IBlockColor&amp;lt;/code&amp;gt; takes an &amp;lt;code&amp;gt;IBlockState&amp;lt;/code&amp;gt;, an (&amp;lt;code&amp;gt;nullable&amp;lt;/code&amp;gt;) &amp;lt;code&amp;gt;IBlockDisplayReader&amp;lt;/code&amp;gt;, and a (&amp;lt;code&amp;gt;nullable&amp;lt;/code&amp;gt;) &amp;lt;code&amp;gt;BlockPos&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;IItemColor&amp;lt;/code&amp;gt; takes an &amp;lt;code&amp;gt;ItemStack&amp;lt;/code&amp;gt;. Both of them take a parameter &amp;lt;code&amp;gt;tintIndex&amp;lt;/code&amp;gt;, which is the tint index of the face being colored. Both of them return an &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;, a color multiplier. This int is treated as four unsigned bytes, alpha, red, green, and blue, in that order, from most significant byte to least. For each pixel in the tinted face, the value of each color channel is &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;(int)((float)base * multiplier / 255)&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt; is the original value for the channel, and &amp;lt;code&amp;gt;multiplier&amp;lt;/code&amp;gt; is the associated byte from the color multiplier. Note that blocks do not use the alpha channel. For example, the grass texture, untinted, looks white and gray. The &amp;lt;code&amp;gt;IBlockColor&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;IItemColor&amp;lt;/code&amp;gt; for grass return color multipliers with low red and blue components, but high alpha and green components, (at least in warm biomes) so when the multiplication is performed, the green is brought out and the red/blue diminished.&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;If an item inherits from the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;builtin/generated&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; model, each layer (“layer0”, “layer1”, etc.) has a tint index corresponding to its layer index.&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;If an item inherits from the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;builtin/generated&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; model, each layer (“layer0”, “layer1”, etc.) has a tint index corresponding to its layer index&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. For blocks, the “particle” layer is index 0&lt;/ins&gt;.&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;=== Creating Color Handlers ===&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;=== Creating Color Handlers ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ferri Arnus</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Tinted_Textures&amp;diff=2367&amp;oldid=prev</id>
		<title>SciWhiz12: SciWhiz12 moved page Coloring textures dynamically to Tinted Textures: less adverb, more descriptive</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Tinted_Textures&amp;diff=2367&amp;oldid=prev"/>
		<updated>2021-01-11T05:06:07Z</updated>

		<summary type="html">&lt;p&gt;SciWhiz12 moved page &lt;a href=&quot;/wiki/Coloring_textures_dynamically&quot; class=&quot;mw-redirect&quot; title=&quot;Coloring textures dynamically&quot;&gt;Tinted Textures&lt;/a&gt; to &lt;a href=&quot;/wiki/Tinted_Textures&quot; title=&quot;Tinted Textures&quot;&gt;Tinted Textures&lt;/a&gt;: less adverb, more descriptive&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:06, 11 January 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>SciWhiz12</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Tinted_Textures&amp;diff=2147&amp;oldid=prev</id>
		<title>Unbekannt: Inital Import dokuwiki</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Tinted_Textures&amp;diff=2147&amp;oldid=prev"/>
		<updated>2020-10-24T19:57:12Z</updated>

		<summary type="html">&lt;p&gt;Inital Import dokuwiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Many blocks and items in vanilla change their texture color depending on where they are, such as grass. Models support specifying “tint indices” on faces, which are integers that can then be handled by &amp;lt;code&amp;gt;IBlockColor&amp;lt;/code&amp;gt;s and &amp;lt;code&amp;gt;IItemColor&amp;lt;/code&amp;gt;s. See the wiki for information on how tint indices are defined in vanilla models.&lt;br /&gt;
&lt;br /&gt;
=== IBlockColor / IItemColor ===&lt;br /&gt;
Both of these are single-method interfaces. &amp;lt;code&amp;gt;IBlockColor&amp;lt;/code&amp;gt; takes an &amp;lt;code&amp;gt;IBlockState&amp;lt;/code&amp;gt;, an (&amp;lt;code&amp;gt;nullable&amp;lt;/code&amp;gt;) &amp;lt;code&amp;gt;IBlockDisplayReader&amp;lt;/code&amp;gt;, and a (&amp;lt;code&amp;gt;nullable&amp;lt;/code&amp;gt;) &amp;lt;code&amp;gt;BlockPos&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;IItemColor&amp;lt;/code&amp;gt; takes an &amp;lt;code&amp;gt;ItemStack&amp;lt;/code&amp;gt;. Both of them take a parameter &amp;lt;code&amp;gt;tintIndex&amp;lt;/code&amp;gt;, which is the tint index of the face being colored. Both of them return an &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;, a color multiplier. This int is treated as four unsigned bytes, alpha, red, green, and blue, in that order, from most significant byte to least. For each pixel in the tinted face, the value of each color channel is &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;(int)((float)base * multiplier / 255)&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt; is the original value for the channel, and &amp;lt;code&amp;gt;multiplier&amp;lt;/code&amp;gt; is the associated byte from the color multiplier. Note that blocks do not use the alpha channel. For example, the grass texture, untinted, looks white and gray. The &amp;lt;code&amp;gt;IBlockColor&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;IItemColor&amp;lt;/code&amp;gt; for grass return color multipliers with low red and blue components, but high alpha and green components, (at least in warm biomes) so when the multiplication is performed, the green is brought out and the red/blue diminished.&lt;br /&gt;
&lt;br /&gt;
If an item inherits from the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;builtin/generated&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; model, each layer (“layer0”, “layer1”, etc.) has a tint index corresponding to its layer index.&lt;br /&gt;
&lt;br /&gt;
=== Creating Color Handlers ===&lt;br /&gt;
&amp;lt;code&amp;gt;IBlockColor&amp;lt;/code&amp;gt;s need to be registered to the &amp;lt;code&amp;gt;BlockColors&amp;lt;/code&amp;gt; instance of the game. &amp;lt;code&amp;gt;BlockColors&amp;lt;/code&amp;gt; can be acquired through &amp;lt;code&amp;gt;ColorHandlerEvent$Block&amp;lt;/code&amp;gt;, and an &amp;lt;code&amp;gt;IBlockColor&amp;lt;/code&amp;gt; can be registered by &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockColors#register&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Note that this does not cause the &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt; for the given block to be colored. &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt; are items and need to colored with an &amp;lt;code&amp;gt;IItemColor&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public void registerBlockColors(ColorHandlerEvent.Block event){&lt;br /&gt;
    event.getBlockColors().register(myIBlockColor, coloredBlock1, coloredBlock2, ...);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;IItemColor&amp;lt;/code&amp;gt;s need to be registered to the &amp;lt;code&amp;gt;ItemColors&amp;lt;/code&amp;gt; instance of the game. &amp;lt;code&amp;gt;ItemColors&amp;lt;/code&amp;gt; can be acquired through &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ColorHandlerEvent$Item()&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, and an &amp;lt;code&amp;gt;IItemColor&amp;lt;/code&amp;gt; can be registered by &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ItemColors#register&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. This method is overloaded to also take &amp;lt;code&amp;gt;Block&amp;lt;/code&amp;gt;s, which simply registers the color handler for the item &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block#asItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (i.e. the block’s &amp;lt;code&amp;gt;BlockItem&amp;lt;/code&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public void registerItemColors(ColorHandlerEvent.Item event){&lt;br /&gt;
    event.getItemColors().register(myIItemColor, coloredItem1, coloredItem2, ...);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This registration must be done client-side, in the initialization phase.&lt;/div&gt;</summary>
		<author><name>Unbekannt</name></author>
	</entry>
</feed>