SpongePowered / SpongeForge

A Forge mod that implements SpongeAPI
http://www.spongepowered.org/
MIT License
1.14k stars 306 forks source link

GameStoppingServerEvent not firing #471

Closed TypicalDarkness closed 8 years ago

TypicalDarkness commented 8 years ago

For some reason this doesn't fire:

@Listener void onServerStop(GameStoppingServerEvent e) {}

Tested on 979.

TypicalDarkness commented 8 years ago

I guess this is has nothing to do with SpongeForge. I'll open the issue at SpongeAPI

gabizou commented 8 years ago

@TypicalDarkness It does have to do with the implementation, not API.

JBYoshi commented 8 years ago

I have a PR that fixes this - #425.

simon816 commented 8 years ago

@JBYoshi that's for GameStoppingEvent, this is GameStoppingServerEvent

The event works fine

@Listener
public void onServerStop(GameStoppingServerEvent e) {
    System.out.println(e);
}
[STDOUT]: [com.simon816.eventtest.SpongePlugin:onServerStop:57]: net.minecraftforge.fml.common.event.FMLServerStoppingEvent@3e5d4255

@TypicalDarkness Ah, I think I know. You need to make your handler public, the code you've got there is package-private.