File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
src/main/java/org/spongepowered/api
entity/living/player/server Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -934,7 +934,7 @@ public final class Keys {
934934 public static final Key <Value <Ticks >> FUSE_DURATION = Keys .key (ResourceKey .sponge ("fuse_duration" ), Ticks .class );
935935
936936 /**
937- * The {@link GameMode} a {@link Humanoid } has.
937+ * The {@link GameMode} a {@link ServerPlayer } has.
938938 */
939939 public static final Key <Value <GameMode >> GAME_MODE = Keys .key (ResourceKey .sponge ("game_mode" ), GameMode .class );
940940
@@ -2181,6 +2181,11 @@ public final class Keys {
21812181 */
21822182 public static final Key <Value <Integer >> POWER = Keys .key (ResourceKey .sponge ("power" ), Integer .class );
21832183
2184+ /**
2185+ * The previous {@link GameMode} of a {@link ServerPlayer}. Readonly.
2186+ */
2187+ public static final Key <Value <GameMode >> PREVIOUS_GAME_MODE = Keys .key (ResourceKey .sponge ("previous_game_mode" ), GameMode .class );
2188+
21842189 /**
21852190 * A {@link Beacon}'s primary effect.
21862191 */
Original file line number Diff line number Diff line change @@ -344,6 +344,15 @@ default Value.Mutable<GameMode> gameMode() {
344344 return this .requireValue (Keys .GAME_MODE ).asMutable ();
345345 }
346346
347+ /**
348+ * {@link Keys#PREVIOUS_GAME_MODE}
349+ *
350+ * @return The previous game mode of the player
351+ */
352+ default Value <GameMode > previousGameMode () {
353+ return this .requireValue (Keys .PREVIOUS_GAME_MODE );
354+ }
355+
347356 /**
348357 * {@link Keys#STATISTICS}
349358 *
You can’t perform that action at this time.
0 commit comments