fix(mysql): ensure teleport data is cleared when updating (#794)

This commit is contained in:
Rubén authored and GitHub committed 2025-04-06 14:21:46 +01:00
1 parent 1d306c2e23
commit c3751b5cde
1 file changed
+4 -1
@@ -912,7 +912,10 @@ public class MySqlDatabase extends Database {
if (teleport != null) {
try (PreparedStatement statement = connection.prepareStatement(format("""
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.setInt(2, setPosition((Position) teleport.getTarget(), connection));
statement.setInt(3, teleport.getType().getTypeId());