minecraft-inventory 0.1.0

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.
Files changed (51) hide show
  1. package/README.md +566 -0
  2. package/package.json +37 -0
  3. package/src/InventoryGUI.tsx +108 -0
  4. package/src/cache/textureCache.ts +95 -0
  5. package/src/components/CursorItem/CursorItem.tsx +94 -0
  6. package/src/components/CursorItem/index.ts +1 -0
  7. package/src/components/HUD/HUD.tsx +11 -0
  8. package/src/components/HUD/index.ts +1 -0
  9. package/src/components/Hotbar/Hotbar.tsx +180 -0
  10. package/src/components/Hotbar/index.ts +1 -0
  11. package/src/components/InventoryOverlay/InventoryOverlay.tsx +196 -0
  12. package/src/components/InventoryOverlay/index.ts +2 -0
  13. package/src/components/InventoryWindow/EnchantmentOptions.tsx +109 -0
  14. package/src/components/InventoryWindow/InventoryBackground.tsx +110 -0
  15. package/src/components/InventoryWindow/InventoryWindow.tsx +120 -0
  16. package/src/components/InventoryWindow/ProgressBar.tsx +78 -0
  17. package/src/components/InventoryWindow/VillagerTradeList.tsx +136 -0
  18. package/src/components/InventoryWindow/index.ts +5 -0
  19. package/src/components/ItemCanvas/ItemCanvas.tsx +154 -0
  20. package/src/components/ItemCanvas/index.ts +1 -0
  21. package/src/components/JEI/JEI.module.css +37 -0
  22. package/src/components/JEI/JEI.tsx +303 -0
  23. package/src/components/JEI/index.ts +2 -0
  24. package/src/components/RecipeGuide/RecipeInventoryView.tsx +293 -0
  25. package/src/components/RecipeGuide/index.ts +1 -0
  26. package/src/components/Slot/Slot.module.css +111 -0
  27. package/src/components/Slot/Slot.tsx +363 -0
  28. package/src/components/Slot/index.ts +1 -0
  29. package/src/components/Text/MessageFormatted.css +5 -0
  30. package/src/components/Text/MessageFormatted.tsx +79 -0
  31. package/src/components/Text/MessageFormattedString.tsx +74 -0
  32. package/src/components/Text/chatUtils.ts +172 -0
  33. package/src/components/Tooltip/Tooltip.module.css +56 -0
  34. package/src/components/Tooltip/Tooltip.tsx +130 -0
  35. package/src/components/Tooltip/index.ts +1 -0
  36. package/src/connector/demo.ts +213 -0
  37. package/src/connector/index.ts +4 -0
  38. package/src/connector/mineflayer.ts +113 -0
  39. package/src/connector/types.ts +41 -0
  40. package/src/context/InventoryContext.tsx +157 -0
  41. package/src/context/ScaleContext.tsx +73 -0
  42. package/src/context/TextureContext.tsx +70 -0
  43. package/src/globals.d.ts +4 -0
  44. package/src/hooks/useKeyboardShortcuts.ts +41 -0
  45. package/src/hooks/useMobile.ts +28 -0
  46. package/src/index.tsx +65 -0
  47. package/src/mount.tsx +52 -0
  48. package/src/registry/index.ts +21 -0
  49. package/src/registry/inventories.ts +612 -0
  50. package/src/styles/tokens.css +47 -0
  51. package/src/types.ts +176 -0
