public abstract class HarvestHandlerAbstractCrop extends HarvestHandler
HarvestHandler.SimpleHarvestHandler| Constructor and Description |
|---|
HarvestHandlerAbstractCrop(java.util.function.Predicate<net.minecraft.block.BlockState> blockChecker) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHarvest(net.minecraft.world.World world,
net.minecraft.world.IBlockReader chunkCache,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
IDrone drone)
Determines if the currently checked block can be harvested.
|
boolean |
harvestAndReplant(net.minecraft.world.World world,
net.minecraft.world.IBlockReader chunkCache,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
IDrone drone)
Should harvest the block (drop items), and replant the plant if applicable.
|
protected abstract boolean |
isMaxAge(net.minecraft.block.BlockState state) |
protected abstract boolean |
isSeed(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
net.minecraft.item.ItemStack stack) |
protected abstract net.minecraft.block.BlockState |
withMinAge(net.minecraft.block.BlockState state) |
addFilterItems, harvestpublic HarvestHandlerAbstractCrop(java.util.function.Predicate<net.minecraft.block.BlockState> blockChecker)
public boolean canHarvest(net.minecraft.world.World world,
net.minecraft.world.IBlockReader chunkCache,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
IDrone drone)
HarvestHandlercanHarvest in class HarvestHandlerworld - 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 dronepublic boolean harvestAndReplant(net.minecraft.world.World world,
net.minecraft.world.IBlockReader chunkCache,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
IDrone drone)
HarvestHandlerharvestAndReplant in class HarvestHandlerworld - 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 block's positionstate - the blockstate at the positiondrone - the drone doing the harvestingprotected abstract boolean isSeed(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
net.minecraft.item.ItemStack stack)
protected abstract boolean isMaxAge(net.minecraft.block.BlockState state)
protected abstract net.minecraft.block.BlockState withMinAge(net.minecraft.block.BlockState state)