Class StructureAnimationRequestBuilder.Builder
- All Implemented Interfaces:
StructureAnimationRequestBuilder.IBuilder,StructureAnimationRequestBuilder.IBuilderStructure,StructureAnimationRequestBuilder.IBuilderStructureActionCause,StructureAnimationRequestBuilder.IBuilderStructureActionType
- Enclosing class:
StructureAnimationRequestBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder(StructureAnimationRequest.IFactory structureToggleRequestFactory, IMessageable messageableServer, IPlayerFactory playerFactory, IConfig config) -
Method Summary
Modifier and TypeMethodDescriptionanimationType(AnimationType animationType) Sets the animation type of the animation.build()Constructs the new structure toggle request.messageReceiver(IMessageable messageReceiver) Optional: Sets the message receiver of the toggle request.preventPerpetualMovement(boolean preventPerpetualMovement) Sets if perpetual movement should be blocked.responsible(@Nullable IPlayer responsible) Sets the player responsible for the toggle.responsible(@Nullable PlayerData playerData) responsible(@Nullable StructureOwner structureOwner) skipAnimation(boolean skip) Optional: Skips the animation.structure(StructureRetriever structureRetriever) Sets the target structure to toggle.structureActionCause(StructureActionCause structureActionCause) Sets what caused this toggle request.structureActionType(StructureActionType structureActionType) Sets the type of action to request of the structure.Optional: Sets the time value of the toggle request.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nl.pim16aap2.animatedarchitecture.core.structures.StructureAnimationRequestBuilder.IBuilder
preventPerpetualMovement, skipAnimationMethods inherited from interface nl.pim16aap2.animatedarchitecture.core.structures.StructureAnimationRequestBuilder.IBuilderStructure
structure, structure
-
Constructor Details
-
Builder
public Builder(StructureAnimationRequest.IFactory structureToggleRequestFactory, IMessageable messageableServer, IPlayerFactory playerFactory, IConfig config)
-
-
Method Details
-
time
Description copied from interface:StructureAnimationRequestBuilder.IBuilderOptional: Sets the time value of the toggle request.- Specified by:
timein interfaceStructureAnimationRequestBuilder.IBuilder- 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
Description copied from interface:StructureAnimationRequestBuilder.IBuilderOptional: 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.
- Specified by:
skipAnimationin interfaceStructureAnimationRequestBuilder.IBuilder- Returns:
- The next step of the guided builder process.
-
preventPerpetualMovement
public StructureAnimationRequestBuilder.IBuilder preventPerpetualMovement(boolean preventPerpetualMovement) Description copied from interface:StructureAnimationRequestBuilder.IBuilderSets if perpetual movement should be blocked. When perpetual movement is requested but denied via this setting, the animation will still be time-limited.- Specified by:
preventPerpetualMovementin interfaceStructureAnimationRequestBuilder.IBuilder- Parameters:
preventPerpetualMovement- True to prevent any perpetual movement.- Returns:
- The next step of the guided builder process.
-
responsible
public StructureAnimationRequestBuilder.IBuilder responsible(@Nullable @Nullable IPlayer responsible) Description copied from interface:StructureAnimationRequestBuilder.IBuilderSets 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.
- Specified by:
responsiblein interfaceStructureAnimationRequestBuilder.IBuilder- 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
public StructureAnimationRequestBuilder.IBuilder responsible(@Nullable @Nullable PlayerData playerData) Description copied from interface:StructureAnimationRequestBuilder.IBuilder- Specified by:
responsiblein interfaceStructureAnimationRequestBuilder.IBuilder
-
responsible
public StructureAnimationRequestBuilder.IBuilder responsible(@Nullable @Nullable StructureOwner structureOwner) Description copied from interface:StructureAnimationRequestBuilder.IBuilder- Specified by:
responsiblein interfaceStructureAnimationRequestBuilder.IBuilder
-
messageReceiver
Description copied from interface:StructureAnimationRequestBuilder.IBuilderOptional: 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()).- Specified by:
messageReceiverin interfaceStructureAnimationRequestBuilder.IBuilder- Parameters:
messageReceiver- The message receiver for all messages related to the toggle request.- Returns:
- The next step of the guided builder process.
-
messageReceiverServer
Description copied from interface:StructureAnimationRequestBuilder.IBuilderSeeStructureAnimationRequestBuilder.IBuilder.messageReceiver(IMessageable).Sets the server to be the message receiver.
- Specified by:
messageReceiverServerin interfaceStructureAnimationRequestBuilder.IBuilder
-
structureActionType
public StructureAnimationRequestBuilder.IBuilder structureActionType(StructureActionType structureActionType) Description copied from interface:StructureAnimationRequestBuilder.IBuilderStructureActionTypeSets the type of action to request of the structure.- Specified by:
structureActionTypein interfaceStructureAnimationRequestBuilder.IBuilderStructureActionType- Parameters:
structureActionType- The type of action to request.- Returns:
- The next step of the guided builder process.
-
structureActionCause
public StructureAnimationRequestBuilder.IBuilderStructureActionType structureActionCause(StructureActionCause structureActionCause) Description copied from interface:StructureAnimationRequestBuilder.IBuilderStructureActionCauseSets what caused this toggle request.- Specified by:
structureActionCausein interfaceStructureAnimationRequestBuilder.IBuilderStructureActionCause- Parameters:
structureActionCause- The cause of the toggle request.- Returns:
- The next step of the guided builder process.
-
structure
public StructureAnimationRequestBuilder.IBuilderStructureActionCause structure(StructureRetriever structureRetriever) Description copied from interface:StructureAnimationRequestBuilder.IBuilderStructureSets the target structure to toggle.- Specified by:
structurein interfaceStructureAnimationRequestBuilder.IBuilderStructure- Parameters:
structureRetriever- A retriever for the structure to toggle.- Returns:
- The next step of the guided builder process.
-
animationType
Description copied from interface:StructureAnimationRequestBuilder.IBuilderSets the animation type of the animation. Defaults toAnimationType.MOVE_BLOCKS.- Specified by:
animationTypein interfaceStructureAnimationRequestBuilder.IBuilder- Parameters:
animationType- The animation type to apply.- Returns:
- The next step of the guided builder process.
-
build
Description copied from interface:StructureAnimationRequestBuilder.IBuilderConstructs the new structure toggle request.- Specified by:
buildin interfaceStructureAnimationRequestBuilder.IBuilder- Returns:
- The new
StructureAnimationRequest.
-