Class BuilderMotionControllerFly

All Implemented Interfaces:
NamedSchema, SchemaConvertable<Void>, Builder<MotionController>, BuilderContext, ISpawnable

public class BuilderMotionControllerFly extends BuilderMotionControllerBase
  • Constructor Details

    • BuilderMotionControllerFly

      public BuilderMotionControllerFly()
  • Method Details

    • build

      @Nonnull public MotionControllerFly build(@Nonnull BuilderSupport builderSupport)
    • getShortDescription

      @Nonnull public String getShortDescription()
      Specified by:
      getShortDescription in class BuilderBase<MotionController>
    • getLongDescription

      @Nonnull public String getLongDescription()
      Specified by:
      getLongDescription in class BuilderBase<MotionController>
    • getBuilderDescriptorState

      @Nonnull public BuilderDescriptorState getBuilderDescriptorState()
      Specified by:
      getBuilderDescriptorState in interface Builder<MotionController>
      Specified by:
      getBuilderDescriptorState in class BuilderBase<MotionController>
    • readConfig

      @Nonnull public BuilderMotionControllerFly readConfig(@Nonnull com.google.gson.JsonElement data)
      Overrides:
      readConfig in class BuilderBase<MotionController>
    • getMinAirSpeed

      public double getMinAirSpeed()
    • getMaxClimbSpeed

      public double getMaxClimbSpeed()
    • getMaxSinkSpeed

      public double getMaxSinkSpeed()
    • getMaxFallSpeed

      public double getMaxFallSpeed()
    • getMaxSinkSpeedFluid

      public double getMaxSinkSpeedFluid()
    • getMaxClimbAngle

      public float getMaxClimbAngle()
    • getMaxSinkAngle

      public float getMaxSinkAngle()
    • getAcceleration

      public double getAcceleration()
    • getDeceleration

      public double getDeceleration()
    • getGravity

      public double getGravity()
    • getMaxTurnSpeed

      public float getMaxTurnSpeed()
    • getMaxRollAngle

      public float getMaxRollAngle()
    • getMaxRollSpeed

      public float getMaxRollSpeed()
    • getRollDamping

      public float getRollDamping()
    • getMinHeightOverGround

      public double getMinHeightOverGround(@Nonnull BuilderSupport support)
    • getMaxHeightOverGround

      public double getMaxHeightOverGround(@Nonnull BuilderSupport support)
    • getMinHeightOverGround

      public double getMinHeightOverGround(@Nonnull ExecutionContext executionContext)
    • getMaxHeightOverGround

      public double getMaxHeightOverGround(@Nonnull ExecutionContext executionContext)
    • getFastFlyThreshold

      public double getFastFlyThreshold()
    • isAutoLevel

      public boolean isAutoLevel()
    • getDesiredAltitudeWeight

      public double getDesiredAltitudeWeight()
    • category

      @Nonnull public Class<MotionController> category()
    • getType

      @Nonnull public String getType()
      Overrides:
      getType in class BuilderBaseWithType<MotionController>
    • canSpawn

      @Nonnull public SpawnTestResult canSpawn(@Nonnull SpawningContext context)
      Description copied from interface: ISpawnable
      Called to test whether this spawnable class type is spawnable regarding the given context
      Parameters:
      context - The SpawningContext to test against
      Returns:
      true if this spawnable can spawn, false if otherwise
    • requiresSpawnDropHeightCheck

      public boolean requiresSpawnDropHeightCheck(@Nonnull SpawningContext context)
      Description copied from interface: ISpawnable
      Called to test whether a spawn drop height check applies to this spawnable for the given context.

      The motion controller that supports the movement mode in the context resolves the answer. An implementation that cannot resolve it returns true, so the caller keeps the check.

      Parameters:
      context - The SpawningContext to test against
      Returns:
      true if the caller must check the spawn drop height, false if otherwise
    • getSpawnPlacement

      @Nonnull public SpawnPositionPlacement getSpawnPlacement(@Nonnull SpawningContext context)
      Description copied from interface: ISpawnable
      Query where a spawn position for this spawnable must sit for the movement mode in the context.

      The motion controller that supports the movement mode in the context resolves the answer. An implementation that cannot resolve it returns SpawnPositionPlacement.ON_GROUND.

      A position search uses the answer to place its candidates. The spawnable still judges the finished candidate in ISpawnable.canSpawn(SpawningContext).

      Parameters:
      context - The SpawningContext to test against
      Returns:
      the placement a spawn position must have
    • getMovementModes

      public void getMovementModes(@Nonnull SpawningContext context, @Nonnull Set<MovementMode> outSupportedMovementModes, @Nonnull Set<MovementMode> outDefaultMovementModes, @Nonnull Set<MovementMode> outSafeMovementModes)
      Description copied from interface: ISpawnable
      Query all movement mode sets for this spawnable.
      Parameters:
      context - The SpawningContext to test against
      outSupportedMovementModes - Populated with every movement mode the NPC's motion controller is capable of. Must be cleared before population.
      outDefaultMovementModes - Populated with the movement modes used when no user configuration is present. Must be cleared before population.
      outSafeMovementModes - Populated with movement modes the NPC can use safely given its breathing configuration (e.g. air-breathing walkers exclude UNDERWATER_WALK). Must be cleared before population.
    • getClassType

      @Nonnull public Class<? extends MotionController> getClassType()
      Specified by:
      getClassType in class BuilderMotionControllerBase
    • getSupportedMovementModes

      @Nonnull public Set<MovementMode> getSupportedMovementModes()
      Description copied from class: BuilderMotionControllerBase
      Return the set of MovementModes this motion controller supports.

      Implementations must return the static constant defined on their corresponding MotionController subclass (e.g. MotionControllerWalk.SUPPORTED_MOVEMENT_MODES). The returned set is immutable and context-independent.

      Specified by:
      getSupportedMovementModes in class BuilderMotionControllerBase