Grenades crashing server when chunk is loaded
victorbetoni opened this issue ยท 3 comments
Apparently the problem is in this line: Line
for some reason the grenade still activated even after the chunk is unloaded, and tries to be activated again when the chunk loads, resulting in a server crash.
I didn't express myself very well, but basically: The grenade that was crashing my server was specifically the flashbang, bc when the flashbang's entity is loaded and it still activated, it calls the FlashGrenadeEntity#flash() method, and this method tries to get the entities around the flashbang to flash them, but it's too early to do it, resulting in a crash. I didn't get any stacktrace in the console, just a crash report which mentioned this line: at com.craftingdead.core.entity.grenade.FlashGrenadeEntity.flash(FlashGrenadeEntity.java:90)
Btw, I applied a workaround with mixins in this line, passing false to setActivated() every time. Worked well