Skip to content

StoneCutterInventory ​

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

Since1.8.4

Handles an open stonecutter screen. Recipe indices in getRecipes() correspond to those accepted by 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 ​

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().

Parameters:

  • inventory: the stonecutter screen to wrap

Methods ​

canCraft ​

canCraft(): booleanSince1.8.4#
Returns whether the menu has an input item.
Returns: true if the menu has an input item; false otherwise

getAvailableRecipeCount ​

getAvailableRecipeCount(): intSince1.8.4#
Returns the number of currently visible recipes.
Returns: the number of currently visible recipes

getOutput ​

getOutput(): ItemStackHelperSince1.8.4#
Returns the stonecutter result slot (slot 1).
Returns: the result slot

getRecipes ​

getRecipes(): List<ItemStackHelper>Since1.8.4#
Returns displayed results for the currently visible recipes, in selection-index order.
Returns: displayed results in selection-index order

getSelectedRecipeIndex ​

getSelectedRecipeIndex(): intSince1.8.4#
Returns the selected recipe index, or -1 when no recipe is selected.
Returns: the selected recipe index, or -1 when none is selected

selectRecipe ​

selectRecipe(int idx): StoneCutterInventorySince1.8.4#
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

toString ​

toString(): String#
Returns the fixed diagnostic label StoneCutterInventory:{}.
Returns: StoneCutterInventory:{}