Advertisement
reventcake295

code error apeared

Jun 13th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. public boolean LocationTest(Player player, World world) throws SQLException {
  2.         Location locatie = new Location(player.getWorld(), 0, 0, 0);
  3.         String worldSt = world.getName();
  4.         String worldname = "";
  5.         String uuid = player.getUniqueId().toString();
  6.  
  7.         if (worldSt == "survival") {
  8.             worldname = "survival_loc_store";
  9.         } else if (worldSt == "ASkyBlock") {
  10.             worldname = "skyblock_loc_store";
  11.         }
  12.  
  13.         // getting the location of the player if he was in these worlds
  14.         PreparedStatement statX = plugin.connection
  15.                 .prepareStatement("SELECT locX FROM revent." + worldname + " WHERE name = ?;");
  16.         statX.setString(1, uuid);
  17.         locatie.setX(Double.parseDouble(statX.executeQuery().getString(1)));
  18.  
  19.         if (locatie == new Location(player.getWorld(), 0, 0, 0)) {
  20.             return false;
  21.         } else
  22.             return true;
  23.  
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement