All Implemented Interfaces:
IBuilding, IBuildingContainer, ICommonBuilding, ISchematicProvider, ITownHall, IBuildingModuleContainer, IModuleContainer<IBuildingModule>, IRequester, IRequestResolverProvider, IItemHandlerCapProvider, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class BuildingTownHall extends AbstractBuilding implements ITownHall
Class used to manage the townHall building block.
  • Field Details

  • Constructor Details

    • BuildingTownHall

      public BuildingTownHall(IColony c, net.minecraft.core.BlockPos l)
      Instantiates the building.
      Parameters:
      c - the colony.
      l - the location.
  • Method Details

    • getSchematicName

      @NotNull public @NotNull String getSchematicName()
      Description copied from interface: ISchematicProvider
      Children must return the name of their structure.
      Specified by:
      getSchematicName in interface ISchematicProvider
      Returns:
      StructureProxy name.
    • getMaxBuildingLevel

      public int getMaxBuildingLevel()
      Description copied from interface: ISchematicProvider
      Children must return their max building level.
      Specified by:
      getMaxBuildingLevel in interface ISchematicProvider
      Overrides:
      getMaxBuildingLevel in class AbstractBuilding
      Returns:
      Max building level.
    • addPermissionEvent

      public void addPermissionEvent(PermissionEvent event)
      Description copied from interface: ITownHall
      Add a colony permission event to the colony. Reduce the list by one if bigger than a treshhold.
      Specified by:
      addPermissionEvent in interface ITownHall
      Parameters:
      event - the event to add.
    • removePermissionEvents

      public void removePermissionEvents(@NotNull @NotNull UUID id)
      Description copied from interface: ITownHall
      Removes all permission events with the given player id (because they were just given permissions)
      Specified by:
      removePermissionEvents in interface ITownHall
      Parameters:
      id - the player id
    • serializeToView

      public void serializeToView(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf, boolean fullSync)
      Description copied from class: AbstractBuilding
      Serializes to view.
      Specified by:
      serializeToView in interface IBuilding
      Overrides:
      serializeToView in class AbstractBuilding
      Parameters:
      buf - RegistryFriendlyByteBuf to write to.
      fullSync - Whether it's a full sync
    • getClaimRadius

      public int getClaimRadius(int newLevel)
      Description copied from class: AbstractBuilding
      Method to calculate the radius to be claimed by this building depending on the level.
      Specified by:
      getClaimRadius in interface IBuilding
      Overrides:
      getClaimRadius in class AbstractBuilding
      Parameters:
      newLevel - the new level of the building.
      Returns:
      the radius.
    • canBeGathered

      public boolean canBeGathered()
      Description copied from class: AbstractBuilding
      Check if the building should be gathered by the dman.
      Specified by:
      canBeGathered in interface IBuilding
      Overrides:
      canBeGathered in class AbstractBuilding
      Returns:
      true if so.