Interface IGuardBuilding

All Superinterfaces:
IBuilding, IBuildingContainer, IBuildingModuleContainer, ICommonBuilding, IItemHandlerCapProvider, IModuleContainer<IBuildingModule>, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>, IRequester, IRequestResolverProvider, ISchematicProvider
All Known Implementing Classes:
AbstractBuildingGuards, BuildingBarracksTower, BuildingGateHouse, BuildingGuardTower, BuildingStable

public interface IGuardBuilding extends IBuilding
  • Field Details

    • PATROL_DISTANCE

      static final int PATROL_DISTANCE
      Worker gets this distance times building level away from his/her hut to patrol.
      See Also:
  • Method Details

    • checkIfGuardShouldTakeDamage

      static boolean checkIfGuardShouldTakeDamage(AbstractEntityCitizen citizen, net.minecraft.world.entity.player.Player player)
      Check if a guard should take damage by a player..
      Parameters:
      citizen - the citizen.
      player - the player.
      Returns:
      false if in follow mode and following the player.
    • getTask

      String getTask()
      Get the guard's task.
      Returns:
      The task of the guard.
    • getNextPatrolTarget

      @Nullable @Nullable net.minecraft.core.BlockPos getNextPatrolTarget(boolean newTarget)
      Returns a patrolTarget to patrol to.
      Parameters:
      newTarget - whether to search a new target
      Returns:
      the position of the next target.
    • arrivedAtPatrolPoint

      void arrivedAtPatrolPoint(AbstractEntityCitizen guard)
      Called when a guard is at the current patrol point
      Parameters:
      guard - guard which arrived
    • getPatrolDistance

      int getPatrolDistance()
      Getter for the patrol distance the guard currently has.
      Returns:
      The distance in whole numbers.
    • shallRetrieveOnLowHealth

      boolean shallRetrieveOnLowHealth()
      Get the guard's RetrieveOnLowHeath.
      Returns:
      if so.
    • shallPatrolManually

      boolean shallPatrolManually()
      Get whether the guard should patrol manually.
      Returns:
      if so.
    • isTightGrouping

      boolean isTightGrouping()
      Returns whether tight grouping in Follow mode is being used.
      Returns:
      whether tight grouping is being used.
    • getGuardPos

      net.minecraft.core.BlockPos getGuardPos(@NotNull @NotNull AbstractEntityCitizen worker)
      Get the position the guard should guard.
      Returns:
      the BlockPos of the guard position.
    • setGuardPos

      void setGuardPos(net.minecraft.core.BlockPos guardPos)
      Set where the guard should guard.
      Parameters:
      guardPos - the BlockPos to guard.
    • getPlayerToFollowOrRally

      net.minecraft.world.entity.player.Player getPlayerToFollowOrRally()
      Entity of player to follow or rally.
      Returns:
      the PlayerEntity reference.
    • setPlayerToFollow

      void setPlayerToFollow(net.minecraft.world.entity.player.Player player)
      Sets the player to follow.
      Parameters:
      player - the player to follow.
    • getRallyLocation

      ILocation getRallyLocation()
      Location to to rally to.
      Returns:
      the ILocation reference.
    • setRallyLocation

      void setRallyLocation(ILocation location)
      Sets the location to rally.
      Parameters:
      location - The location to rally to.
    • getPositionToFollow

      net.minecraft.core.BlockPos getPositionToFollow()
      Gets the position to follow.
      Returns:
      the position the guard is supposed to be while following.
    • addPatrolTarget

      void addPatrolTarget(net.minecraft.core.BlockPos target)
      Adds new patrolTargets.
      Parameters:
      target - the target to add
    • resetPatrolTargets

      void resetPatrolTargets()
      Resets the patrolTargets list.
    • getBonusVision

      int getBonusVision()
      Get the Vision bonus range for the building level
      Returns:
      an integer for the additional range.
    • calculateMobs

      void calculateMobs()
      Populates the mobs list from the BuiltInRegistries.
    • requiresManualTarget

      boolean requiresManualTarget()
      If we have to calculate a new target manually.
      Returns:
      true if so.
    • setTempNextPatrolPoint

      void setTempNextPatrolPoint(net.minecraft.core.BlockPos pos)
      Sets a one time consumed temporary next position to patrol towards
      Parameters:
      pos - Position to set
    • getMinePos

      net.minecraft.core.BlockPos getMinePos()
      Get the position of the assigned mine
      Returns:
      the coords of the assigned mine