Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getId()
- getWeight()
- getSpawnBlockSet()
- getSpawnBlockSetIndex()
- getSpawnFluidTagIndex()
- getFlockDefinitionId()
- getFlockDefinitionIndex()
- getEnableSafeSpawning()
- getConfigMovementModeWeights()
- getOrComputeMovementModeWeights(ISpawnable, SpawningContext)
- claimSpawnOverYRangeReport()
- getFlockDefinition()
- toString()
Class RoleSpawnParameters
java.lang.Object
com.hypixel.hytale.server.spawning.assets.spawns.config.RoleSpawnParameters
- All Implemented Interfaces:
IWeightedElement
Created on 23/11/2018
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<RoleSpawnParameters> static final RoleSpawnParameters[] -
Constructor Summary
ConstructorsConstructorDescriptionRoleSpawnParameters(String id, double weight, String spawnBlockSet, String flockDefinitionId) -
Method Summary
Modifier and TypeMethodDescriptionbooleanClaim the one report of a spawn height over the beacon Y range for this role.booleanintgetId()double[]getOrComputeMovementModeWeights(ISpawnable spawnable, SpawningContext context) Return the cached movement mode weight array for this role, computing and caching it on first call.intintdoubletoString()
-
Field Details
-
CODEC
-
EMPTY_ARRAY
-
-
Constructor Details
-
RoleSpawnParameters
-
-
Method Details
-
getId
-
getWeight
public double getWeight()- Specified by:
getWeightin interfaceIWeightedElement
-
getSpawnBlockSet
-
getSpawnBlockSetIndex
public int getSpawnBlockSetIndex() -
getSpawnFluidTagIndex
public int getSpawnFluidTagIndex() -
getFlockDefinitionId
-
getFlockDefinitionIndex
public int getFlockDefinitionIndex() -
getEnableSafeSpawning
public boolean getEnableSafeSpawning() -
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
configMovementModeWeightsmap, the supported, default and (whenenableSafeSpawningis true) safe movement modes reported byspawnable.- Parameters:
spawnable- the spawnable for this role, used to obtain movement mode setscontext- the current spawning context, forwarded toISpawnable.getMovementModes(SpawningContext, Set, Set, Set)- Returns:
- the cached weight array, or
nullif 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:
truefor the first call,falsefor every call after it
-
getFlockDefinition
-
toString
-