Project-Poseidon icon indicating copy to clipboard operation
Project-Poseidon copied to clipboard

Breaking a block on the last use of your tool doesn't drop the correct item

Open quickplot opened this issue 3 years ago • 3 comments

If you break a block that needs a certain tool to successfully drop it's item you will get nothing if that tool is on it's last use and breaks after mining the block. The issue is that item breaking is handled earlier in the tick than determining drops. The code that handles tools breaking is here https://github.com/RhysB/Project-Poseidon/blob/master/src/net/minecraft/server/ItemStack.java#L127 and the code that handles item drops for ores is here https://github.com/RhysB/Project-Poseidon/blob/master/src/net/minecraft/server/ItemPickaxe.java#L11 (there's other items that need tools to properly drop like shears on leaves, so those need fixing too)

quickplot avatar Mar 04 '23 03:03 quickplot

I will try to reproduce and fix this. However, I'm not sure if it won't possibly create any duplication glitches?

ghost avatar Mar 07 '23 06:03 ghost

You can probably just backport a fix from a newer version of Minecraft

quickplot avatar Mar 09 '23 19:03 quickplot

Works as intended tbh. Unless you want it as an option, then sure

Moresteck avatar Mar 09 '23 20:03 Moresteck