Package net.minestom.server.snapshot
Record Class SnapshotImpl.Server
java.lang.Object
java.lang.Record
net.minestom.server.snapshot.SnapshotImpl.Server
- All Implemented Interfaces:
ServerSnapshot,Snapshot
- Enclosing class:
SnapshotImpl
public static record SnapshotImpl.Server(Collection<InstanceSnapshot> instances, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<AtomicReference<EntitySnapshot>> entityRefs)
extends Record
implements ServerSnapshot
-
Constructor Summary
ConstructorsConstructorDescriptionServer(Collection<InstanceSnapshot> instances, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<AtomicReference<EntitySnapshot>> entityRefs) Creates an instance of aServerrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection<EntitySnapshot> entities()@UnknownNullability EntitySnapshotentity(int id) it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<AtomicReference<EntitySnapshot>> Returns the value of theentityRefsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinstancesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Server
public Server(Collection<InstanceSnapshot> instances, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<AtomicReference<EntitySnapshot>> entityRefs) Creates an instance of aServerrecord class.- Parameters:
instances- the value for theinstancesrecord componententityRefs- the value for theentityRefsrecord component
-
-
Method Details
-
entities
- Specified by:
entitiesin interfaceServerSnapshot
-
entity
- Specified by:
entityin interfaceServerSnapshot
-
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). -
instances
Returns the value of theinstancesrecord component.- Specified by:
instancesin interfaceServerSnapshot- Returns:
- the value of the
instancesrecord component
-
entityRefs
public it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<AtomicReference<EntitySnapshot>> entityRefs()Returns the value of theentityRefsrecord component.- Returns:
- the value of the
entityRefsrecord component
-