Class CocoaPlantModule
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.TreeSidePlantModule
com.minecolonies.core.colony.buildings.workerbuildings.plantation.modules.specific.CocoaPlantModule
- All Implemented Interfaces:
IBuildingExtensionModule,IPlantationModule
Planter module for growing
Requirements:
Items.COCOA_BEANS.
Requirements:
- All requirements from
TreeSidePlantModule
-
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.AbstractPlantationModule
DEFAULT_MAX_PLANTSFields inherited from class com.minecolonies.core.colony.buildingextensions.modules.AbstractBuildingExtensionModule
extension -
Constructor Summary
ConstructorsConstructorDescriptionCocoaPlantModule(IBuildingExtension field, String fieldTag, String workTag, net.minecraft.world.item.Item item) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.block.state.BlockStategetPlantingBlockState(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos workPosition, net.minecraft.world.level.block.state.BlockState blockState) Generate a block state for a new plant.net.minecraft.resources.ResourceLocationGet the required research effect for this module.Returns the requested tool type in order to work on this module.protected booleanisValidClearingBlock(net.minecraft.world.level.block.state.BlockState blockState) Check if the block is a correct block for clearing.protected booleanisValidHarvestBlock(net.minecraft.world.level.block.state.BlockState blockState) Check if the block is a correct block for harvesting.Methods inherited from class com.minecolonies.core.colony.buildings.workerbuildings.plantation.modules.generic.TreeSidePlantModule
decideFieldWork, getActionLimit, getNextWorkingPosition, getPositionToWalkTo, getRequiredItemsForOperation, getValidWorkingPositions, isValidPlantingBlockMethods inherited from class com.minecolonies.core.colony.buildings.workerbuildings.plantation.AbstractPlantationModule
applyBonemeal, equals, getFieldTag, getItem, getMaxWorkingPositions, getPlantsToRequest, getValidBonemeal, getWorkingPositions, getWorkTag, hashCodeMethods inherited from class com.minecolonies.core.colony.buildingextensions.modules.AbstractBuildingExtensionModule
getBuildingExtensionMethods 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
getBuildingExtension
-
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: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.
-
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:IPlantationModuleGenerate a block state for a new plant.- Specified by:
getPlantingBlockStatein interfaceIPlantationModule- Overrides:
getPlantingBlockStatein classAbstractPlantationModule- 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
Description copied from interface:IPlantationModuleReturns 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:TreeSidePlantModuleCheck if the block is a correct block for clearing.- Overrides:
isValidClearingBlockin classTreeSidePlantModule- 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:TreeSidePlantModuleCheck if the block is a correct block for harvesting.- Specified by:
isValidHarvestBlockin classTreeSidePlantModule- Parameters:
blockState- the block state.- Returns:
- whether the block can be harvested.
-