All Implemented Interfaces:
ITickingStateAI

public class EntityAIWorkFlorist extends AbstractEntityAIInteract<JobFlorist,BuildingFlorist>
Florist AI class.
  • Field Details

  • Constructor Details

    • EntityAIWorkFlorist

      public EntityAIWorkFlorist(@NotNull @NotNull JobFlorist job)
      Creates the abstract part of the AI. Always use this constructor!
      Parameters:
      job - the job to fulfill
  • 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<JobFlorist,BuildingFlorist>
    • holdEfficientTool

      public boolean holdEfficientTool(@NotNull @NotNull net.minecraft.world.level.block.state.BlockState target, net.minecraft.core.BlockPos pos)
      Description copied from class: AbstractEntityAIBasic
      Check and ensure that we hold the most efficient tool for the job.

      If we have no tool for the job, we will request on, return immediately.

      Overrides:
      holdEfficientTool in class AbstractEntityAIBasic<JobFlorist,BuildingFlorist>
      Parameters:
      target - the BlockState to mine
      pos - the pos to mine
      Returns:
      true if we have a tool for the job
    • getActionsDoneUntilDumping

      protected int getActionsDoneUntilDumping()
      Description copied from class: AbstractEntityAIBasic
      Calculates after how many actions the ai should dump it's inventory.

      Override this to change the value.

      Overrides:
      getActionsDoneUntilDumping in class AbstractEntityAIBasic<JobFlorist,BuildingFlorist>
      Returns:
      the number of actions done before item dump.
    • getBlockMiningTime

      public int getBlockMiningTime(@NotNull @NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull @NotNull net.minecraft.core.BlockPos pos)
      Calculate how long it takes to mine this block.
      Overrides:
      getBlockMiningTime in class AbstractEntityAIInteract<JobFlorist,BuildingFlorist>
      Parameters:
      state - the blockstate
      pos - coordinate
      Returns:
      the delay in ticks
    • getExpectedBuildingClass

      public Class<BuildingFlorist> 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<JobFlorist,BuildingFlorist>
      Returns:
      the building type associated with this AI's worker.
    • getFlowerDropAtPos

      protected List<String> getFlowerDropAtPos(net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos pos)
      Retrieves the item registry name of the first flower drop at the specified position.
      Parameters:
      world - the world in which to check for flower drops.
      pos - the position to check for flower drops.
      Returns:
      an Optional containing the registry name of the flower drop, or an empty Optional if no flower is found.