Class EntityAIWorkDeliveryman

All Implemented Interfaces:
ITickingStateAI

public class EntityAIWorkDeliveryman extends AbstractEntityAIInteract<JobDeliveryman,BuildingDeliveryman>
Delivers item at needs.
  • Field Details

  • Constructor Details

    • EntityAIWorkDeliveryman

      public EntityAIWorkDeliveryman(@NotNull @NotNull JobDeliveryman deliveryman)
      Initialize the deliveryman and add all his tasks.
      Parameters:
      deliveryman - the job he has.
  • Method Details

    • updateRenderMetaData

      protected void updateRenderMetaData()
      Description copied from class: AbstractEntityAIBasic
      Can be overridden in implementations.

      Here the AI can check if the chestBelt has to be re rendered and do it.

      Overrides:
      updateRenderMetaData in class AbstractEntityAIBasic<JobDeliveryman,BuildingDeliveryman>
    • getExpectedBuildingClass

      public Class<BuildingDeliveryman> getExpectedBuildingClass()
      Description copied from class: AbstractEntityAIBasic
      Can be overridden in implementations to return the exact building type the worker expects.
      Specified by:
      getExpectedBuildingClass in class AbstractEntityAIBasic<JobDeliveryman,BuildingDeliveryman>
      Returns:
      the building type associated with this AI's worker.
    • workerRequiresItem

      public static int workerRequiresItem(IBuilding building, net.minecraft.world.item.ItemStack stack, List<ItemStorage> localAlreadyKept)
      Check if worker of a certain building requires the item now. Or the builder for the current task.
      Parameters:
      building - the building to check for.
      stack - the stack to stack with.
      localAlreadyKept - already kept resources.
      Returns:
      the amount which can get dumped.
    • gatherIfInTileEntity

      public boolean gatherIfInTileEntity(net.minecraft.world.level.block.entity.BlockEntity entity, net.minecraft.world.item.ItemStack is)
      Finds the first @see ItemStack the type of is. It will be taken from the chest and placed in the worker inventory. Make sure that the worker stands next the chest to not break immersion. Also make sure to have inventory space for the stack.
      Parameters:
      entity - the tileEntity chest or building or rack.
      is - the itemStack.
      Returns:
      true if found the stack.