Package com.ldtteam.structurize.util
Record Class ScanToolData.Slot
java.lang.Object
java.lang.Record
com.ldtteam.structurize.util.ScanToolData.Slot
- Enclosing class:
ScanToolData
public static record ScanToolData.Slot(@NotNull String name, @NotNull BoxPreviewData box)
extends Record
Data for one scan slot
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ScanToolData.Slot> static final ScanToolData.Slotstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ScanToolData.Slot> -
Constructor Summary
ConstructorsConstructorDescriptionSlot(@NotNull String name, @NotNull BoxPreviewData box) Creates an instance of aSlotrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull BoxPreviewDatabox()Returns the value of theboxrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull Stringname()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.withBox(BoxPreviewData box) Updates the box of the slot.Updates the name of the slot.
-
Field Details
-
EMPTY
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ScanToolData.Slot> STREAM_CODEC
-
-
Constructor Details
-
Slot
Creates an instance of aSlotrecord class.- Parameters:
name- the value for thenamerecord componentbox- the value for theboxrecord component
-
-
Method Details
-
withName
Updates the name of the slot.- Parameters:
name- the new name.- Returns:
- the
ScanToolData.Slotwith the updated value.
-
withBox
Updates the box of the slot.- Parameters:
box- the new box.- Returns:
- the
ScanToolData.Slotwith the updated value.
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
box
Returns the value of theboxrecord component.- Returns:
- the value of the
boxrecord component
-