Class BuilderMotionControllerDive

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

public class BuilderMotionControllerDive extends BuilderMotionControllerBase
  • Constructor Details

    • BuilderMotionControllerDive

      public BuilderMotionControllerDive()
  • Method Details

    • 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>
    • build

      @Nonnull public MotionControllerDive build(@Nonnull BuilderSupport builderSupport)
    • readConfig

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

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

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

      public double getMinHorizontalSpeed()
    • getAcceleration

      public double getAcceleration()
    • getMaxVerticalSpeed

      public double getMaxVerticalSpeed()
    • getGravity

      public double getGravity()
    • getMaxFallSpeed

      public double getMaxFallSpeed()
    • getMaxSinkSpeed

      public double getMaxSinkSpeed()
    • getMaxMoveTurnAngle

      public float getMaxMoveTurnAngle()
    • getMaxRotationSpeed

      public double getMaxRotationSpeed()
    • getMinDiveDepth

      public double getMinDiveDepth()
    • getMaxDiveDepth

      public double getMaxDiveDepth()
    • getMinWaterDepth

      public double getMinWaterDepth()
    • getMaxWaterDepth

      public double getMaxWaterDepth()
    • getMinDepthAboveGround

      public double getMinDepthAboveGround()
    • getMinDepthBelowSurface

      public double getMinDepthBelowSurface()
    • getSwimDepth

      public double getSwimDepth()
    • getSinkRatio

      public double getSinkRatio()
    • getFastDiveThreshold

      public double getFastDiveThreshold()
    • getDesiredDepthWeight

      public double getDesiredDepthWeight()
    • 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