`CHUNK_UNLOAD` event is never fired
Kneelawk opened this issue ยท 0 comments
The Issue
After doing some testing with the CHUNK_UNLOAD event, I have not been able to find any circumstance under which it is called. Most importantly CHUNK_UNLOAD is not currently fired when unloading the world, meaning that using it to ignore unloading-type INVALIDATE events cannot be done.
Currently LMP makes use of LBA's UnloadableBlockEntity which is where the bug seems to originate, as LBA never seems to call UnloadableBlockEntity.onChunkUnload, as described in AlexIIL/LibBlockAttributes#50.
Potential Solution
One solution would be to fix LBA's UnloadableBlockEntity calling mechanism, possibly to make use of FAPI's ServerChunkEvents.CHUNK_UNLOAD and ClientChunkEvents.CHUNK_UNLOAD events.
However, given the existence of FAPI's CHUNK_UNLOAD events, it might not be needed for the UnloadableBlockEntity interface to even exist any more, especially given that it is located in the mixin.api package, suggesting that it might not actually be LBA public API anyways. Instead, LMP could just make use of FAPI's CHUNK_UNLOAD events directly.