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
FieldsModifier and TypeFieldDescriptionprivate final ResourceKey<Level> The field for thedimensionrecord component.private final Holder<DimensionType> The field for thedimensionTyperecord component.private final GameTypeThe field for thegameTyperecord component.private final booleanThe field for theisDebugrecord component.private final booleanThe field for theisFlatrecord component.The field for thelastDeathLocationrecord component.private final intThe field for theportalCooldownrecord component.private final GameTypeThe field for thepreviousGameTyperecord component.private final longThe field for theseedrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionCommonPlayerSpawnInfo(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 aCommonPlayerSpawnInforecord class.CommonPlayerSpawnInfo(RegistryFriendlyByteBuf p_321843_) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedimensionrecord component.Returns the value of thedimensionTyperecord component.final booleanIndicates whether some other object is "equal to" this one.gameType()Returns the value of thegameTyperecord component.final inthashCode()Returns a hash code value for this object.booleanisDebug()Returns the value of theisDebugrecord component.booleanisFlat()Returns the value of theisFlatrecord component.Returns the value of thelastDeathLocationrecord component.intReturns the value of theportalCooldownrecord component.Returns the value of thepreviousGameTyperecord component.longseed()Returns the value of theseedrecord component.final StringtoString()Returns a string representation of this record class.voidwrite(RegistryFriendlyByteBuf p_321515_)
-
Field Details
-
dimensionType
The field for thedimensionTyperecord component. -
dimension
The field for thedimensionrecord component. -
seed
private final long seedThe field for theseedrecord component. -
gameType
The field for thegameTyperecord component. -
previousGameType
The field for thepreviousGameTyperecord component. -
isDebug
private final boolean isDebugThe field for theisDebugrecord component. -
isFlat
private final boolean isFlatThe field for theisFlatrecord component. -
lastDeathLocation
The field for thelastDeathLocationrecord component. -
portalCooldown
private final int portalCooldownThe field for theportalCooldownrecord 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 aCommonPlayerSpawnInforecord class.- Parameters:
dimensionType- the value for thedimensionTyperecord componentdimension- the value for thedimensionrecord componentseed- the value for theseedrecord componentgameType- the value for thegameTyperecord componentpreviousGameType- the value for thepreviousGameTyperecord componentisDebug- the value for theisDebugrecord componentisFlat- the value for theisFlatrecord componentlastDeathLocation- the value for thelastDeathLocationrecord componentportalCooldown- the value for theportalCooldownrecord 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 thedimensionTyperecord component.- Returns:
- the value of the
dimensionTyperecord component
-
dimension
Returns the value of thedimensionrecord component.- Returns:
- the value of the
dimensionrecord component
-
seed
public long seed()Returns the value of theseedrecord component.- Returns:
- the value of the
seedrecord component
-
gameType
Returns the value of thegameTyperecord component.- Returns:
- the value of the
gameTyperecord component
-
previousGameType
Returns the value of thepreviousGameTyperecord component.- Returns:
- the value of the
previousGameTyperecord 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
-
lastDeathLocation
Returns the value of thelastDeathLocationrecord component.- Returns:
- the value of the
lastDeathLocationrecord component
-
portalCooldown
public int portalCooldown()Returns the value of theportalCooldownrecord component.- Returns:
- the value of the
portalCooldownrecord component
-