diff options
| author | Myles <mylesandmore9@gmail.com> | 2022-12-02 19:27:54 -0600 | 
|---|---|---|
| committer | Myles <mylesandmore9@gmail.com> | 2022-12-02 19:27:54 -0600 | 
| commit | 1bd5aeeadf2449fcadcf78641f086e5d285d5bae (patch) | |
| tree | cb2a084ae84a802e2781c97dff96fec400a37a11 /src | |
| parent | fc6d55c3fcdc23c841d0e61f1e9f46b04a815c95 (diff) | |
| download | Tumble-1bd5aeeadf2449fcadcf78641f086e5d285d5bae.tar.gz Tumble-1bd5aeeadf2449fcadcf78641f086e5d285d5bae.tar.bz2 Tumble-1bd5aeeadf2449fcadcf78641f086e5d285d5bae.zip  | |
I CANT DO THIS
by that I mean editing without an ide
seriously the chromebook is AWFUL :((((
Diffstat (limited to '')
| -rw-r--r-- | src/main/java/com/MylesAndMore/tumble/Game.java | 42 | 
1 files changed, 21 insertions, 21 deletions
diff --git a/src/main/java/com/MylesAndMore/tumble/Game.java b/src/main/java/com/MylesAndMore/tumble/Game.java index 6135cfd..2161e2f 100644 --- a/src/main/java/com/MylesAndMore/tumble/Game.java +++ b/src/main/java/com/MylesAndMore/tumble/Game.java @@ -1,17 +1,18 @@  package com.MylesAndMore.tumble; -import com.MylesAndMore.tuble.TumbleManager; +import com.MylesAndMore.tumble.TumbleManager;  import org.bukkit.Bukkit;  import org.bukkit.entity.Player;  import org.bukkit.Location;  import org.bukkit.World; -import Java.util.Arrays; -import Java.util.Collections; -import Java.util.List; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Objects;  public final class Game { -    // Define the gameInstnace +    // Define the gameInstance      private static Game gameInstance;      // Private Game() constructor for singleton instance @@ -21,22 +22,22 @@ public final class Game {      // Define local game vars      // The gameType keeps the current game type (shocker) -    String gameType = null; +    static String gameType = null;      // Creates a new Game      // This will return true if the game succeeds creation, and false if not      private static boolean createGame() {          if (Objects.equals(TumbleManager.getGameType(), "shovels")) {              // shovels logic -            gameType = "shovels" +            gameType = "shovels";          }          else if (Objects.equals(TumbleManager.getGameType(), "snowballs")) {              // snowballs -            gameType = "snowballs" +            gameType = "snowballs";          }          else if (Objects.equals(TumbleManager.getGameType(), "mixed")) {              // mixed (choose random shovels or snowballs) -            gameType = "mixed" +            gameType = "mixed";          }          else {              // The game type in the config did not match a specified game type; return false to signify that @@ -45,32 +46,31 @@ public final class Game {          return true;      } -    private static boolean sendPlayers() { +    private static void sendPlayers() {          World gameWorld = Bukkit.getWorld(TumbleManager.getGameWorld());          // Define the game world's spawnpoint as a new Location -        Location gameSpawn = new Location(gameWorld.getSpawnLocation()); +        Location gameSpawn = gameWorld.getSpawnLocation();          // Get the X, Y, and Z coords of that location -        int x = gameSpawn.getX(); -        int y = gameSpawn.getY(); -        int z = gameSpawn.getZ(); +        double x = gameSpawn.getX(); +        double y = gameSpawn.getY(); +        double z = gameSpawn.getZ();          // Create Locations to scatter players around the first layer          // These are just edited off the original spawn location;          // they assume that the first layer has a radius of 17 blocks (it always will w/ the current generator code)          List<Location> scatterLocations = Arrays.asList( -            new Location(gameWorld, (x - 16), y, z); -            new Location(gameWorld, x, y, (z - 16)); -            new Location(gameWorld, (x + 16), y, z);; -            new Location(gameWorld, x, y, (z + 16)) -        ); +            new Location(gameWorld, (x - 16), y, z), +            new Location(gameWorld, x, y, (z - 16)), +            new Location(gameWorld, (x + 16), y, z), +            new Location(gameWorld, x, y, (z + 16)));          // Shuffle the location list so players don't always spawn in the same location (basically, actually scatter the locations)          Collections.shuffle(scatterLocations);          // While there are still players in the lobby, send them to the gameWorld          // This is just a way of sending everybody in the lobby to the game -        for (List<Player> playersInLobby = TumbleManager.getPlayersInLobby(); playersInLobby.size() > 0; playersInLobby = TumbleManager.getPlayersInLobby() & scatterLoations.remove(0)) { +        for (List<Player> playersInLobby = TumbleManager.getPlayersInLobby(); playersInLobby.size() > 0; playersInLobby = TumbleManager.getPlayersInLobby(), scatterLocations.remove(0)) {              // Get a singular player from the player list              Player aPlayer = playersInLobby.get(0);              // Get a singular location from the scatter list -            Location aLocation = scatterLoations.get(0); +            Location aLocation = scatterLocations.get(0);              // Teleport that player to that scatter location              aPlayer.teleport(aLocation);          }  | 
