This commit is contained in:
boy0001 2015-09-14 18:20:25 +10:00
parent 5137b23357
commit 91bfcd0deb
2 changed files with 5 additions and 2 deletions

View File

@ -26,6 +26,8 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import com.intellectualcrafters.plot.PS;
/** /**
* Connects to and uses a MySQL database * Connects to and uses a MySQL database
* *
@ -71,6 +73,7 @@ public class MySQL extends Database {
return connection; return connection;
} }
Class.forName("com.mysql.jdbc.Driver"); Class.forName("com.mysql.jdbc.Driver");
PS.debug("jdbc:mysql://" + hostname + ":" + port + "/" + database);
connection = DriverManager.getConnection("jdbc:mysql://" + hostname + ":" + port + "/" + database, user, password); connection = DriverManager.getConnection("jdbc:mysql://" + hostname + ":" + port + "/" + database, user, password);
return connection; return connection;
} }

View File

@ -487,10 +487,10 @@ public class MainUtil {
final Location top = getPlotTopLoc(plot.world, plot.id); final Location top = getPlotTopLoc(plot.world, plot.id);
final Location bot = getPlotBottomLoc(plot.world, plot.id).add(1, 0, 1); final Location bot = getPlotBottomLoc(plot.world, plot.id).add(1, 0, 1);
final int x = ((top.getX() - bot.getX()) / 2) + bot.getX(); 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 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()); 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) { public static boolean teleportPlayer(final PlotPlayer player, final Location from, final Plot plot) {