bspkrs / Treecapitator

DaftPVF's Treecapitator mod for Minecraft. Chops down trees in a single blow. Requires bspkrsCore.
http://www.minecraftforum.net/topic/1009577-
42 stars 36 forks source link

HarvestDropsEvent is bypassed when stackDrops is true #32

Open squeek502 opened 9 years ago

squeek502 commented 9 years ago

Relevant code on the 1.7.10 branch:

                    if (TCSettings.stackDrops)
                        addDrop(block, metadata, pos);
                    else if (TCSettings.itemsDropInPlace)
                        block.dropBlockAsItem(world, pos.x, pos.y, pos.z, metadata, EnchantmentHelper.getFortuneModifier(player));
                    else
                        block.dropBlockAsItem(world, startPos.x, startPos.y, startPos.z, metadata, EnchantmentHelper.getFortuneModifier(player));

block.dropBlockAsItem has some extra Forge logic, calling ForgeEventFactory.fireBlockHarvesting to allow the HarvestDropsEvent to modify the drops of a block.

Adding a ForgeEventFactory.fireBlockHarvesting call to this code block would allow consistent functionality and compatibility with mods that modify drops in that Forge event.