接口 MerchantInventory

所有超级接口:
Inventory, Iterable<ItemStack>

public interface MerchantInventory extends Inventory
代表玩家和商人之间的用户界面接口.
该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.

  • 方法详细资料

    • getSelectedRecipeIndex

      int getSelectedRecipeIndex()
      获取当前的交易配方的索引.

      原文: Get the index of the currently selected recipe.

      返回:
      当前所选的交易配方的索引
    • getSelectedRecipe

      @Nullable @Nullable MerchantRecipe 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

      @NotNull @NotNull Merchant getMerchant()
      Gets the Merchant associated with this inventory.
      返回:
      merchant