Class BuilderMotionControllerBase

All Implemented Interfaces:
NamedSchema, SchemaConvertable<Void>, Builder<MotionController>, BuilderContext, ISpawnable
Direct Known Subclasses:
BuilderMotionControllerDive, BuilderMotionControllerFly, BuilderMotionControllerWalk

public abstract class BuilderMotionControllerBase extends BuilderBaseWithType<MotionController>
  • Constructor Details

    • BuilderMotionControllerBase

      public BuilderMotionControllerBase()
  • Method Details

    • readCommonConfig

      @Nonnull public Builder<MotionController> readCommonConfig(@Nonnull com.google.gson.JsonElement data)
      Overrides:
      readCommonConfig in class BuilderBase<MotionController>
    • isEnabled

      public final boolean isEnabled(ExecutionContext context)
    • getIdentifier

      @Nonnull public String getIdentifier()
      Returns:
      the unique identifier of the spawnable class type
    • validate

      public boolean validate(String configName, @Nonnull NPCLoadTimeValidationHelper validationHelper, ExecutionContext context, Scope globalScope, @Nonnull List<String> errors)
      Description copied from interface: Builder
      Iterates the builder tree and validates all present dynamic value holders based on the execution context and scope provided. Will also run an optional ILoadTimeValidationHelper
      Specified by:
      validate in interface Builder<MotionController>
      Overrides:
      validate in class BuilderBase<MotionController>
      Parameters:
      configName - the name of the parent file from which the execution context and scope are derived
      validationHelper - an optional validation helper that will be run in certain contexts depending on implementations
      context - the execution context for resolving value holders
      globalScope - the scope for resolving value holders
      errors - a list for storing any errors encountered
      Returns:
      false if any errors were encountered during validation, true otherwise
    • getEpsilonAngle

      public float getEpsilonAngle()
    • getEpsilonSpeed

      public double getEpsilonSpeed()
    • getExternalVelocityDamping

      public double getExternalVelocityDamping(@Nonnull BuilderSupport builderSupport)
    • getMaxHorizontalSpeed

      public double getMaxHorizontalSpeed(@Nonnull BuilderSupport builderSupport)
    • getMaxHeadRotationSpeed

      public float getMaxHeadRotationSpeed(@Nonnull BuilderSupport support)
    • getFastHorizontalThreshold

      public double getFastHorizontalThreshold(@Nonnull BuilderSupport builderSupport)
    • getFastHorizontalThresholdRange

      public double getFastHorizontalThresholdRange(@Nonnull BuilderSupport builderSupport)
    • getClassType

      public abstract Class<? extends MotionController> getClassType()
    • getSupportedMovementModes

      @Nonnull public abstract Set<MovementMode> getSupportedMovementModes()
      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.