Package at.petrak.hexcasting.forge.cap
Record Class ForgeCapabilityHandler.SimpleProvider<CAP>
java.lang.Object
java.lang.Record
at.petrak.hexcasting.forge.cap.ForgeCapabilityHandler.SimpleProvider<CAP>
- All Implemented Interfaces:
net.minecraftforge.common.capabilities.ICapabilityProvider
- Enclosing class:
- ForgeCapabilityHandler
public static record ForgeCapabilityHandler.SimpleProvider<CAP>(BooleanSupplier invalidated, net.minecraftforge.common.capabilities.Capability<CAP> capability, net.minecraftforge.common.util.LazyOptional<CAP> instance)
extends Record
implements net.minecraftforge.common.capabilities.ICapabilityProvider
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleProvider(BooleanSupplier invalidated, net.minecraftforge.common.capabilities.Capability<CAP> capability, net.minecraftforge.common.util.LazyOptional<CAP> instance) Creates an instance of aSimpleProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraftforge.common.capabilities.Capability<CAP>Returns the value of thecapabilityrecord component.final booleanIndicates whether some other object is "equal to" this one.<T> @NotNull net.minecraftforge.common.util.LazyOptional<T>getCapability(@NotNull net.minecraftforge.common.capabilities.Capability<T> cap, @Nullable net.minecraft.core.Direction side) final inthashCode()Returns a hash code value for this object.net.minecraftforge.common.util.LazyOptional<CAP>instance()Returns the value of theinstancerecord component.Returns the value of theinvalidatedrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
-
Constructor Details
-
SimpleProvider
public SimpleProvider(BooleanSupplier invalidated, net.minecraftforge.common.capabilities.Capability<CAP> capability, net.minecraftforge.common.util.LazyOptional<CAP> instance) Creates an instance of aSimpleProviderrecord class.- Parameters:
invalidated- the value for theinvalidatedrecord componentcapability- the value for thecapabilityrecord componentinstance- the value for theinstancerecord component
-
-
Method Details
-
getCapability
@NotNull public <T> @NotNull net.minecraftforge.common.util.LazyOptional<T> getCapability(@NotNull @NotNull net.minecraftforge.common.capabilities.Capability<T> cap, @Nullable @Nullable net.minecraft.core.Direction side) - Specified by:
getCapabilityin interfacenet.minecraftforge.common.capabilities.ICapabilityProvider
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
invalidated
Returns the value of theinvalidatedrecord component.- Returns:
- the value of the
invalidatedrecord component
-
capability
Returns the value of thecapabilityrecord component.- Returns:
- the value of the
capabilityrecord component
-
instance
Returns the value of theinstancerecord component.- Returns:
- the value of the
instancerecord component
-