接口 MerchantInventory
该Inventory的持有者是拥有的村民, 如果玩家正在于由插件创造的Inventory进行交易, 则Holder(持有者)将为null
原文: Represents a trading inventory between a player and a merchant.
The holder of this Inventory is the owning Villager, or null if the player is
trading with a merchant created by a plugin.
-
方法概要
修饰符和类型方法说明Gets the Merchant associated with this inventory.获取当前活跃的交易配方.int
获取当前的交易配方的索引.从接口继承的方法 org.bukkit.inventory.Inventory
addItem, all, all, clear, clear, contains, contains, contains, contains, containsAtLeast, first, first, firstEmpty, getContents, getHolder, getItem, getLocation, getMaxStackSize, getSize, getStorageContents, getType, getViewers, isEmpty, iterator, iterator, remove, remove, removeItem, setContents, setItem, setMaxStackSize, setStorageContents
从接口继承的方法 java.lang.Iterable
forEach, spliterator
-
方法详细资料
-
getSelectedRecipeIndex
int getSelectedRecipeIndex()获取当前的交易配方的索引.原文: Get the index of the currently selected recipe.
- 返回:
- 当前所选的交易配方的索引
-
getSelectedRecipe
获取当前活跃的交易配方.This will be
null
if the items provided by the player do not match the ingredients of the selected recipe. This does not necessarily match the recipe selected by the player: If the player has selected the first recipe, the merchant will search all of its offers for a matching recipe to activate.原文:Get the currently active recipe.
This will be
null
if the items provided by the player do not match the ingredients of the selected recipe. This does not necessarily match the recipe selected by the player: If the player has selected the first recipe, the merchant will search all of its offers for a matching recipe to activate.- 返回:
- 当前活跃的交易配方
-
getMerchant
Gets the Merchant associated with this inventory.- 返回:
- merchant
-