CustomBlockData icon indicating copy to clipboard operation
CustomBlockData copied to clipboard

Data does not get removed from blocks that are indirectly broken

Open SirMrStep opened this issue 3 years ago • 8 comments

I've noticed that for blocks like cactus where when the bottom block get's broken all the cactus blocks above break, the data will not get removed from the block and stays there until something is either placed in it's location or it is manually removed. To fix this I suggest getting the cactus blocks above the broken cactus and removing data from them if they have any.

SirMrStep avatar Jun 29 '22 10:06 SirMrStep

Noted. IIRC there's some event for that but I currently don't remember the name. I'm on vacation anyway until july 17th, so feel free to PR if you don't wanna wait :P

mfnalex avatar Jun 29 '22 12:06 mfnalex

There is a BlockGrowEvent but I have no idea when that was added to the api so for the sake of backwards compatibility (if you care about that) I'd just grab the blocks above. I can make a quick and dirty PR for this issue and the other one I posted. They will be done in a bit.

SirMrStep avatar Jun 29 '22 19:06 SirMrStep

Turns out you were right, BlockPhysicsEvent can capture any blocks updated or broken in any way. Made a pull request fixing both this and #7

SirMrStep avatar Jul 02 '22 16:07 SirMrStep

Thanks, I'll merge this after having tested it after my vacation

mfnalex avatar Jul 10 '22 15:07 mfnalex