Record Class CustomCapabilityAttachment.Factory
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.block.entity.CustomCapabilityAttachment.Factory
- All Implemented Interfaces:
BlockEntityAttachmentFactory
- Enclosing class:
CustomCapabilityAttachment
public static record CustomCapabilityAttachment.Factory(net.neoforged.neoforge.capabilities.BlockCapability<?,?> type, Supplier<?> dataFactory)
extends Record
implements BlockEntityAttachmentFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(BlockEntityAttachmentInfo info, KubeBlockEntity entity) Supplier<?> Returns the value of thedataFactoryrecord component.final booleanIndicates whether some other object is "equal to" this one.List<net.neoforged.neoforge.capabilities.BlockCapability<?, ?>> final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.net.neoforged.neoforge.capabilities.BlockCapability<?, ?> type()Returns the value of thetyperecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.latvian.mods.kubejs.block.entity.BlockEntityAttachmentFactory
isTicking
-
Constructor Details
-
Factory
public Factory(net.neoforged.neoforge.capabilities.BlockCapability<?, ?> type, Supplier<?> dataFactory) Creates an instance of aFactoryrecord class.- Parameters:
type- the value for thetyperecord componentdataFactory- the value for thedataFactoryrecord component
-
-
Method Details
-
create
- Specified by:
createin interfaceBlockEntityAttachmentFactory
-
getCapabilities
- Specified by:
getCapabilitiesin interfaceBlockEntityAttachmentFactory
-
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). -
type
public net.neoforged.neoforge.capabilities.BlockCapability<?,?> type()Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
dataFactory
Returns the value of thedataFactoryrecord component.- Returns:
- the value of the
dataFactoryrecord component
-