Class KelpPlantModule
java.lang.Object
com.minecolonies.core.colony.buildingextensions.modules.AbstractBuildingExtensionModule
com.minecolonies.core.colony.buildings.workerbuildings.plantation.AbstractPlantationModule
com.minecolonies.core.colony.buildings.workerbuildings.plantation.modules.generic.UpwardsGrowingPlantModule
com.minecolonies.core.colony.buildings.workerbuildings.plantation.modules.specific.KelpPlantModule
- All Implemented Interfaces:
IBuildingExtensionModule,IPlantationModule
Planter module for growing
Requirements:
Items.KELP.
Requirements:
- All requirements from
UpwardsGrowingPlantModule -
There must be an air block directly above the water at least
MAX_HEIGHT+ 1 from the working position block. This is where the AI will attempt to walk to.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.minecolonies.api.colony.buildingextensions.plantation.IPlantationModule
IPlantationModule.ActionToPerform, IPlantationModule.PlantationModuleResult, IPlantationModule.PlanterAIModuleResultResetState -
Field Summary
Fields inherited from class com.minecolonies.core.colony.buildings.workerbuildings.plantation.modules.generic.UpwardsGrowingPlantModule
DEFAULT_MINIMUM_PLANT_LENGTHFields inherited from class com.minecolonies.core.colony.buildings.workerbuildings.plantation.AbstractPlantationModule
DEFAULT_MAX_PLANTSFields inherited from class com.minecolonies.core.colony.buildingextensions.modules.AbstractBuildingExtensionModule
extension -
Constructor Summary
ConstructorsConstructorDescriptionKelpPlantModule(IBuildingExtension field, String fieldTag, String workTag, net.minecraft.world.item.Item item) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected @NotNull IntegerGet the maximum length this plant can grow.protected intGet the minimum length this plant should grow to before considered harvestable.net.minecraft.core.BlockPosgetPositionToWalkTo(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos workingPosition) Determines where the planter should walk to, in order to most effectively work on the given working position.net.minecraft.resources.ResourceLocationGet the required research effect for this module.Returns the requested tool type in order to work on this module.protected booleanisValidHarvestBlock(net.minecraft.world.level.block.state.BlockState blockState) Check if the block is a correct block for harvesting.protected booleanisValidPlantingBlock(net.minecraft.world.level.block.state.BlockState blockState) Check if the block is a correct block for planting.Methods inherited from class com.minecolonies.core.colony.buildings.workerbuildings.plantation.modules.generic.UpwardsGrowingPlantModule
decideFieldWork, getActionLimit, getNextWorkingPosition, getRequiredItemsForOperation, isValidClearingBlockMethods inherited from class com.minecolonies.core.colony.buildings.workerbuildings.plantation.AbstractPlantationModule
applyBonemeal, equals, getFieldTag, getItem, getMaxWorkingPositions, getPlantingBlockState, getPlantsToRequest, getValidBonemeal, getValidWorkingPositions, getWorkingPositions, getWorkTag, hashCodeMethods inherited from class com.minecolonies.core.colony.buildingextensions.modules.AbstractBuildingExtensionModule
getExtensionMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.buildingextensions.modules.IBuildingExtensionModule
getExtension
-
Constructor Details
-
KelpPlantModule
public KelpPlantModule(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
-
isValidPlantingBlock
protected boolean isValidPlantingBlock(net.minecraft.world.level.block.state.BlockState blockState) Description copied from class:UpwardsGrowingPlantModuleCheck if the block is a correct block for planting. Defaults to being any air block.- Overrides:
isValidPlantingBlockin classUpwardsGrowingPlantModule- Parameters:
blockState- the block state.- Returns:
- whether the block can be planted.
-
isValidHarvestBlock
protected boolean isValidHarvestBlock(net.minecraft.world.level.block.state.BlockState blockState) Description copied from class:UpwardsGrowingPlantModuleCheck if the block is a correct block for harvesting.- Specified by:
isValidHarvestBlockin classUpwardsGrowingPlantModule- Parameters:
blockState- the block state.- Returns:
- whether the block can be harvested.
-
getMinimumPlantLength
protected int getMinimumPlantLength()Description copied from class:UpwardsGrowingPlantModuleGet the minimum length this plant should grow to before considered harvestable. Defaults toUpwardsGrowingPlantModule.DEFAULT_MINIMUM_PLANT_LENGTH.- Overrides:
getMinimumPlantLengthin classUpwardsGrowingPlantModule- Returns:
- the minimum plant length
-
getMaximumPlantLength
Description copied from class:UpwardsGrowingPlantModuleGet the maximum length this plant can grow. Defaults to null.- Overrides:
getMaximumPlantLengthin classUpwardsGrowingPlantModule- Returns:
- the maximum plant length
-
getPositionToWalkTo
public net.minecraft.core.BlockPos getPositionToWalkTo(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos workingPosition) Description copied from interface:IPlantationModuleDetermines where the planter should walk to, in order to most effectively work on the given working position. Defaults to the same block.- Specified by:
getPositionToWalkToin interfaceIPlantationModule- Overrides:
getPositionToWalkToin classUpwardsGrowingPlantModule- Parameters:
world- the world reference that can be used for block state lookups.workingPosition- the original working position.- Returns:
- the position for the planter to walk to.
-
getRequiredResearchEffect
public net.minecraft.resources.ResourceLocation getRequiredResearchEffect()Description copied from interface:IPlantationModuleGet the required research effect for this module. Null if there is no research required for this field.- Specified by:
getRequiredResearchEffectin interfaceIPlantationModule- Overrides:
getRequiredResearchEffectin classAbstractPlantationModule- Returns:
- the key of where to find the effect.
-
getRequiredTool
Description copied from interface:IPlantationModuleReturns the requested tool type in order to work on this module.- Returns:
- the tool to work on this module.
-