类 MerchantRecipe
java.lang.Object
org.bukkit.inventory.MerchantRecipe
- 所有已实现的接口:
Recipe
Represents a merchant's trade.
Trades can take one or two ingredients, and provide one result. The
ingredients' Itemstack amounts are respected in the trade.
A trade has a limited number of uses, after which the trade can no longer be used, unless the player uses a different trade, which will cause its maximum uses to increase.
A trade may or may not reward experience for being completed.
A trade has a limited number of uses, after which the trade can no longer be used, unless the player uses a different trade, which will cause its maximum uses to increase.
A trade may or may not reward experience for being completed.
-
构造器概要
构造器说明MerchantRecipe
(ItemStack result, int maxUses) MerchantRecipe
(ItemStack result, int uses, int maxUses, boolean experienceReward) -
方法概要
修饰符和类型方法说明void
addIngredient
(ItemStack item) int
Get the maximum number of uses this trade has.得到这个配方的结果.int
getUses()
Get the number of times this trade has been used.boolean
Whether to reward experience for the trade.void
removeIngredient
(int index) void
setExperienceReward
(boolean flag) Set whether to reward experience for the trade.void
setIngredients
(List<ItemStack> ingredients) void
setMaxUses
(int maxUses) Set the maximum number of uses this trade has.void
setUses
(int uses) Set the number of times this trade has been used.
-
构造器详细资料
-
MerchantRecipe
-
MerchantRecipe
-
-
方法详细资料
-
getResult
从接口复制的说明:Recipe
得到这个配方的结果.原文: Get the result of this recipe.
-
addIngredient
-
removeIngredient
public void removeIngredient(int index) -
setIngredients
-
getIngredients
-
getUses
public int getUses()Get the number of times this trade has been used.- 返回:
- the number of uses
-
setUses
public void setUses(int uses) Set the number of times this trade has been used.- 参数:
uses
- the number of uses
-
getMaxUses
public int getMaxUses()Get the maximum number of uses this trade has.
The maximum uses of this trade may increase when a player trades with the owning merchant.- 返回:
- the maximum number of uses
-
setMaxUses
public void setMaxUses(int maxUses) Set the maximum number of uses this trade has.- 参数:
maxUses
- the maximum number of time this trade can be used
-
hasExperienceReward
public boolean hasExperienceReward()Whether to reward experience for the trade.- 返回:
- whether to reward experience for completing this trade
-
setExperienceReward
public void setExperienceReward(boolean flag) Set whether to reward experience for the trade.- 参数:
flag
- whether to reward experience for completing this trade
-