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
ConstructorDescriptionPlayer
(EntitySnapshot snapshot, String username, GameMode gameMode) Creates an instance of aPlayer
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull ChunkSnapshot
chunk()
final boolean
Indicates whether some other object is "equal to" this one.gameMode()
Returns the value of thegameMode
record component.<T> @UnknownNullability T
Reads the specified tag.final int
hashCode()
Returns a hash code value for this object.int
id()
@NotNull InstanceSnapshot
instance()
@NotNull Collection
<@NotNull EntitySnapshot> @NotNull Pos
position()
snapshot()
Returns the value of thesnapshot
record component.final String
toString()
Returns a string representation of this record class.@NotNull EntityType
type()
username()
Returns the value of theusername
record component.@NotNull UUID
uuid()
@Nullable EntitySnapshot
vehicle()
@NotNull Vec
velocity()
@NotNull Collection
<@NotNull PlayerSnapshot> viewers()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minestom.server.tag.TagReadable
hasTag
-
Constructor Details
-
Player
Creates an instance of aPlayer
record class.- Parameters:
snapshot
- the value for thesnapshot
record componentusername
- the value for theusername
record componentgameMode
- the value for thegameMode
record component
-
-
Method Details
-
type
- Specified by:
type
in interfaceEntitySnapshot
-
uuid
- Specified by:
uuid
in interfaceEntitySnapshot
-
id
public int id()- Specified by:
id
in interfaceEntitySnapshot
-
position
- Specified by:
position
in interfaceEntitySnapshot
-
velocity
- Specified by:
velocity
in interfaceEntitySnapshot
-
instance
- Specified by:
instance
in interfaceEntitySnapshot
-
chunk
- Specified by:
chunk
in interfaceEntitySnapshot
-
viewers
- Specified by:
viewers
in interfaceEntitySnapshot
-
passengers
- Specified by:
passengers
in interfaceEntitySnapshot
-
vehicle
- Specified by:
vehicle
in interfaceEntitySnapshot
-
getTag
Description copied from interface:TagReadable
Reads the specified tag.- Specified by:
getTag
in 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 thesnapshot
record component.- Returns:
- the value of the
snapshot
record component
-
username
Returns the value of theusername
record component.- Specified by:
username
in interfacePlayerSnapshot
- Returns:
- the value of the
username
record component
-
gameMode
Returns the value of thegameMode
record component.- Specified by:
gameMode
in interfacePlayerSnapshot
- Returns:
- the value of the
gameMode
record component
-