Interface IColonyView

All Superinterfaces:
IColony
All Known Implementing Classes:
ColonyView

public interface IColonyView extends IColony
  • Method Details

    • getFreePositions

      List<net.minecraft.core.BlockPos> getFreePositions()
      Get a copy of the freePositions list.
      Returns:
      the list of free to interact positions.
    • getFreeBlocks

      List<net.minecraft.world.level.block.Block> getFreeBlocks()
      Get a copy of the freeBlocks list.
      Returns:
      the list of free to interact blocks.
    • addFreePosition

      void addFreePosition(@NotNull @NotNull net.minecraft.core.BlockPos pos)
      Add a new free to interact position.
      Specified by:
      addFreePosition in interface IColony
      Parameters:
      pos - position to add.
    • addFreeBlock

      void addFreeBlock(@NotNull @NotNull net.minecraft.world.level.block.Block block)
      Add a new free to interact block.
      Specified by:
      addFreeBlock in interface IColony
      Parameters:
      block - block to add.
    • removeFreePosition

      void removeFreePosition(@NotNull @NotNull net.minecraft.core.BlockPos pos)
      Remove a free to interact position.
      Specified by:
      removeFreePosition in interface IColony
      Parameters:
      pos - position to remove.
    • removeFreeBlock

      void removeFreeBlock(@NotNull @NotNull net.minecraft.world.level.block.Block block)
      Remove a free to interact block.
      Specified by:
      removeFreeBlock in interface IColony
      Parameters:
      block - state to remove.
    • getDimension

      net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDimension()
      Returns the dimension ID of the view.
      Specified by:
      getDimension in interface IColony
      Returns:
      dimension ID of the view.
    • getPlayers

      @NotNull @NotNull Map<UUID,ColonyPlayer> getPlayers()
      Returns a map of players in the colony. Key is the UUID, value is Player
      Returns:
      Map of UUID's and Player
    • getCitizenCount

      int getCitizenCount()
      Returns the maximum amount of total citizen beds in the colony.
      Returns:
      maximum amount of citizens.
    • getCitizenCountLimit

      int getCitizenCountLimit()
      Returns the maximum amount of citizen slots in the colony considering beds and guard towers
      Returns:
      maximum amount of citizens.
    • getCitizens

      Map<Integer,ICitizenDataView> getCitizens()
      Getter for the citizens map.
      Returns:
      a unmodifiable Map of the citizen.
    • getWorkOrders

      Collection<IWorkOrderView> getWorkOrders()
      Getter for the workOrders.
      Returns:
      a unmodifiable Collection of the workOrders.
    • getWorkOrder

      IWorkOrderView getWorkOrder(int id)
      Getter for a single workorder.
      Parameters:
      id - workorder id.
      Returns:
      a specific workorder.
    • getCitizen

      ICitizenDataView getCitizen(int id)
      Gets the CitizenDataView for a citizen id.
      Specified by:
      getCitizen in interface IColony
      Parameters:
      id - the citizen id.
      Returns:
      CitizenDataView for the citizen.
    • handleColonyViewMessage

      @Nullable @Nullable IMessage handleColonyViewMessage(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf, @NotNull @NotNull net.minecraft.world.level.Level world, boolean isNewSubscription)
      Populate a ColonyView from the network data.
      Parameters:
      buf - FriendlyByteBuf to read from.
      isNewSubscription - Whether this is a new subscription of not.
      world - the world it is in.
      Returns:
      null == no response.
    • handlePermissionsViewMessage

      @Nullable @Nullable IMessage handlePermissionsViewMessage(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf)
      Update permissions.
      Parameters:
      buf - buffer containing permissions.
      Returns:
      null == no response
    • handleColonyViewWorkOrderMessage

      @Nullable @Nullable IMessage handleColonyViewWorkOrderMessage(net.minecraft.network.FriendlyByteBuf buf)
      Update a ColonyView's workOrders given a network data ColonyView update packet. This uses a full-replacement - workOrders do not get updated and are instead overwritten.
      Parameters:
      buf - Network data.
      Returns:
      null == no response.
    • handleColonyViewCitizensMessage

      @Nullable @Nullable IMessage handleColonyViewCitizensMessage(int id, net.minecraft.network.FriendlyByteBuf buf)
      Update a ColonyView's citizens given a network data ColonyView update packet. This uses a full-replacement - citizens do not get updated and are instead overwritten.
      Parameters:
      id - ID of the citizen.
      buf - Network data.
      Returns:
      null == no response.
    • handleColonyViewVisitorMessage

      void handleColonyViewVisitorMessage(net.minecraft.network.FriendlyByteBuf visitorViewData, boolean refresh)
      Handles visitor view messages
      Parameters:
      refresh - if all need to be refreshed.
      visitorViewData - the new data to set
    • handleColonyViewAnimalMessage

      void handleColonyViewAnimalMessage(net.minecraft.network.FriendlyByteBuf animalViewData, boolean refresh)
      Handles animal view messages
      Parameters:
      refresh - if all need to be refreshed.
      animalViewData - the new data to set
    • handleColonyViewRemoveCitizenMessage

      @Nullable @Nullable IMessage handleColonyViewRemoveCitizenMessage(int citizen)
      Remove a citizen from the ColonyView.
      Parameters:
      citizen - citizen ID.
      Returns:
      null == no response.
    • handleColonyViewRemoveWorkOrderMessage

      @Nullable @Nullable IMessage handleColonyViewRemoveWorkOrderMessage(int workOrderId)
      Remove a workOrder from the ColonyView.
      Parameters:
      workOrderId - id of the workOrder.
      Returns:
      null == no response
    • handleColonyViewResearchManagerUpdate

      void handleColonyViewResearchManagerUpdate(net.minecraft.nbt.CompoundTag compoundTag)
      Handle the colony view research manager updating.
      Parameters:
      compoundTag - the tag to update the research manager with.
    • addPlayer

      void addPlayer(String player)
      Update a players permissions.
      Parameters:
      player - player username.
    • removePlayer

      void removePlayer(UUID player)
      Remove player from colony permissions.
      Parameters:
      player - the UUID of the player to remove.
    • getOverallHappiness

      double getOverallHappiness()
      Getter for the overall happiness.
      Specified by:
      getOverallHappiness in interface IColony
      Returns:
      the happiness, a double.
    • getCenter

      net.minecraft.core.BlockPos getCenter()
      Description copied from interface: IColony
      Returns the position of the colony.
      Specified by:
      getCenter in interface IColony
      Returns:
      pos of the colony.
    • getName

      String getName()
      Description copied from interface: IColony
      Returns the name of the colony.
      Specified by:
      getName in interface IColony
      Returns:
      Name of the colony.
    • setName

      void setName(String name)
      Sets the name of the view.
      Specified by:
      setName in interface IColony
      Parameters:
      name - Name of the view.
    • getPermissions

      @NotNull @NotNull IPermissions getPermissions()
      Description copied from interface: IColony
      Returns the permissions of the colony.
      Specified by:
      getPermissions in interface IColony
      Returns:
      IPermissions of the colony.
    • isCoordInColony

      boolean isCoordInColony(@NotNull @NotNull net.minecraft.world.level.Level w, @NotNull @NotNull net.minecraft.core.BlockPos pos)
      Description copied from interface: IColony
      Determine if a given chunk coordinate is considered to be within the colony's bounds.
      Specified by:
      isCoordInColony in interface IColony
      Parameters:
      w - World to check.
      pos - Block Position.
      Returns:
      True if inside colony, otherwise false.
    • getDistanceSquared

      long getDistanceSquared(@NotNull @NotNull net.minecraft.core.BlockPos pos)
      Description copied from interface: IColony
      Returns the squared (x, z) distance to the center.
      Specified by:
      getDistanceSquared in interface IColony
      Parameters:
      pos - Block Position.
      Returns:
      Squared distance to the center in (x, z) direction.
    • getID

      int getID()
      Returns the ID of the view.
      Specified by:
      getID in interface IColony
      Returns:
      ID of the view.
    • getLastContactInHours

      int getLastContactInHours()
      Description copied from interface: IColony
      Get the last contact of a player to the colony in hours.
      Specified by:
      getLastContactInHours in interface IColony
      Returns:
      an integer with a describing value.
    • getWorld

      net.minecraft.world.level.Level getWorld()
      Description copied from interface: IColony
      Method to get the World this colony is in.
      Specified by:
      getWorld in interface IColony
      Returns:
      the World the colony is in.
    • getRequestManager

      @NotNull @NotNull IRequestManager getRequestManager()
      Description copied from interface: IColony
      Get the current IRequestManager for this Colony. Returns null if the current Colony does not support the request system.
      Specified by:
      getRequestManager in interface IColony
      Returns:
      the IRequestManager for this colony, null if not supported.
    • markDirty

      void markDirty()
      Description copied from interface: IColony
      Called to mark this colony dirty, and in need of syncing / saving.
      Specified by:
      markDirty in interface IColony
    • canBeAutoDeleted

      boolean canBeAutoDeleted()
      Description copied from interface: IColony
      Called to check if the colony can be deleted by an automatic cleanup.
      Specified by:
      canBeAutoDeleted in interface IColony
      Returns:
      true if so.
    • getRequesterBuildingForPosition

      @Nullable @Nullable IRequester getRequesterBuildingForPosition(@NotNull @NotNull net.minecraft.core.BlockPos pos)
      Description copied from interface: IColony
      Method used to get a IRequester from a given Position. Is always a Building.
      Specified by:
      getRequesterBuildingForPosition in interface IColony
      Parameters:
      pos - The position to get the Building that acts as a requester.
      Returns:
      The IRequester from the position, or null.
    • removeVisitingPlayer

      void removeVisitingPlayer(net.minecraft.world.entity.player.Player player)
      Description copied from interface: IColony
      Remove a visiting player.
      Specified by:
      removeVisitingPlayer in interface IColony
      Parameters:
      player - the player.
    • addVisitingPlayer

      void addVisitingPlayer(net.minecraft.world.entity.player.Player player)
      Description copied from interface: IColony
      Add a visiting player.
      Specified by:
      addVisitingPlayer in interface IColony
      Parameters:
      player - the player.
    • getLastSpawnPoints

      List<net.minecraft.core.BlockPos> getLastSpawnPoints()
      Get a list of all barb spawn positions in the colony view.
      Returns:
      a copy of the list.
    • isRemote

      boolean isRemote()
      Description copied from interface: IColony
      Check if the colony is on the server or client.
      Specified by:
      isRemote in interface IColony
      Returns:
      true if so.
    • getStructurePack

      String getStructurePack()
      Get the style of the colony.
      Specified by:
      getStructurePack in interface IColony
      Returns:
      the current default style.
    • isRaiding

      boolean isRaiding()
      If currently being raided.
      Returns:
      true if so.
    • areSpiesEnabled

      boolean areSpiesEnabled()
    • getVisitor

      ICitizenDataView getVisitor(int citizenId)
      Gets the data view for a visitor
      Parameters:
      citizenId - id to query
      Returns:
      citizen data for visitor
    • getAnimal

      IAnimalDataView getAnimal(int animalId)
      Gets the data view for an animal
      Parameters:
      animalId - id to query
      Returns:
      animal data for visitor
    • getNameFileIds

      List<String> getNameFileIds()
      Get a list of all available citizen name style options.
      Returns:
      the list of options.
    • getClientBuildingManager

      IRegisteredStructureManagerView getClientBuildingManager()
      Client side building manager.
      Returns:
      the client side building manager