public class FlatDistinctAlgorithm extends java.lang.Object implements SelectionAlgorithm
This algorithm will ignore the frequency of particular spawns inside the area, and
treat all as equally likely in terms of location (no location weighting). The used
rarity value is the mean of all location-adjusted rarities for each SpawnInfo
.
The result is that even if a particular SpawnInfo
is available at many more
locations, it is not given any greater priority over one that may be possible only at
a single location. This is designed for legendary Pokémon spawning.
It is guaranteed to only return zero or one SpawnAction
s.
Constructor and Description |
---|
FlatDistinctAlgorithm() |
Modifier and Type | Method and Description |
---|---|
java.util.List<SpawnAction<? extends net.minecraft.entity.Entity>> |
calculateSpawnActions(AbstractSpawner spawner,
java.util.List<SpawnSet> spawnSets,
java.util.List<SpawnLocation> spawnLocations)
|
java.util.Map<SpawnInfo,java.lang.Float> |
getAdjustedRarities(AbstractSpawner spawner,
java.util.Map<SpawnLocation,java.util.List<SpawnInfo>> possibleSpawns)
Gets the adjusted rarities of the given mapping from
SpawnLocation to list of SpawnInfo s. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
choose, chooseViaPercentage, getPercentages
public java.util.List<SpawnAction<? extends net.minecraft.entity.Entity>> calculateSpawnActions(AbstractSpawner spawner, java.util.List<SpawnSet> spawnSets, java.util.List<SpawnLocation> spawnLocations)
SelectionAlgorithm
calculateSpawnActions
in interface SelectionAlgorithm
public java.util.Map<SpawnInfo,java.lang.Float> getAdjustedRarities(AbstractSpawner spawner, java.util.Map<SpawnLocation,java.util.List<SpawnInfo>> possibleSpawns)
SelectionAlgorithm
SpawnLocation
to list of SpawnInfo
s.getAdjustedRarities
in interface SelectionAlgorithm