Interface IColony

All Known Subinterfaces:
IColonyView
All Known Implementing Classes:
Colony, ColonyView

public interface IColony
Interface of the Colony and ColonyView which will have to implement the following methods.
  • Field Details

    • CLOSE_COLONY_CAP

      static final net.minecraftforge.common.capabilities.Capability<IColonyTagCapability> CLOSE_COLONY_CAP
  • Method Details

    • onWorldLoad

      void onWorldLoad(@NotNull @NotNull net.minecraft.world.level.Level w)
    • onWorldUnload

      void onWorldUnload(@NotNull @NotNull net.minecraft.world.level.Level w)
    • onServerTick

      void onServerTick(@NotNull net.minecraftforge.event.TickEvent.ServerTickEvent event)
    • getWorkManager

      @NotNull @NotNull IWorkManager getWorkManager()
    • onWorldTick

      void onWorldTick(@NotNull net.minecraftforge.event.TickEvent.LevelTickEvent event)
    • getCenter

      net.minecraft.core.BlockPos getCenter()
      Returns the position of the colony.
      Returns:
      pos of the colony.
    • getName

      String getName()
      Returns the name of the colony.
      Returns:
      Name of the colony.
    • setName

      void setName(String n)
    • getPermissions

      IPermissions getPermissions()
      Returns the permissions of the colony.
      Returns:
      IPermissions of the colony.
    • isCoordInColony

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

      long getDistanceSquared(net.minecraft.core.BlockPos pos)
      Returns the squared (x, z) distance to the center.
      Parameters:
      pos - Block Position.
      Returns:
      Squared distance to the center in (x, z) direction.
    • getID

      int getID()
      returns this colonies unique id.
      Returns:
      an int representing the id.
    • getTeamColonyColor

      net.minecraft.ChatFormatting getTeamColonyColor()
      Getter for the team colony color.
      Returns:
      the color.
    • getColonyFlag

      net.minecraft.nbt.ListTag getColonyFlag()
      Returns this colony's banner patterns, as a List
      Returns:
      a list of pattern-color pairs
    • isDay

      boolean isDay()
      Whether it is day for the colony
      Returns:
      true if it is day
    • getLastContactInHours

      int getLastContactInHours()
      Get the last contact of a player to the colony in hours.
      Returns:
      an integer with a describing value.
    • getWorld

      net.minecraft.world.level.Level getWorld()
      Method to get the World this colony is in.
      Returns:
      the World the colony is in.
    • getRequestManager

      @NotNull @NotNull IRequestManager getRequestManager()
      Get the current IRequestManager for this Colony. Returns null if the current Colony does not support the request system.
      Returns:
      the IRequestManager for this colony, null if not supported.
    • markDirty

      void markDirty()
      Called to mark this colony dirty, and in need of syncing / saving.
    • canBeAutoDeleted

      boolean canBeAutoDeleted()
      Called to check if the colony can be deleted by an automatic cleanup.
      Returns:
      true if so.
    • getRequesterBuildingForPosition

      @Nullable @Nullable IRequester getRequesterBuildingForPosition(@NotNull @NotNull net.minecraft.core.BlockPos pos)
      Method used to get a IRequester from a given Position. Is always a Building.
      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)
      Remove a visiting player.
      Parameters:
      player - the player.
    • getMessagePlayerEntities

      @NotNull @NotNull List<net.minecraft.world.entity.player.Player> getMessagePlayerEntities()
      Get the players in the colony which should receive the message.
      Returns:
      list of players
    • getWayPoints

      @NotNull default @NotNull List<net.minecraft.core.BlockPos> getWayPoints(@NotNull @NotNull net.minecraft.core.BlockPos position, @NotNull @NotNull net.minecraft.core.BlockPos target)
    • getOverallHappiness

      double getOverallHappiness()
    • getWayPoints

      Map<net.minecraft.core.BlockPos,net.minecraft.world.level.block.state.BlockState> getWayPoints()
    • getStructurePack

      String getStructurePack()
    • setStructurePack

      void setStructurePack(String style)
    • getServerBuildingManager

      IRegisteredStructureManager getServerBuildingManager()
    • getCommonBuildingManager

      ICommonRegisteredStructureManager getCommonBuildingManager()
    • getCitizenManager

      ICitizenManager getCitizenManager()
    • getGraveManager

      IGraveManager getGraveManager()
    • getVisitorManager

      IVisitorManager getVisitorManager()
      Gets the visitor manager
      Returns:
      manager
    • getAnimalManager

      IAnimalManager getAnimalManager()
      Get the animal manager of the colony.
      Returns:
      the animal manager.
    • getRaiderManager

      IRaiderManager getRaiderManager()
    • getEventManager

      IEventManager getEventManager()
      Get the event manager of the colony.
      Returns:
      the event manager.
    • getReproductionManager

      IReproductionManager getReproductionManager()
      Get the reproduction manager of the colony.
      Returns:
      the reproduction manager.
    • getEventDescriptionManager

      IEventDescriptionManager getEventDescriptionManager()
      Get the event description manager of the colony.
      Returns:
      the event description manager.
    • getPackageManager

      IColonyPackageManager getPackageManager()
      The colony networking packaging manager.
      Returns:
      The packaging manager.
    • getTravellingManager

      ITravellingManager getTravellingManager()
      Get the travelling manager of the colony.
      Returns:
      the travelling manager.
    • getConnectionManager

      IColonyConnectionManager getConnectionManager()
      Get the connection manager of the colony.
      Returns:
      the connection manager.
    • addVisitingPlayer

      void addVisitingPlayer(net.minecraft.world.entity.player.Player player)
      Add a visiting player.
      Parameters:
      player - the player.
    • getDimension

      net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDimension()
      Get the colony dimension.
      Returns:
      the dimension id.
    • isRemote

      boolean isRemote()
      Check if the colony is on the server or client.
      Returns:
      true if so.
    • getResearchManager

      IResearchManager getResearchManager()
      Get the research manager.
      Returns:
      the research manager object.
    • usedMercenaries

      void usedMercenaries()
      Save the time when mercenaries are used, to set a cooldown.
    • getMercenaryUseTime

      long getMercenaryUseTime()
      Get the last time mercenaries were used.
      Returns:
      the mercenary use time.
    • getColonyTag

      net.minecraft.nbt.CompoundTag getColonyTag()
    • isColonyUnderAttack

      boolean isColonyUnderAttack()
    • isValidAttackingPlayer

      boolean isValidAttackingPlayer(net.minecraft.world.entity.player.Player entity)
    • isValidAttackingGuard

      boolean isValidAttackingGuard(AbstractEntityCitizen entity)
    • setColonyColor

      void setColonyColor(net.minecraft.ChatFormatting color)
    • setColonyFlag

      void setColonyFlag(net.minecraft.nbt.ListTag patterns)
    • addWayPoint

      void addWayPoint(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState newWayPointState)
    • addGuardToAttackers

      void addGuardToAttackers(AbstractEntityCitizen entityCitizen, net.minecraft.world.entity.player.Player followPlayer)
    • addFreePosition

      void addFreePosition(net.minecraft.core.BlockPos pos)
    • addFreeBlock

      void addFreeBlock(net.minecraft.world.level.block.Block block)
    • removeFreePosition

      void removeFreePosition(net.minecraft.core.BlockPos pos)
    • removeFreeBlock

      void removeFreeBlock(net.minecraft.world.level.block.Block block)
    • setCanBeAutoDeleted

      void setCanBeAutoDeleted(boolean canBeDeleted)
    • write

      net.minecraft.nbt.CompoundTag write(net.minecraft.nbt.CompoundTag colonyCompound)
    • read

      void read(net.minecraft.nbt.CompoundTag compound)
    • getImportantMessageEntityPlayers

      @NotNull @NotNull List<net.minecraft.world.entity.player.Player> getImportantMessageEntityPlayers()
      Returns a set of players receiving important messages for the colony.
      Returns:
      set of players.
    • useAdditionalChildTime

      boolean useAdditionalChildTime(int amount)
      Tries to use a given amount of additional growth-time for childs.
      Parameters:
      amount - amount to use
      Returns:
      true if used up.
    • updateHasChilds

      void updateHasChilds()
      Sets whether the colony has a child.
    • addLoadedChunk

      void addLoadedChunk(long chunkPos, net.minecraft.world.level.chunk.LevelChunk chunk)
      Adds a loaded chunk to the colony list
      Parameters:
      chunkPos - chunk to add
    • removeLoadedChunk

      void removeLoadedChunk(long chunkPos)
      Adds a chunk from the colony list
      Parameters:
      chunkPos - chunk to remove
    • getLoadedChunkCount

      int getLoadedChunkCount()
      Returns the amount of loaded chunks
      Returns:
      amount of chunks
    • getLoadedChunks

      Set<Long> getLoadedChunks()
    • getState

      ColonyState getState()
      Returns the colonies current state.
      Returns:
      the state.
    • isActive

      boolean isActive()
      Is the colony active currently.
      Returns:
      true if so.
    • getTicketedChunks

      Set<Long> getTicketedChunks()
      Get the set of chunk positions which the colony is loading through tickets
      Returns:
      set of positions
    • setTextureStyle

      void setTextureStyle(String style)
      Set the texture style of the colony.
      Parameters:
      style - the style to set.
    • getTextureStyleId

      String getTextureStyleId()
      Get the colony style.
      Returns:
      the string id of the style.
    • getNameStyle

      String getNameStyle()
      Get the colony name style.
      Returns:
      the string id of the style.
    • setNameStyle

      void setNameStyle(String style)
      Set the colony name style.
      Parameters:
      style - the string id of the style.
    • getCitizenNameFile

      CitizenNameFile getCitizenNameFile()
      Get the matching citizen name file of the colony .
      Returns:
      the matching file.
    • getStatisticsManager

      IStatisticsManager getStatisticsManager()
      Get the statistics manager of the colony.
      Returns:
      the statistics manager.
    • getDay

      int getDay()
      Get the current day of the colony.
      Returns:
      the current day progress of the colony.
    • getQuestManager

      IQuestManager getQuestManager()
      Get the quest manager of the colony.
      Returns:
      the quest manager.
    • getCitizen

      ICitizen getCitizen(int id)
      Get citizen from colony.
      Parameters:
      id - the id of the cit.
      Returns:
      the cit.
    • getSettings

      ICommonSettingsModule getSettings()
      Get the colony level settings module.
      Returns:
      the settings module.