Class BuildingCombatAcademy

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

public class BuildingCombatAcademy extends AbstractBuilding
Building class for the Combat Academy.
  • Constructor Details

    • BuildingCombatAcademy

      public BuildingCombatAcademy(@NotNull @NotNull IColony c, net.minecraft.core.BlockPos l)
      The abstract constructor of the building.
      Parameters:
      c - the colony
      l - the position
  • Method Details

    • registerBlockPosition

      public void registerBlockPosition(@NotNull @NotNull net.minecraft.world.level.block.Block block, @NotNull @NotNull net.minecraft.core.BlockPos pos, @NotNull @NotNull net.minecraft.world.level.Level world)
      Description copied from interface: IBuildingContainer
      Register a block 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 AbstractBuildingContainer
      Parameters:
      block - to be registered
      pos - of the block
      world - world to register it at.
    • deserializeNBT

      public void deserializeNBT(net.minecraft.nbt.CompoundTag compound)
      Specified by:
      deserializeNBT in interface IBuildingContainer
      Specified by:
      deserializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      deserializeNBT in class AbstractBuilding
    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT()
      Specified by:
      serializeNBT in interface IBuildingContainer
      Specified by:
      serializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      serializeNBT in class AbstractBuilding
    • 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.
    • getRandomCombatTarget

      public net.minecraft.core.BlockPos getRandomCombatTarget(net.minecraft.util.RandomSource random)
      Get a random position to shoot at.
      Parameters:
      random - the random obj.
      Returns:
      a random shooting target position.
    • getRandomCombatPartner

      public AbstractEntityCitizen getRandomCombatPartner(AbstractEntityCitizen citizen)
      Get a random trainings partner in the building.
      Parameters:
      citizen - the worker to get the partner for.
      Returns:
      the entityCitizen partner or null.
    • hasCombatPartner

      public boolean hasCombatPartner(AbstractEntityCitizen citizen)
      Check if the worker has a combat partner assigned to him right now.
      Parameters:
      citizen - the citizen to check for.
      Returns:
      true if so.
    • getCombatPartner

      public AbstractEntityCitizen getCombatPartner(AbstractEntityCitizen citizen)
      Get the citizen of the combat partner or null if not existing or available.
      Parameters:
      citizen - the citizen.
      Returns:
      the citizen or null.
    • resetPartner

      public void resetPartner(AbstractEntityCitizen worker)
      Reset the combat partner for a worker.
      Parameters:
      worker - the worker to reset it for.