Class RoleSpawnParameters

java.lang.Object
com.hypixel.hytale.server.spawning.assets.spawns.config.RoleSpawnParameters
All Implemented Interfaces:
IWeightedElement

public class RoleSpawnParameters extends Object implements IWeightedElement
Created on 23/11/2018
  • Field Details

  • Constructor Details

    • RoleSpawnParameters

      public RoleSpawnParameters(String id, double weight, String spawnBlockSet, String flockDefinitionId)
  • Method Details

    • getId

      public String getId()
    • getWeight

      public double getWeight()
      Specified by:
      getWeight in interface IWeightedElement
    • getSpawnBlockSet

      public String getSpawnBlockSet()
    • getSpawnBlockSetIndex

      public int getSpawnBlockSetIndex()
    • getSpawnFluidTagIndex

      public int getSpawnFluidTagIndex()
    • getFlockDefinitionId

      public String getFlockDefinitionId()
    • getFlockDefinitionIndex

      public int getFlockDefinitionIndex()
    • getEnableSafeSpawning

      public boolean getEnableSafeSpawning()
    • getConfigMovementModeWeights

      @Nullable public Map<MovementMode, Double> getConfigMovementModeWeights()
    • getOrComputeMovementModeWeights

      @Nullable public double[] getOrComputeMovementModeWeights(@Nonnull ISpawnable spawnable, @Nonnull SpawningContext context)
      Return the cached movement mode weight array for this role, computing and caching it on first call.

      The weights are derived from the optional user-configured configMovementModeWeights map, the supported, default and (when enableSafeSpawning is true) safe movement modes reported by spawnable.

      Parameters:
      spawnable - the spawnable for this role, used to obtain movement mode sets
      context - the current spawning context, forwarded to ISpawnable.getMovementModes(SpawningContext, Set, Set, Set)
      Returns:
      the cached weight array, or null if no movement mode has a non-zero weight
    • claimSpawnOverYRangeReport

      public boolean claimSpawnOverYRangeReport()
      Claim the one report of a spawn height over the beacon Y range for this role.
      Returns:
      true for the first call, false for every call after it
    • getFlockDefinition

      @Nullable public FlockAsset getFlockDefinition()
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object