getFirst

static Optional<ItemgetFirst(Predicate<Item> filter)

Gets the first item listed in the shop that matches the specified predicate

Return

the first item in the shop that matches the specified predicate, or an empty optional if no item was found

Parameters

filter

the filter to find an item in the shop

static Optional<ItemgetFirst(Array<String> name)

Gets the first item listed in the shop that has exactly any of the specified names

Return

the first item in the shop that has exactly any of the specified names, or an empty optional if no item was found

Parameters

name

the item names to find an item in the shop

static Optional<ItemgetFirst(Array<int> id)

Gets the first item listed in the shop that has any of the specified ids

Return

the first item in the shop that has any of the specified ids, or an empty optional if no item was found

Parameters

id

the item ids to find an item in the shop