很久以前,Mojang 移除了客户端渲染皮肤 Alpha 通道的功能。这导致那些以艺术方式使用透明效果的皮肤出现了问题。
本模组旨在重新引入这一功能。通过 Mixin 技术,它禁用了在渲染时剥离皮肤 Alpha 通道的代码。
此模组并不会让其他玩家看到你的透明皮肤。它仅影响你自己客户端的渲染效果。
Fabric 版本的原始 Mixin 可在这里找到,我仅利用其中提供的信息将其移植到 Forge,并添加了几个额外的 Mixin,以使透明效果无缝衔接,仿佛由官方实现一般。
本质上,此模组引入了三个 Mixin。第一个用于禁用皮肤下载类中的 Alpha 和颜色剥离功能。该类通常会将 Alpha 值设为 0,从而导致没有任何部分透明。第二个 Mixin 是同一功能的变体,仅针对 SkinProcessor 类,该类似乎仅用于与 Realms 相关的内容。
第三个 Mixin 修补了 FirstPersonRenderer 类,使手部渲染也尊重透明效果。通常情况下,手部渲染完全忽略 Alpha 通道,但通过使用头部注入技术,我成功覆盖了这一行为。
注意:我并未从这个链接中获取任何收益。该链接完全非商业化。
A long while ago Mojang removed the ability for the client to render skin's alpha channel. This broke skins that used transparency in an artistic manner.
This mod aims to reintroduce that functionality. Using mixins it turns off the code that strips the alpha channel from the skin upon rendering.
This mod doesn't make it so other people see your transparent skins. This only affects your client's rendering.
Original mixin for Fabric was found here, I just used the info found in it to port this mixin to Forge as well as added a few more to make the transparency seamless as if it was made first party.
Essentially this mod adds 3 mixins. The first one is disabling the alpha and color stripping for the skin downloading class. This class normally will set the alpha to be 0 making nothing transparent. The second mixin is a variant of the same mixin just for a SkinProcessor class, which only seems to be used for Realms-related stuff.
The third mixin patches the FirstPersonRenderer class and makes the hand respect transparency. Normally it's rendered without any care to the alpha channel but using head injection I was able to override that.
Note: I do not make any money off this link. It's fully non-monetized.
评论 0
登录后参与评分
还没有评论,来抢沙发吧