Class SeapicklePlantModule
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.SeapicklePlantModule
- 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
ConstructorsConstructorDescriptionSeapicklePlantModule(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.decideFieldWork(net.minecraft.world.level.Level world, @NotNull net.minecraft.core.BlockPos workPosition) Core function for the planter module, is responsible for telling the AI what to do on the specific field.protected intGet the maximum amount of working positions this field is allowed to handle.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
getActionLimit, getNextWorkingPosition, getPercentageChance, getRequiredItemsForOperationMethods inherited from class com.minecolonies.core.colony.buildings.workerbuildings.plantation.AbstractPlantationModule
equals, getFieldTag, getItem, getPlantingBlockState, getPlantsToRequest, getPositionToWalkTo, getRequiredResearchEffect, 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
-
SeapicklePlantModule
public SeapicklePlantModule(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
-
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.
-
decideFieldWork
public IPlantationModule.PlantationModuleResult.Builder decideFieldWork(net.minecraft.world.level.Level world, @NotNull @NotNull net.minecraft.core.BlockPos workPosition) Description copied from interface:IPlantationModuleCore function for the planter module, is responsible for telling the AI what to do on the specific field.- Specified by:
decideFieldWorkin interfaceIPlantationModule- Overrides:
decideFieldWorkin classBoneMealedPlantModule- Parameters:
world- the world reference that can be used for block state lookups.workPosition- the position that has been chosen for work.- Returns:
- a basic enum state telling the planter AI what the AI should be doing next.
-
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.
-
getMaxWorkingPositions
protected int getMaxWorkingPositions()Description copied from class:AbstractPlantationModuleGet the maximum amount of working positions this field is allowed to handle. Defaults toAbstractPlantationModule.DEFAULT_MAX_PLANTS.- Overrides:
getMaxWorkingPositionsin classBoneMealedPlantModule- Returns:
- the maximum amount of plants.
-
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
-
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.
-