GlowstoneMC / Glowstone

A fast, customizable and compatible open source server for Minecraft: Java Edition
https://glowstone.net
Other
1.9k stars 273 forks source link

Fix dead bush drops nothing #833

Closed XuZhen86 closed 6 years ago

XuZhen86 commented 6 years ago

This pull request tries to fix the bug that dead bush drops nothing when breaks.

Observed behavior: Dead bush drops nothing when breaks.

Expected behavior:

Dead bushes drop 0–2 sticks when broken without shears. When shears are used, a dead bush will drop itself. If the block below the dead bush is removed, the bush will simply disappear without dropping anything. Dead Bush

Solution: Rewrite the getDrops() in BlockDeadBush. Returns nothing when tool == null Returns the dead bush when tool is a shear, otherwise return 0-2 sticks.

mastercoms commented 6 years ago

Thanks for your contribution to Glowstone!

mastercoms commented 6 years ago

Sorry, I missed your question about a tool null check. Items should be checked if they are empty, using InventoryUtil.