cpw.mods.fml.common.registry

## Class VillagerRegistry

- java.lang.Object
- - cpw.mods.fml.common.registry.VillagerRegistry

-     public class VillagerRegistry
      extends Object

  Registry for villager trading control
  Author:
    cpw

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `VillagerRegistry.IVillageCreationHandler` Allow access to the `StructureVillagePieces` array controlling new village creation so you can insert your own new village pieces
    `static interface` | `VillagerRegistry.IVillageTradeHandler` Allow access to the `MerchantRecipeList` for a villager type for manipulation

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VillagerRegistry()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addEmeraldBuyRecipe(EntityVillager villager, MerchantRecipeList list, Random random, Item item, float chance, int min, int max)`
    `static void` | `addEmeraldSellRecipe(EntityVillager villager, MerchantRecipeList list, Random random, Item item, float chance, int min, int max)`
    `static void` | `addExtraVillageComponents(ArrayList components, Random random, int i)`
    `static void` | `applyRandomTrade(EntityVillager villager, Random rand)`
    `static Collection<Integer>` | `getRegisteredVillagers()` Returns a list of all added villager types
    `static Object` | `getVillageComponent(StructureVillagePieceWeight villagePiece, ComponentVillageStartPiece startPiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5)`
    `static String` | `getVillagerSkin(int villagerType, String defaultSkin)` Callback to setup new villager types
    `static VillagerRegistry` | `instance()`
    `static void` | `manageVillagerTrades(MerchantRecipeList recipeList, EntityVillager villager, int villagerType, Random random)` Callback to handle trade setup for villagers
    `void` | `registerVillageCreationHandler(VillagerRegistry.IVillageCreationHandler handler)` Register a new village creation handler
    `void` | `registerVillagerType(int villagerId, String villagerSkin)` Register a new skin for a villager type
    `void` | `registerVillageTradeHandler(int villagerId, VillagerRegistry.IVillageTradeHandler handler)` Register a new villager trading handler for the specified villager type

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### VillagerRegistry

          public VillagerRegistry()

  - ### Method Detail

    - #### instance

          public static VillagerRegistry instance()

    - #### registerVillagerType

          public void registerVillagerType(int villagerId,
                                  String villagerSkin)

      Register a new skin for a villager type
      Parameters:
        `villagerId` -
        `villagerSkin` -

    - #### registerVillageCreationHandler

          public void registerVillageCreationHandler(VillagerRegistry.IVillageCreationHandler handler)

      Register a new village creation handler
      Parameters:
        `handler` -

    - #### registerVillageTradeHandler

          public void registerVillageTradeHandler(int villagerId,
                                         VillagerRegistry.IVillageTradeHandler handler)

      Register a new villager trading handler for the specified villager type
      Parameters:
        `villagerId` -
        `handler` -

    - #### getVillagerSkin

          public static String getVillagerSkin(int villagerType,
                               String defaultSkin)

      Callback to setup new villager types
      Parameters:
        `villagerType` -
        `defaultSkin` -

    - #### getRegisteredVillagers

          public static Collection<Integer> getRegisteredVillagers()

      Returns a list of all added villager types
      Returns:
        newVillagerIds

    - #### manageVillagerTrades

          public static void manageVillagerTrades(MerchantRecipeList recipeList,
                                  EntityVillager villager,
                                  int villagerType,
                                  Random random)

      Callback to handle trade setup for villagers
      Parameters:
        `recipeList` -
        `villager` -
        `villagerType` -
        `random` -

    - #### addExtraVillageComponents

          public static void addExtraVillageComponents(ArrayList components,
                                       Random random,
                                       int i)

    - #### getVillageComponent

          public static Object getVillageComponent(StructureVillagePieceWeight villagePiece,
                                   ComponentVillageStartPiece startPiece,
                                   List pieces,
                                   Random random,
                                   int p1,
                                   int p2,
                                   int p3,
                                   int p4,
                                   int p5)

    - #### addEmeraldBuyRecipe

          public static void addEmeraldBuyRecipe(EntityVillager villager,
                                 MerchantRecipeList list,
                                 Random random,
                                 Item item,
                                 float chance,
                                 int min,
                                 int max)

    - #### addEmeraldSellRecipe

          public static void addEmeraldSellRecipe(EntityVillager villager,
                                  MerchantRecipeList list,
                                  Random random,
                                  Item item,
                                  float chance,
                                  int min,
                                  int max)

    - #### applyRandomTrade

          public static void applyRandomTrade(EntityVillager villager,
                              Random rand)