Event.getGame -> method does not exist?

Hey guys,
Today I opened Intelliji, cause I wanted to work on my plugin.
Unfortunately, I noticed, that there is something wrong in my code / new in the api.

Following problem:

So as you can see, I can’t get the Game object with event.getGame() as I did it before, because the method getGame() does not exist any more.

Question: how can I get the game object now by using the GameStartedEvent?

You can’t.

The game object was removed from the event.

You have two options.

Put this code in your main class.

@Inject
private Game game;

OR

use Sponge.getGame()

Hope that helps. ^^

2 Likes

This was mentioned in the major API breakage PSA.

2 Likes