55import appeng .helpers .InventoryAction ;
66import com .llamalad7 .mixinextras .injector .wrapoperation .Operation ;
77import com .llamalad7 .mixinextras .injector .wrapoperation .WrapOperation ;
8- import org .lwjgl .input .Mouse ;
98import org .spongepowered .asm .mixin .Mixin ;
109import org .spongepowered .asm .mixin .injection .At ;
1110
1211@ Mixin (AEBaseGui .class )
1312public class MixinAEBaseGui {
1413
15- @ WrapOperation (method = "handleMouseClick" , at = @ At (value = "NEW" , target = "(Lappeng/helpers/InventoryAction;IJ)Lappeng/core/sync/packets/PacketInventoryAction;" , ordinal = 0 , remap = false ))
16- protected PacketInventoryAction handleMouseClick (final InventoryAction action , final int slot , final long id , final Operation <PacketInventoryAction > original ) {
17- long newid = Mouse .getEventButton ();
18- if (newid == -1 ) {
19- newid = Mouse .isButtonDown (0 ) ? 0 : 1 ;
20- }
21- return original .call (action , slot , newid );
22- }
23-
24- @ WrapOperation (method = "mouseClickMove" , at = @ At (value = "NEW" , target = "(Lappeng/helpers/InventoryAction;IJ)Lappeng/core/sync/packets/PacketInventoryAction;" , ordinal = 0 , remap = false ))
25- protected PacketInventoryAction mouseClickMove (final InventoryAction action , final int slot , final long id , final Operation <PacketInventoryAction > original ) {
26- long newid = Mouse .getEventButton ();
27- if (newid == -1 ) {
28- newid = Mouse .isButtonDown (0 ) ? 0 : 1 ;
29- }
30- return original .call (action , slot , newid );
14+ @ WrapOperation (method = {"mouseClickMove" , "handleMouseClick" }, at = @ At (value = "NEW" , target = "(Lappeng/helpers/InventoryAction;IJ)Lappeng/core/sync/packets/PacketInventoryAction;" ,ordinal = 0 , remap = false ))
15+ protected PacketInventoryAction writeMouseButton (final InventoryAction action , final int slot , final long id , final Operation <PacketInventoryAction > original ) {
16+ return original .call (action , slot , action == InventoryAction .PICKUP_OR_SET_DOWN ? 0L : 1L );
3117 }
3218}
0 commit comments