[SPIGOT-1581] BlockBreakEvent doesn't get called in a specific case. Created: 01/Mar/16 Updated: 02/Jul/16 Resolved: 02/Jul/16 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | kukelekuuk | Assignee: | Unassigned |
Resolution: | Done | Votes: | 0 |
Labels: | Craftbukkit |
Description |
https://gist.github.com/kukelekuuk00/ade3b6a1485788fb1250 Here I have a piece of code that lets me hook into creating, interacting and destroying signs. Or at least, that's what it was supposed to do. I cut out most of the code. Right now only the creating and interacting part remains. The problem I'm having here is that whenever I create signs I can't break them any more. They don't even call a blockbreakevent. But the moment I remove the sign type from the titles array it'll work just fine. I can't wrap my head around this. It makes no sense. By all means it SHOULD call the blockbreakevent, but it doesn't. http://www.mediafire.com/download/b44budwrj09tlm9/SignAPITest-1.0-SNAPSHOT.jar The jar file. I tested it on craftbukkit and spigot 1.9. (but it happens on previous versions, too) |
Comments |
Comment by kukelekuuk [ 09/Apr/16 ] |
Wow, such a basic mistake, yet so easily overlooked. I can't thank you enough. |
Comment by blablubbabc [ 09/Apr/16 ] |
You are cancelling the PlayerInteractionEvent, if the player left clicks (= starts breaking) your special sign. If you cancel that interaction, it will not trigger a block break and therefore you never get any BlockBreakEvents for your special sign blocks. |
Comment by kukelekuuk [ 19/Mar/16 ] |
Anything? I have no idea why this doesn't work, so I can't figure out how to work around it. It really put my plugin development to a halt, considering I have multiple plugins that rely on a central sign management system. |