mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Finish cross-server respawning, close #123
This commit is contained in:
1 parent
f0d9807ee4
commit
713bf2ea42
12 files changed
+70
-51
No files matched your search
@@ -566,7 +566,7 @@ public class MySqlDatabase extends Database {
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
try (Connection connection = getConnection()) {
|
||||
try (PreparedStatement statement = connection.prepareStatement(formatStatementTables("""
|
||||
SELECT `x`, `y`, `z`, `yaw`, `pitch`, `world_name`, `world_uuid`, `server_name`
|
||||
SELECT `x`, `y`, `z`, `yaw`, `pitch`, `world_name`, `world_uuid`, `server_name`, `type`
|
||||
FROM `%teleports_table%`
|
||||
INNER JOIN `%positions_table%` ON `%teleports_table%`.`destination_id` = `%positions_table%`.`id`
|
||||
WHERE `player_uuid`=?"""))) {
|
||||
@@ -637,10 +637,11 @@ public class MySqlDatabase extends Database {
|
||||
if (teleport != null) {
|
||||
try (Connection connection = getConnection()) {
|
||||
try (PreparedStatement statement = connection.prepareStatement(formatStatementTables("""
|
||||
INSERT INTO `%teleports_table%` (`player_uuid`, `destination_id`)
|
||||
VALUES (?,?);"""))) {
|
||||
INSERT INTO `%teleports_table%` (`player_uuid`, `destination_id`, `type`)
|
||||
VALUES (?,?,?);"""))) {
|
||||
statement.setString(1, user.uuid.toString());
|
||||
statement.setInt(2, setPosition(teleport.target, connection));
|
||||
statement.setInt(3, teleport.type.typeId);
|
||||
|
||||
statement.executeUpdate();
|
||||
}
|
||||
|
||||
@@ -649,10 +649,11 @@ public class SqLiteDatabase extends Database {
|
||||
if (teleport != null) {
|
||||
try {
|
||||
try (PreparedStatement statement = getConnection().prepareStatement(formatStatementTables("""
|
||||
INSERT INTO `%teleports_table%` (`player_uuid`, `destination_id`)
|
||||
VALUES (?,?);"""))) {
|
||||
INSERT INTO `%teleports_table%` (`player_uuid`, `destination_id`, `type`)
|
||||
VALUES (?,?,?);"""))) {
|
||||
statement.setString(1, user.uuid.toString());
|
||||
statement.setInt(2, setPosition(teleport.target, connection));
|
||||
statement.setInt(3, teleport.type.typeId);
|
||||
|
||||
statement.executeUpdate();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user