Class NPCRegistryShopkeepers

java.lang.Object
com.pixelmonmod.pixelmon.entities.npcs.registry.NPCRegistryShopkeepers

public class NPCRegistryShopkeepers extends Object
  • Field Details

  • Constructor Details

    • NPCRegistryShopkeepers

      public NPCRegistryShopkeepers()
  • Method Details

    • registerShopItems

      public void registerShopItems(com.google.gson.JsonElement element)
      Registers shop data from shopItems.json.
    • getRandom

      public ShopkeeperData getRandom()
      Randomly selects a group of shopkeeper data.
      Returns:
      A randomly selected group of shopkeeper data.
    • getById

      public ShopkeeperData getById(String id)
      Gets an NPC shopkeeper from its internal ID.
      Parameters:
      id - The ID of the NPC shopkeeper.
      Returns:
      The base shopkeeper data.
    • getRandom

      public ShopkeeperData getRandom(EnumShopKeeperType type)
      Randomly selects a group of shopkeeper data.
      Parameters:
      type - The type of shopkeeper to get data for.
      Returns:
      A randomly selected group of shopkeeper data.
    • getTranslatedData

      @Nullable public ShopkeeperData getTranslatedData(String langCode, String id)
      Retrieves shopkeeper NPC data for a specific shopkeeper type.
      Parameters:
      langCode - The lang code to translate strings with.
      id - The type of shopkeeper NPC to get data for.
      Returns:
      Shopkeeper NPC data for the specified shopkeeper NPC type.
    • getTranslatedChat

      public ShopkeeperChat getTranslatedChat(String langCode, String npcIndex, int index)
      Retrieves the translated version of the indexed shopkeeper chat.
      Parameters:
      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.
      Returns:
      Translated shopkeeper chat.
    • getJsonName

      public String getJsonName(String npcIndex)
      Retrieves the json name for the indexed shopkeeper.
      Parameters:
      npcIndex - The type of shopkeeper NPC to get data for.
      Returns:
      Json name for shopkeeper index.
    • getNext

      public ShopkeeperData getNext(String npcIndex)
      Gets the next shopkeeper from a current index.
      Parameters:
      npcIndex - The index of the current shopkeeper.
      Returns:
      The next shopkeeper from the current one.
    • getItem

      public ShopItem getItem(String npcIndex, String itemID)
      Retrieves the desired shop item by name.
      Parameters:
      npcIndex - The type of shopkeeper NPC to get data for.
      itemID - The id of the item.
      Returns:
      ShopItem instance for that item.
    • getItem

      public BaseShopItem getItem(String name)
      Retrieves the base shop item by name.
      Parameters:
      name - The name of the desired item.
      Returns:
      BaseShopItem instance for that item.
    • getItem

      public BaseShopItem getItem(net.minecraft.world.item.ItemStack itemStack)
      Retrieves the base shop item by ItemStack.
      Parameters:
      itemStack - The desired item.
      Returns:
      BaseShopItem instance for that item.
    • getTranslatedName

      public String getTranslatedName(String langCode, String npcIndex, int nameIndex)
      Retrieves the translated version of the indexed shopkeeper name.
      Parameters:
      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.
      Returns:
      Translated shopkeeper name.
    • hasRoaming

      public boolean hasRoaming()
      Checks if there are any spawn shopkeepers registered.
      Returns:
      Whether there are any spawn shopkeepers registered.
    • getRandomSpawning

      public ShopkeeperData getRandomSpawning(String biomeID)
      Gets a random spawn shopkeeper for a biome.
      Parameters:
      biomeID - The ID of the biome to get a shopkeeper for.
      Returns:
      A random spawn shopkeeper for the specified biome, or null if there aren't any.
    • getRoamingBiomes

      public String[] getRoamingBiomes()
      Gets biomes where spawn shopkeepers can spawn in.
      Returns:
      An array of biome IDs where spawn shopkeepers can spawn in.