Skip to content

Commit

Permalink
1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisKarolGajda committed Aug 18, 2022
1 parent a96c085 commit 434f830
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.opkarol.opc.api.commands;

import me.opkarol.opc.api.utils.FormatUtils;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
Expand All @@ -21,4 +22,12 @@ public boolean isPlayer() {

return getPlayer();
}

public void sendMessage(String message) {
if (isPlayer()) {
sender.sendMessage(FormatUtils.formatMessage(message));
} else {
sender.sendMessage(message);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ public interface IMySqlDatabase {

void delete(@NotNull MySqlDeleteTable table);

ResultSet get(String getValue);
ResultSet get(MySqlTable getValue);
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public void delete(@NotNull MySqlDeleteTable table) {
}

@Override
public ResultSet get(String table) {
public ResultSet get(MySqlTable table) {
try (Connection conn = source.getConnection();
PreparedStatement stmt = conn.prepareStatement(String.format("SELECT * FROM `%s`", table))) {
PreparedStatement stmt = conn.prepareStatement(String.format("SELECT * FROM `%s`", table.getTableName()))) {
return stmt.executeQuery();
} catch (SQLException e) {
e.printStackTrace();
Expand Down

0 comments on commit 434f830

Please sign in to comment.