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

public class BuildingBarracks extends AbstractBuilding
Building class for the Barracks.
  • Field Details

    • SPIES_GOLD_COST

      public static int SPIES_GOLD_COST
      The goldcost for spies
  • Constructor Details

    • BuildingBarracks

      public BuildingBarracks(@NotNull @NotNull IColony colony, net.minecraft.core.BlockPos pos)
      Constructor for a AbstractBuilding.
      Parameters:
      colony - Colony the building belongs to.
      pos - Location of the building (it's Hut Block).
  • Method Details

    • getSchematicName

      @NotNull public @NotNull String getSchematicName()
      Description copied from interface: ISchematicProvider
      Children must return the name of their structure.
      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.
    • onDestroyed

      public void onDestroyed()
      Specified by:
      onDestroyed in interface IBuilding
      Overrides:
      onDestroyed in class AbstractBuilding
    • onUpgradeComplete

      public void onUpgradeComplete(@Nullable @Nullable com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, int newLevel)
      Description copied from interface: IBuilding
      Called upon completion of an upgrade process. We suppress this warning since this parameter will be used in child classes which override this method.
      Specified by:
      onUpgradeComplete in interface IBuilding
      Overrides:
      onUpgradeComplete in class AbstractBuilding
      Parameters:
      newLevel - The new level.
    • registerBlockPosition

      public void registerBlockPosition(@NotNull @NotNull net.minecraft.world.level.block.state.BlockState block, @NotNull @NotNull net.minecraft.core.BlockPos pos, @NotNull @NotNull net.minecraft.world.level.Level world)
      Description copied from interface: IBuildingContainer
      Register a blockState and position. We suppress this warning since this parameter will be used in child classes which override this method.
      Specified by:
      registerBlockPosition in interface IBuildingContainer
      Overrides:
      registerBlockPosition in class AbstractBuilding
      Parameters:
      block - to be registered
      pos - of the blockState
      world - world to register it at.
    • onColonyTick

      public void onColonyTick(@NotNull @NotNull IColony colony)
      Description copied from class: AbstractBuilding
      Regularly tick this building and check if we got the minimum stock(like once a minute is still fine) - If not: Check if there is a request for this already. -- If not: Create a request. - If so: Check if there is a request for this still. -- If so: cancel it.
      Specified by:
      onColonyTick in interface IBuilding
      Overrides:
      onColonyTick in class AbstractBuilding
    • 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.
    • deserializeNBT

      public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound)
      Specified by:
      deserializeNBT in interface IBuildingContainer
      Specified by:
      deserializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      deserializeNBT in class AbstractBuilding
    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider)
      Specified by:
      serializeNBT in interface IBuildingContainer
      Specified by:
      serializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      serializeNBT in class AbstractBuilding
    • getTowers

      public List<net.minecraft.core.BlockPos> getTowers()