mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 17:57:34 +01:00
SPIGOT-6899: Add Player#getPreviousGameMode
By: Doc <nachito94@msn.com>
This commit is contained in:
parent
4c024e72f9
commit
474603beb3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user