Class HighlightedBlockSpawner.Builder

java.lang.Object
nl.pim16aap2.animatedarchitecture.core.api.HighlightedBlockSpawner.Builder
Enclosing class:
HighlightedBlockSpawner

public static final class HighlightedBlockSpawner.Builder extends Object
The default builder implementation for highlighted blocks.
  • Method Details

    • forPlayer

      public HighlightedBlockSpawner.Builder forPlayer(IPlayer player)
      Sets the player who will see the highlighted block.
      Parameters:
      player - The player who will see the highlighted block.
      Returns:
      This builder.
    • atLocation

      public HighlightedBlockSpawner.Builder atLocation(ILocation location)
      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

      public HighlightedBlockSpawner.Builder inWorld(IWorld world)
      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

      public HighlightedBlockSpawner.Builder forDuration(@Nullable Duration duration)
      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

      public HighlightedBlockSpawner.Builder atPosition(IVector3D position)
      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

      public HighlightedBlockSpawner.Builder atPosition(double x, double y, double z)
      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

      public HighlightedBlockSpawner.Builder withRotation(double roll, double pitch, double yaw)
      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

      public HighlightedBlockSpawner.Builder withRotation(IVector3D rotation)
      Sets the rotation components of the highlighted block.
      Parameters:
      rotation - The rotation vector, where x=roll, y=pitch, z=yaw.
      Returns:
      This builder.
    • atPosition

      public HighlightedBlockSpawner.Builder atPosition(RotatedPosition rotatedPosition)
      Sets both the position and rotation of the highlighted block.
      Parameters:
      rotatedPosition - The rotated position.
      Returns:
      This builder.
    • withColor

      public HighlightedBlockSpawner.Builder withColor(Color color)
      Sets the color of the highlighted block.
      Parameters:
      color - The color of the highlighted block.
      Returns:
      This builder.
    • spawn

      public Optional<IHighlightedBlock> spawn()
      Creates and spawns the new highlighted block using the provided configuration.
      Returns:
      The IHighlightedBlock that was spawned. The optional will be empty if it could not be spawned for some reason.