Villager
public interface Merchant
Modifier and Type | Method | Description |
---|---|---|
MerchantRecipe |
getRecipe(int i) |
Get the recipe at a certain index of this merchant's trade list.
|
int |
getRecipeCount() |
Get the number of trades this merchant currently has available.
|
List<MerchantRecipe> |
getRecipes() |
Get a list of trades currently available from this merchant.
|
HumanEntity |
getTrader() |
Gets the player this merchant is trading with, or null if it is not
currently trading.
|
boolean |
isTrading() |
Gets whether this merchant is currently trading.
|
void |
setRecipe(int i,
MerchantRecipe recipe) |
Set the recipe at a certain index of this merchant's trade list.
|
void |
setRecipes(List<MerchantRecipe> recipes) |
Set the list of trades currently available from this merchant.
|
@NotNull List<MerchantRecipe> getRecipes()
void setRecipes(@NotNull List<MerchantRecipe> recipes)
recipes
- a list of recipes@NotNull MerchantRecipe getRecipe(int i) throws IndexOutOfBoundsException
i
- the indexIndexOutOfBoundsException
- Throws when specified index is larger than Merchant's inventoryvoid setRecipe(int i, @NotNull MerchantRecipe recipe) throws IndexOutOfBoundsException
i
- the indexrecipe
- the recipeIndexOutOfBoundsException
- Throws when specified index is larger than Merchant's inventoryint getRecipeCount()
boolean isTrading()
@Nullable HumanEntity getTrader()
Copyright © 2020. All rights reserved.