@@ -70,6 +70,24 @@ public static List<Patch> getPatches() {
70
70
.targetInjectionPoint ("FIELD" , "Lnet/minecraft/world/item/HoeItem;f_41332_:Ljava/util/Map;" )
71
71
.modifyInjectionPoint ("INVOKE" , "Lnet/minecraft/world/level/block/state/BlockState;getToolModifiedState(Lnet/minecraft/world/item/context/UseOnContext;Lnet/minecraftforge/common/ToolAction;Z)Lnet/minecraft/world/level/block/state/BlockState;" , true )
72
72
.build (),
73
+ Patch .builder ()
74
+ .targetClass ("net/minecraft/world/entity/animal/SnowGolem" )
75
+ .targetMethod ("m_6071_(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;)Lnet/minecraft/world/InteractionResult;" )
76
+ .targetInjectionPoint ("FIELD" , "Lnet/minecraft/world/level/Level;f_46443_:Z" )
77
+ .splitMixin ("net/minecraft/world/entity/animal/SnowGolem" )
78
+ .build (),
79
+ Patch .builder ()
80
+ .targetClass ("net/minecraft/world/entity/animal/Sheep" )
81
+ .targetMethod ("m_6071_(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;)Lnet/minecraft/world/InteractionResult;" )
82
+ .targetInjectionPoint ("FIELD" , "Lnet/minecraft/world/level/Level;f_46443_:Z" )
83
+ .splitMixin ("net/minecraft/world/entity/animal/Sheep" )
84
+ .build (),
85
+ Patch .builder ()
86
+ .targetClass ("net/minecraft/world/entity/animal/MushroomCow" )
87
+ .targetMethod ("m_6071_(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;)Lnet/minecraft/world/InteractionResult;" )
88
+ .targetInjectionPoint ("FIELD" , "Lnet/minecraft/world/level/Level;f_46443_:Z" )
89
+ .splitMixin ("net/minecraft/world/entity/animal/MushroomCow" )
90
+ .build (),
73
91
Patch .builder ()
74
92
.targetClass ("net/minecraft/client/KeyMapping" )
75
93
.targetMethod ("m_90837_" )
@@ -640,6 +658,31 @@ public static List<Patch> getPatches() {
640
658
.collect (Collectors .toList ()); // Mutable list
641
659
}
642
660
661
+ public static List <Patch > getGeneratedClassPatches () {
662
+ return List .of (
663
+ Patch .builder ()
664
+ .targetClass ("net/minecraft/world/entity/animal/SnowGolem" )
665
+ .targetClass ("net/minecraft/world/entity/animal/Sheep" )
666
+ .targetClass ("net/minecraft/world/entity/animal/MushroomCow" )
667
+ .targetMethod ("m_6071_(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;)Lnet/minecraft/world/InteractionResult;" )
668
+ .targetInjectionPoint ("FIELD" , "Lnet/minecraft/world/level/Level;f_46443_:Z" )
669
+ .modifyTarget ("onSheared" )
670
+ .modifyInjectionPoint ("HEAD" , "" )
671
+ .transformParams (b -> b
672
+ .inject (1 , Type .getObjectType ("net/minecraft/world/item/ItemStack" ))
673
+ .inject (2 , Type .getObjectType ("net/minecraft/world/level/Level" ))
674
+ .inject (3 , Type .getObjectType ("net/minecraft/core/BlockPos" ))
675
+ .inject (4 , Type .INT_TYPE )
676
+ .inline (5 , i -> {
677
+ i .visitVarInsn (Opcodes .ALOAD , 1 );
678
+ i .visitVarInsn (Opcodes .ALOAD , 2 );
679
+ i .invokestatic ("dev/su5ed/sinytra/connector/mod/ConnectorMod" , "itemToHand" , "(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/item/ItemStack;)Lnet/minecraft/world/InteractionHand;" , false );
680
+ })
681
+ .withOffset ())
682
+ .build ()
683
+ );
684
+ }
685
+
643
686
private static Patch buildGuiPatch (int minOrdinal , int maxOrdinal , String targetMethodName , String injectionPoint , boolean offsetOrdinal ) {
644
687
return Patch .builder ()
645
688
.targetClass ("net/minecraft/client/gui/Gui" )
0 commit comments