Record Class CustomCapabilityAttachment
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.block.entity.CustomCapabilityAttachment
- All Implemented Interfaces:
BlockEntityAttachment
public record CustomCapabilityAttachment(net.neoforged.neoforge.capabilities.BlockCapability<?,?> capability, Object data)
extends Record
implements BlockEntityAttachment
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCustomCapabilityAttachment(net.neoforged.neoforge.capabilities.BlockCapability<?, ?> capability, Object data) Creates an instance of aCustomCapabilityAttachmentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.neoforged.neoforge.capabilities.BlockCapability<?, ?> Returns the value of thecapabilityrecord component.data()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.<CAP,SRC> CAP getCapability(net.neoforged.neoforge.capabilities.BlockCapability<CAP, SRC> c) final inthashCode()Returns a hash code value for this object.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 dev.latvian.mods.kubejs.block.entity.BlockEntityAttachment
deserialize, onRemove, serialize, serverTick
-
Field Details
-
TYPE
-
-
Constructor Details
-
CustomCapabilityAttachment
public CustomCapabilityAttachment(net.neoforged.neoforge.capabilities.BlockCapability<?, ?> capability, Object data) Creates an instance of aCustomCapabilityAttachmentrecord class.- Parameters:
capability- the value for thecapabilityrecord componentdata- the value for thedatarecord component
-
-
Method Details
-
getWrappedObject
- Specified by:
getWrappedObjectin interfaceBlockEntityAttachment
-
getCapability
@Nullable public <CAP,SRC> CAP getCapability(net.neoforged.neoforge.capabilities.BlockCapability<CAP, SRC> c) - Specified by:
getCapabilityin interfaceBlockEntityAttachment
-
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). -
capability
public net.neoforged.neoforge.capabilities.BlockCapability<?,?> capability()Returns the value of thecapabilityrecord component.- Returns:
- the value of the
capabilityrecord component
-
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-