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>
  • Field Details

    • LOGGER

      @Nonnull private static final com.hypixel.hytale.logger.HytaleLogger LOGGER
    • MAX_ATTEMPTS_PER_TICK

      public static final int MAX_ATTEMPTS_PER_TICK
      See Also:
    • ROUNDING_BREAK_POINT

      public static final double ROUNDING_BREAK_POINT
      See Also:
    • ownerRef

      @Nonnull private final Ref<EntityStore> ownerRef
    • spawnedEntities

      private final List<Ref<EntityStore>> spawnedEntities
    • playersInRegion

      private final List<PlayerRef> playersInRegion
    • nextPlayerIndex

      private int nextPlayerIndex
    • entitiesPerPlayer

      private final it.unimi.dsi.fastutil.objects.Object2IntMap<UUID> entitiesPerPlayer
    • entityTimeoutCounter

      private final it.unimi.dsi.fastutil.objects.Object2DoubleMap<Ref<EntityStore>> entityTimeoutCounter
    • unspawnableRoles

      private final it.unimi.dsi.fastutil.ints.IntSet unspawnableRoles
    • threatComparator

      private final Comparator<PlayerRef> threatComparator
    • baseMaxTotalSpawns

      private int baseMaxTotalSpawns
    • currentScaledMaxTotalSpawns

      private int currentScaledMaxTotalSpawns
    • baseMaxConcurrentSpawns

      private int[] baseMaxConcurrentSpawns
    • currentScaledMaxConcurrentSpawns

      private int currentScaledMaxConcurrentSpawns
    • spawnsThisRound

      private int spawnsThisRound
    • remainingSpawns

      private int remainingSpawns
    • roundStart

      private boolean roundStart
    • beaconRadiusSquared

      private double beaconRadiusSquared
    • spawnRadiusSquared

      private double spawnRadiusSquared
    • despawnNPCAfterTimeout

      private double despawnNPCAfterTimeout
    • despawnBeaconAfterTimeout

      private Duration despawnBeaconAfterTimeout
    • despawnNPCsIfIdle

      private boolean despawnNPCsIfIdle
  • Constructor Details

    • BeaconSpawnController

      public BeaconSpawnController(@Nonnull World world, @Nonnull Ref<EntityStore> ownerRef)
  • 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

      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.Object2DoubleMap<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)