mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 14:38:53 +00:00
fix(mysql): ensure teleport data is cleared when updating (#794)
This commit is contained in:
1 parent
1d306c2e23
commit
c3751b5cde
1 file changed
+4
-1
@@ -912,7 +912,10 @@ public class MySqlDatabase extends Database {
|
|||||||
if (teleport != null) {
|
if (teleport != null) {
|
||||||
try (PreparedStatement statement = connection.prepareStatement(format("""
|
try (PreparedStatement statement = connection.prepareStatement(format("""
|
||||||
INSERT INTO `%teleport_data%` (`player_uuid`, `destination_id`, `type`)
|
INSERT INTO `%teleport_data%` (`player_uuid`, `destination_id`, `type`)
|
||||||
VALUES (?,?,?);"""))) {
|
VALUES (?,?,?)
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
`destination_id` = VALUES(`destination_id`),
|
||||||
|
`type` = VALUES(`type`);"""))) {
|
||||||
statement.setString(1, user.getUuid().toString());
|
statement.setString(1, user.getUuid().toString());
|
||||||
statement.setInt(2, setPosition((Position) teleport.getTarget(), connection));
|
statement.setInt(2, setPosition((Position) teleport.getTarget(), connection));
|
||||||
statement.setInt(3, teleport.getType().getTypeId());
|
statement.setInt(3, teleport.getType().getTypeId());
|
||||||
|
|||||||
Reference in new issue
Block a user