Class SpawnerCoordinator

java.lang.Object
com.pixelmonmod.pixelmon.api.spawning.SpawnerCoordinator
Direct Known Subclasses:
TrackingSpawnerCoordinator

public class SpawnerCoordinator extends Object
A coordinator of all spawning. An instance of this or a subclass must be stored under PixelmonSpawning.coordinator. The coordinator will not function until activate() is called. Ticking will be automatic as long as it is activated. It is recommended to simply put an instance of the chosen coordinator implementation in the PixelmonSpawning field during pre-initialization and letting Pixelmon handle its booting.
  • Field Details

  • Constructor Details

    • SpawnerCoordinator

      public SpawnerCoordinator(AbstractSpawner... spawners)
  • Method Details

    • onTick

      public void onTick(net.minecraftforge.event.TickEvent.ServerTickEvent event)
    • getActive

      public boolean getActive()
    • activate

      public SpawnerCoordinator activate()
      Boots the coordinator, which without overriding involves scheduling the processor and registering on the Forge bus.
    • deactivate

      public void deactivate()
      Deactivates the coordinator by cancelling the processor, clearing the spawners, and unregistering from the Forge bus.
    • getSpawner

      @Nullable public AbstractSpawner getSpawner(String name)
      Attempts to get the spawner with the given name. Returns null if it can't find it.