Class StudyItemListener

java.lang.Object
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement>>
net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener
com.minecolonies.core.datalistener.StudyItemListener
All Implemented Interfaces:
net.minecraft.server.packs.resources.PreparableReloadListener

public class StudyItemListener extends net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener
Loads and listens to study items for the BuildingLibrary.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    Container class for any study item.

    Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

    net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    apply(@NotNull Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement> jsonElementMap, @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profiler)
     
    static Map<net.minecraft.resources.ResourceLocation,StudyItemListener.StudyItem>
    Get the current map of study items.
    static boolean
    isStudyItem(net.minecraft.world.item.ItemStack stack)
    Check if the given item is a valid study item.

    Methods inherited from class net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener

    getPreparedPath, prepare, scanDirectory

    Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener

    reload

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

    getName
  • Constructor Details

    • StudyItemListener

      public StudyItemListener()
      Default constructor.
  • Method Details

    • getAllStudyItems

      public static Map<net.minecraft.resources.ResourceLocation,StudyItemListener.StudyItem> getAllStudyItems()
      Get the current map of study items.
      Returns:
      the map of study items.
    • isStudyItem

      public static boolean isStudyItem(net.minecraft.world.item.ItemStack stack)
      Check if the given item is a valid study item.
      Parameters:
      stack - the item stack to check.
      Returns:
      true if so.
    • apply

      protected void apply(@NotNull @NotNull Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement> jsonElementMap, @NotNull @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull @NotNull net.minecraft.util.profiling.ProfilerFiller profiler)
      Specified by:
      apply in class net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement>>