Weeding producing extra crop-sticks
dshadowwolf opened this issue ยท 3 comments
Recently spotted that using a hand-rake to weed seems to be giving me crop-sticks in addition to weed seeds. I'm pretty certain that giving me crop-sticks and leaving the set in the world is not an intended effect.
You're welcome!
[For later reference: line 395.]
I was just looking at the related code, so I can at least link to the probable cause of this.
- In the TileEntityCrops::getDrops method, crop sticks are included with the drops. L138
- And that method (different from the Block or Event variations) is called in at least four different places:
Speculation: Given that three out of the four are when the crop is being destroyed, the simplest solution I can think of is to change the lambda inside TileEntityCrop::onRaked to filter out crop sticks. I don't have an IDE in front of me right now, but perhaps something like:
stack -> if (stack.getItem() != AgriItems.getInstance().CROPS) WorldHelper.spawnItemInWorld(this.worldObj, this.pos, stack)
Hope any of this is helpful!
This has been fixed for the next alpha. Thanks for the report!
Also, thanks @CodesCubesAndCrashes for the in-depth analysis!