@@ -0,0 +1,612 @@
1
+ import type { InventoryTypeDefinition } from '../types'
2
+
3
+ const SLOT_SIZE = 18
4
+
5
+ function playerInv(
6
+ yOffset: number,
7
+ invStartIndex = 9,
8
+ hotbarStartIndex = 36,
9
+ ): InventoryTypeDefinition['slots'] {
10
+ const slots: InventoryTypeDefinition['slots'] = []
11
+ for (let row = 0; row < 3; row++) {
12
+ for (let col = 0; col < 9; col++) {
13
+ slots.push({
14
+ index: invStartIndex + row * 9 + col,
15
+ x: 8 + col * SLOT_SIZE,
16
+ y: yOffset + row * SLOT_SIZE,
17
+ group: 'inventory',
18
+ })
19
+ }
20
+ }
21
+ for (let col = 0; col < 9; col++) {
22
+ slots.push({
23
+ index: hotbarStartIndex + col,
24
+ x: 8 + col * SLOT_SIZE,
25
+ y: yOffset + 58,
26
+ group: 'hotbar',
27
+ })
28
+ }
29
+ return slots
30
+ }
31
+
32
+ function hotbarSlots(yOffset: number, indexOffset = 36, xOffset = 8): InventoryTypeDefinition['slots'] {
33
+ return Array.from({ length: 9 }, (_, col) => ({
34
+ index: indexOffset + col,
35
+ x: xOffset + col * SLOT_SIZE,
36
+ y: yOffset,
37
+ group: 'hotbar',
38
+ }))
39
+ }
40
+
41
+ function gridSlots(
42
+ startIndex: number,
43
+ cols: number,
44
+ rows: number,
45
+ x: number,
46
+ y: number,
47
+ group: string,
48
+ ): InventoryTypeDefinition['slots'] {
49
+ const slots: InventoryTypeDefinition['slots'] = []
50
+ for (let row = 0; row < rows; row++) {
51
+ for (let col = 0; col < cols; col++) {
52
+ slots.push({
53
+ index: startIndex + row * cols + col,
54
+ x: x + col * SLOT_SIZE,
55
+ y: y + row * SLOT_SIZE,
56
+ group,
57
+ })
58
+ }
59
+ }
60
+ return slots
61
+ }
62
+
63
+ export const inventoryDefinitions: Record<string, InventoryTypeDefinition> = {
64
+ player: {
65
+ name: 'player',
66
+ title: 'Inventory',
67
+ backgroundTexture: 'gui/container/inventory',
68
+ backgroundWidth: 176,
69
+ backgroundHeight: 166,
70
+ slots: [
71
+ // Result
72
+ { index: 0, x: 154, y: 28, group: 'result', resultSlot: true },
73
+ // Crafting 2x2
74
+ ...gridSlots(1, 2, 2, 98, 18, 'crafting'),
75
+ // Armor (head to feet = slots 5-8)
76
+ { index: 5, x: 8, y: 8, group: 'armor', label: 'Head' },
77
+ { index: 6, x: 8, y: 26, group: 'armor', label: 'Chest' },
78
+ { index: 7, x: 8, y: 44, group: 'armor', label: 'Legs' },
79
+ { index: 8, x: 8, y: 62, group: 'armor', label: 'Feet' },
80
+ // Offhand
81
+ { index: 45, x: 77, y: 62, group: 'offhand', label: 'Offhand' },
82
+ // Player inventory 9-35, hotbar 36-44
83
+ ...playerInv(84, 9, 36),
84
+ ],
85
+ },
86
+
87
+ chest: {
88
+ name: 'chest',
89
+ title: 'Chest',
90
+ backgroundTexture: 'gui/container/shulker_box',
91
+ backgroundWidth: 176,
92
+ backgroundHeight: 166,
93
+ playerInventoryOffset: { x: 8, y: 84 },
94
+ slots: [
95
+ ...gridSlots(0, 9, 3, 8, 18, 'container'),
96
+ // player inv: 27-53, hotbar: 54-62
97
+ ...playerInv(84, 27, 54),
98
+ ],
99
+ },
100
+
101
+ generic_9x1: {
102
+ name: 'generic_9x1',
103
+ title: 'Container',
104
+ backgroundTexture: 'gui/container/shulker_box',
105
+ backgroundWidth: 176,
106
+ backgroundHeight: 96,
107
+ slots: [
108
+ ...gridSlots(0, 9, 1, 8, 18, 'container'),
109
+ // inv: 9-35, hotbar: 36-44
110
+ ...playerInv(14, 9, 36),
111
+ ],
112
+ },
113
+
114
+ large_chest: {
115
+ name: 'large_chest',
116
+ title: 'Large Chest',
117
+ backgroundTexture: 'gui/container/generic_54',
118
+ backgroundWidth: 176,
119
+ backgroundHeight: 222,
120
+ playerInventoryOffset: { x: 8, y: 140 },
121
+ slots: [
122
+ ...gridSlots(0, 9, 6, 8, 18, 'container'),
123
+ // player inv: 54-80, hotbar: 81-89
124
+ ...playerInv(140, 54, 81),
125
+ ],
126
+ },
127
+
128
+ crafting_table: {
129
+ name: 'crafting_table',
130
+ title: 'Crafting',
131
+ backgroundTexture: 'gui/container/crafting_table',
132
+ backgroundWidth: 176,
133
+ backgroundHeight: 166,
134
+ slots: [
135
+ { index: 0, x: 124, y: 35, group: 'result', resultSlot: true },
136
+ ...gridSlots(1, 3, 3, 30, 17, 'crafting'),
137
+ // inv: 10-36, hotbar: 37-45
138
+ ...playerInv(84, 10, 37),
139
+ ],
140
+ },
141
+
142
+ furnace: {
143
+ name: 'furnace',
144
+ title: 'Furnace',
145
+ backgroundTexture: 'gui/container/furnace',
146
+ backgroundWidth: 176,
147
+ backgroundHeight: 166,
148
+ properties: {
149
+ litTime: { dataSlot: 0, description: 'Fuel burn time remaining' },
150
+ litDuration: { dataSlot: 1, description: 'Max fuel burn time' },
151
+ cookingProgress: { dataSlot: 2, description: 'Cook progress (0-200)' },
152
+ totalCookTime: { dataSlot: 3, description: 'Total cook time' },
153
+ },
154
+ progressBars: [
155
+ {
156
+ id: 'fire',
157
+ x: 56, y: 36, width: 14, height: 14,
158
+ direction: 'up',
159
+ textureX: 176, textureY: 0,
160
+ emptyTextureX: 176, emptyTextureY: 12,
161
+ getValue: (p) => p.litTime ?? 0,
162
+ getMax: (p) => p.litDuration || 200,
163
+ },
164
+ {
165
+ id: 'arrow',
166
+ x: 79, y: 34, width: 24, height: 16,
167
+ direction: 'right',
168
+ textureX: 176, textureY: 14,
169
+ getValue: (p) => p.cookingProgress ?? 0,
170
+ getMax: (p) => p.totalCookTime || 200,
171
+ },
172
+ ],
173
+ slots: [
174
+ { index: 0, x: 56, y: 17, group: 'input' },
175
+ { index: 1, x: 56, y: 53, group: 'fuel', fuelSlot: true },
176
+ { index: 2, x: 116, y: 35, group: 'result', resultSlot: true },
177
+ // player inv: 3-29, hotbar: 30-38
178
+ ...playerInv(84, 3, 30),
179
+ ],
180
+ },
181
+
182
+ blast_furnace: {
183
+ name: 'blast_furnace',
184
+ title: 'Blast Furnace',
185
+ backgroundTexture: 'gui/container/blast_furnace',
186
+ backgroundWidth: 176,
187
+ backgroundHeight: 166,
188
+ properties: {
189
+ litTime: { dataSlot: 0, description: 'Fuel burn time remaining' },
190
+ litDuration: { dataSlot: 1, description: 'Max fuel burn time' },
191
+ cookingProgress: { dataSlot: 2, description: 'Cook progress (0-200)' },
192
+ totalCookTime: { dataSlot: 3, description: 'Total cook time' },
193
+ },
194
+ progressBars: [
195
+ {
196
+ id: 'fire',
197
+ x: 56, y: 36, width: 14, height: 14,
198
+ direction: 'up',
199
+ textureX: 176, textureY: 0,
200
+ getValue: (p) => p.litTime ?? 0,
201
+ getMax: (p) => p.litDuration || 200,
202
+ },
203
+ {
204
+ id: 'arrow',
205
+ x: 79, y: 34, width: 24, height: 16,
206
+ direction: 'right',
207
+ textureX: 176, textureY: 14,
208
+ getValue: (p) => p.cookingProgress ?? 0,
209
+ getMax: (p) => p.totalCookTime || 200,
210
+ },
211
+ ],
212
+ slots: [
213
+ { index: 0, x: 56, y: 17, group: 'input' },
214
+ { index: 1, x: 56, y: 53, group: 'fuel', fuelSlot: true },
215
+ { index: 2, x: 116, y: 35, group: 'result', resultSlot: true },
216
+ ...playerInv(84, 3, 30),
217
+ ],
218
+ },
219
+
220
+ smoker: {
221
+ name: 'smoker',
222
+ title: 'Smoker',
223
+ backgroundTexture: 'gui/container/smoker',
224
+ backgroundWidth: 176,
225
+ backgroundHeight: 166,
226
+ properties: {
227
+ litTime: { dataSlot: 0, description: 'Fuel burn time remaining' },
228
+ litDuration: { dataSlot: 1, description: 'Max fuel burn time' },
229
+ cookingProgress: { dataSlot: 2, description: 'Cook progress (0-200)' },
230
+ totalCookTime: { dataSlot: 3, description: 'Total cook time' },
231
+ },
232
+ progressBars: [
233
+ {
234
+ id: 'fire',
235
+ x: 56, y: 36, width: 14, height: 14,
236
+ direction: 'up',
237
+ textureX: 176, textureY: 0,
238
+ getValue: (p) => p.litTime ?? 0,
239
+ getMax: (p) => p.litDuration || 200,
240
+ },
241
+ {
242
+ id: 'arrow',
243
+ x: 79, y: 34, width: 24, height: 16,
244
+ direction: 'right',
245
+ textureX: 176, textureY: 14,
246
+ getValue: (p) => p.cookingProgress ?? 0,
247
+ getMax: (p) => p.totalCookTime || 200,
248
+ },
249
+ ],
250
+ slots: [
251
+ { index: 0, x: 56, y: 17, group: 'input' },
252
+ { index: 1, x: 56, y: 53, group: 'fuel', fuelSlot: true },
253
+ { index: 2, x: 116, y: 35, group: 'result', resultSlot: true },
254
+ // smoker: inv 3-29, hotbar: 30-38
255
+ ...playerInv(84, 3, 30),
256
+ ],
257
+ },
258
+
259
+ brewing_stand: {
260
+ name: 'brewing_stand',
261
+ title: 'Brewing Stand',
262
+ backgroundTexture: 'gui/container/brewing_stand',
263
+ backgroundWidth: 176,
264
+ backgroundHeight: 166,
265
+ properties: {
266
+ brewTime: { dataSlot: 0, description: 'Brew time remaining (0-400)' },
267
+ fuelLevel: { dataSlot: 1, description: 'Fuel level (0-20)' },
268
+ },
269
+ progressBars: [
270
+ {
271
+ id: 'brew_arrow',
272
+ x: 97, y: 16, width: 9, height: 28,
273
+ direction: 'down',
274
+ textureX: 176, textureY: 0,
275
+ getValue: (p) => 400 - (p.brewTime ?? 400),
276
+ getMax: () => 400,
277
+ },
278
+ {
279
+ id: 'fuel',
280
+ x: 18, y: 44, width: 18, height: 4,
281
+ direction: 'right',
282
+ textureX: 176, textureY: 29,
283
+ getValue: (p) => p.fuelLevel ?? 0,
284
+ getMax: () => 20,
285
+ },
286
+ ],
287
+ slots: [
288
+ { index: 0, x: 56, y: 51, group: 'bottle', label: 'Left' },
289
+ { index: 1, x: 79, y: 58, group: 'bottle', label: 'Center' },
290
+ { index: 2, x: 102, y: 51, group: 'bottle', label: 'Right' },
291
+ { index: 3, x: 79, y: 17, group: 'ingredient' },
292
+ { index: 4, x: 17, y: 17, group: 'fuel', fuelSlot: true },
293
+ // inv: 5-31, hotbar: 32-40
294
+ ...playerInv(84, 5, 32),
295
+ ],
296
+ },
297
+
298
+ anvil: {
299
+ name: 'anvil',
300
+ title: 'Repair & Name',
301
+ backgroundTexture: 'gui/container/anvil',
302
+ backgroundWidth: 176,
303
+ backgroundHeight: 166,
304
+ properties: {
305
+ repairCost: { dataSlot: 0, description: 'Level cost' },
306
+ },
307
+ slots: [
308
+ { index: 0, x: 27, y: 47, group: 'input' },
309
+ { index: 1, x: 76, y: 47, group: 'input' },
310
+ { index: 2, x: 134, y: 47, group: 'result', resultSlot: true },
311
+ // inv: 3-29, hotbar: 30-38
312
+ ...playerInv(84, 3, 30),
313
+ ],
314
+ },
315
+
316
+ grindstone: {
317
+ name: 'grindstone',
318
+ title: 'Repair & Disenchant',
319
+ backgroundTexture: 'gui/container/grindstone',
320
+ backgroundWidth: 176,
321
+ backgroundHeight: 166,
322
+ slots: [
323
+ { index: 0, x: 49, y: 19, group: 'input' },
324
+ { index: 1, x: 49, y: 40, group: 'input' },
325
+ { index: 2, x: 129, y: 34, group: 'result', resultSlot: true },
326
+ ...playerInv(84, 3, 30),
327
+ ],
328
+ },
329
+
330
+ enchanting_table: {
331
+ name: 'enchanting_table',
332
+ title: 'Enchant',
333
+ backgroundTexture: 'gui/container/enchanting_table',
334
+ backgroundWidth: 176,
335
+ backgroundHeight: 166,
336
+ properties: {
337
+ topEnchantLevel: { dataSlot: 0, description: 'Top enchantment level' },
338
+ middleEnchantLevel: { dataSlot: 1, description: 'Middle enchantment level' },
339
+ bottomEnchantLevel: { dataSlot: 2, description: 'Bottom enchantment level' },
340
+ seed: { dataSlot: 3, description: 'Random seed' },
341
+ topEnchantId: { dataSlot: 4, description: 'Top enchantment ID' },
342
+ middleEnchantId: { dataSlot: 5, description: 'Middle enchantment ID' },
343
+ bottomEnchantId: { dataSlot: 6, description: 'Bottom enchantment ID' },
344
+ },
345
+ slots: [
346
+ { index: 0, x: 15, y: 47, group: 'enchant' },
347
+ { index: 1, x: 35, y: 47, group: 'lapis', label: 'Lapis Lazuli' },
348
+ // inv: 2-28, hotbar: 29-37
349
+ ...playerInv(84, 2, 29),
350
+ ],
351
+ },
352
+
353
+ smithing_table: {
354
+ name: 'smithing_table',
355
+ title: 'Upgrade Gear',
356
+ backgroundTexture: 'gui/container/smithing',
357
+ guiTextureVersion: '1.21.4',
358
+ backgroundWidth: 176,
359
+ backgroundHeight: 166,
360
+ slots: [
361
+ { index: 0, x: 8, y: 48, group: 'template', label: 'Template' },
362
+ { index: 1, x: 26, y: 48, group: 'input', label: 'Base' },
363
+ { index: 2, x: 44, y: 48, group: 'addition', label: 'Material' },
364
+ { index: 3, x: 98, y: 48, group: 'result', resultSlot: true },
365
+ // inv: 4-30, hotbar: 31-39
366
+ ...playerInv(84, 4, 31),
367
+ ],
368
+ },
369
+
370
+ smithing_table_legacy: {
371
+ name: 'smithing_table_legacy',
372
+ title: 'Upgrade Gear',
373
+ backgroundTexture: 'gui/container/smithing',
374
+ backgroundWidth: 176,
375
+ backgroundHeight: 166,
376
+ slots: [
377
+ { index: 0, x: 27, y: 47, group: 'input', label: 'Base' },
378
+ { index: 1, x: 76, y: 47, group: 'addition', label: 'Material' },
379
+ { index: 2, x: 134, y: 47, group: 'result', resultSlot: true },
380
+ ...playerInv(84, 3, 30),
381
+ ],
382
+ },
383
+
384
+ hopper: {
385
+ name: 'hopper',
386
+ title: 'Item Hopper',
387
+ backgroundTexture: 'gui/container/hopper',
388
+ backgroundWidth: 176,
389
+ backgroundHeight: 133,
390
+ slots: [
391
+ ...gridSlots(0, 5, 1, 44, 20, 'container'),
392
+ ...Array.from({ length: 27 }, (_, i) => ({
393
+ index: 5 + i,
394
+ x: 8 + (i % 9) * SLOT_SIZE,
395
+ y: 51 + Math.floor(i / 9) * SLOT_SIZE,
396
+ group: 'inventory' as const,
397
+ })),
398
+ ...hotbarSlots(109, 32),
399
+ ],
400
+ },
401
+
402
+ dispenser: {
403
+ name: 'dispenser',
404
+ title: 'Dispenser',
405
+ backgroundTexture: 'gui/container/dispenser',
406
+ backgroundWidth: 176,
407
+ backgroundHeight: 166,
408
+ slots: [
409
+ ...gridSlots(0, 3, 3, 62, 17, 'container'),
410
+ // inv: 9-35, hotbar: 36-44
411
+ ...playerInv(84, 9, 36),
412
+ ],
413
+ },
414
+
415
+ dropper: {
416
+ name: 'dropper',
417
+ title: 'Dropper',
418
+ backgroundTexture: 'gui/container/dispenser',
419
+ backgroundWidth: 176,
420
+ backgroundHeight: 166,
421
+ slots: [
422
+ ...gridSlots(0, 3, 3, 62, 17, 'container'),
423
+ ...playerInv(84, 9, 36),
424
+ ],
425
+ },
426
+
427
+ beacon: {
428
+ name: 'beacon',
429
+ title: 'Beacon',
430
+ backgroundTexture: 'gui/container/beacon',
431
+ backgroundWidth: 230,
432
+ backgroundHeight: 219,
433
+ slots: [
434
+ { index: 0, x: 136, y: 110, group: 'payment', label: 'Payment' },
435
+ // inv: 1-27, hotbar: 28-36
436
+ ...playerInv(136, 1, 28),
437
+ ],
438
+ },
439
+
440
+ horse: {
441
+ name: 'horse',
442
+ title: 'Horse',
443
+ backgroundTexture: 'gui/container/horse',
444
+ backgroundWidth: 176,
445
+ backgroundHeight: 166,
446
+ slots: [
447
+ { index: 0, x: 8, y: 18, group: 'saddle', label: 'Saddle' },
448
+ { index: 1, x: 8, y: 36, group: 'armor', label: 'Horse Armor' },
449
+ // inv: 2-28, hotbar: 29-37
450
+ ...playerInv(84, 2, 29),
451
+ ],
452
+ },
453
+
454
+ donkey: {
455
+ name: 'donkey',
456
+ title: 'Donkey',
457
+ backgroundTexture: 'gui/container/horse',
458
+ backgroundWidth: 176,
459
+ backgroundHeight: 166,
460
+ slots: [
461
+ { index: 0, x: 8, y: 18, group: 'saddle', label: 'Saddle' },
462
+ // chest items 2-16 (3x5) when has chest
463
+ ...Array.from({ length: 15 }, (_, i) => ({
464
+ index: 2 + i,
465
+ x: 80 + (i % 5) * SLOT_SIZE,
466
+ y: 18 + Math.floor(i / 5) * SLOT_SIZE,
467
+ group: 'chest' as const,
468
+ })),
469
+ // inv: 17-43, hotbar: 44-52 (after 2 equipment + 15 chest)
470
+ ...playerInv(84, 17, 44),
471
+ ],
472
+ },
473
+
474
+ llama: {
475
+ name: 'llama',
476
+ title: 'Llama',
477
+ backgroundTexture: 'gui/container/horse',
478
+ backgroundWidth: 176,
479
+ backgroundHeight: 166,
480
+ slots: [
481
+ { index: 0, x: 8, y: 18, group: 'saddle', label: 'Carpet' },
482
+ ...Array.from({ length: 15 }, (_, i) => ({
483
+ index: 2 + i,
484
+ x: 80 + (i % 5) * SLOT_SIZE,
485
+ y: 18 + Math.floor(i / 5) * SLOT_SIZE,
486
+ group: 'chest' as const,
487
+ })),
488
+ ...playerInv(84, 17, 44),
489
+ ],
490
+ },
491
+
492
+ villager: {
493
+ name: 'villager',
494
+ title: 'Villager',
495
+ backgroundTexture: 'gui/container/villager2',
496
+ backgroundWidth: 276,
497
+ backgroundHeight: 166,
498
+ slots: [
499
+ { index: 0, x: 136, y: 37, group: 'trade_input1' },
500
+ { index: 1, x: 162, y: 37, group: 'trade_input2' },
501
+ { index: 2, x: 216, y: 37, group: 'trade_result', resultSlot: true },
502
+ ...Array.from({ length: 27 }, (_, i) => ({
503
+ index: 3 + i,
504
+ x: 108 + (i % 9) * SLOT_SIZE,
505
+ y: 84 + Math.floor(i / 9) * SLOT_SIZE,
506
+ group: 'inventory' as const,
507
+ })),
508
+ ...hotbarSlots(142, 30, 108),
509
+ ],
510
+ },
511
+
512
+ shulker_box: {
513
+ name: 'shulker_box',
514
+ title: 'Shulker Box',
515
+ backgroundTexture: 'gui/container/shulker_box',
516
+ backgroundWidth: 176,
517
+ backgroundHeight: 166,
518
+ slots: [
519
+ ...gridSlots(0, 9, 3, 8, 18, 'container'),
520
+ ...playerInv(84, 27, 54),
521
+ ],
522
+ },
523
+
524
+ barrel: {
525
+ name: 'barrel',
526
+ title: 'Barrel',
527
+ backgroundTexture: 'gui/container/shulker_box',
528
+ backgroundWidth: 176,
529
+ backgroundHeight: 166,
530
+ slots: [
531
+ ...gridSlots(0, 9, 3, 8, 18, 'container'),
532
+ ...playerInv(84, 27, 54),
533
+ ],
534
+ },
535
+
536
+ cartography_table: {
537
+ name: 'cartography_table',
538
+ title: 'Cartography Table',
539
+ backgroundTexture: 'gui/container/cartography_table',
540
+ backgroundWidth: 176,
541
+ backgroundHeight: 166,
542
+ slots: [
543
+ { index: 0, x: 15, y: 15, group: 'input', label: 'Map' },
544
+ { index: 1, x: 15, y: 39, group: 'input', label: 'Paper/Map' },
545
+ { index: 2, x: 145, y: 39, group: 'result', resultSlot: true },
546
+ ...playerInv(84, 3, 30),
547
+ ],
548
+ },
549
+
550
+ loom: {
551
+ name: 'loom',
552
+ title: 'Loom',
553
+ backgroundTexture: 'gui/container/loom',
554
+ backgroundWidth: 176,
555
+ backgroundHeight: 166,
556
+ slots: [
557
+ { index: 0, x: 13, y: 26, group: 'input', label: 'Banner' },
558
+ { index: 1, x: 33, y: 26, group: 'input', label: 'Dye' },
559
+ { index: 2, x: 23, y: 45, group: 'input', label: 'Pattern' },
560
+ { index: 3, x: 143, y: 58, group: 'result', resultSlot: true },
561
+ ...playerInv(84, 4, 31),
562
+ ],
563
+ },
564
+
565
+ stonecutter: {
566
+ name: 'stonecutter',
567
+ title: 'Stonecutter',
568
+ backgroundTexture: 'gui/container/stonecutter',
569
+ backgroundWidth: 176,
570
+ backgroundHeight: 166,
571
+ slots: [
572
+ { index: 0, x: 20, y: 33, group: 'input' },
573
+ { index: 1, x: 143, y: 33, group: 'result', resultSlot: true },
574
+ ...playerInv(84, 2, 29),
575
+ ],
576
+ },
577
+
578
+ lectern: {
579
+ name: 'lectern',
580
+ title: 'Lectern',
581
+ backgroundTexture: 'gui/container/lectern',
582
+ backgroundWidth: 176,
583
+ backgroundHeight: 166,
584
+ slots: [],
585
+ },
586
+
587
+ crafter: {
588
+ name: 'crafter',
589
+ title: 'Crafter',
590
+ backgroundTexture: 'gui/container/crafter',
591
+ guiTextureVersion: '1.21.4',
592
+ backgroundWidth: 176,
593
+ backgroundHeight: 166,
594
+ slots: [
595
+ ...gridSlots(0, 3, 3, 30, 17, 'crafting'),
596
+ { index: 9, x: 124, y: 35, group: 'result', resultSlot: true },
597
+ ...playerInv(84, 10, 37),
598
+ ],
599
+ },
600
+
601
+ creative: {
602
+ name: 'creative',
603
+ title: 'Creative Inventory',
604
+ backgroundTexture: 'gui/container/creative_inventory/tab_items',
605
+ backgroundWidth: 195,
606
+ backgroundHeight: 136,
607
+ slots: [
608
+ ...gridSlots(0, 9, 5, 9, 48, 'body'),
609
+ ...hotbarSlots(142, 0),
610
+ ],
611
+ },
612
+ }
@@ -0,0 +1,47 @@
1
+ /* Minecraft Inventory GUI - Design Tokens
2
+ All sizes use CSS custom properties driven by --mc-scale
3
+ so the entire UI scales without transform */
4
+
5
+ :root {
6
+ --mc-scale: 2;
7
+
8
+ /* Computed from scale */
9
+ --mc-slot-size: calc(18px * var(--mc-scale));
10
+ --mc-font-size: calc(7px * var(--mc-scale));
11
+ --mc-pixel: calc(1px * var(--mc-scale));
12
+ --mc-border: calc(1px * var(--mc-scale));
13
+ --mc-gap: calc(2px * var(--mc-scale));
14
+ --mc-padding: calc(4px * var(--mc-scale));
15
+ --mc-count-font: calc(6px * var(--mc-scale));
16
+
17
+ /* Colors */
18
+ --mc-bg: #c6c6c6;
19
+ --mc-dark: #404040;
20
+ --mc-darker: #282828;
21
+ --mc-slot-bg: #8b8b8b;
22
+ --mc-slot-border-light: #ffffff;
23
+ --mc-slot-border-dark: #373737;
24
+ --mc-tooltip-bg: #100010;
25
+ --mc-tooltip-border: #5000ff;
26
+ --mc-tooltip-text: #ffffff;
27
+ --mc-tooltip-lore: #6b29a4;
28
+ --mc-highlight: rgba(255,255,255,0.4);
29
+ --mc-held-highlight: rgba(255,255,255,0.5);
30
+ --mc-text-shadow: rgba(0,0,0,0.5);
31
+ --mc-count-color: #ffffff;
32
+ --mc-enchant-color: #8080ff;
33
+ --mc-durability-full: #55ff55;
34
+ --mc-durability-low: #ff5555;
35
+ }
36
+
37
+ .mc-inv-root {
38
+ font-family: 'Minecraftia', 'Minecraft', monospace;
39
+ image-rendering: pixelated;
40
+ image-rendering: crisp-edges;
41
+ user-select: none;
42
+ -webkit-user-select: none;
43
+ }
44
+
45
+ .mc-inv-root * {
46
+ box-sizing: border-box;
47
+ }