Package net.neoforged.neoforge.resource
Class ContextAwareReloadListener
java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
- All Implemented Interfaces:
PreparableReloadListener
- Direct Known Subclasses:
SimplePreparableReloadListener
Reload listeners that descend from this class will have the reload context automatically populated when it is available.
The context is guaranteed to be available for the duration of PreparableReloadListener.reload(net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier, net.minecraft.server.packs.resources.ResourceManager, java.util.concurrent.Executor, java.util.concurrent.Executor).
For children of SimplePreparableReloadListener, it will be available during both SimplePreparableReloadListener.prepare(net.minecraft.server.packs.resources.ResourceManager, net.minecraft.util.profiling.ProfilerFiller) prepare()} and apply().
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final ICondition.IContextReturns the condition context held by this listener, orICondition.IContext.EMPTYif it is unavailable.protected final HolderLookup.ProviderReturns the registry access held by this listener, orRegistryAccess.EMPTYif it is unavailable.voidinjectContext(ICondition.IContext context, HolderLookup.Provider registryLookup) protected final ConditionalOps<JsonElement> protected final ConditionalOps<JsonElement> makeConditionalOps(com.mojang.serialization.DynamicOps<JsonElement> ops) Methods 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, reload
-
Field Details
-
conditionContext
-
registryLookup
-
-
Constructor Details
-
ContextAwareReloadListener
public ContextAwareReloadListener()
-
-
Method Details
-
injectContext
@Internal public void injectContext(ICondition.IContext context, HolderLookup.Provider registryLookup) -
getContext
Returns the condition context held by this listener, orICondition.IContext.EMPTYif it is unavailable. -
getRegistryLookup
Returns the registry access held by this listener, orRegistryAccess.EMPTYif it is unavailable. -
makeConditionalOps
-
makeConditionalOps
protected final ConditionalOps<JsonElement> makeConditionalOps(com.mojang.serialization.DynamicOps<JsonElement> ops)
-