Class FlatDistinctAlgorithm
java.lang.Object
com.pixelmonmod.pixelmon.api.spawning.archetypes.algorithms.selection.FlatDistinctAlgorithm
- All Implemented Interfaces:
SelectionAlgorithm
The Flat & Distinct Algorithm
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionList<SpawnAction<? extends net.minecraft.world.entity.Entity>>
calculateSpawnActions
(AbstractSpawner spawner, List<SpawnSet> spawnSets, List<SpawnLocation> spawnLocations) getAdjustedRarities
(AbstractSpawner spawner, Map<SpawnLocation, List<SpawnInfo>> possibleSpawns) Gets the adjusted rarities of the given mapping fromSpawnLocation
to list ofSpawnInfo
s.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.pixelmonmod.pixelmon.api.spawning.calculators.SelectionAlgorithm
choose, chooseViaPercentage, getPercentages
-
Constructor Details
-
FlatDistinctAlgorithm
public FlatDistinctAlgorithm()
-
-
Method Details
-
calculateSpawnActions
public List<SpawnAction<? extends net.minecraft.world.entity.Entity>> calculateSpawnActions(AbstractSpawner spawner, List<SpawnSet> spawnSets, List<SpawnLocation> spawnLocations) Description copied from interface:SelectionAlgorithm
- Specified by:
calculateSpawnActions
in interfaceSelectionAlgorithm
-
getAdjustedRarities
public Map<SpawnInfo,Float> getAdjustedRarities(AbstractSpawner spawner, Map<SpawnLocation, List<SpawnInfo>> possibleSpawns) Description copied from interface:SelectionAlgorithm
Gets the adjusted rarities of the given mapping fromSpawnLocation
to list ofSpawnInfo
s.- Specified by:
getAdjustedRarities
in interfaceSelectionAlgorithm
-