|
13 | 13 | */ |
14 | 14 | public interface IFSlotClickContext extends IFSlotContext, IFConfinedContext { |
15 | 15 |
|
16 | | - // TODO needs documentation |
17 | | - @NotNull |
18 | | - ViewContainer getClickedContainer(); |
19 | | - |
20 | | - Component getComponent(); |
21 | | - |
22 | | - int getClickedSlot(); |
23 | | - |
24 | | - /** |
25 | | - * If the click was using the left mouse button. |
26 | | - * |
27 | | - * @return If the click was using the left mouse button. |
28 | | - */ |
29 | | - boolean isLeftClick(); |
30 | | - |
31 | | - /** |
32 | | - * If the click was using the right mouse button. |
33 | | - * |
34 | | - * @return If the click was using the right mouse button. |
35 | | - */ |
36 | | - boolean isRightClick(); |
37 | | - |
38 | | - /** |
39 | | - * If the click was using the middle mouse button, commonly known as the scroll button. |
40 | | - * |
41 | | - * @return If the click was using the middle mouse button. |
42 | | - */ |
43 | | - boolean isMiddleClick(); |
44 | | - |
45 | | - /** |
46 | | - * If the click was accompanied by a click holding the keyboard shift button. |
47 | | - * |
48 | | - * @return If it was a click holding the keyboard shift button. |
49 | | - */ |
50 | | - boolean isShiftClick(); |
51 | | - |
52 | | - default boolean isShiftLeftClick() { |
53 | | - return isLeftClick() && isShiftClick(); |
54 | | - } |
55 | | - |
56 | | - default boolean isShiftRightClick() { |
57 | | - return isRightClick() && isShiftClick(); |
58 | | - } |
59 | | - |
60 | | - /** |
61 | | - * If the click source came from a keyboard, e.g. the player's toolbar number. |
62 | | - * |
63 | | - * @return If the click source came from a keyboard. |
64 | | - */ |
65 | | - boolean isKeyboardClick(); |
66 | | - |
67 | | - /** |
68 | | - * If the click did not occur within any containers. |
69 | | - * |
70 | | - * @return If the click did not occur within any containers. |
71 | | - */ |
72 | | - boolean isOutsideClick(); |
73 | | - |
74 | | - /** |
75 | | - * The click identifier, available only in cases where the library does not cover all types of |
76 | | - * clicks, so you can discover the type of click through its identifier. |
77 | | - * |
78 | | - * @return The click type identifier. Can be null if the click type is known or a platform doesn't implement an identifier. |
79 | | - */ |
80 | | - default String getClickIdentifier() { |
81 | | - return null; |
82 | | - } |
83 | | - |
84 | | - /** |
85 | | - * If the click was cancelled. |
86 | | - * |
87 | | - * @return If the click was cancelled. |
88 | | - */ |
89 | | - boolean isCancelled(); |
90 | | - |
91 | | - /** |
92 | | - * Cancels the click. |
93 | | - * |
94 | | - * @param cancelled If the click should be cancelled. |
95 | | - */ |
96 | | - void setCancelled(boolean cancelled); |
97 | | - |
98 | | - /** |
99 | | - * <b><i> This is an internal inventory-framework API that should not be used from outside of |
100 | | - * this library. No compatibility guarantees are provided. </i></b> |
101 | | - */ |
102 | | - @ApiStatus.Internal |
103 | | - Object getPlatformEvent(); |
104 | | - |
105 | | - /** |
106 | | - * <b><i> This is an internal inventory-framework API that should not be used from outside of |
107 | | - * this library. No compatibility guarantees are provided. </i></b> |
108 | | - */ |
109 | | - @ApiStatus.Internal |
110 | | - boolean isCombined(); |
| 16 | + // TODO needs documentation |
| 17 | + @NotNull |
| 18 | + ViewContainer getClickedContainer(); |
| 19 | + |
| 20 | + Component getComponent(); |
| 21 | + |
| 22 | + int getClickedSlot(); |
| 23 | + |
| 24 | + /** |
| 25 | + * If the click was using the left mouse button. |
| 26 | + * |
| 27 | + * @return If the click was using the left mouse button. |
| 28 | + */ |
| 29 | + boolean isLeftClick(); |
| 30 | + |
| 31 | + /** |
| 32 | + * If the click was using the right mouse button. |
| 33 | + * |
| 34 | + * @return If the click was using the right mouse button. |
| 35 | + */ |
| 36 | + boolean isRightClick(); |
| 37 | + |
| 38 | + /** |
| 39 | + * If the click was using the middle mouse button, commonly known as the scroll button. |
| 40 | + * |
| 41 | + * @return If the click was using the middle mouse button. |
| 42 | + */ |
| 43 | + boolean isMiddleClick(); |
| 44 | + |
| 45 | + /** |
| 46 | + * If the click was accompanied by a click holding the keyboard shift button. |
| 47 | + * |
| 48 | + * @return If it was a click holding the keyboard shift button. |
| 49 | + */ |
| 50 | + boolean isShiftClick(); |
| 51 | + |
| 52 | + default boolean isShiftLeftClick() { |
| 53 | + return isLeftClick() && isShiftClick(); |
| 54 | + } |
| 55 | + |
| 56 | + default boolean isShiftRightClick() { |
| 57 | + return isRightClick() && isShiftClick(); |
| 58 | + } |
| 59 | + |
| 60 | + /** |
| 61 | + * If the click source came from a keyboard, e.g. the player's toolbar number. |
| 62 | + * |
| 63 | + * @return If the click source came from a keyboard. |
| 64 | + */ |
| 65 | + boolean isKeyboardClick(); |
| 66 | + |
| 67 | + /** |
| 68 | + * If the click did not occur within any containers. |
| 69 | + * |
| 70 | + * @return If the click did not occur within any containers. |
| 71 | + */ |
| 72 | + boolean isOutsideClick(); |
| 73 | + |
| 74 | + /** |
| 75 | + * The click identifier, available only in cases where the library does not cover all types of |
| 76 | + * clicks, so you can discover the type of click through its identifier. |
| 77 | + * |
| 78 | + * @return The click type identifier. Can be null if the click type is known or a platform doesn't implement an identifier. |
| 79 | + */ |
| 80 | + default String getClickIdentifier() { |
| 81 | + return null; |
| 82 | + } |
| 83 | + |
| 84 | + /** |
| 85 | + * If the click was cancelled. |
| 86 | + * |
| 87 | + * @return If the click was cancelled. |
| 88 | + */ |
| 89 | + boolean isCancelled(); |
| 90 | + |
| 91 | + /** |
| 92 | + * Cancels the click. |
| 93 | + * |
| 94 | + * @param cancelled If the click should be cancelled. |
| 95 | + */ |
| 96 | + void setCancelled(boolean cancelled); |
| 97 | + |
| 98 | + /** |
| 99 | + * <b><i> This is an internal inventory-framework API that should not be used from outside of |
| 100 | + * this library. No compatibility guarantees are provided. </i></b> |
| 101 | + */ |
| 102 | + @ApiStatus.Internal |
| 103 | + Object getPlatformEvent(); |
| 104 | + |
| 105 | + /** |
| 106 | + * <b><i> This is an internal inventory-framework API that should not be used from outside of |
| 107 | + * this library. No compatibility guarantees are provided. </i></b> |
| 108 | + */ |
| 109 | + @ApiStatus.Internal |
| 110 | + boolean isCombined(); |
111 | 111 | } |
0 commit comments