# StoneCutterInventory

`com.jsmacrosce.jsmacros.client.api.classes.inventory.StoneCutterInventory`

**Since:** 1.8.4

Handles an open stonecutter screen. Recipe indices in [getRecipes()](#com.jsmacrosce.jsmacros.client.api.classes.inventory.StoneCutterInventory_getRecipes-) correspond to
 those accepted by [selectRecipe(int)](#com.jsmacrosce.jsmacros.client.api.classes.inventory.StoneCutterInventory_selectRecipe-int-).  
 ```js
const inv = Player.openInventory();  
if (inv instanceof Inventories.StoneCutter) {
  if (inv.canCraft()) {
    const count = inv.getAvailableRecipeCount();  
    Chat.log(`${count} cuts from ${inv.getSlot(0).getItemId()}`);  
    inv.selectRecipe(0);  
    Chat.log(`now making ${inv.getOutput().getItemId()}`);  
  }
}
 ```

Available in scripts as `Inventories.StoneCutter`.

## Constructors

### new StoneCutterInventory {#com.jsmacrosce.jsmacros.client.api.classes.inventory.StoneCutterInventory_constructor-StonecutterScreen-}

```js
new StoneCutterInventory(StonecutterScreen inventory)
```

Wraps the supplied stonecutter screen and captures its menu and current client player state.  
 Obtain the current inventory wrapper with [FPlayer.openInventory()](../../../../../../../../libraries/com/jsmacrosce/jsmacros/client/api/library/impl/FPlayer.md#com.jsmacrosce.jsmacros.client.api.library.impl.FPlayer_openInventory-).

**Parameters:**
- `inventory`: the stonecutter screen to wrap

## Methods

### canCraft {#com.jsmacrosce.jsmacros.client.api.classes.inventory.StoneCutterInventory_canCraft-}

```js
canCraft(): boolean
```

Returns whether the menu has an input item.

**Returns:** `true` if the menu has an input item; `false` otherwise

**Since:** 1.8.4

### getAvailableRecipeCount {#com.jsmacrosce.jsmacros.client.api.classes.inventory.StoneCutterInventory_getAvailableRecipeCount-}

```js
getAvailableRecipeCount(): int
```

Returns the number of currently visible recipes.

**Returns:** the number of currently visible recipes

**Since:** 1.8.4

### getOutput {#com.jsmacrosce.jsmacros.client.api.classes.inventory.StoneCutterInventory_getOutput-}

```js
getOutput(): ItemStackHelper
```

Returns the stonecutter result slot (slot 1).

**Returns:** the result slot

**Since:** 1.8.4

### getRecipes {#com.jsmacrosce.jsmacros.client.api.classes.inventory.StoneCutterInventory_getRecipes-}

```js
getRecipes(): List<ItemStackHelper>
```

Returns displayed results for the currently visible recipes, in selection-index order.

**Returns:** displayed results in selection-index order

**Since:** 1.8.4

### getSelectedRecipeIndex {#com.jsmacrosce.jsmacros.client.api.classes.inventory.StoneCutterInventory_getSelectedRecipeIndex-}

```js
getSelectedRecipeIndex(): int
```

Returns the selected recipe index, or `-1` when no recipe is selected.

**Returns:** the selected recipe index, or `-1` when none is selected

**Since:** 1.8.4

### selectRecipe {#com.jsmacrosce.jsmacros.client.api.classes.inventory.StoneCutterInventory_selectRecipe-int-}

```js
selectRecipe(int idx): StoneCutterInventory
```

Selects a currently visible recipe by its zero-based index. Indices outside the visible
 range do nothing.

**Parameters:**
- `idx`: zero-based recipe index

**Returns:** this inventory for chaining, regardless of whether selection occurred

**Since:** 1.8.4

### toString {#com.jsmacrosce.jsmacros.client.api.classes.inventory.StoneCutterInventory_toString-}

```js
toString(): String
```

Returns the fixed diagnostic label `StoneCutterInventory:{}`.

**Returns:** `StoneCutterInventory:{}`
