Sponge: Server crash when DetonateExplosiveEvent is cancelled

Created on 23 Nov 2017  路  8Comments  路  Source: SpongePowered/Sponge

Reopening here, original issue https://github.com/SpongePowered/SpongeVanilla/issues/349

Server encounters 'java.lang.IllegalStateException: not primed' and dies when DetonateExplosiveEvent is canceled.

Build number: 1.12.1-7.0.0-BETA-327
Server log: https://pastebin.com/peWkgXsQ

I am installing my plugin, but no other plugins.
This is the code that I guess causing this error:

@Listener
public void onDetonateExplosive(DetonateExplosiveEvent event) {
        event.setCancelled(true);
}

Same with SF 1.12.2-2529-7.0.0-BETA-2742.

accepted event bug 1.12

Most helpful comment

Not connected, but this seems to be an easy fix. I just need to test it.

All 8 comments

@JBYoshi I know you were fixing some things with explosions previously. Is this connected or could you handle this?

Not connected, but this seems to be an easy fix. I just need to test it.

@JBYoshi I'm not 100% sure that this is the correct fix, What is the correct definition of Primed? Maybe it shouldn't be checking the primed state at all?

"Primed" means it will explode. "Defuse" means cancelling a future (primed) explosion. During the event, the TNT is still "primed" because it only explodes after the event finishes.

Tested on SpongeForge 1.12 (bleeding branch)

I'm not able to reproduce the crash, this can be closed.

@ryantheleach you reopened this, status?

It was reopened based on looking at the code, not the error.

Basically, I see fused explosives as having the following timeline.

fuseTicking -> primed -> exploding.

The problem is the edge cases at the transitions, during the event the fix made it seem like a tnt could be BOTH in primed state and in exploding state.

In my mind they are mutually exclusive. exploding is the state after primed.

During the event, the TNT is still "primed" because it only explodes after the event finishes.

Covered most of the concerned I had, but is the TNT considered exploding in the detonate event if it happens before the explosion?

Closing this, open a new issue ryan and don't take over this issue. The original issue, the crash, is fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JoeSGT picture JoeSGT  路  5Comments

SjsolisZXA picture SjsolisZXA  路  3Comments

XakepSDK picture XakepSDK  路  5Comments

Grinch picture Grinch  路  4Comments

Xemiru picture Xemiru  路  3Comments