@@ -97,27 +97,27 @@ private boolean patchCapeLayer(ClassTransformationContext context) {
9797 modified |= this .applyIfMatches ("[556,560]" , "cape-layer.render.v1" , () -> replaceEntitySolidWithTranslucent (
9898 context , context .findMethod (CAPE_LAYER , "render" , "(" + objectDesc (POSE_STACK ) + objectDesc (MULTI_BUFFER_SOURCE ) + "I" + objectDesc (ABSTRACT_CLIENT_PLAYER ) + "FFFFFFF)V" ),
9999 RENDER_TYPE
100- ));
100+ ), false );
101101 // 19w45a ~ 1.21.1 (1.15 ~ 1.21.1)
102102 modified |= this .applyIfMatches ("[561,767],[801,803],[0x40000001,0x400000CC]" , "cape-layer.render.v2" , () -> replaceEntitySolidWithTranslucent (
103103 context , context .findMethod (CAPE_LAYER , "render" , "(" + objectDesc (POSE_STACK ) + objectDesc (MULTI_BUFFER_SOURCE ) + "I" + objectDesc (ABSTRACT_CLIENT_PLAYER ) + "FFFFFF)V" ),
104104 RENDER_TYPE
105- ));
105+ ), false );
106106 // 24w33a ~ 1.21.8 (1.21.2 ~ 1.21.8)
107107 modified |= this .applyIfMatches ("[768,772],[0x400000CD,0x40000103]" , "cape-layer.render.v3" , () -> replaceEntitySolidWithTranslucent (
108108 context , context .findMethod (CAPE_LAYER , "render" , "(" + objectDesc (POSE_STACK ) + objectDesc (MULTI_BUFFER_SOURCE ) + "I" + objectDesc (PLAYER_RENDER_STATE ) + "FF)V" ),
109109 RENDER_TYPE
110- ));
110+ ), false );
111111 // 25w31a ~ 25w42a (1.21.9 ~ 1.21.10)
112112 modified |= this .applyIfMatches ("773,[0x40000104,0x40000112]" , "cape-layer.submit.v1" , () -> replaceEntitySolidWithTranslucent (
113113 context , context .findMethod (CAPE_LAYER , "submit" , "(" + objectDesc (POSE_STACK ) + objectDesc (SUBMIT_NODE_COLLECTOR ) + "I" + objectDesc (AVATAR_RENDER_STATE ) + "FF)V" ),
114114 RENDER_TYPE
115- ));
115+ ), false );
116116 // 25w43a+ (1.21.11+)
117117 modified |= this .applyIfMatches ("[774,800],[804,0x40000000],[0x40000113,]" , "cape-layer.submit.v2" , () -> replaceEntitySolidWithTranslucent (
118118 context , context .findMethod (CAPE_LAYER , "submit" , "(" + objectDesc (POSE_STACK ) + objectDesc (SUBMIT_NODE_COLLECTOR ) + "I" + objectDesc (AVATAR_RENDER_STATE ) + "FF)V" ),
119119 RENDER_TYPES
120- ));
120+ ), false );
121121 return modified ;
122122 }
123123
@@ -127,12 +127,12 @@ private boolean patchPlayerRenderer(ClassTransformationContext context) {
127127 modified |= this .applyIfMatches ("[556,560]" , "player-renderer.render-hand.v1" , () -> replaceEntitySolidWithTranslucent (
128128 context , context .findMethod (PLAYER_RENDERER , "renderHand" , "(" + objectDesc (POSE_STACK ) + objectDesc (MULTI_BUFFER_SOURCE ) + objectDesc (ABSTRACT_CLIENT_PLAYER ) + objectDesc (MODEL_PART ) + objectDesc (MODEL_PART ) + ")V" ),
129129 RENDER_TYPE
130- ));
130+ ), false );
131131 // 19w45a ~ 1.21.1 (1.15 ~ 1.21.1)
132132 modified |= this .applyIfMatches ("[561,767],[801,803],[0x40000001,0x400000CC]" , "player-renderer.render-hand.v2" , () -> replaceEntitySolidWithTranslucent (
133133 context , context .findMethod (PLAYER_RENDERER , "renderHand" , "(" + objectDesc (POSE_STACK ) + objectDesc (MULTI_BUFFER_SOURCE ) + "I" + objectDesc (ABSTRACT_CLIENT_PLAYER ) + objectDesc (MODEL_PART ) + objectDesc (MODEL_PART ) + ")V" ),
134134 RENDER_TYPE
135- ));
135+ ), false );
136136 return modified ;
137137 }
138138
@@ -157,7 +157,9 @@ private boolean replaceEntitySolidWithTranslucent(ClassTransformationContext con
157157 continue ;
158158 }
159159
160- methodNode .instructions .set (instruction , new MethodInsnNode (INVOKESTATIC , remappedOwner , replacementName , remappedDesc , false ));
160+ methodNode .instructions .insertBefore (instruction , new InsnNode (DUP ));
161+ methodNode .instructions .insert (instruction , new MethodInsnNode (INVOKESTATIC , remappedOwner , replacementName , remappedDesc , false ));
162+ methodNode .instructions .insert (instruction , new InsnNode (POP ));
161163 modified = true ;
162164 }
163165
0 commit comments