Class NoOpStoredContext
java.lang.Object
com.pixelmonmod.pixelmon.api.context.StoredContext
com.pixelmonmod.pixelmon.api.context.NoOpStoredContext
A
StoredContext implementation that intentionally stores no values.
Mutating methods are accepted and ignored, while inherited read methods behave as an empty context. This is useful as a shared default for APIs that expose context access but do not always need per-instance context storage.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()copy()voidcopy(StoredContext other) <A> StoredContextsetContext(ContextKey<A> key, A value) Sets the context key with the given value<A> StoredContextsetContext(net.minecraft.resources.ResourceLocation key, A value) Sets the context key with the given valuewithPlayer(net.minecraft.server.level.ServerPlayer player) Adds the generic contexts for the playerMethods inherited from class com.pixelmonmod.pixelmon.api.context.StoredContext
contextKeyEntrySet, entrySet, getContext, getContext, getContextOrDefault, getContextType, getNullableContext, getNullableContext, hasContext, hasContext, noOp, of, of, replace, replace, strict, strict
-
Field Details
-
INSTANCE
-
-
Method Details
-
setContext
Description copied from class:StoredContextSets the context key with the given value- Overrides:
setContextin classStoredContext- Type Parameters:
A- The type of the key and value- Parameters:
key- The keyvalue- The value being set- Returns:
- The context instance
-
setContext
public <A> StoredContext setContext(net.minecraft.resources.ResourceLocation key, @Nullable A value) Description copied from class:StoredContextSets the context key with the given value- Overrides:
setContextin classStoredContext- Type Parameters:
A- The type of the key and value- Parameters:
key- The keyvalue- The value being set- Returns:
- The context instance
-
withPlayer
Description copied from class:StoredContextAdds the generic contexts for the player- Overrides:
withPlayerin classStoredContext- Parameters:
player- The player for adding the generic contexts- Returns:
- The context instance
-
copy
- Overrides:
copyin classStoredContext
-
copy
- Overrides:
copyin classStoredContext
-
clear
public void clear()- Overrides:
clearin classStoredContext
-