Class VillagerCache

java.lang.Object
com.mrbysco.justenoughprofessions.VillagerCache

public class VillagerCache extends Object
This class is used to cache the villager entity used for rendering the villager professionHolder
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
     
    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

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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()