Class PlayerTrackingSpawner


public class PlayerTrackingSpawner extends TickingSpawner
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.
  • Field Details

    • playerUUID

      public final UUID playerUUID
      The UUID of the player being tracked.
    • playerStorage

      public PlayerPartyStorage playerStorage
      The PlayerPartyStorage of the player being tracked. This can be null.
    • lastStorageCheck

      public Long lastStorageCheck
      The last time storage and the pokemonLevel variables were updated.
    • possibleSpawns

      protected List<SpawnAction<? extends net.minecraft.world.entity.Entity>> 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 class TickingSpawner
    • 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 the TickingSpawner.capacity and the maximumSpawnedPokemon.
      Overrides:
      hasCapacity in class TickingSpawner
    • canSpawn

      public boolean canSpawn(SpawnAction<?> action)
      Overrides:
      canSpawn in class TickingSpawner
    • shouldDoSpawning

      public boolean shouldDoSpawning()
      Description copied from class: AbstractSpawner
      Whether or not this spawner should do spawning when it is triggered
      Overrides:
      shouldDoSpawning in class TickingSpawner
    • isTrackedPlayerOnline

      public boolean isTrackedPlayerOnline()
    • getSpawns

      public List<SpawnAction<? extends net.minecraft.world.entity.Entity>> getSpawns(int pass)
      Description copied from class: TickingSpawner
      Performs a specific pass, where pass index starts at zero, returning a list of SpawnActions that should execute. Null or empty lists are acceptable. An implementation that doesn't use passes will ignore this parameter.
      Specified by:
      getSpawns in class TickingSpawner