Class BeaconSpawnController

java.lang.Object
com.hypixel.hytale.server.spawning.controllers.SpawnController<NPCBeaconSpawnJob>
com.hypixel.hytale.server.spawning.controllers.BeaconSpawnController

public class BeaconSpawnController extends SpawnController<NPCBeaconSpawnJob>
A spawn controller for NPC spawn beacons.
  • Field Details

    • MAX_ATTEMPTS_PER_TICK

      public static final int MAX_ATTEMPTS_PER_TICK
      The maximum number of spawn attempts per tick.
      See Also:
    • ROUNDING_BREAK_POINT

      public static final double ROUNDING_BREAK_POINT
      The rounding break point for spawn calculations.
      See Also:
  • Constructor Details

    • BeaconSpawnController

      public BeaconSpawnController(@Nonnull World world, @Nonnull Ref<EntityStore> ownerRef)
      Default Constructor for a BeaconSpawnController instance.
      Parameters:
      world - The world this spawn controller belongs to.
      ownerRef - The entity reference of the owning spawn beacon entity.
  • Method Details

    • getMaxActiveJobs

      public int getMaxActiveJobs()
      Overrides:
      getMaxActiveJobs in class SpawnController<NPCBeaconSpawnJob>
    • createRandomSpawnJob

      @Nullable public NPCBeaconSpawnJob createRandomSpawnJob(@Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Specified by:
      createRandomSpawnJob in class SpawnController<NPCBeaconSpawnJob>
    • initialise

      public void initialise(@Nonnull BeaconSpawnWrapper spawnWrapper)
    • getSpawnsThisRound

      public int getSpawnsThisRound()
    • setRemainingSpawns

      public void setRemainingSpawns(int remainingSpawns)
    • addRoundSpawn

      public void addRoundSpawn()
    • isRoundStart

      public boolean isRoundStart()
    • setRoundStart

      public void setRoundStart(boolean roundStart)
    • getOwnerRef

      @Nonnull public Ref<EntityStore> getOwnerRef()
    • getBaseMaxConcurrentSpawns

      public int[] getBaseMaxConcurrentSpawns()
    • getPlayersInRegion

      public List<PlayerRef> getPlayersInRegion()
    • getCurrentScaledMaxConcurrentSpawns

      public int getCurrentScaledMaxConcurrentSpawns()
    • setCurrentScaledMaxConcurrentSpawns

      public void setCurrentScaledMaxConcurrentSpawns(int currentScaledMaxConcurrentSpawns)
    • getDespawnBeaconAfterTimeout

      public Duration getDespawnBeaconAfterTimeout()
    • getSpawnRadiusSquared

      public double getSpawnRadiusSquared()
    • getBeaconRadiusSquared

      public double getBeaconRadiusSquared()
    • getBaseMaxTotalSpawns

      public int getBaseMaxTotalSpawns()
    • setCurrentScaledMaxTotalSpawns

      public void setCurrentScaledMaxTotalSpawns(int currentScaledMaxTotalSpawns)
    • getSpawnedEntities

      public List<Ref<EntityStore>> getSpawnedEntities()
    • setNextPlayerIndex

      public void setNextPlayerIndex(int nextPlayerIndex)
    • getEntityTimeoutCounter

      public it.unimi.dsi.fastutil.objects.Reference2DoubleMap<Ref<EntityStore>> getEntityTimeoutCounter()
    • getEntitiesPerPlayer

      public it.unimi.dsi.fastutil.objects.Object2IntMap<UUID> getEntitiesPerPlayer()
    • isDespawnNPCsIfIdle

      public boolean isDespawnNPCsIfIdle()
    • getDespawnNPCAfterTimeout

      public double getDespawnNPCAfterTimeout()
    • getThreatComparator

      public Comparator<PlayerRef> getThreatComparator()
    • notifySpawnedEntityExists

      public void notifySpawnedEntityExists(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
    • onJobFinished

      public void onJobFinished(@Nonnull ComponentAccessor<EntityStore> componentAccessor)
    • notifyNPCRemoval

      public void notifyNPCRemoval(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
    • hasSlots

      public boolean hasSlots()
    • markNPCUnspawnable

      public void markNPCUnspawnable(int roleIndex)
    • clearUnspawnableNPCs

      public void clearUnspawnableNPCs()
    • onAllConcurrentSpawned

      public void onAllConcurrentSpawned(@Nonnull ComponentAccessor<EntityStore> componentAccessor)