Class CapabilityCache<T>
java.lang.Object
me.desht.pneumaticcraft.common.capabilities.CapabilityCache<T>
Generic capability cache.
Typical usage is to
Typical usage is to
get() and use it if it is present, otherwise call set(LazyOptional) to update the capability cache.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CapabilityCache
public CapabilityCache()
-
-
Method Details
-
get
-
set
@NotNull public @NotNull net.minecraftforge.common.util.LazyOptional<T> set(net.minecraftforge.common.util.LazyOptional<T> cap) Sets the cached capability. Also handles registering an invalidation listener to clear the cached capability.- Parameters:
cap- Capability to set.- Returns:
- The capability that was set.
-
clear
public void clear()
-