From 91bfcd0deb4a520ff9c2f54010e04040179148b2 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Mon, 14 Sep 2015 18:20:25 +1000 Subject: [PATCH] Fixes #620 --- .../java/com/intellectualcrafters/plot/database/MySQL.java | 3 +++ .../java/com/intellectualcrafters/plot/util/MainUtil.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/intellectualcrafters/plot/database/MySQL.java b/src/main/java/com/intellectualcrafters/plot/database/MySQL.java index 34ffd1fd2..9998b0fb4 100644 --- a/src/main/java/com/intellectualcrafters/plot/database/MySQL.java +++ b/src/main/java/com/intellectualcrafters/plot/database/MySQL.java @@ -26,6 +26,8 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; +import com.intellectualcrafters.plot.PS; + /** * Connects to and uses a MySQL database * @@ -71,6 +73,7 @@ public class MySQL extends Database { return connection; } Class.forName("com.mysql.jdbc.Driver"); + PS.debug("jdbc:mysql://" + hostname + ":" + port + "/" + database); connection = DriverManager.getConnection("jdbc:mysql://" + hostname + ":" + port + "/" + database, user, password); return connection; } diff --git a/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java b/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java index 2bb00afb7..fffdd2720 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java +++ b/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java @@ -487,10 +487,10 @@ public class MainUtil { final Location top = getPlotTopLoc(plot.world, plot.id); final Location bot = getPlotBottomLoc(plot.world, plot.id).add(1, 0, 1); final int x = ((top.getX() - bot.getX()) / 2) + bot.getX(); - final int z = bot.getZ(); + final int z = bot.getZ() - 1; final PlotManager manager = PS.get().getPlotManager(plot.world); final int y = Math.max(getHeighestBlock(plot.world, x, z), manager.getSignLoc(PS.get().getPlotWorld(plot.world), plot).getY()); - return new Location(plot.world, x, y + 1, z - 1); + return new Location(plot.world, x, y + 1, z); } public static boolean teleportPlayer(final PlotPlayer player, final Location from, final Plot plot) {