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
Nested ClassesModifier and TypeClassDescriptionstatic classNested 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
FieldsModifier and TypeFieldDescriptionintfloatThe last time storage and the pokemonLevel variables were updated.intintThePlayerPartyStorageof the player being tracked.final UUIDThe UUID of the player being tracked.protected List<SpawnAction<? extends net.minecraft.world.entity.Entity>>intfloatFields inherited from class com.pixelmonmod.pixelmon.api.spawning.archetypes.spawners.TickingSpawner
capacity, lastCycleTime, minDistBetweenSpawns, nextSpawnTime, spawnFrequency, spawnLocationCalculator, spawnsPerPassFields 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) intGets 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 ofSpawnActions that should execute.net.minecraft.server.level.ServerPlayerbooleanhasCapacity(int numSpawns) Gets if the spawner has enough space for the given number of entities.booleanbooleanWhether or not this spawner should do spawning when it is triggeredMethods inherited from class com.pixelmonmod.pixelmon.api.spawning.archetypes.spawners.TickingSpawner
doPass, onSpawnEndedMethods inherited from class com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
calculateSpatialData, fits, getCondition, getSuitableSpawns, getSuitableSpawnsForBiome, getTrackedBlockCollection, getTweak, getWeightedSpawnInfo, hasCondition, hasTweak
-
Field Details
-
playerUUID
The UUID of the player being tracked. -
playerStorage
ThePlayerPartyStorageof 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:TickingSpawnerGets the number of passes. An implementation that doesn't use passes will return 1.- Specified by:
getNumPassesin classTickingSpawner
-
getTrackedPlayer
@Nullable public net.minecraft.server.level.ServerPlayer getTrackedPlayer() -
hasCapacity
public boolean hasCapacity(int numSpawns) Description copied from class:TickingSpawnerGets if the spawner has enough space for the given number of entities. By default this considers theTickingSpawner.capacityand the maximumSpawnedPokemon.- Overrides:
hasCapacityin classTickingSpawner
-
canSpawn
- Overrides:
canSpawnin classTickingSpawner
-
shouldDoSpawning
public boolean shouldDoSpawning()Description copied from class:AbstractSpawnerWhether or not this spawner should do spawning when it is triggered- Overrides:
shouldDoSpawningin classTickingSpawner
-
isTrackedPlayerOnline
public boolean isTrackedPlayerOnline() -
getSpawns
Description copied from class:TickingSpawnerPerforms 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.- Specified by:
getSpawnsin classTickingSpawner
-