All Implemented Interfaces:
IBuildingExtensionModule, IPlantationModule

public class SeapicklePlantModule extends BoneMealedPlantModule
Planter module for growing Items.SEAGRASS.
Requirements:
  1. All requirements from BoneMealedPlantModule
  2. All working positions must have water directly overhead of them, else the seagrass won't be able to grow.
  • Constructor Details

    • SeapicklePlantModule

      public SeapicklePlantModule(IBuildingExtension field, String fieldTag, String workTag, net.minecraft.world.item.Item item)
      Default constructor.
      Parameters:
      field - the field instance this module is working on.
      fieldTag - the tag of the field anchor block.
      workTag - the tag of the working positions.
      item - the item which is harvested.
  • Method Details

    • getRequiredTool

      public EquipmentTypeEntry getRequiredTool()
      Description copied from interface: IPlantationModule
      Returns the requested tool type in order to work on this module.
      Returns:
      the tool to work on this module.
    • decideFieldWork

      public IPlantationModule.PlantationModuleResult.Builder decideFieldWork(net.minecraft.world.level.Level world, @NotNull @NotNull net.minecraft.core.BlockPos workPosition)
      Description copied from interface: IPlantationModule
      Core function for the planter module, is responsible for telling the AI what to do on the specific field.
      Specified by:
      decideFieldWork in interface IPlantationModule
      Overrides:
      decideFieldWork in class BoneMealedPlantModule
      Parameters:
      world - the world reference that can be used for block state lookups.
      workPosition - the position that has been chosen for work.
      Returns:
      a basic enum state telling the planter AI what the AI should be doing next.
    • isValidHarvestBlock

      protected boolean isValidHarvestBlock(net.minecraft.world.level.block.state.BlockState blockState)
      Description copied from class: BoneMealedPlantModule
      Check if the block is a correct block for harvesting. Defaults to check if the block state is not air.
      Overrides:
      isValidHarvestBlock in class BoneMealedPlantModule
      Parameters:
      blockState - the block state.
      Returns:
      whether the block can be harvested.
    • isValidBonemealLocation

      protected boolean isValidBonemealLocation(net.minecraft.world.level.block.state.BlockState blockState)
      Description copied from class: BoneMealedPlantModule
      Check if the block is a correct block for planting. Defaults to being any air block.
      Overrides:
      isValidBonemealLocation in class BoneMealedPlantModule
      Parameters:
      blockState - the block state.
      Returns:
      whether the block can be planted.
    • getMaxWorkingPositions

      protected int getMaxWorkingPositions()
      Description copied from class: AbstractPlantationModule
      Get the maximum amount of working positions this field is allowed to handle. Defaults to AbstractPlantationModule.DEFAULT_MAX_PLANTS.
      Overrides:
      getMaxWorkingPositions in class BoneMealedPlantModule
      Returns:
      the maximum amount of plants.
    • getValidBonemeal

      public @NonNull List<net.minecraft.world.item.Item> getValidBonemeal()
      Description copied from interface: IPlantationModule
      Returns which items are considered valid bonemeal items. Defaults to an empty list. (Most modules should not need any bonemeal).
      Specified by:
      getValidBonemeal in interface IPlantationModule
      Overrides:
      getValidBonemeal in class BoneMealedPlantModule
    • applyBonemeal

      public void applyBonemeal(AbstractEntityCitizen worker, net.minecraft.core.BlockPos workPosition, net.minecraft.world.item.ItemStack stackInSlot, net.minecraft.world.entity.player.Player fakePlayer)
      Description copied from interface: IPlantationModule
      Logic for applying bonemeal to the working position.
      Specified by:
      applyBonemeal in interface IPlantationModule
      Overrides:
      applyBonemeal in class AbstractPlantationModule
      Parameters:
      worker - the worker entity working on the plantation.
      workPosition - the position that has been chosen for work.
      stackInSlot - the item stack to use for the planting.
      fakePlayer - a fake player class to use.