Contents
Class EntityTransformSnapshot
java.lang.Object
com.hypixel.hytale.builtin.buildertools.snapshot.EntityTransformSnapshot
- All Implemented Interfaces:
EntitySnapshot<EntityTransformSnapshot>, SelectionSnapshot<EntityTransformSnapshot>
public class EntityTransformSnapshot
extends Object
implements EntitySnapshot<EntityTransformSnapshot>
Represents an entity that has been moved during a tool operation.
Restoring this snapshot will move the entity back to its position and rotation prior to the operation moving it.
-
Constructor Summary
ConstructorsConstructorDescriptionEntityTransformSnapshot(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) Default Constructor for aEntityTransformSnapshotinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTransform(ComponentAccessor<EntityStore> componentAccessor) Restores the entity's transform to the state captured by this snapshot without creating an inverse.restoreEntity(PlayerRef playerRef, World world, ComponentAccessor<EntityStore> componentAccessor) voidupdateEntityRef(Ref<EntityStore> oldRef, Ref<EntityStore> newRef) Updates the entity reference held by this snapshot.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EntitySnapshot
restoreMethods inherited from interface SelectionSnapshot
estimatedBlockWeight
-
Constructor Details
-
EntityTransformSnapshot
public EntityTransformSnapshot(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Default Constructor for aEntityTransformSnapshotinstance.- Parameters:
ref- The entity reference of the entity being tracked.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
-
Method Details
-
updateEntityRef
Description copied from interface:EntitySnapshotUpdates the entity reference held by this snapshot. Called when an entity is re-created after an undo of a remove operation, so that earlier snapshots in the history can track the new ref instead of the now-invalid old one.- Specified by:
updateEntityRefin interfaceEntitySnapshot<EntityTransformSnapshot>- Parameters:
oldRef- the previous (now invalid) entity referencenewRef- the new entity reference after re-creation
-
applyTransform
Restores the entity's transform to the state captured by this snapshot without creating an inverse. -
restoreEntity
public EntityTransformSnapshot restoreEntity(@Nonnull PlayerRef playerRef, @Nonnull World world, @Nonnull ComponentAccessor<EntityStore> componentAccessor) - Specified by:
restoreEntityin interfaceEntitySnapshot<EntityTransformSnapshot>
-