Skip to content

Commit

Permalink
Fix compatibility with Enchant the Rainbow
Browse files Browse the repository at this point in the history
Fixes #1041
  • Loading branch information
Matyrobbrt committed May 1, 2024
1 parent 145cf28 commit f8ec141
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,13 @@ public static List<Patch> getPatches() {
.targetClass("net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer")
.targetMethod("m_289604_(Lnet/minecraft/world/item/ArmorMaterial;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/world/item/armortrim/ArmorTrim;Lnet/minecraft/client/model/HumanoidModel;Z)V")
.modifyTarget("renderTrim(Lnet/minecraft/world/item/ArmorMaterial;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/world/item/armortrim/ArmorTrim;Lnet/minecraft/client/model/Model;Z)V")
.modifyParams(builder -> builder.replace(5, Type.getObjectType("net/minecraft/client/model/Model")))
.transformParams(builder -> builder.replace(5, Type.getObjectType("net/minecraft/client/model/Model")))
.build(),
Patch.builder()
.targetMixinType(MixinConstants.REDIRECT)
.targetClass("net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer")
.targetMethod("m_289597_(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/client/model/HumanoidModel;)V") // renderGlint
.modifyTarget("renderGlint(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/client/model/Model;)V")
.build(),
// For mods who wish to override HumanoidArmorLayer parts. On Fabric, the usual approach seems to be modifying the model (4th) arg of renderModel in HumanoidArmorLayer#renderArmorPiece.
// To make this kind of modification forge-compatible, we:
Expand Down

0 comments on commit f8ec141

Please sign in to comment.