Class SeagrassPlantModule
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.BoneMealedPlantModule
com.minecolonies.core.colony.buildings.workerbuildings.plantation.modules.specific.SeagrassPlantModule
- All Implemented Interfaces:
IBuildingExtensionModule,IPlantationModule
Planter module for growing
Requirements:
Items.SEAGRASS.
Requirements:
- All requirements from
BoneMealedPlantModule - All working positions must have water directly overhead of them, else the seagrass won't be able to grow.
-
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
ConstructorsConstructorDescriptionSeagrassPlantModule(IBuildingExtension field, String fieldTag, String workTag, net.minecraft.world.item.Item item) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyBonemeal(AbstractEntityCitizen worker, net.minecraft.core.BlockPos workPosition, net.minecraft.world.item.ItemStack stackInSlot, net.minecraft.world.entity.player.Player fakePlayer) Logic for applying bonemeal to the 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.@NonNull List<net.minecraft.world.item.Item>Returns which items are considered valid bonemeal items.protected booleanisValidBonemealLocation(net.minecraft.world.level.block.state.BlockState blockState) Check if the block is a correct block for planting.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.BoneMealedPlantModule
decideFieldWork, getActionLimit, getMaxWorkingPositions, getNextWorkingPosition, getPercentageChance, getRequiredItemsForOperationMethods inherited from class com.minecolonies.core.colony.buildings.workerbuildings.plantation.AbstractPlantationModule
equals, getFieldTag, getItem, getPlantingBlockState, getPlantsToRequest, getPositionToWalkTo, 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
-
SeagrassPlantModule
public SeagrassPlantModule(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.
-
applyBonemeal
public void applyBonemeal(AbstractEntityCitizen worker, net.minecraft.core.BlockPos workPosition, net.minecraft.world.item.ItemStack stackInSlot, net.minecraft.world.entity.player.Player fakePlayer) Description copied from interface:IPlantationModuleLogic for applying bonemeal to the working position.- Specified by:
applyBonemealin interfaceIPlantationModule- Overrides:
applyBonemealin classAbstractPlantationModule- Parameters:
worker- the worker entity working on the plantation.workPosition- the position that has been chosen for work.stackInSlot- the item stack to use for the planting.fakePlayer- a fake player class to use.
-
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:BoneMealedPlantModuleCheck if the block is a correct block for harvesting. Defaults to check if the block state is not air.- Overrides:
isValidHarvestBlockin classBoneMealedPlantModule- Parameters:
blockState- the block state.- Returns:
- whether the block can be harvested.
-
isValidBonemealLocation
protected boolean isValidBonemealLocation(net.minecraft.world.level.block.state.BlockState blockState) Description copied from class:BoneMealedPlantModuleCheck if the block is a correct block for planting. Defaults to being any air block.- Overrides:
isValidBonemealLocationin classBoneMealedPlantModule- Parameters:
blockState- the block state.- Returns:
- whether the block can be planted.
-
getValidBonemeal
Description copied from interface:IPlantationModuleReturns which items are considered valid bonemeal items. Defaults to an empty list. (Most modules should not need any bonemeal).- Specified by:
getValidBonemealin interfaceIPlantationModule- Overrides:
getValidBonemealin classBoneMealedPlantModule
-