All Implemented Interfaces:
IBuildingExtensionModule, IPlantationModule

public class CocoaPlantModule extends TreeSidePlantModule
Planter module for growing Items.COCOA_BEANS.
Requirements:
  1. All requirements from TreeSidePlantModule
  • Constructor Details

    • CocoaPlantModule

      public CocoaPlantModule(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.
    • getPlantingBlockState

      public net.minecraft.world.level.block.state.BlockState getPlantingBlockState(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos workPosition, net.minecraft.world.level.block.state.BlockState blockState)
      Description copied from interface: IPlantationModule
      Generate a block state for a new plant.
      Specified by:
      getPlantingBlockState in interface IPlantationModule
      Overrides:
      getPlantingBlockState in class AbstractPlantationModule
      Parameters:
      world - the world reference that can be used for block state lookups.
      workPosition - the position that has been chosen for work.
      blockState - the default block state for the block.
    • 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.
    • isValidClearingBlock

      protected boolean isValidClearingBlock(net.minecraft.world.level.block.state.BlockState blockState)
      Description copied from class: TreeSidePlantModule
      Check if the block is a correct block for clearing.
      Overrides:
      isValidClearingBlock in class TreeSidePlantModule
      Parameters:
      blockState - the block state.
      Returns:
      whether the block can be cleared.
    • isValidHarvestBlock

      protected boolean isValidHarvestBlock(net.minecraft.world.level.block.state.BlockState blockState)
      Description copied from class: TreeSidePlantModule
      Check if the block is a correct block for harvesting.
      Specified by:
      isValidHarvestBlock in class TreeSidePlantModule
      Parameters:
      blockState - the block state.
      Returns:
      whether the block can be harvested.