public abstract class TickingSpawner extends AbstractSpawner
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
PixelmonConfig
options for its operational parameters including capacity, maximum
spawns per pass, frequency, and distance between spawns.
Created by Hiroku
Modifier and Type | Class and Description |
---|---|
static class |
TickingSpawner.TickingSpawnerBuilder<T extends TickingSpawner> |
AbstractSpawner.SpawnerBuilder<T extends AbstractSpawner>
Modifier and Type | Field and Description |
---|---|
int |
capacity
The maximum number of entities that may exist in the world as a result of this spawner at any one time.
|
long |
lastCycleTime
The last (epoch) time a cycle occurred for this spawner.
|
float |
minDistBetweenSpawns
The minimum distance that must exist between spawned entities.
|
long |
nextSpawnTime
The last (epoch) time an entity was successfully spawned.
|
float |
spawnFrequency
The number of seconds between each pass.
|
ICalculateSpawnLocations |
spawnLocationCalculator
|
int |
spawnsPerPass
The maximum number of entities that can spawn during a single pass.
|
cacheSets, checkSpawns, conditions, isBusy, lastSpawnTime, name, rarityMultipliers, rarityTweaks, selectionAlgorithm, spawnedTracker, spawnSets, tweaks
Constructor and Description |
---|
TickingSpawner(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
canSpawn(SpawnAction<?> action) |
void |
doPass(SpawnerCoordinator coordinator)
Performs a pass.
|
abstract int |
getNumPasses()
Gets the number of passes.
|
abstract java.util.List<SpawnAction<? extends net.minecraft.entity.Entity>> |
getSpawns(int pass)
Performs a specific pass, where pass index starts at zero, returning a list of
SpawnAction s
that should execute. |
boolean |
hasCapacity(int numSpawns)
Gets if the spawner has enough space for the given number of entities.
|
void |
onSpawnEnded() |
boolean |
shouldDoSpawning()
Whether or not this spawner should do spawning when it is triggered
|
calculateSpatialData, fits, getCondition, getSuitableSpawns, getTrackedBlockCollection, getTweak, getWeightedSpawnInfo, hasCondition, hasTweak
public long lastCycleTime
public long nextSpawnTime
public ICalculateSpawnLocations spawnLocationCalculator
public int capacity
hasCapacity(int)
.public int spawnsPerPass
public float spawnFrequency
public float minDistBetweenSpawns
public abstract java.util.List<SpawnAction<? extends net.minecraft.entity.Entity>> getSpawns(int pass)
SpawnAction
s
that should execute. Null or empty lists are acceptable. An implementation that doesn't use passes
will ignore this parameter.public abstract int getNumPasses()
public boolean hasCapacity(int numSpawns)
capacity
and the maximumSpawnedPokemon.public boolean canSpawn(SpawnAction<?> action)
public boolean shouldDoSpawning()
AbstractSpawner
shouldDoSpawning
in class AbstractSpawner
public void onSpawnEnded()
public void doPass(SpawnerCoordinator coordinator)
getSpawns(int)
, and executes any SpawnAction
s.