PrisonTeam / Prison

The home of the Prison project, a Minecraft plugin to provide mining and ranking gameplay experience.
https://www.spigotmc.org/resources/prison.1223/
Other
127 stars 50 forks source link

Auto pickup cancelling BlockBreakEvent #178

Closed datatags closed 3 years ago

datatags commented 3 years ago

Hello, I was wondering if there is a specific reason the BlockBreakEvent is cancelled when auto pickup works. (https://github.com/PrisonTeam/Prison/blob/master/prison-spigot/src/main/java/tech/mcprison/prison/spigot/autofeatures/AutoManagerFeatures.java) The reason I'm asking is that it breaks plugins that only run code if the event wasn't cancelled, specifically my plugin CommandMineRewards. If you can proceed without cancelling it that would be great, or if you have a workaround for it, that could work too. CMR cannot just run even when the event is cancelled because it should not issue rewards if the block doesn't actually break.

Thanks!

rbluer commented 3 years ago

Because if the event is not canceled then it would result in a double drop... a normal drop and a second drop in the players inventory.

That's why the event gets canceled. It must.

Please visit our discord server and you can DM me directly (RoyalBlueRanger). I'd be happy to talk to you about this and see if there is some kind of a work around on either side of things

datatags commented 3 years ago

Does event.getDrops().clear() not prevent the items from dropping?

I don't really do discord, sorry

GABRYCA commented 3 years ago

There're tons of issues when using it, sometimes it doesn't even cancel drops and others cancel the whole world drops. We're working on some fixes right now, so maybe this won't be an issue in the future.

datatags commented 3 years ago

Ok, thanks for the quick replies! I'll close this for now and see if I can work something out. Thanks again!