Contents
Class EntitySettingsSnapshot
java.lang.Object
com.hypixel.hytale.builtin.buildertools.snapshot.EntitySettingsSnapshot
- All Implemented Interfaces:
EntitySnapshot<EntitySettingsSnapshot>, SelectionSnapshot<EntitySettingsSnapshot>
public class EntitySettingsSnapshot
extends Object
implements EntitySnapshot<EntitySettingsSnapshot>
Captures entity property settings (light, pickup, collision) in a single snapshot.
When restored, all captured properties are reverted to their previous state.
-
Constructor Summary
ConstructorsConstructorDescriptionEntitySettingsSnapshot(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyPickupState(Ref<EntityStore> ref, boolean enabled, ComponentAccessor<EntityStore> componentAccessor) Applies the pickup enabled/disabled state to an entity.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
-
EntitySettingsSnapshot
public EntitySettingsSnapshot(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
-
-
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<EntitySettingsSnapshot>- Parameters:
oldRef- the previous (now invalid) entity referencenewRef- the new entity reference after re-creation
-
restoreEntity
public EntitySettingsSnapshot restoreEntity(@Nonnull PlayerRef playerRef, @Nonnull World world, @Nonnull ComponentAccessor<EntityStore> componentAccessor) - Specified by:
restoreEntityin interfaceEntitySnapshot<EntitySettingsSnapshot>
-
applyPickupState
public static void applyPickupState(@Nonnull Ref<EntityStore> ref, boolean enabled, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Applies the pickup enabled/disabled state to an entity.
-