diff options
Diffstat (limited to 'src/main/java/com/MylesAndMore/tumble/Game.java')
-rw-r--r-- | src/main/java/com/MylesAndMore/tumble/Game.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/com/MylesAndMore/tumble/Game.java b/src/main/java/com/MylesAndMore/tumble/Game.java index 8f0af60..63c68df 100644 --- a/src/main/java/com/MylesAndMore/tumble/Game.java +++ b/src/main/java/com/MylesAndMore/tumble/Game.java @@ -182,6 +182,15 @@ public class Game { } } + private void setSurvival() { + for (List<Player> spectators = gamePlayers; spectators.size() > 0; spectators.remove(0)) { + // Get a singular player from the player list + Player spectatorPlayer = spectators.get(0); + // Set that player's gamemode to survival + spectatorPlayer.setGameMode(GameMode.SURVIVAL); + } + } + public void itemDamage(PlayerItemDamageEvent event) { // If the game type is shovels, if (Objects.equals(roundType, "shovels")) { @@ -224,7 +233,7 @@ public class Game { // A new method will need to be written for this; current one only supports lobby // Set their gamemodes to survival - + setSurvival(); } } |