Add event for player changing game mode (#7355)

This commit is contained in:
Ocelot authored and GitHub committed 2020-10-15 10:15:06 -07:00
1 parent 5f292895cb
commit 51fa230e7b
8 files changed
+176 -7

No files matched your search

@@ -0,0 +1,37 @@
package net.minecraftforge.client.event;
import net.minecraft.client.network.play.NetworkPlayerInfo;
import net.minecraft.world.GameType;
import net.minecraftforge.eventbus.api.Event;
/**
* Fired before the client player is notified of a change in game mode from the server.
*/
public class ClientPlayerChangeGameModeEvent extends Event
{
private final NetworkPlayerInfo info;
private final GameType currentGameMode;
private final GameType newGameMode;
public ClientPlayerChangeGameModeEvent(NetworkPlayerInfo info, GameType currentGameMode, GameType newGameMode)
{
this.info = info;
this.currentGameMode = currentGameMode;
this.newGameMode = newGameMode;
}
public NetworkPlayerInfo getInfo()
{
return info;
}
public GameType getCurrentGameMode()
{
return currentGameMode;
}
public GameType getNewGameMode()
{
return newGameMode;
}
}