public interface Merchant
Represents a merchant. A merchant is a special type of inventory which can facilitate custom trades between items.
限定符和类型 | 方法和说明 |
---|---|
MerchantRecipe |
getRecipe(int i)
获取该商人的交易列表的某个索引处的
MerchantRecipe . |
int |
getRecipeCount()
获取此商人当前可用的交易数量.
|
java.util.List<MerchantRecipe> |
getRecipes()
获取该商人当前可用的交易列表.
|
HumanEntity |
getTrader()
获取该商人正在进行交易的玩家, 如果目前没有交易,则返回null.
|
boolean |
isTrading()
获取该商人是否正在交易.
|
void |
setRecipe(int i,
MerchantRecipe recipe)
设置在该商人的交易列表的指定索引处的
MerchantRecipe . |
void |
setRecipes(java.util.List<MerchantRecipe> recipes)
设置该商家当前可用的交易列表.
|
java.util.List<MerchantRecipe> getRecipes()
原文: Get a list of trades currently available from this merchant.
void setRecipes(java.util.List<MerchantRecipe> recipes)
原文: Set the list of trades currently available from this merchant.
This will not change the selected trades of players currently trading
with this merchant.
recipes
- 一个关于MerchantRecipe
的ListMerchantRecipe getRecipe(int i) throws java.lang.IndexOutOfBoundsException
MerchantRecipe
.
原文: Get the recipe at a certain index of this merchant's trade list.
i
- 索引MerchantRecipe
java.lang.IndexOutOfBoundsException
- 当下标越界时抛出此异常void setRecipe(int i, MerchantRecipe recipe) throws java.lang.IndexOutOfBoundsException
MerchantRecipe
.
原文: Set the recipe at a certain index of this merchant's trade list.
i
- 索引recipe
- 给定的交易配方java.lang.IndexOutOfBoundsException
- 当下标越界时抛出此异常int getRecipeCount()
原文: Get the number of trades this merchant currently has available.
boolean isTrading()
原文: Gets whether this merchant is currently trading.
HumanEntity getTrader()
原文: Gets the player this merchant is trading with, or null if it is not currently trading.