Class PlayerTrackingSpawner
java.lang.Object
com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
com.pixelmonmod.pixelmon.api.spawning.archetypes.spawners.TickingSpawner
com.pixelmonmod.pixelmon.spawning.PlayerTrackingSpawner
Pixelmon's implementation of a
TickingSpawner
. This attaches itself to a single player,
and tracks their motion to select places to spawn. It maintains a cache of some party information
of the player it is tracking.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.spawning.archetypes.spawners.TickingSpawner
TickingSpawner.TickingSpawnerBuilder<T extends TickingSpawner>
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
AbstractSpawner.SpawnerBuilder<T extends AbstractSpawner>
-
Field Summary
Modifier and TypeFieldDescriptionint
float
The last time storage and the pokemonLevel variables were updated.int
int
ThePlayerPartyStorage
of the player being tracked.final UUID
The UUID of the player being tracked.protected List<SpawnAction<? extends net.minecraft.world.entity.Entity>>
int
float
Fields inherited from class com.pixelmonmod.pixelmon.api.spawning.archetypes.spawners.TickingSpawner
capacity, lastCycleTime, minDistBetweenSpawns, nextSpawnTime, spawnFrequency, spawnLocationCalculator, spawnsPerPass
Fields inherited from class com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
cacheSets, checkSpawns, conditions, isBusy, lastSpawnTime, name, rarityMultipliers, rarityTweaks, selectionAlgorithm, spawnedTracker, spawnSets, tweaks
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canSpawn
(SpawnAction<?> action) int
Gets the number of passes.List<SpawnAction<? extends net.minecraft.world.entity.Entity>>
getSpawns
(int pass) Performs a specific pass, where pass index starts at zero, returning a list ofSpawnAction
s that should execute.net.minecraft.server.level.ServerPlayer
boolean
hasCapacity
(int numSpawns) Gets if the spawner has enough space for the given number of entities.boolean
boolean
Whether or not this spawner should do spawning when it is triggeredMethods inherited from class com.pixelmonmod.pixelmon.api.spawning.archetypes.spawners.TickingSpawner
doPass, onSpawnEnded
Methods inherited from class com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
calculateSpatialData, fits, getCondition, getSuitableSpawns, getTrackedBlockCollection, getTweak, getWeightedSpawnInfo, hasCondition, hasTweak
-
Field Details
-
playerUUID
The UUID of the player being tracked. -
playerStorage
ThePlayerPartyStorage
of the player being tracked. This can be null. -
lastStorageCheck
The last time storage and the pokemonLevel variables were updated. -
possibleSpawns
-
minDistFromCentre
public int minDistFromCentre -
maxDistFromCentre
public int maxDistFromCentre -
horizontalTrackFactor
public float horizontalTrackFactor -
verticalTrackFactor
public float verticalTrackFactor -
horizontalSliceRadius
public int horizontalSliceRadius -
verticalSliceRadius
public int verticalSliceRadius
-
-
Constructor Details
-
PlayerTrackingSpawner
public PlayerTrackingSpawner(net.minecraft.server.level.ServerPlayer player)
-
-
Method Details
-
getNumPasses
public int getNumPasses()Description copied from class:TickingSpawner
Gets the number of passes. An implementation that doesn't use passes will return 1.- Specified by:
getNumPasses
in classTickingSpawner
-
getTrackedPlayer
@Nullable public net.minecraft.server.level.ServerPlayer getTrackedPlayer() -
hasCapacity
public boolean hasCapacity(int numSpawns) Description copied from class:TickingSpawner
Gets if the spawner has enough space for the given number of entities. By default this considers theTickingSpawner.capacity
and the maximumSpawnedPokemon.- Overrides:
hasCapacity
in classTickingSpawner
-
canSpawn
- Overrides:
canSpawn
in classTickingSpawner
-
shouldDoSpawning
public boolean shouldDoSpawning()Description copied from class:AbstractSpawner
Whether or not this spawner should do spawning when it is triggered- Overrides:
shouldDoSpawning
in classTickingSpawner
-
isTrackedPlayerOnline
public boolean isTrackedPlayerOnline() -
getSpawns
Description copied from class:TickingSpawner
Performs a specific pass, where pass index starts at zero, returning a list ofSpawnAction
s that should execute. Null or empty lists are acceptable. An implementation that doesn't use passes will ignore this parameter.- Specified by:
getSpawns
in classTickingSpawner
-