Class TavernBuildingModule

java.lang.Object
com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
com.minecolonies.core.colony.buildings.modules.TavernBuildingModule
All Implemented Interfaces:
IBuildingEventsModule, IBuildingModule, IDefinesCoreBuildingStatsModule, IPersistentModule, ITickingModule, IHasDirty

Tavern building for the colony. Houses 4 citizens Plays a tavern theme on entering Spawns/allows citizen recruitment Spawns trader/quest npcs
  • Field Details

  • Constructor Details

    • TavernBuildingModule

      public TavernBuildingModule()
  • Method Details

    • getMaxInhabitants

      public IStat<Integer> getMaxInhabitants()
      Description copied from interface: IDefinesCoreBuildingStatsModule
      Get the max number of inhabitants this module allows.
      Specified by:
      getMaxInhabitants in interface IDefinesCoreBuildingStatsModule
      Returns:
      the modules max number of assigned citizens.
    • onPlayerEnterBuilding

      public void onPlayerEnterBuilding(net.minecraft.world.entity.player.Player player)
      Description copied from interface: IBuildingEventsModule
      On player entering hook.
      Specified by:
      onPlayerEnterBuilding in interface IBuildingEventsModule
      Parameters:
      player - the player that entered the building.
    • onColonyTick

      public void onColonyTick(@NotNull @NotNull IColony colony)
      Description copied from interface: ITickingModule
      Colony tick hook.
      Specified by:
      onColonyTick in interface ITickingModule
      Parameters:
      colony - the colony the tick is invoked from.
    • onUpgradeComplete

      public void onUpgradeComplete(int newlevel)
      Description copied from interface: IBuildingEventsModule
      Upgrade complete module hook.
      Specified by:
      onUpgradeComplete in interface IBuildingEventsModule
      Parameters:
      newlevel - the new level.
    • spawnVisitor

      @Nullable public @Nullable IVisitorData spawnVisitor()
      Spawns a visitor citizen that can be recruited.
    • serializeNBT

      public void serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag nbt)
      Description copied from interface: IPersistentModule
      Serialize the module from a compound.
      Specified by:
      serializeNBT in interface IPersistentModule
      Parameters:
      nbt - the compound.
    • deserializeNBT

      public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag nbt)
      Description copied from interface: IPersistentModule
      Deserialize the module.
      Specified by:
      deserializeNBT in interface IPersistentModule
      Parameters:
      nbt - the nbt compound.
    • getFreeSitPosition

      public net.minecraft.core.BlockPos getFreeSitPosition()
      Gets a free sitting position
      Returns:
      a blockpos to sit at
    • onDestroyed

      public void onDestroyed()
      Description copied from interface: IBuildingEventsModule
      On destruction hook of the building, calling into the modules.
      Specified by:
      onDestroyed in interface IBuildingEventsModule
    • getExternalCitizens

      public List<Integer> getExternalCitizens()
      Gets the assigned visitor ids
      Returns:
      list of ids
    • getWorkPos

      public net.minecraft.core.BlockPos getWorkPos()
      Get a random work position
      Returns:
      a random work pos
    • initTagPositions

      public void initTagPositions()
      Initializes the sitting and work position lists
    • removeCitizen

      public boolean removeCitizen(Integer id)
      Removes the given citizen id
      Parameters:
      id - to remove
    • setNoVisitorTime

      public void setNoVisitorTime(int noVisitorTime)
      Sets the delay time before a new visitor spawns
      Parameters:
      noVisitorTime - time in ticks