All Implemented Interfaces:
IBuildingExtensionModule, IPlantationModule

public class VinePlantModule extends PercentageHarvestPlantModule
Planter module for growing Items.VINE. All possible positions of the vines should be tagged with the vine tag. The planter will automatically plant an X amount of vines down, depending on the amount of tagged positions. After that any excess that will grow will be harvested. The planter will make an attempt to not plant the vines next to one another as much as possible.
Requirements:
  1. All requirements from PercentageHarvestPlantModule
  • Constructor Details

    • VinePlantModule

      public VinePlantModule(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.
    • isValidHarvestBlock

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

      protected int getMinimumPlantPercentage()
      Description copied from class: PercentageHarvestPlantModule
      The percentage of positions the planter should always leave present at the bare minimum. If this is not reached the planter will plant additional plants to reach this minimum.
      Specified by:
      getMinimumPlantPercentage in class PercentageHarvestPlantModule
      Returns:
      a percentage of plants to always leave be.