Record Class SnapshotImpl.Player
java.lang.Object
java.lang.Record
net.minestom.server.snapshot.SnapshotImpl.Player
- All Implemented Interfaces:
EntitySnapshot, PlayerSnapshot, Snapshot, TagReadable
- Enclosing class:
SnapshotImpl
public static record SnapshotImpl.Player(EntitySnapshot snapshot, String username, GameMode gameMode)
extends Record
implements PlayerSnapshot
-
Constructor Summary
ConstructorsConstructorDescriptionPlayer(EntitySnapshot snapshot, String username, GameMode gameMode) Creates an instance of aPlayerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionchunk()final booleanIndicates whether some other object is "equal to" this one.gameMode()Returns the value of thegameModerecord component.<T> @UnknownNullability TReads the specified tag.final inthashCode()Returns a hash code value for this object.intid()instance()position()snapshot()Returns the value of thesnapshotrecord component.final StringtoString()Returns a string representation of this record class.type()username()Returns the value of theusernamerecord component.uuid()vehicle()velocity()viewers()Methods inherited from interface TagReadable
hasTag
-
Constructor Details
-
Player
Creates an instance of aPlayerrecord class.- Parameters:
snapshot- the value for thesnapshotrecord componentusername- the value for theusernamerecord componentgameMode- the value for thegameModerecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceEntitySnapshot
-
uuid
- Specified by:
uuidin interfaceEntitySnapshot
-
id
public int id()- Specified by:
idin interfaceEntitySnapshot
-
position
- Specified by:
positionin interfaceEntitySnapshot
-
velocity
- Specified by:
velocityin interfaceEntitySnapshot
-
instance
- Specified by:
instancein interfaceEntitySnapshot
-
chunk
- Specified by:
chunkin interfaceEntitySnapshot
-
viewers
- Specified by:
viewersin interfaceEntitySnapshot
-
passengers
- Specified by:
passengersin interfaceEntitySnapshot
-
vehicle
- Specified by:
vehiclein interfaceEntitySnapshot
-
getTag
Description copied from interface:TagReadableReads the specified tag.- Specified by:
getTagin interfaceTagReadable- Type Parameters:
T- the tag type- Parameters:
tag- the tag to read- Returns:
- the read tag, null if not present
-
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). -
snapshot
Returns the value of thesnapshotrecord component.- Returns:
- the value of the
snapshotrecord component
-
username
Returns the value of theusernamerecord component.- Specified by:
usernamein interfacePlayerSnapshot- Returns:
- the value of the
usernamerecord component
-
gameMode
Returns the value of thegameModerecord component.- Specified by:
gameModein interfacePlayerSnapshot- Returns:
- the value of the
gameModerecord component
-