All Implemented Interfaces:
IBuildingExtensionModule, IPlantationModule

public class SeagrassPlantModule 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

    • SeagrassPlantModule

      public SeagrassPlantModule(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

    • getRequiredResearchEffect

      public net.minecraft.resources.ResourceLocation getRequiredResearchEffect()
      Description copied from interface: IPlantationModule
      Get the required research effect for this module. Null if there is no research required for this field.
      Specified by:
      getRequiredResearchEffect in interface IPlantationModule
      Overrides:
      getRequiredResearchEffect in class AbstractPlantationModule
      Returns:
      the key of where to find the effect.
    • 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.
    • 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.
    • 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.
    • 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