Chunky (Bukkit)

Chunky (Bukkit)

20.6k Downloads

onGenerationComplete function fires multiple times

MadeByIToncek opened this issue ยท 5 comments

commented

Hello, so I'm implementing Chunky support to my plugin and I've come across a strange bug. So if you start a job using api and then listen for generation finish using the onGenerationComplete() function in api, it actually triggers multiple times, messing up my whole code.

commented

The issue looks to be here:

chunky.getEventBus().call(new GenerationCompleteEvent(selection.world().getName()));

commented

That should only fire once, when the thread dies (there is only one thread).

Are you sure you aren't registering listeners multiple times?

commented

I'm assuming you've probably fixed this, given no response. If not, for further help with the Chunky API, please join the chunky support channel on the Discord server. Thank you!

commented

Hello, sorry for my late response. No, I'm not firing it multiple times. I've checked that. It actually spams it a few times. I've temporarily fixed this with simple boolean lock but it is not elegant at all. (Also the event fires a little bit before finishing)

commented

Hello, sorry for my late response. No, I'm not firing it multiple times. I've checked that. It actually spams it a few times. I've temporarily fixed this with simple boolean lock but it is not elegant at all. (Also the event fires a little bit before finishing)

Hi, no worries. I closed the issue since I assume this is not a bug, but an issue with using the API. I provide support through the Discord server and not through Github.

I can re-open this issue if you can provide evidence that this is indeed a bug. That can be done by providing a link to your project, or provide source code that will produce the incorrect behavior you claim to see. That way I can look into it further.