Record Class ClipboardContent
java.lang.Object
java.lang.Record
com.simibubi.create.content.equipment.clipboard.ClipboardContent
public record ClipboardContent(ClipboardOverrides.ClipboardType type, List<List<ClipboardEntry>> pages, boolean readOnly, int previouslyOpenedPage, Optional<net.minecraft.nbt.CompoundTag> copiedValues)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ClipboardContent> static final ClipboardContentstatic final com.mojang.serialization.Codec<List<List<ClipboardEntry>>> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, List<List<ClipboardEntry>>> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ClipboardContent> -
Constructor Summary
ConstructorsConstructorDescriptionClipboardContent(ClipboardOverrides.ClipboardType type, List<List<ClipboardEntry>> pages, boolean readOnly) ClipboardContent(ClipboardOverrides.ClipboardType type, List<List<ClipboardEntry>> pages, boolean readOnly, int previouslyOpenedPage, Optional<net.minecraft.nbt.CompoundTag> copiedValues) Creates an instance of aClipboardContentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionOptional<net.minecraft.nbt.CompoundTag> Returns the value of thecopiedValuesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.pages()Returns the value of thepagesrecord component.intReturns the value of thepreviouslyOpenedPagerecord component.booleanreadOnly()Returns the value of thereadOnlyrecord component.setCopiedValues(net.minecraft.nbt.CompoundTag copiedValues) setPages(List<List<ClipboardEntry>> pages) setPreviouslyOpenedPage(int previouslyOpenedPage) setReadOnly(boolean readOnly) final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
EMPTY
-
PAGES_CODEC
-
PAGES_STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,List<List<ClipboardEntry>>> PAGES_STREAM_CODEC -
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ClipboardContent> STREAM_CODEC
-
-
Constructor Details
-
ClipboardContent
public ClipboardContent(ClipboardOverrides.ClipboardType type, List<List<ClipboardEntry>> pages, boolean readOnly) -
ClipboardContent
public ClipboardContent(ClipboardOverrides.ClipboardType type, List<List<ClipboardEntry>> pages, boolean readOnly, int previouslyOpenedPage, Optional<net.minecraft.nbt.CompoundTag> copiedValues) Creates an instance of aClipboardContentrecord class.- Parameters:
type- the value for thetyperecord componentpages- the value for thepagesrecord componentreadOnly- the value for thereadOnlyrecord componentpreviouslyOpenedPage- the value for thepreviouslyOpenedPagerecord componentcopiedValues- the value for thecopiedValuesrecord component
-
-
Method Details
-
setType
-
setPages
-
setReadOnly
-
setPreviouslyOpenedPage
-
setCopiedValues
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
pages
Returns the value of thepagesrecord component.- Returns:
- the value of the
pagesrecord component
-
readOnly
public boolean readOnly()Returns the value of thereadOnlyrecord component.- Returns:
- the value of the
readOnlyrecord component
-
previouslyOpenedPage
public int previouslyOpenedPage()Returns the value of thepreviouslyOpenedPagerecord component.- Returns:
- the value of the
previouslyOpenedPagerecord component
-
copiedValues
Returns the value of thecopiedValuesrecord component.- Returns:
- the value of the
copiedValuesrecord component
-