Package net.minestom.server.snapshot
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 TypeMethodDescription@NotNull ChunkSnapshotchunk()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()@NotNull InstanceSnapshotinstance()@NotNull Collection<@NotNull EntitySnapshot> @NotNull Posposition()snapshot()Returns the value of thesnapshotrecord component.final StringtoString()Returns a string representation of this record class.@NotNull EntityTypetype()username()Returns the value of theusernamerecord component.@NotNull UUIDuuid()@Nullable EntitySnapshotvehicle()@NotNull Vecvelocity()@NotNull Collection<@NotNull PlayerSnapshot> viewers()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minestom.server.tag.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
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. 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
-