cpw.mods.fml.common.registry

## Class VillagerRegistry

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

-     public class VillagerRegistry
      extends java.lang.Object

  Registry for villager trading control

- - ### 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, java.util.Random random, Item item, float chance, int min, int max)`
    `static void` | `addEmeraldSellRecipe(EntityVillager villager, MerchantRecipeList list, java.util.Random random, Item item, float chance, int min, int max)`
    `static void` | `addExtraVillageComponents(java.util.ArrayList components, java.util.Random random, int i)`
    `static void` | `applyRandomTrade(EntityVillager villager, java.util.Random rand)`
    `static java.util.Collection<java.lang.Integer>` | `getRegisteredVillagers()` Returns a list of all added villager types
    `static java.lang.Object` | `getVillageComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, java.util.List pieces, java.util.Random random, int p1, int p2, int p3, int p4, int p5)`
    `static ResourceLocation` | `getVillagerSkin(int villagerType, ResourceLocation defaultSkin)` Callback to setup new villager types
    `static VillagerRegistry` | `instance()`
    `static void` | `manageVillagerTrades(MerchantRecipeList recipeList, EntityVillager villager, int villagerType, java.util.Random random)` Callback to handle trade setup for villagers
    `void` | `registerVillageCreationHandler(VillagerRegistry.IVillageCreationHandler handler)` Register a new village creation handler
    `void` | `registerVillagerId(int id)` Register your villager id
    `void` | `registerVillagerSkin(int villagerId, ResourceLocation 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

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

- - ### Constructor Detail

    - #### VillagerRegistry

          public VillagerRegistry()

  - ### Method Detail

    - #### instance

          public static VillagerRegistry instance()

    - #### registerVillagerId

          public void registerVillagerId(int id)

      Register your villager id
      Parameters:
        `id` -

    - #### registerVillagerSkin

          public void registerVillagerSkin(int villagerId,
                                  ResourceLocation 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 ResourceLocation getVillagerSkin(int villagerType,
                                         ResourceLocation defaultSkin)

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

    - #### getRegisteredVillagers

          public static java.util.Collection<java.lang.Integer> getRegisteredVillagers()

      Returns a list of all added villager types
      Returns:
        newVillagerIds

    - #### manageVillagerTrades

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

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

    - #### addExtraVillageComponents

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

    - #### getVillageComponent

          public static java.lang.Object getVillageComponent(StructureVillagePieces.PieceWeight villagePiece,
                                             StructureVillagePieces.Start startPiece,
                                             java.util.List pieces,
                                             java.util.Random random,
                                             int p1,
                                             int p2,
                                             int p3,
                                             int p4,
                                             int p5)

    - #### addEmeraldBuyRecipe

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

    - #### addEmeraldSellRecipe

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

    - #### applyRandomTrade

          public static void applyRandomTrade(EntityVillager villager,
                              java.util.Random rand)