public abstract class HarvestHandler extends net.minecraftforge.registries.ForgeRegistryEntry<HarvestHandler>
RegistryEvent.Register| Modifier and Type | Class and Description |
|---|---|
static class |
HarvestHandler.SimpleHarvestHandler
A simple harvest handler which just compares against a list of blocks, without checking any blockstate properties.
|
| Constructor and Description |
|---|
HarvestHandler() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<net.minecraft.item.ItemStack> |
addFilterItems(net.minecraft.world.World world,
net.minecraft.world.IBlockReader chunkCache,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
IDrone drone)
Should add the items the connected item filters in the Harvest puzzle piece in the Programmer can use to determine if a block should be harvested.
|
abstract 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.
|
void |
harvest(net.minecraft.world.World world,
net.minecraft.world.IBlockReader chunkCache,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
IDrone drone)
Should actually harvest the block.
|
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.
|
public void harvest(net.minecraft.world.World world,
net.minecraft.world.IBlockReader chunkCache,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
IDrone drone)
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 block's positionstate - the blockstate at the positiondrone - the drone doing the harvestingpublic 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)
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 block's positionstate - the blockstate at the positiondrone - the drone doing the harvestingpublic abstract 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)
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 dronepublic java.util.List<net.minecraft.item.ItemStack> addFilterItems(net.minecraft.world.World world,
net.minecraft.world.IBlockReader chunkCache,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
IDrone drone)
canHarvest(World, IBlockReader, BlockPos, BlockState, IDrone), when that method returns trueworld - 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 blockposstate - the blockstatedrone - the drone