home, sethome and homelist implementation

This commit is contained in:
William committed 2022-05-28 23:03:04 +01:00
1 parent 5e793e8ec7
commit 0e33fb8014
18 files changed
+349 -138

No files matched your search

@@ -205,7 +205,7 @@ public class MySqlDatabase extends Database {
return CompletableFuture.supplyAsync(() -> {
try (Connection connection = getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(formatStatementTables("""
SELECT `uuid`, `username`
SELECT `uuid`, `username`, `home_slots`, `ignoring_requests`, `rtp_cooldown`
FROM `%players_table%`
WHERE `username`=?"""))) {
statement.setString(1, name);
@@ -232,7 +232,7 @@ public class MySqlDatabase extends Database {
return CompletableFuture.supplyAsync(() -> {
try (Connection connection = getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(formatStatementTables("""
SELECT `uuid`, `username`
SELECT `uuid`, `username`, `home_slots`, `ignoring_requests`, `rtp_cooldown`
FROM `%players_table%`
WHERE `uuid`=?"""))) {
@@ -445,7 +445,7 @@ public class MySqlDatabase extends Database {
}
}
} catch (SQLException e) {
getLogger().log(Level.SEVERE, "Failed to query a player's home by UUID", e);
getLogger().log(Level.SEVERE, "Failed to query a player's home by uuid", e);
}
return Optional.empty();
});
@@ -175,7 +175,7 @@ public class SqLiteDatabase extends Database {
return CompletableFuture.supplyAsync(() -> {
try {
try (PreparedStatement statement = getConnection().prepareStatement(formatStatementTables("""
SELECT `uuid`, `username`
SELECT `uuid`, `username`, `home_slots`, `ignoring_requests`, `rtp_cooldown`
FROM `%players_table%`
WHERE `username`=?"""))) {
statement.setString(1, name);
@@ -202,7 +202,7 @@ public class SqLiteDatabase extends Database {
return CompletableFuture.supplyAsync(() -> {
try {
try (PreparedStatement statement = getConnection().prepareStatement(formatStatementTables("""
SELECT `uuid`, `username`
SELECT `uuid`, `username`, `home_slots`, `ignoring_requests`, `rtp_cooldown`
FROM `%players_table%`
WHERE `uuid`=?"""))) {
@@ -609,6 +609,7 @@ public class SqLiteDatabase extends Database {
@Override
public CompletableFuture<Void> setLastPosition(@NotNull User user, @NotNull Position position) {
System.out.println("teleport b3.5");
return CompletableFuture.runAsync(() -> {
try {
try (PreparedStatement statement = getConnection().prepareStatement(formatStatementTables("""