Interface ITravellingManager

All Known Implementing Classes:
TravellingManager

public interface ITravellingManager
Manages the traveling system for a given colony.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    finishTravellingFor(int citizenId)
    Triggers the cleanup of the travelling data when the citizen finishes travelling, either by design, or through an abort.
    default void
    Triggers the cleanup of the travelling data when the citizen finishes travelling, either by design, or through an abort.
    Optional<net.minecraft.core.BlockPos>
    getTravellingTargetFor(int citizenId)
    Gets the travelling target, when travelling, for the citizen with the given id.
    default Optional<net.minecraft.core.BlockPos>
    Gets the travelling target, when travelling, for the given citizen.
    boolean
    isTravelling(int citizenId)
    Indicates whether the citizen with the given id is travelling or not.
    default boolean
    Indicates whether the given citizen is travelling
    default boolean
    isTravelling(ICitizenDataView citizenDataView)
    Indicates whether the given citizen is travelling.
    void
    Triggers the recall of all travelling citizens regards of state of completion.
    void
    startTravellingTo(int citizenId, net.minecraft.core.BlockPos target, int travelTimeInTicks)
    Triggers the travelling logic for the citizen with the given id.
    default void
    startTravellingTo(ICitizenData citizenData, net.minecraft.core.BlockPos target, int travelTimeInTicks)
    Triggers the travelling logic for the given citizen.
  • Method Details

    • isTravelling

      default boolean isTravelling(ICitizenData citizenData)
      Indicates whether the given citizen is travelling
      Parameters:
      citizenData - The citizen data to check for.
      Returns:
      True when travelling, false when not.
    • isTravelling

      default boolean isTravelling(ICitizenDataView citizenDataView)
      Indicates whether the given citizen is travelling.
      Parameters:
      citizenDataView - The citizen data view to check for.
      Returns:
      True when travelling, false when not.
    • isTravelling

      boolean isTravelling(int citizenId)
      Indicates whether the citizen with the given id is travelling or not.
      Parameters:
      citizenId - The citizen id to check for.
      Returns:
      True when travelling, false when not.
    • getTravellingTargetFor

      default Optional<net.minecraft.core.BlockPos> getTravellingTargetFor(ICitizenData citizenData)
      Gets the travelling target, when travelling, for the given citizen.
      Parameters:
      citizenData - The citizen to get the target for.
      Returns:
      An optional with the travelling target. The optional is empty when the citizen is not travelling.
    • getTravellingTargetFor

      Optional<net.minecraft.core.BlockPos> getTravellingTargetFor(int citizenId)
      Gets the travelling target, when travelling, for the citizen with the given id.
      Parameters:
      citizenId - The id of the citizen to get the target for.
      Returns:
      An optional with the travelling target. The optional is empty when the citizen is not travelling.
    • startTravellingTo

      default void startTravellingTo(ICitizenData citizenData, net.minecraft.core.BlockPos target, int travelTimeInTicks)
      Triggers the travelling logic for the given citizen.

      Does not despawn the entity. Discard it after calling this method.

      Parameters:
      citizenData - The data of the citizen.
      target - The target to which the citizen is travelling, aka his respawn point.
      travelTimeInTicks - The time in ticks which needs to have passed for the travelling to complete.
    • startTravellingTo

      void startTravellingTo(int citizenId, net.minecraft.core.BlockPos target, int travelTimeInTicks)
      Triggers the travelling logic for the citizen with the given id.

      Does not despawn the entity. Discard it after calling this method.

      Parameters:
      citizenId - The id of the citizen.
      target - The target to which the citizen is travelling, aka his respawn point.
      travelTimeInTicks - The time in ticks which needs to have passed for the travelling to complete.
    • finishTravellingFor

      default void finishTravellingFor(ICitizenData citizenData)
      Triggers the cleanup of the travelling data when the citizen finishes travelling, either by design, or through an abort.

      Does not spawn the entity. Trigger an entity update for the citizen to properly spawn it.

      Parameters:
      citizenData - The citizen to stop the travelling for.
    • finishTravellingFor

      void finishTravellingFor(int citizenId)
      Triggers the cleanup of the travelling data when the citizen finishes travelling, either by design, or through an abort.

      Does not spawn the entity. Trigger an entity update for the citizen to properly spawn it.

      Parameters:
      citizenId - The id of the citizen to stop the travelling for.
    • recallAllTravellingCitizens

      void recallAllTravellingCitizens()
      Triggers the recall of all travelling citizens regards of state of completion.