public class NPCRegistryShopkeepers
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.HashMap<java.lang.String,BaseShopItem> |
shopItems
Map from item names to shop item prices.
|
Constructor and Description |
---|
NPCRegistryShopkeepers() |
Modifier and Type | Method and Description |
---|---|
ShopkeeperData |
getById(java.lang.String id)
Gets an NPC shopkeeper from its internal ID.
|
BaseShopItem |
getItem(net.minecraft.item.ItemStack itemStack)
Retrieves the base shop item by ItemStack.
|
BaseShopItem |
getItem(java.lang.String name)
Retrieves the base shop item by name.
|
ShopItem |
getItem(java.lang.String npcIndex,
java.lang.String itemID)
Retrieves the desired shop item by name.
|
java.lang.String |
getJsonName(java.lang.String npcIndex)
Retrieves the json name for the indexed shopkeeper.
|
ShopkeeperData |
getNext(java.lang.String npcIndex)
Gets the next shopkeeper from a current index.
|
ShopkeeperData |
getRandom()
Randomly selects a group of shopkeeper data.
|
ShopkeeperData |
getRandom(EnumShopKeeperType type)
Randomly selects a group of shopkeeper data.
|
ShopkeeperData |
getRandomSpawning(java.lang.String biomeID)
Gets a random spawn shopkeeper for a biome.
|
java.lang.String[] |
getRoamingBiomes()
Gets biomes where spawn shopkeepers can spawn in.
|
ShopkeeperChat |
getTranslatedChat(java.lang.String langCode,
java.lang.String npcIndex,
int index)
Retrieves the translated version of the indexed shopkeeper chat.
|
ShopkeeperData |
getTranslatedData(java.lang.String langCode,
java.lang.String id)
Retrieves shopkeeper NPC data for a specific shopkeeper type.
|
java.lang.String |
getTranslatedName(java.lang.String langCode,
java.lang.String npcIndex,
int nameIndex)
Retrieves the translated version of the indexed shopkeeper name.
|
boolean |
hasRoaming()
Checks if there are any spawn shopkeepers registered.
|
void |
registerShopItems(com.google.gson.JsonElement element)
Registers shop data from shopItems.json.
|
public static java.util.HashMap<java.lang.String,BaseShopItem> shopItems
public void registerShopItems(com.google.gson.JsonElement element)
public ShopkeeperData getRandom()
public ShopkeeperData getById(java.lang.String id)
id
- The ID of the NPC shopkeeper.public ShopkeeperData getRandom(EnumShopKeeperType type)
type
- The type of shopkeeper to get data for.public ShopkeeperData getTranslatedData(java.lang.String langCode, java.lang.String id)
langCode
- The lang code to translate strings with.id
- The type of shopkeeper NPC to get data for.public ShopkeeperChat getTranslatedChat(java.lang.String langCode, java.lang.String npcIndex, int index)
langCode
- The lang code to translate strings with.npcIndex
- The type of shopkeeper NPC to get data for.index
- The index of the chat entry.public java.lang.String getJsonName(java.lang.String npcIndex)
npcIndex
- The type of shopkeeper NPC to get data for.public ShopkeeperData getNext(java.lang.String npcIndex)
npcIndex
- The index of the current shopkeeper.public ShopItem getItem(java.lang.String npcIndex, java.lang.String itemID)
npcIndex
- The type of shopkeeper NPC to get data for.itemID
- The id of the item.public BaseShopItem getItem(java.lang.String name)
name
- The name of the desired item.public BaseShopItem getItem(net.minecraft.item.ItemStack itemStack)
itemStack
- The desired item.public java.lang.String getTranslatedName(java.lang.String langCode, java.lang.String npcIndex, int nameIndex)
langCode
- The lang code to translate strings with.npcIndex
- The type of shopkeeper NPC to get data for.nameIndex
- The index of the name entry.public boolean hasRoaming()
public ShopkeeperData getRandomSpawning(java.lang.String biomeID)
biomeID
- The ID of the biome to get a shopkeeper for.public java.lang.String[] getRoamingBiomes()