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 |
private static class |
VillagerRegistry.VanillaTrades |
static class |
VillagerRegistry.VillagerCareer |
static class |
VillagerRegistry.VillagerProfession |
Modifier and Type | Field and Description |
---|---|
static VillagerRegistry.VillagerProfession |
FARMER |
private boolean |
hasInit |
private static VillagerRegistry |
INSTANCE |
(package private) RegistryNamespaced<ResourceLocation,VillagerRegistry.VillagerProfession> |
REGISTRY |
private java.util.Map<java.lang.Class<?>,VillagerRegistry.IVillageCreationHandler> |
villageCreationHandlers |
Modifier | Constructor and Description |
---|---|
private |
VillagerRegistry() |
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) |
private void |
init() |
static VillagerRegistry |
instance() |
static void |
onSetProfession(EntityVillager entity,
int network) |
static void |
onSetProfession(EntityZombieVillager entity,
int network) |
private void |
register(VillagerRegistry.VillagerProfession prof,
int id) |
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.
|
static void |
setRandomProfession(EntityZombieVillager entity,
java.util.Random rand) |
public static final VillagerRegistry.VillagerProfession FARMER
private static final VillagerRegistry INSTANCE
private java.util.Map<java.lang.Class<?>,VillagerRegistry.IVillageCreationHandler> villageCreationHandlers
RegistryNamespaced<ResourceLocation,VillagerRegistry.VillagerProfession> REGISTRY
private boolean hasInit
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)
private void register(VillagerRegistry.VillagerProfession prof, int id)
private void init()
public static void setRandomProfession(EntityVillager entity, java.util.Random rand)
entity
- The new entityrand
- The world's RNGpublic static void setRandomProfession(EntityZombieVillager entity, java.util.Random rand)
public 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)