Make Tree Crops give drop directly to player
milkev opened this issue ยท 3 comments
Make sure you are not opening a duplicate.
- I have searched the issue tracker and did not find an issue describing my bug.
Description of your suggestion.
When harvesting tree crops, more often than not, they rise up above the tree, onto the top of it. it makes it a pain to go pick them up, and, atleast for me, has resulted in ignoring most of the tree crops.
it would be great if the harvested items dropped below the tree crop block, or if they were just given directly to the player. this would make harvesting from trees a lot less painful.
yup, going to make them drop on the player instead of at the block location most likely.
I'd rather suggest dropping the items with a direction. That way, for example, the harvest falls down, if the leaf block is used from below:
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
if (getAge(state) == getMaxAge()) {
world.setBlockState(pos, this.withAge(0), 2);
if (world instanceof ServerWorld) {
getDroppedStacks(state, (ServerWorld)world, pos, null).forEach((stack) -> {
dropStack(world, pos, hit.getSide(), stack);
});
state.onStacksDropped((ServerWorld)world, pos, ItemStack.EMPTY);
return ActionResult.CONSUME;
}
return ActionResult.SUCCESS ;
}
return ActionResult.PASS;
}
Also, use ActionResult.SUCCESS
on the client, so it shows the arm swing animation. (This should also be done in CroptopiaCropBlock.onUse
)