Interface StructureAnimationRequestBuilder.IBuilder

Enclosing class:
StructureAnimationRequestBuilder

public static interface StructureAnimationRequestBuilder.IBuilder
  • Method Details

    • time

      Optional: Sets the time value of the toggle request.
      Parameters:
      time - The duration (in seconds) of the toggle animation. Because the maximum speed of the animated blocks is limited, there is a lower bound limit of this value. The exact limit depends on the type and dimensions of the structure.

      A value of null (default) allows the structure to figure out the time on its own.

      Returns:
      The next step of the guided builder process.
    • skipAnimation

      StructureAnimationRequestBuilder.IBuilder skipAnimation(boolean skip)
      Optional: Skips the animation.

      If this method is called, the animation will be skipped, and the blocks will be moved from their old positions to the new ones immediately. This allows toggling structures without spawning any entities.

      This is useful for when there aren't any players nearby to witness the animation anyway, as opening the structure without playing the animation avoids the heavy performance impact of spawning and animating entities.

      Returns:
      The next step of the guided builder process.
    • skipAnimation

    • preventPerpetualMovement

      StructureAnimationRequestBuilder.IBuilder preventPerpetualMovement(boolean preventPerpetualMovement)
      Sets if perpetual movement should be blocked. When perpetual movement is requested but denied via this setting, the animation will still be time-limited.
      Parameters:
      preventPerpetualMovement - True to prevent any perpetual movement.
      Returns:
      The next step of the guided builder process.
    • preventPerpetualMovement

      default StructureAnimationRequestBuilder.IBuilder preventPerpetualMovement()
      Prevents perpetual movement. When perpetual movement is requested but denied via this setting, the animation will still be time-limited.
      Returns:
      The next step of the guided builder process.
    • responsible

      StructureAnimationRequestBuilder.IBuilder responsible(@Nullable IPlayer responsible)
      Sets the player responsible for the toggle. When the toggle was not caused by a player this value is optional.

      However, this value is required if the toggle was caused by a player.

      When the toggle request was not caused by a player (e.g. via redstone) and this value is not set, it will default to the prime owner of the structure.

      Parameters:
      responsible - The player responsible for the toggle request. The responsible player's build-permissions are used for things like checking access to certain areas.
      Returns:
      The next step of the guided builder process.
    • responsible

    • responsible

      StructureAnimationRequestBuilder.IBuilder responsible(@Nullable StructureOwner structureOwnerOwner)
    • messageReceiver

      StructureAnimationRequestBuilder.IBuilder messageReceiver(IMessageable messageReceiver)
      Optional: Sets the message receiver of the toggle request. The message receiver will receive all messages related to the toggle request.

      When the toggle request is caused by a player, this defaults to that player. In all other situations, it defaults to the server (See IAnimatedArchitecturePlatform.getServer()).

      Parameters:
      messageReceiver - The message receiver for all messages related to the toggle request.
      Returns:
      The next step of the guided builder process.
    • messageReceiverServer

      See messageReceiver(IMessageable).

      Sets the server to be the message receiver.

    • animationType

      Sets the animation type of the animation. Defaults to AnimationType.MOVE_BLOCKS.
      Parameters:
      animationType - The animation type to apply.
      Returns:
      The next step of the guided builder process.
    • build

      Constructs the new structure toggle request.
      Returns:
      The new StructureAnimationRequest.