Record Class ServerboundChangeDifficultyPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ServerboundChangeDifficultyPacket
- All Implemented Interfaces:
Packet<ServerGamePacketListener>
public record ServerboundChangeDifficultyPacket(Difficulty difficulty)
extends Record
implements Packet<ServerGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DifficultyThe field for thedifficultyrecord component.static final StreamCodec<io.netty.buffer.ByteBuf, ServerboundChangeDifficultyPacket> -
Constructor Summary
ConstructorsConstructorDescriptionServerboundChangeDifficultyPacket(Difficulty difficulty) Creates an instance of aServerboundChangeDifficultyPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedifficultyrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ServerGamePacketListener listener) Passes this Packet on to the NetHandler for processing.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
difficulty
The field for thedifficultyrecord component. -
STREAM_CODEC
public static final StreamCodec<io.netty.buffer.ByteBuf, ServerboundChangeDifficultyPacket> STREAM_CODEC
-
-
Constructor Details
-
ServerboundChangeDifficultyPacket
Creates an instance of aServerboundChangeDifficultyPacketrecord class.- Parameters:
difficulty- the value for thedifficultyrecord component
-
-
Method Details
-
type
- Specified by:
typein interfacePacket<ServerGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ServerGamePacketListener>
-
toString
-
hashCode
-
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). -
difficulty
Returns the value of thedifficultyrecord component.- Returns:
- the value of the
difficultyrecord component
-