From a4c491876f935f56199d54909d1045a80551b0e4 Mon Sep 17 00:00:00 2001 From: CoolLoong <1542536763@qq.com> Date: Thu, 7 Mar 2024 01:44:03 +0800 Subject: [PATCH] fix: sql --- .../ms/kevi/plotplugin/command/defaults/HomesCommand.java | 2 +- src/main/java/ms/kevi/plotplugin/database/Database.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/ms/kevi/plotplugin/command/defaults/HomesCommand.java b/src/main/java/ms/kevi/plotplugin/command/defaults/HomesCommand.java index 98d039b..fd9af39 100644 --- a/src/main/java/ms/kevi/plotplugin/command/defaults/HomesCommand.java +++ b/src/main/java/ms/kevi/plotplugin/command/defaults/HomesCommand.java @@ -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)); diff --git a/src/main/java/ms/kevi/plotplugin/database/Database.java b/src/main/java/ms/kevi/plotplugin/database/Database.java index fe78f1a..74d573a 100644 --- a/src/main/java/ms/kevi/plotplugin/database/Database.java +++ b/src/main/java/ms/kevi/plotplugin/database/Database.java @@ -147,7 +147,7 @@ public List 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()); @@ -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());