Record Class CommonPlayerSpawnInfo
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.CommonPlayerSpawnInfo
public record CommonPlayerSpawnInfo(Holder<DimensionType> dimensionType, ResourceKey<Level> dimension, long seed, GameType gameType, @Nullable GameType previousGameType, boolean isDebug, boolean isFlat, Optional<GlobalPos> lastDeathLocation, int portalCooldown)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ResourceKey
<Level> The field for thedimension
record component.private final Holder
<DimensionType> The field for thedimensionType
record component.private final GameType
The field for thegameType
record component.private final boolean
The field for theisDebug
record component.private final boolean
The field for theisFlat
record component.The field for thelastDeathLocation
record component.private final int
The field for theportalCooldown
record component.private final GameType
The field for thepreviousGameType
record component.private final long
The field for theseed
record component. -
Constructor Summary
ConstructorDescriptionCommonPlayerSpawnInfo
(Holder<DimensionType> dimensionType, ResourceKey<Level> dimension, long seed, GameType gameType, GameType previousGameType, boolean isDebug, boolean isFlat, Optional<GlobalPos> lastDeathLocation, int portalCooldown) Creates an instance of aCommonPlayerSpawnInfo
record class.CommonPlayerSpawnInfo
(RegistryFriendlyByteBuf p_331063_) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedimension
record component.Returns the value of thedimensionType
record component.final boolean
Indicates whether some other object is "equal to" this one.gameType()
Returns the value of thegameType
record component.final int
hashCode()
Returns a hash code value for this object.boolean
isDebug()
Returns the value of theisDebug
record component.boolean
isFlat()
Returns the value of theisFlat
record component.Returns the value of thelastDeathLocation
record component.int
Returns the value of theportalCooldown
record component.Returns the value of thepreviousGameType
record component.long
seed()
Returns the value of theseed
record component.final String
toString()
Returns a string representation of this record class.void
write
(RegistryFriendlyByteBuf p_335866_)
-
Field Details
-
dimensionType
The field for thedimensionType
record component. -
dimension
The field for thedimension
record component. -
seed
private final long seedThe field for theseed
record component. -
gameType
The field for thegameType
record component. -
previousGameType
The field for thepreviousGameType
record component. -
isDebug
private final boolean isDebugThe field for theisDebug
record component. -
isFlat
private final boolean isFlatThe field for theisFlat
record component. -
lastDeathLocation
The field for thelastDeathLocation
record component. -
portalCooldown
private final int portalCooldownThe field for theportalCooldown
record component.
-
-
Constructor Details
-
CommonPlayerSpawnInfo
-
CommonPlayerSpawnInfo
public CommonPlayerSpawnInfo(Holder<DimensionType> dimensionType, ResourceKey<Level> dimension, long seed, GameType gameType, @Nullable GameType previousGameType, boolean isDebug, boolean isFlat, Optional<GlobalPos> lastDeathLocation, int portalCooldown) Creates an instance of aCommonPlayerSpawnInfo
record class.- Parameters:
dimensionType
- the value for thedimensionType
record componentdimension
- the value for thedimension
record componentseed
- the value for theseed
record componentgameType
- the value for thegameType
record componentpreviousGameType
- the value for thepreviousGameType
record componentisDebug
- the value for theisDebug
record componentisFlat
- the value for theisFlat
record componentlastDeathLocation
- the value for thelastDeathLocation
record componentportalCooldown
- the value for theportalCooldown
record component
-
-
Method Details
-
write
-
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 thedimensionType
record component.- Returns:
- the value of the
dimensionType
record component
-
dimension
Returns the value of thedimension
record component.- Returns:
- the value of the
dimension
record component
-
seed
public long seed()Returns the value of theseed
record component.- Returns:
- the value of the
seed
record component
-
gameType
Returns the value of thegameType
record component.- Returns:
- the value of the
gameType
record component
-
previousGameType
Returns the value of thepreviousGameType
record component.- Returns:
- the value of the
previousGameType
record component
-
isDebug
public boolean isDebug()Returns the value of theisDebug
record component.- Returns:
- the value of the
isDebug
record component
-
isFlat
public boolean isFlat()Returns the value of theisFlat
record component.- Returns:
- the value of the
isFlat
record component
-
lastDeathLocation
Returns the value of thelastDeathLocation
record component.- Returns:
- the value of the
lastDeathLocation
record component
-
portalCooldown
public int portalCooldown()Returns the value of theportalCooldown
record component.- Returns:
- the value of the
portalCooldown
record component
-