Interface IRaiderManager

All Known Implementing Classes:
RaidManager

public interface IRaiderManager
Interface implementing all methods required for all raider managers.
  • Method Details

    • canHaveRaiderEvents

      boolean canHaveRaiderEvents()
      Checks if the raider manager can have raider events.
      Returns:
      true if so.
    • willRaidTonight

      boolean willRaidTonight()
      Checks if raiders will raid tonight.
      Returns:
      true if so.
    • setCanHaveRaiderEvents

      void setCanHaveRaiderEvents(boolean canHave)
      Set that the manager can receive raider events.
      Parameters:
      canHave - true or false.
    • setRaidNextNight

      void setRaidNextNight(IRaiderManager.RaidSettings raidSettings)
      Set if raiders will raid tonight.
      Parameters:
      raidSettings - the settings for the next raid, or null to stop the next raid.
    • areSpiesEnabled

      boolean areSpiesEnabled()
      Returns whether spies are enabled
      Returns:
      true if enabled.
    • setSpiesEnabled

      void setSpiesEnabled(boolean enabled)
      Sets whether spies are enabled
      Parameters:
      enabled - true if enabled.
    • raiderEvent

      IRaiderManager.RaidSpawnResult raiderEvent(@NotNull @NotNull IRaiderManager.RaidSettings raidSettings)
      Trigger a specific type of raid on a colony.
      Parameters:
      raidSettings - the settings for this raid.
    • calculateSpawnLocation

      net.minecraft.core.BlockPos calculateSpawnLocation()
      Calculates the spawn position for raids
      Returns:
      the spawn location.
    • getLastSpawnPoints

      List<net.minecraft.core.BlockPos> getLastSpawnPoints()
      Getter for the last spawn points.
      Returns:
      a copy of the list
    • calculateRaiderAmount

      int calculateRaiderAmount(int raidLevel)
      Calculates the barbarian amount for raids
      Parameters:
      raidLevel - the colonies raidlevel
      Returns:
      the number of barbs.
    • isRaided

      boolean isRaided()
      Whether the colony is currently raided.
      Returns:
      true if so.
    • onNightFall

      void onNightFall()
      Called on nightfall.
    • getNightsSinceLastRaid

      int getNightsSinceLastRaid()
      Returns the amount of nights since the last raid
      Returns:
      the number of nights.
    • setNightsSinceLastRaid

      void setNightsSinceLastRaid(int nightsSinceLastRaid)
      Sets the amount of nights since the last raid
      Parameters:
      nightsSinceLastRaid - the nights to set.
    • canRaid

      boolean canRaid()
      Whether the colony can be raided.
      Returns:
      true if possible.
    • getColonyRaidLevel

      int getColonyRaidLevel()
      calculates the colonies raid level
      Returns:
      the raid level.
    • getRandomBuilding

      net.minecraft.core.BlockPos getRandomBuilding()
      Returns a random building for raiders to go to, groups up 3 raiders to the same position.
      Returns:
      a random building.
    • getRaidDifficultyModifier

      double getRaidDifficultyModifier()
      Gets the difficulty modifier for raids, default difficulty is 1.0
      Returns:
      difficulty
    • onLostCitizen

      void onLostCitizen(ICitizenData citizen)
      Called on loosing a citizen, to record deaths during raids
      Parameters:
      citizen - that died
    • write

      void write(net.minecraft.nbt.CompoundTag compound)
      Writes the raid manager to nbt
      Parameters:
      compound - to write to
    • read

      void read(net.minecraft.nbt.CompoundTag compound)
      Reads the raid manager form nbt
      Parameters:
      compound - to read from
    • getLostCitizen

      int getLostCitizen()
      Gets the amount of citizens lost in a raid.
      Returns:
      amount
    • onRaiderDeath

      void onRaiderDeath(AbstractEntityMinecoloniesRaider entity)
      Called when a raider mob dies
      Parameters:
      entity -
    • onRaidEventFinished

      void onRaidEventFinished(IColonyRaidEvent event)
    • setPassThroughRaid

      void setPassThroughRaid()
      Notify raid manager of a passing through raid.