minecraft-inventory 0.1.15 → 0.1.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minecraft-inventory",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "release": {
@@ -31,6 +31,8 @@ export interface InventoryOverlayProps {
31
31
  jeiPosition?: 'left' | 'right'
32
32
  jeiOnGetRecipes?: (item: JEIItem) => RecipeGuide[]
33
33
  jeiOnGetUsages?: (item: JEIItem) => RecipeGuide[]
34
+ jeiOnItemClick?: (item: JEIItem) => void
35
+ jeiOnItemRightClick?: (item: JEIItem) => void
34
36
  /** Enable Notes sidebar (uses localStorage by default if callbacks not provided) */
35
37
  enableNotes?: boolean
36
38
  /** Callback to get notes. If not provided and enableNotes is true, uses localStorage. */
@@ -72,6 +74,8 @@ export function InventoryOverlay({
72
74
  jeiPosition = 'right',
73
75
  jeiOnGetRecipes,
74
76
  jeiOnGetUsages,
77
+ jeiOnItemClick,
78
+ jeiOnItemRightClick,
75
79
  enableNotes = false,
76
80
  notesOnGet,
77
81
  notesOnSave,
@@ -144,6 +148,8 @@ export function InventoryOverlay({
144
148
  <JEI
145
149
  items={jeiItems}
146
150
  position={jeiPosition}
151
+ onItemClick={jeiOnItemClick}
152
+ onItemRightClick={jeiOnItemRightClick}
147
153
  onGetRecipes={jeiOnGetRecipes}
148
154
  onGetUsages={jeiOnGetUsages}
149
155
  onPushRecipeFrame={pushRecipeFrame}
@@ -298,7 +304,7 @@ export function InventoryOverlay({
298
304
  lineHeight: 1,
299
305
  }}
300
306
  >
301
- INV 0.1.15
307
+ INV 0.1.16
302
308
  </a>
303
309
  )}
304
310
 
@@ -26,6 +26,7 @@ interface JEIProps {
26
26
  maxHeight?: number
27
27
  onItemClick?: (item: JEIItem) => void
28
28
  onItemMiddleClick?: (item: JEIItem) => void
29
+ onItemRightClick?: (item: JEIItem) => void
29
30
  /** Called when R is pressed while hovering an item — return list of recipes to display */
30
31
  onGetRecipes?: (item: JEIItem) => RecipeGuide[]
31
32
  /** Called when U is pressed while hovering an item — return list of usages to display */
@@ -67,6 +68,7 @@ export function JEI({
67
68
  maxHeight,
68
69
  onItemClick,
69
70
  onItemMiddleClick,
71
+ onItemRightClick,
70
72
  onGetRecipes,
71
73
  onGetUsages,
72
74
  onPushRecipeFrame,
@@ -353,6 +355,12 @@ export function JEI({
353
355
  } else {
354
356
  pushRecipeFrame(jeiItem, 'recipes')
355
357
  }
358
+ } else if (button === 'right' && mode === 'normal') {
359
+ if (onItemRightClick) {
360
+ onItemRightClick(jeiItem)
361
+ } else {
362
+ pushRecipeFrame(jeiItem, 'usages')
363
+ }
356
364
  } else if (button === 'middle' && onItemMiddleClick) {
357
365
  onItemMiddleClick(jeiItem)
358
366
  }