Class TickingSpawner
java.lang.Object
com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
com.pixelmonmod.pixelmon.api.spawning.archetypes.spawners.TickingSpawner
- Direct Known Subclasses:
LegendarySpawner,PlayerTrackingSpawner
An
AbstractSpawner which ticks. This implementation provides a way of establishing
different passes so that on each cycle a different process is taken. This by default uses
config ptions for its operational parameters including capacity, maximum
spawns per pass, frequency, and distance between spawns.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
AbstractSpawner.SpawnerBuilder<T extends AbstractSpawner> -
Field Summary
FieldsModifier and TypeFieldDescriptionintThe maximum number of entities that may exist in the world as a result of this spawner at any one time.longThe last (epoch) time a cycle occurred for this spawner.floatThe minimum distance that must exist between spawned entities.longThe last (epoch) time an entity was successfully spawned.floatThe number of seconds between each pass.intThe maximum number of entities that can spawn during a single pass.Fields inherited from class com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
cacheSets, checkSpawns, conditions, isBusy, lastSpawnTime, name, rarityMultipliers, rarityTweaks, selectionAlgorithm, spawnedTracker, spawnSets, tweaks -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanSpawn(SpawnAction<?> action) voiddoPass(SpawnerCoordinator coordinator) Performs a pass.abstract intGets the number of passes.abstract List<SpawnAction<? extends net.minecraft.world.entity.Entity>>getSpawns(int pass) Performs a specific pass, where pass index starts at zero, returning a list ofSpawnActions that should execute.booleanhasCapacity(int numSpawns) Gets if the spawner has enough space for the given number of entities.voidbooleanWhether or not this spawner should do spawning when it is triggeredMethods inherited from class com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
calculateSpatialData, fits, getCondition, getSuitableSpawns, getSuitableSpawnsForBiome, getTrackedBlockCollection, getTweak, getWeightedSpawnInfo, hasCondition, hasTweak
-
Field Details
-
lastCycleTime
public long lastCycleTimeThe last (epoch) time a cycle occurred for this spawner. -
nextSpawnTime
public long nextSpawnTimeThe last (epoch) time an entity was successfully spawned. -
spawnLocationCalculator
-
capacity
public int capacityThe maximum number of entities that may exist in the world as a result of this spawner at any one time. This can be bypassed by overridinghasCapacity(int). -
spawnsPerPass
public int spawnsPerPassThe maximum number of entities that can spawn during a single pass. -
spawnFrequency
public float spawnFrequencyThe number of seconds between each pass. -
minDistBetweenSpawns
public float minDistBetweenSpawnsThe minimum distance that must exist between spawned entities. The lower this is, the more clustered entities may spawn.
-
-
Constructor Details
-
TickingSpawner
-
-
Method Details
-
getSpawns
Performs a specific pass, where pass index starts at zero, returning a list ofSpawnActions that should execute. Null or empty lists are acceptable. An implementation that doesn't use passes will ignore this parameter. -
getNumPasses
public abstract int getNumPasses()Gets the number of passes. An implementation that doesn't use passes will return 1. -
hasCapacity
public boolean hasCapacity(int numSpawns) Gets if the spawner has enough space for the given number of entities. By default this considers thecapacityand the maximumSpawnedPokemon. -
canSpawn
-
shouldDoSpawning
public boolean shouldDoSpawning()Description copied from class:AbstractSpawnerWhether or not this spawner should do spawning when it is triggered- Overrides:
shouldDoSpawningin classAbstractSpawner
-
onSpawnEnded
public void onSpawnEnded() -
doPass
Performs a pass. This checks for capacity, callsgetSpawns(int), and executes anySpawnActions.
-