|
1 | 1 | package yalter.mousetweaks.api; |
2 | 2 |
|
3 | | -import net.minecraft.inventory.Container; |
4 | | -import net.minecraft.inventory.Slot; |
5 | | - |
6 | | -/** |
7 | | - * This is the interface you want to implement in your GuiScreen to make it compatible with Mouse Tweaks. |
8 | | - * If this interface is not enough (for example, you need a custom slot click function, or if you use a custom Container |
9 | | - * which happens to be incompatible), check IMTModGuiContainer2Ex instead. |
10 | | - * If you just need to disable Mouse Tweaks or the wheel tweak, see the MouseTweaksIgnore |
11 | | - * or the MouseTweaksDisableWheelTweak annotations. |
12 | | - */ |
13 | 3 | public interface IMTModGuiContainer2 { |
14 | | - /** |
15 | | - * If you want to disable Mouse Tweaks in your GuiScreen, return true from this method. |
16 | | - * |
17 | | - * @return True if Mouse Tweaks should be disabled, false otherwise. |
18 | | - */ |
19 | | - boolean MT_isMouseTweaksDisabled(); |
20 | | - |
21 | | - /** |
22 | | - * If you want to disable the Wheel Tweak in your GuiScreen, return true from this method. |
23 | | - * |
24 | | - * @return True if the Wheel Tweak should be disabled, false otherwise. |
25 | | - */ |
26 | | - boolean MT_isWheelTweakDisabled(); |
27 | | - |
28 | | - /** |
29 | | - * Returns the Container. |
30 | | - * |
31 | | - * @return Container that is currently in use. |
32 | | - */ |
33 | | - Container MT_getContainer(); |
34 | | - |
35 | | - /** |
36 | | - * Returns the Slot that is currently selected by the player, or null if no Slot is selected. |
37 | | - * |
38 | | - * @return Slot that is located under the mouse, or null if no Slot it currently under the mouse. |
39 | | - */ |
40 | | - Slot MT_getSlotUnderMouse(); |
41 | | - |
42 | | - /** |
43 | | - * Return true if the given Slot behaves like the vanilla crafting output slots (inside the crafting table, |
44 | | - * or the furnace output slot, or the anvil output slot, etc.). These slots are handled differently by Mouse Tweaks. |
45 | | - * |
46 | | - * @param slot the slot to check |
47 | | - * @return True if slot is a crafting output slot. |
48 | | - */ |
49 | | - boolean MT_isCraftingOutput(Slot slot); |
50 | | - |
51 | | - /** |
52 | | - * Return true if the given Slot should be ignored by Mouse Tweaks. Examples of ignored slots are the item select |
53 | | - * slots and the Destroy Item slot in the vanilla creative inventory. |
54 | | - * |
55 | | - * @param slot the slot to check |
56 | | - * @return Tru if slot should be ignored by Mouse Tweaks. |
57 | | - */ |
58 | | - boolean MT_isIgnored(Slot slot); |
59 | | - |
60 | | - /** |
61 | | - * If your container has an RMB dragging functionality (like vanilla containers), disable it inside this method. |
62 | | - * This method is called every frame (render tick), which is after all mouseClicked / mouseClickMove / mouseReleased |
63 | | - * events are handled (although note these events are handled every game tick, which is far less frequent than every |
64 | | - * render tick).<br><br> |
65 | | - * <p> |
66 | | - * If true is returned from this method, Mouse Tweaks (after checking other conditions like isIgnored) will click |
67 | | - * the slot on which the right mouse button was initially pressed (in most cases this is the slot currently under |
68 | | - * mouse). This is needed because the vanilla RMB dragging functionality prevents the initial slot click.<br><br> |
69 | | - * <p> |
70 | | - * For vanilla containers this method looks like this: |
71 | | - * <pre> |
72 | | - * this.ignoreMouseUp = true; |
73 | | - * |
74 | | - * if (this.dragSplitting) { |
75 | | - * if (this.dragSplittingButton == 1) { |
76 | | - * this.dragSplitting = false; |
77 | | - * return true; |
78 | | - * } |
79 | | - * } |
80 | | - * |
81 | | - * return false; |
82 | | - * </pre> |
83 | | - * |
84 | | - * @return True if Mouse Tweaks should click the slot on which the RMB was pressed. |
85 | | - */ |
86 | | - boolean MT_disableRMBDraggingFunctionality(); |
87 | 4 | } |
0 commit comments