Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MouseButton button = MouseButton.LEFT;
- switch (packet102windowclick.shift) {
- case 0:
- // Shift key not held
- switch (packet102windowclick.button) {
- case 0:
- button = MouseButton.LEFT;
- break;
- case 1:
- button = MouseButton.RIGHT;
- break;
- default:
- throw new AssertionError("Minecraft Packet 102 change! Shift=" + packet102windowclick.shift + " Button=" + packet102windowclick.button + " Slot=" + packet102windowclick.slot);
- }
- break;
- case 1:
- // Shift key held
- switch (packet102windowclick.button) {
- case 0:
- button = MouseButton.SHIFT_LEFT;
- break;
- case 1:
- button = MouseButton.SHIFT_RIGHT;
- break;
- default:
- throw new AssertionError("Minecraft Packet 102 change! Shift=" + packet102windowclick.shift + " Button=" + packet102windowclick.button + " Slot=" + packet102windowclick.slot);
- }
- case 2:
- // Number press
- switch (packet102windowclick.button) {
- case 0:
- button = MouseButton.NUMBER_1;
- break;
- case 1:
- button = MouseButton.NUMBER_2;
- break;
- case 2:
- button = MouseButton.NUMBER_3;
- break;
- case 3:
- button = MouseButton.NUMBER_4;
- break;
- case 4:
- button = MouseButton.NUMBER_5;
- break;
- case 5:
- button = MouseButton.NUMBER_6;
- break;
- case 6:
- button = MouseButton.NUMBER_7;
- break;
- case 7:
- button = MouseButton.NUMBER_8;
- break;
- case 8:
- button = MouseButton.NUMBER_9;
- break;
- }
- case 3:
- // Middle click is always 3/3
- if (packet102windowclick.button != 3) {
- throw new AssertionError("Minecraft Packet 102 change! Shift=" + packet102windowclick.shift + " Button=" + packet102windowclick.button + " Slot=" + packet102windowclick.slot);
- }
- button = MouseButton.MIDDLE;
- case 5:
- // Painting
- if (packet102windowclick.slot == -999) {
- // Start or stop
- switch (packet102windowclick.button) {
- case 0:
- button = MouseButton.DRAG_START_LEFT;
- break;
- case 2:
- button = MouseButton.DRAG_FINISH_LEFT;
- break;
- case 4:
- button = MouseButton.DRAG_START_RIGHT;
- break;
- case 6:
- button = MouseButton.DRAG_FINISH_RIGHT;
- break;
- default:
- throw new AssertionError("Minecraft Packet 102 change! Shift=" + packet102windowclick.shift + " Button=" + packet102windowclick.button + " Slot=" + packet102windowclick.slot);
- }
- } else {
- // Middle of stream
- switch (packet102windowclick.button) {
- case 0:
- button = MouseButton.DRAG_LEFT;
- case 1:
- button = MouseButton.DRAG_RIGHT;
- default:
- throw new AssertionError("Minecraft Packet 102 change! Shift=" + packet102windowclick.shift + " Button=" + packet102windowclick.button + " Slot=" + packet102windowclick.slot);
- }
- }
- break;
- case 6:
- // Double click
- button = MouseButton.DOUBLE_CLICK;
- break;
- default:
- throw new AssertionError("Minecraft Packet 102 change! Shift=" + packet102windowclick.shift + " Button=" + packet102windowclick.button + " Slot=" + packet102windowclick.slot);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement