Class HighlightedBlockSpawner.Builder
java.lang.Object
nl.pim16aap2.animatedarchitecture.core.api.HighlightedBlockSpawner.Builder
- Enclosing class:
HighlightedBlockSpawner
The default builder implementation for highlighted blocks.
-
Method Summary
Modifier and TypeMethodDescriptionatLocation(ILocation location) Sets the location where the highlighted block will be spawned.atPosition(double x, double y, double z) Sets the position to spawn the highlighted block at.atPosition(RotatedPosition rotatedPosition) Sets both the position and rotation of the highlighted block.atPosition(IVector3D position) Sets the position to spawn the highlighted block at.forDuration(@Nullable Duration duration) Sets the duration the highlighted block should exist for after it has been spawned.Sets the player who will see the highlighted block.Sets the world where the highlighted block will be spawned.spawn()Creates and spawns the new highlighted block using the provided configuration.Sets the color of the highlighted block.withRotation(double roll, double pitch, double yaw) Sets the rotation components of the highlighted block.withRotation(IVector3D rotation) Sets the rotation components of the highlighted block.
-
Method Details
-
forPlayer
Sets the player who will see the highlighted block.- Parameters:
player- The player who will see the highlighted block.- Returns:
- This builder.
-
atLocation
Sets the location where the highlighted block will be spawned.- Parameters:
location- The location where the highlighted block will be spawned. This sets the coordinates and the world.- Returns:
- This builder.
-
inWorld
Sets the world where the highlighted block will be spawned.- Parameters:
world- The world the highlighted block will be spawned in.- Returns:
- This builder.
-
forDuration
Sets the duration the highlighted block should exist for after it has been spawned.- Parameters:
duration- The amount of time the highlighted block should exist for after it has been spawned.- Returns:
- This builder.
-
atPosition
Sets the position to spawn the highlighted block at.- Parameters:
position- The position to spawn the highlighted block at. This only sets the coordinates; not the world.- Returns:
- This builder.
-
atPosition
Sets the position to spawn the highlighted block at.Note that this only sets the coordinates; not the world.
- Parameters:
x- The x-coordinate.y- The y-coordinate.z- The z-coordinate.- Returns:
- This builder.
-
withRotation
Sets the rotation components of the highlighted block.- Parameters:
roll- The roll in degrees.pitch- The pitch in degrees.yaw- The yaw in degrees.- Returns:
- This builder.
-
withRotation
Sets the rotation components of the highlighted block.- Parameters:
rotation- The rotation vector, where x=roll, y=pitch, z=yaw.- Returns:
- This builder.
-
atPosition
Sets both the position and rotation of the highlighted block.- Parameters:
rotatedPosition- The rotated position.- Returns:
- This builder.
-
withColor
Sets the color of the highlighted block.- Parameters:
color- The color of the highlighted block.- Returns:
- This builder.
-
spawn
Creates and spawns the new highlighted block using the provided configuration.- Returns:
- The
IHighlightedBlockthat was spawned. The optional will be empty if it could not be spawned for some reason.
-