Record Class EntitySnapshot
java.lang.Object
java.lang.Record
nl.pim16aap2.lightkeeper.framework.EntitySnapshot
- Record Components:
uuid- The entity's UUID.typeKey- Namespaced entity type key, e.g.minecraft:block_display.position- The entity's position at the burst tick.customName- The entity's custom name, ornullwhen unnamed.pdcKeys- Namespaced keys present in the entity's persistent data container, sorted.transform- The display transformation for display entities, ornullfor all other entities.tick- The server tick of the query burst.
public record EntitySnapshot(UUID uuid, String typeKey, Vec3 position, @Nullable String customName, List<String> pdcKeys, @Nullable EntitySnapshot.Transform transform, long tick)
extends Record
Frozen snapshot of one entity's state, read in the same main-thread burst as its query siblings — every
snapshot from one
EntityQuery.snapshot() call shares one tick and is internally consistent.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA rotation quaternion.static final recordA display entity's transformation: display entities move via transform, not position. -
Constructor Summary
ConstructorsConstructorDescriptionEntitySnapshot(UUID uuid, String typeKey, Vec3 position, @Nullable String customName, List<String> pdcKeys, @Nullable EntitySnapshot.Transform transform, long tick) Validates and defensively copies the fields; sortspdcKeysso the documented ordering holds regardless of the source. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the value of thecustomNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.pdcKeys()Returns the value of thepdcKeysrecord component.position()Returns the value of thepositionrecord component.longtick()Returns the value of thetickrecord component.final StringtoString()Returns a string representation of this record class.@Nullable EntitySnapshot.TransformReturns the value of thetransformrecord component.typeKey()Returns the value of thetypeKeyrecord component.uuid()Returns the value of theuuidrecord component.
-
Constructor Details
-
EntitySnapshot
public EntitySnapshot(UUID uuid, String typeKey, Vec3 position, @Nullable String customName, List<String> pdcKeys, @Nullable EntitySnapshot.Transform transform, long tick) Validates and defensively copies the fields; sortspdcKeysso the documented ordering holds regardless of the source.
-
-
Method Details
-
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 '=='. -
uuid
Returns the value of theuuidrecord component.- Returns:
- the value of the
uuidrecord component
-
typeKey
Returns the value of thetypeKeyrecord component.- Returns:
- the value of the
typeKeyrecord component
-
position
Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
customName
Returns the value of thecustomNamerecord component.- Returns:
- the value of the
customNamerecord component
-
pdcKeys
Returns the value of thepdcKeysrecord component.- Returns:
- the value of the
pdcKeysrecord component
-
transform
Returns the value of thetransformrecord component.- Returns:
- the value of the
transformrecord component
-
tick
public long tick()Returns the value of thetickrecord component.- Returns:
- the value of the
tickrecord component
-