Class VillagerCache
java.lang.Object
com.mrbysco.justenoughprofessions.VillagerCache
This class is used to cache the villager entity used for rendering the villager professionHolder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic @Nullable net.minecraft.world.entity.npc.villager.VillagergetVillagerEntity(net.minecraft.core.Holder<net.minecraft.world.entity.npc.villager.VillagerProfession> professionHolder) Get a villager entity with a specific professionHolder If the entity is not cached, it will create a new one and cache it
-
Constructor Details
-
VillagerCache
public VillagerCache()
-
-
Method Details
-
getVillagerEntity
@Nullable public static @Nullable net.minecraft.world.entity.npc.villager.Villager getVillagerEntity(net.minecraft.core.Holder<net.minecraft.world.entity.npc.villager.VillagerProfession> professionHolder) Get a villager entity with a specific professionHolder If the entity is not cached, it will create a new one and cache it- Parameters:
professionHolder- The professionHolder to set the villager to- Returns:
- The villager entity
-
clearCache
public static void clearCache()
-