Class BuildingNetherWorker

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 BuildingNetherWorker extends AbstractBuilding
  • Field Details

  • Constructor Details

    • BuildingNetherWorker

      public BuildingNetherWorker(@NotNull @NotNull IColony colony, net.minecraft.core.BlockPos pos)
  • 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.
    • shallClosePortalOnReturn

      public boolean shallClosePortalOnReturn()
      Should the portal be closed on return?
    • onWakeUp

      public void onWakeUp()
      Description copied from class: AbstractBuilding
      Executed when a new day start.
      Specified by:
      onWakeUp in interface IBuilding
      Overrides:
      onWakeUp in class AbstractBuilding
    • 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
    • buildingRequiresCertainAmountOfItem

      public int buildingRequiresCertainAmountOfItem(net.minecraft.world.item.ItemStack stack, List<ItemStorage> localAlreadyKept, boolean inventory, JobEntry jobEntry)
      Description copied from interface: IBuilding
      Check if the worker requires a certain amount of that item and the alreadykept list contains it. Always leave one stack behind if the worker requires a certain amount of it. Just to be sure.
      Specified by:
      buildingRequiresCertainAmountOfItem in interface IBuilding
      Overrides:
      buildingRequiresCertainAmountOfItem in class AbstractBuilding
      Parameters:
      stack - the stack to check it with.
      localAlreadyKept - already kept items.
      inventory - if it should be in the inventory or in the building.
      jobEntry - the job entry trying to dump.
      Returns:
      the amount which can get dumped or 0 if not.
    • isReadyForTrip

      public boolean isReadyForTrip()
      Check to see if it's valid to do a trip by checking how many done in this current period
      Returns:
      true if the worker can go to the nether
    • recordTrip

      public void recordTrip()
      Let the building know we're doing a trip
    • getPortalLocation

      public net.minecraft.core.BlockPos getPortalLocation()
      Get the tagged location that the worker should walk to in the portal. This should be a 'air block' in the portal that can directly be checked to see if the portal is open
      Returns:
      the block above the tag, null if not available
    • getMaxPerPeriod

      public static int getMaxPerPeriod()
      Get the max per period, potentially modified by research
      Returns:
    • getPeriodDays

      public static int getPeriodDays()
      Get how many days are in a period, potentially modified by research.
      Returns:
    • onPlacement

      public void onPlacement()
      Description copied from class: AbstractBuilding
      On setting down the building.
      Specified by:
      onPlacement in interface IBuilding
      Overrides:
      onPlacement in class AbstractBuilding