Record Class ServerboundEditBookPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ServerboundEditBookPacket
- All Implemented Interfaces:
Packet<ServerGamePacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
private static final int
private static final int
The field for thepages
record component.private final int
The field for theslot
record component.static final StreamCodec
<FriendlyByteBuf, ServerboundEditBookPacket> The field for thetitle
record component.private static final int
-
Constructor Summary
ConstructorDescriptionServerboundEditBookPacket
(int slot, List<String> pages, Optional<String> title) Creates an instance of aServerboundEditBookPacket
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.void
handle
(ServerGamePacketListener p_134008_) final int
hashCode()
Returns a hash code value for this object.pages()
Returns the value of thepages
record component.int
slot()
Returns the value of theslot
record component.title()
Returns the value of thetitle
record component.final String
toString()
Returns a string representation of this record class.type()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Field Details
-
slot
private final int slotThe field for theslot
record component. -
pages
The field for thepages
record component. -
title
The field for thetitle
record component. -
MAX_BYTES_PER_CHAR
public static final int MAX_BYTES_PER_CHAR- See Also:
-
TITLE_MAX_CHARS
private static final int TITLE_MAX_CHARS- See Also:
-
PAGE_MAX_CHARS
private static final int PAGE_MAX_CHARS- See Also:
-
MAX_PAGES_COUNT
private static final int MAX_PAGES_COUNT- See Also:
-
STREAM_CODEC
-
-
Constructor Details
-
ServerboundEditBookPacket
Creates an instance of aServerboundEditBookPacket
record class.- Parameters:
slot
- the value for theslot
record componentpages
- the value for thepages
record componenttitle
- the value for thetitle
record component
-
-
Method Details
-
type
- Specified by:
type
in interfacePacket<ServerGamePacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ServerGamePacketListener>
-
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 '=='. -
slot
public int slot()Returns the value of theslot
record component.- Returns:
- the value of the
slot
record component
-
pages
Returns the value of thepages
record component.- Returns:
- the value of the
pages
record component
-
title
Returns the value of thetitle
record component.- Returns:
- the value of the
title
record component
-