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 class |
VillagerRegistry.VillagerCareer |
static class |
VillagerRegistry.VillagerProfession |
Modifier and Type | Field and Description |
---|---|
static VillagerRegistry.VillagerProfession |
FARMER |
Modifier and Type | Method and Description |
---|---|
static void |
addExtraVillageComponents(java.util.List<StructureVillagePieces.PieceWeight> list,
java.util.Random random,
int i) |
static VillagerRegistry.VillagerProfession |
getById(int network)
Deprecated.
|
static int |
getId(VillagerRegistry.VillagerProfession prof)
Deprecated.
|
static StructureVillagePieces.Village |
getVillageComponent(StructureVillagePieces.PieceWeight villagePiece,
StructureVillagePieces.Start startPiece,
java.util.List<StructureComponent> pieces,
java.util.Random random,
int p1,
int p2,
int p3,
EnumFacing facing,
int p5) |
static VillagerRegistry |
instance() |
static void |
onSetProfession(EntityVillager entity,
int network) |
static void |
onSetProfession(EntityZombieVillager entity,
int network) |
void |
registerVillageCreationHandler(VillagerRegistry.IVillageCreationHandler handler)
Register a new village creation handler
|
static void |
setRandomProfession(EntityVillager entity,
java.util.Random rand)
Hook called when spawning a Villager, sets it's profession to a random registered profession.
|
public static final VillagerRegistry.VillagerProfession FARMER
public static VillagerRegistry instance()
public void registerVillageCreationHandler(VillagerRegistry.IVillageCreationHandler handler)
handler
- public static void addExtraVillageComponents(java.util.List<StructureVillagePieces.PieceWeight> list, java.util.Random random, int i)
public static StructureVillagePieces.Village getVillageComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, java.util.List<StructureComponent> pieces, java.util.Random random, int p1, int p2, int p3, EnumFacing facing, int p5)
public static void setRandomProfession(EntityVillager entity, java.util.Random rand)
entity
- The new entityrand
- The world's RNGpublic static void onSetProfession(EntityVillager entity, int network)
public static void onSetProfession(EntityZombieVillager entity, int network)
@Deprecated public static VillagerRegistry.VillagerProfession getById(int network)
@Deprecated public static int getId(@Nullable VillagerRegistry.VillagerProfession prof)