public class VillagerRegistry
extends java.lang.Object
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 and Description |
---|
VillagerRegistry() |
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
|
public static VillagerRegistry instance()
public void registerVillagerId(int id)
id
- public void registerVillagerSkin(int villagerId, ResourceLocation villagerSkin)
villagerId
- villagerSkin
- public void registerVillageCreationHandler(VillagerRegistry.IVillageCreationHandler handler)
handler
- public void registerVillageTradeHandler(int villagerId, VillagerRegistry.IVillageTradeHandler handler)
villagerId
- handler
- public static ResourceLocation getVillagerSkin(int villagerType, ResourceLocation defaultSkin)
villagerType
- defaultSkin
- public static java.util.Collection<java.lang.Integer> getRegisteredVillagers()
public static void manageVillagerTrades(MerchantRecipeList recipeList, EntityVillager villager, int villagerType, java.util.Random random)
recipeList
- villager
- villagerType
- random
- public static void addExtraVillageComponents(java.util.ArrayList components, java.util.Random random, int i)
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)
public static void addEmeraldBuyRecipe(EntityVillager villager, MerchantRecipeList list, java.util.Random random, Item item, float chance, int min, int max)
public static void addEmeraldSellRecipe(EntityVillager villager, MerchantRecipeList list, java.util.Random random, Item item, float chance, int min, int max)
public static void applyRandomTrade(EntityVillager villager, java.util.Random rand)