Class AnimatedPreviewBlockContainer
java.lang.Object
nl.pim16aap2.animatedarchitecture.core.animation.AnimatedPreviewBlockContainer
- All Implemented Interfaces:
IAnimatedBlockContainer
A manager for
AnimatedHighlightedBlocks.-
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleancreateAnimatedBlocks(StructureSnapshot snapshot, IAnimationComponent animationComponent) Attempts to create and spawn the animated blocks for the given input.booleanThe (unmodifiable) list of animated blocks.@Nullable AnimationRegionGetter for the animation region.voidHandles the blocks when the animation is completed.inthashCode()voidRemoves the original blocks from the world.voidRestores all spawned animated blocks to their original positions.voidTries to replace the original blocks with the animated blocks in the world.toString()
-
Method Details
-
createAnimatedBlocks
public boolean createAnimatedBlocks(StructureSnapshot snapshot, IAnimationComponent animationComponent) Description copied from interface:IAnimatedBlockContainerAttempts to create and spawn the animated blocks for the given input.- Specified by:
createAnimatedBlocksin interfaceIAnimatedBlockContainer- Parameters:
snapshot- The snapshot of the structure to create the animated blocks for.animationComponent- The animation component to use for retrieving additional information for the animated blocks.- Returns:
- The result of the attempted creation of the animated blocks.
-
removeOriginalBlocks
public void removeOriginalBlocks()Description copied from interface:IAnimatedBlockContainerRemoves the original blocks from the world.This method does not have to be called when spawning the animated blocks using
IAnimatedBlockContainer.spawnAnimatedBlocks().- Specified by:
removeOriginalBlocksin interfaceIAnimatedBlockContainer
-
spawnAnimatedBlocks
public void spawnAnimatedBlocks()Description copied from interface:IAnimatedBlockContainerTries to replace the original blocks with the animated blocks in the world.This method also handles the removal of the original blocks.
- Specified by:
spawnAnimatedBlocksin interfaceIAnimatedBlockContainer
-
restoreBlocksOnFailure
public void restoreBlocksOnFailure()Description copied from interface:IAnimatedBlockContainerRestores all spawned animated blocks to their original positions.Should be used in case something failed.
- Specified by:
restoreBlocksOnFailurein interfaceIAnimatedBlockContainer
-
handleAnimationCompletion
public void handleAnimationCompletion()Description copied from interface:IAnimatedBlockContainerHandles the blocks when the animation is completed.For the most common use-case, this means that the animated blocks will be killed and the blocks they represented will be placed in their final positions.
- Specified by:
handleAnimationCompletionin interfaceIAnimatedBlockContainer
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getAnimatedBlocks
The (unmodifiable) list of animated blocks.- Specified by:
getAnimatedBlocksin interfaceIAnimatedBlockContainer- Returns:
- All the animated blocks that are part of the animation. In case an error occurred during the creation, this will contain all the animated blocks that have been created up to the point that the problem occurred.
-
getAnimationRegion
Description copied from interface:IAnimatedBlockContainerGetter for the animation region.- Specified by:
getAnimationRegionin interfaceIAnimatedBlockContainer- Returns:
- The animation region.
-