Recipe
public class MerchantRecipe extends java.lang.Object implements Recipe
VillagerReplenishTradeEvent
Constructor | Description |
---|---|
MerchantRecipe(ItemStack result,
int maxUses) |
|
MerchantRecipe(ItemStack result,
int uses,
int maxUses,
boolean experienceReward) |
Modifier and Type | Method | Description |
---|---|---|
void |
addIngredient(ItemStack item) |
|
java.util.List<ItemStack> |
getIngredients() |
|
int |
getMaxUses() |
Get the maximum number of uses this trade has.
|
ItemStack |
getResult() |
Get the result of this recipe.
|
int |
getUses() |
Get the number of times this trade has been used.
|
boolean |
hasExperienceReward() |
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(java.util.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.
|
public MerchantRecipe(ItemStack result, int maxUses)
public MerchantRecipe(ItemStack result, int uses, int maxUses, boolean experienceReward)
public ItemStack getResult()
Recipe
public void addIngredient(ItemStack item)
public void removeIngredient(int index)
public void setIngredients(java.util.List<ItemStack> ingredients)
public java.util.List<ItemStack> getIngredients()
public int getUses()
public void setUses(int uses)
uses
- the number of usespublic int getMaxUses()
public void setMaxUses(int maxUses)
maxUses
- the maximum number of time this trade can be usedpublic boolean hasExperienceReward()
public void setExperienceReward(boolean flag)
flag
- whether to reward experience for completing this tradeCopyright © 2018. All rights reserved.