Class VinePlantModule
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.PercentageHarvestPlantModule
com.minecolonies.core.colony.buildings.workerbuildings.plantation.modules.specific.VinePlantModule
- All Implemented Interfaces:
IBuildingExtensionModule,IPlantationModule
Planter module for growing
Requirements:
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:
- All requirements from
PercentageHarvestPlantModule
-
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
ConstructorsConstructorDescriptionVinePlantModule(IBuildingExtension field, String fieldTag, String workTag, net.minecraft.world.item.Item item) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected intThe percentage of positions the planter should always leave present at the bare minimum.net.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 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.PercentageHarvestPlantModule
decideFieldWork, getActionLimit, getNextWorkingPosition, getPositionToWalkTo, getRequiredItemsForOperation, isValidClearingBlock, isValidPlantingBlockMethods inherited from class com.minecolonies.core.colony.buildings.workerbuildings.plantation.AbstractPlantationModule
applyBonemeal, equals, getFieldTag, getItem, getMaxWorkingPositions, getPlantsToRequest, getValidBonemeal, getValidWorkingPositions, 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
-
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: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.
-
isValidHarvestBlock
protected boolean isValidHarvestBlock(net.minecraft.world.level.block.state.BlockState blockState) Description copied from class:PercentageHarvestPlantModuleCheck if the block is a correct block for harvesting.- Specified by:
isValidHarvestBlockin classPercentageHarvestPlantModule- Parameters:
blockState- the block state.- Returns:
- whether the block can be harvested.
-
getMinimumPlantPercentage
protected int getMinimumPlantPercentage()Description copied from class:PercentageHarvestPlantModuleThe 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:
getMinimumPlantPercentagein classPercentageHarvestPlantModule- Returns:
- a percentage of plants to always leave be.
-