Skip to content

Commit

Permalink
fix: sql
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolLoong committed Mar 6, 2024
1 parent 7f44d7b commit a4c4918
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public boolean execute(Player player, String[] args) {
player.sendMessage(this.translate(player, TranslationKey.HOMES_ENTRY,
plots.get(plot.getManager()).indexOf(plot) + 1,
plot.getId(),
plot.getManager().getLevel().getName()
plot.getManager().getLevel().getFolderName()
));

player.sendMessage(this.translate(player, TranslationKey.HOMES_END));
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ms/kevi/plotplugin/database/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public List<Plot> getPlots(PlotManager manager) {

public DatabaseAction updatePlot(Plot plot) {
return connection -> {
final String levelName = plot.getManager().getLevel().getName();
final String levelName = plot.getManager().getLevel().getFolderName();

try (final PreparedStatement selectStatement = connection.prepareStatement("SELECT * FROM " + levelName + " WHERE id = ?")) {
selectStatement.setLong(1, plot.getId().asLong());
Expand Down Expand Up @@ -244,7 +244,7 @@ public DatabaseAction insertPlot(String levelName, PlotId plotId, String owner,

public DatabaseAction deletePlot(Plot plot) {
return connection -> {
final String levelName = plot.getManager().getLevel().getName();
final String levelName = plot.getManager().getLevel().getFolderName();

try (final PreparedStatement deleteStatement = connection.prepareStatement("DELETE FROM " + levelName + " WHERE id = ?")) {
deleteStatement.setLong(1, plot.getId().asLong());
Expand Down

0 comments on commit a4c4918

Please sign in to comment.