Class HarvestHandlerCactusLike
java.lang.Object
me.desht.pneumaticcraft.api.harvesting.HarvestHandler
me.desht.pneumaticcraft.common.harvesting.HarvestHandlerCactusLike
- Direct Known Subclasses:
HempHarvestHandler
-
Nested Class Summary
Nested classes/interfaces inherited from class me.desht.pneumaticcraft.api.harvesting.HarvestHandler
HarvestHandler.SimpleHarvestHandler -
Constructor Summary
ConstructorsConstructorDescriptionHarvestHandlerCactusLike(Predicate<net.minecraft.world.level.block.state.BlockState> blockChecker) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHarvest(net.minecraft.world.level.Level world, net.minecraft.world.level.BlockGetter chunkCache, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, IDrone drone) Determines if the currently checked block can be harvested.Methods inherited from class me.desht.pneumaticcraft.api.harvesting.HarvestHandler
addFilterItems, harvest, harvestAndReplant
-
Constructor Details
-
HarvestHandlerCactusLike
public HarvestHandlerCactusLike(Predicate<net.minecraft.world.level.block.state.BlockState> blockChecker)
-
-
Method Details
-
canHarvest
public boolean canHarvest(net.minecraft.world.level.Level world, net.minecraft.world.level.BlockGetter chunkCache, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, IDrone drone) Description copied from class:HarvestHandlerDetermines if the currently checked block can be harvested.- Specified by:
canHarvestin classHarvestHandler- Parameters:
world- the worldchunkCache- Use preferably methods from this cache as it's generally quicker than accessing via 'world'. The cache has access to the chunks that are accessed by the Drone current program, so as long as only the y pos is varied of the supplied pos, you are good. If not, use 'world'.pos- the blockpos to be checkedstate- the blockstatedrone- the drone- Returns:
- true if the block can be harvested, false if not.
-