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 ClassesModifier and TypeClassDescriptionstatic final recordContainer 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapply(@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 booleanisStudyItem(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, scanDirectoryMethods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reloadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
applyin classnet.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement>>
-