@wq2/miniblox-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +661 -0
- package/ReadME.md +23 -0
- package/dist/index.d.mts +4711 -0
- package/dist/index.mjs +70 -0
- package/package.json +28 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region src/slot/SlotActionType.ts
|
|
2
|
+
const SlotActionType = /* @__PURE__ */ ((SlotActionType) => {
|
|
3
|
+
/**
|
|
4
|
+
* Left-click pickup/place (clickedButton == 0).
|
|
5
|
+
* - If slot is empty: places held item
|
|
6
|
+
* - If slot has item and held item is same type: combines stacks
|
|
7
|
+
* - If slot has item and held item is different: swaps them
|
|
8
|
+
* - If slot ID is -999 (outside container): drops entire held stack
|
|
9
|
+
*/
|
|
10
|
+
SlotActionType[(SlotActionType["PICKUP_LEFT"] = 0)] = "PICKUP_LEFT";
|
|
11
|
+
/**
|
|
12
|
+
* Right-click pickup/place (clickedButton == 1).
|
|
13
|
+
* - SPECIAL: Acts as QUICK_MOVE in this JS version (shift-click behavior)
|
|
14
|
+
* - transferStackInSlot() is called to move item to player inventory
|
|
15
|
+
* - If same item type exists in slot, retries the action
|
|
16
|
+
* - If slot ID is -999: drops 1 item from held stack
|
|
17
|
+
*/
|
|
18
|
+
SlotActionType[(SlotActionType["PICKUP_RIGHT"] = 1)] = "PICKUP_RIGHT";
|
|
19
|
+
/**
|
|
20
|
+
* Number key swap (0-9 for hotbar slots).
|
|
21
|
+
* - Swaps clicked slot with hotbar slot specified by clickedButton
|
|
22
|
+
* - If hotbar slot is empty and slot is valid: places item there
|
|
23
|
+
* - If both slot and hotbar have items: exchanges them
|
|
24
|
+
* - If hotbar inventory is different player: adds to empty slots first
|
|
25
|
+
*/
|
|
26
|
+
SlotActionType[(SlotActionType["SWAP"] = 2)] = "SWAP";
|
|
27
|
+
/**
|
|
28
|
+
* Creative mode item duplication.
|
|
29
|
+
* - Requires: player.abilities.creative == true AND held stack is null
|
|
30
|
+
* - Clones clicked slot's item to full max stack size
|
|
31
|
+
* - Places cloned full-size stack in cursor
|
|
32
|
+
*/
|
|
33
|
+
SlotActionType[(SlotActionType["CLONE"] = 3)] = "CLONE";
|
|
34
|
+
/**
|
|
35
|
+
* Drop key action.
|
|
36
|
+
* - Requires: held stack is null AND slot ID >= 0
|
|
37
|
+
* - clickedButton == 0: drops 1 item
|
|
38
|
+
* - clickedButton == 1: drops entire slot stack
|
|
39
|
+
* - Calls onPickupFromSlot() before dropping
|
|
40
|
+
*/
|
|
41
|
+
SlotActionType[(SlotActionType["THROW"] = 4)] = "THROW";
|
|
42
|
+
/**
|
|
43
|
+
* Drag to distribute items across multiple slots.
|
|
44
|
+
* - dragEvent 0: Start drag, validates drag mode
|
|
45
|
+
* - dragMode 0: even split across slots
|
|
46
|
+
* - dragMode 1: one item per slot
|
|
47
|
+
* - dragMode 2: creative fill (creative mode only)
|
|
48
|
+
* - dragEvent 1: Collecting phase, adds valid slots to dragSlots set
|
|
49
|
+
* - Requires: slot stackSize > dragSlots.size
|
|
50
|
+
* - dragEvent 2: Distribution phase, splits held stack across collected slots
|
|
51
|
+
* - Uses dragMode to compute distribution
|
|
52
|
+
* - Requires: held stackSize >= dragSlots.size
|
|
53
|
+
*/
|
|
54
|
+
SlotActionType[(SlotActionType["QUICK_CRAFT"] = 5)] = "QUICK_CRAFT";
|
|
55
|
+
/**
|
|
56
|
+
* Shift-click to auto-move items (double-click in Java, mode 6 in JS).
|
|
57
|
+
* - Scans through slots in two passes:
|
|
58
|
+
* - Pass 1 (if clickedButton==0): forward scan, prioritizes partially-filled stacks
|
|
59
|
+
* - Pass 2: continues to fill stacks to max capacity
|
|
60
|
+
* - If clickedButton==1: reverse scan (from end to start)
|
|
61
|
+
* - Merges with existing stacks or finds empty slots
|
|
62
|
+
* - Respects canMergeSlot() and canAddItemToSlot() checks
|
|
63
|
+
* - Calls detectAndSendChanges() at end
|
|
64
|
+
*/
|
|
65
|
+
SlotActionType[(SlotActionType["QUICK_MOVE"] = 6)] = "QUICK_MOVE";
|
|
66
|
+
return SlotActionType;
|
|
67
|
+
})({});
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
export { SlotActionType };
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wq2/miniblox-sdk",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "SDK for Miniblox (mostly typings), originally from Vape Rewrite & Spherical.",
|
|
5
|
+
"readme": "ReadME.md",
|
|
6
|
+
"repository": {
|
|
7
|
+
"url": "git+https://github.com/MinibloxCheaters2/miniblox-types.git"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"ReadME.md"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./dist/index.mjs"
|
|
18
|
+
},
|
|
19
|
+
"types": "./dist/index.d.mts",
|
|
20
|
+
"type": "module",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@types/three": "0.158.3"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"tsdown": "^0.22.0",
|
|
26
|
+
"typescript": "^6.0.3"
|
|
27
|
+
}
|
|
28
|
+
}
|