Record Class RespawnPacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.RespawnPacket
- All Implemented Interfaces:
NetworkBuffer.Writer,SendablePacket,ServerPacket
public record RespawnPacket(String dimensionType, String worldName, long hashedSeed, GameMode gameMode, GameMode previousGameMode, boolean isDebug, boolean isFlat, DeathLocation deathLocation, int portalCooldown, int copyData)
extends Record
implements ServerPacket
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionRespawnPacket(String dimensionType, String worldName, long hashedSeed, GameMode gameMode, GameMode previousGameMode, boolean isDebug, boolean isFlat, DeathLocation deathLocation, int portalCooldown, int copyData) Creates an instance of aRespawnPacketrecord class.RespawnPacket(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescriptionintcopyData()Returns the value of thecopyDatarecord component.Returns the value of thedeathLocationrecord component.Returns the value of thedimensionTyperecord component.final booleanIndicates whether some other object is "equal to" this one.gameMode()Returns the value of thegameModerecord component.intgetId(@NotNull ConnectionState state) Gets the id of this packet.final inthashCode()Returns a hash code value for this object.longReturns the value of thehashedSeedrecord component.booleanisDebug()Returns the value of theisDebugrecord component.booleanisFlat()Returns the value of theisFlatrecord component.intReturns the value of theportalCooldownrecord component.Returns the value of thepreviousGameModerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theworldNamerecord component.voidwrite(@NotNull NetworkBuffer writer)
-
Field Details
-
COPY_NONE
public static final int COPY_NONE- See Also:
-
COPY_ATTRIBUTES
public static final int COPY_ATTRIBUTES- See Also:
-
COPY_METADATA
public static final int COPY_METADATA- See Also:
-
COPY_ALL
public static final int COPY_ALL- See Also:
-
-
Constructor Details
-
RespawnPacket
-
RespawnPacket
public RespawnPacket(String dimensionType, String worldName, long hashedSeed, GameMode gameMode, GameMode previousGameMode, boolean isDebug, boolean isFlat, DeathLocation deathLocation, int portalCooldown, int copyData) Creates an instance of aRespawnPacketrecord class.- Parameters:
dimensionType- the value for thedimensionTyperecord componentworldName- the value for theworldNamerecord componenthashedSeed- the value for thehashedSeedrecord componentgameMode- the value for thegameModerecord componentpreviousGameMode- the value for thepreviousGameModerecord componentisDebug- the value for theisDebugrecord componentisFlat- the value for theisFlatrecord componentdeathLocation- the value for thedeathLocationrecord componentportalCooldown- the value for theportalCooldownrecord componentcopyData- the value for thecopyDatarecord component
-
-
Method Details
-
write
- Specified by:
writein interfaceNetworkBuffer.Writer
-
getId
Description copied from interface:ServerPacketGets the id of this packet.Written in the final buffer header so it needs to match the client id.
- Specified by:
getIdin interfaceServerPacket- Returns:
- the id of this packet
-
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 '=='. -
dimensionType
Returns the value of thedimensionTyperecord component.- Returns:
- the value of the
dimensionTyperecord component
-
worldName
Returns the value of theworldNamerecord component.- Returns:
- the value of the
worldNamerecord component
-
hashedSeed
public long hashedSeed()Returns the value of thehashedSeedrecord component.- Returns:
- the value of the
hashedSeedrecord component
-
gameMode
Returns the value of thegameModerecord component.- Returns:
- the value of the
gameModerecord component
-
previousGameMode
Returns the value of thepreviousGameModerecord component.- Returns:
- the value of the
previousGameModerecord component
-
isDebug
public boolean isDebug()Returns the value of theisDebugrecord component.- Returns:
- the value of the
isDebugrecord component
-
isFlat
public boolean isFlat()Returns the value of theisFlatrecord component.- Returns:
- the value of the
isFlatrecord component
-
deathLocation
Returns the value of thedeathLocationrecord component.- Returns:
- the value of the
deathLocationrecord component
-
portalCooldown
public int portalCooldown()Returns the value of theportalCooldownrecord component.- Returns:
- the value of the
portalCooldownrecord component
-
copyData
public int copyData()Returns the value of thecopyDatarecord component.- Returns:
- the value of the
copyDatarecord component
-