SPIGOT-6899: Add Player#getPreviousGameMode

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot 2022-01-17 10:12:15 +11:00
parent 4c024e72f9
commit 474603beb3

View File

@ -1001,6 +1001,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return GameMode.getByValue(getHandle().gameMode.getGameModeForPlayer().getId());
}
@Override
public GameMode getPreviousGameMode() {
EnumGamemode previousGameMode = getHandle().gameMode.getPreviousGameModeForPlayer();
return (previousGameMode == null) ? null : GameMode.getByValue(previousGameMode.getId());
}
@Override
public void giveExp(int exp) {
getHandle().giveExperiencePoints(exp);