BuildCraft|Core

BuildCraft|Core

7M Downloads

Quarry and HarvestDropsEvent

DemoXinMC opened this issue · 5 comments

commented

It has come to my attention that the Quarry does not fire the HarvestDropsEvent event when breaking blocks. HarvestDropsEvent is used to edit the potential drops from blocks when they are broken.

If the Quarry could be adjusted to fire this event (BlockEvent::HarvestDropsEvent) and then get the dropped items from the event's values after that, it would bring the Quarry inline with the way standard pickaxes work.

commented

I am unsure if this is a deliberate choice or not ; the devs may not want
the Quarry to be used as a 1 stop block collector, good for all
situations. Which blocks use that event?
On 19 Nov 2013 11:54, "DemoXin" [email protected] wrote:

It has come to my attention that the Quarry does not fire the
HarvestDropsEvent event when breaking blocks. HarvestDropsEvent is used to
edit the potential drops from blocks when they are broken.

If the Quarry could be adjusted to fire this event
(BlockEvent::HarvestDropsEvent) and then get the dropped items from the
event's values after that, it would bring the Quarry inline with the way
standard pickaxes work.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1324
.

commented

Forge itself calls the event for any blocks that are broken with the necessary tool or hand that would yield a drop.

EDIT: This includes all vanilla blocks.

EDIT2:
Furthering my research has shown that the HarvestDropsEvent is fired during Block.dropBlockAsItemWithChance, through ForgeEventFactory.fireBlockHarvesting, which returns a float between 0.0f and 1.0f and an ArrayList<ItemStack> that is iterated with each stack being checked and the float acting as a percentage-based chance to drop.

commented

Someone could also alter the array list adding more items - this change would add maximum compatibility with mods.

commented

Make a PR. ;)

commented

Its been added.