From 7d611c137dff8a99b7c8f8cd0322426c5fb8068a Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Sat, 24 Aug 2019 18:36:47 +0800 Subject: [PATCH] Purge old shop before creation Former-commit-id: 1bfcdc8e32caec92c77f5170249cfa725a58767b [formerly de367796aa3ff40fa500b97c2a21f18c2d4fcc3f] Former-commit-id: 86f79ca03bf4f938eaed750a557d87f2305a2a08 --- .../java/org/maxgamer/quickshop/Database/DatabaseHelper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/maxgamer/quickshop/Database/DatabaseHelper.java b/src/main/java/org/maxgamer/quickshop/Database/DatabaseHelper.java index f2ba8df60..755f2128c 100644 --- a/src/main/java/org/maxgamer/quickshop/Database/DatabaseHelper.java +++ b/src/main/java/org/maxgamer/quickshop/Database/DatabaseHelper.java @@ -101,6 +101,7 @@ public class DatabaseHelper { public void createShop(@NotNull Database db, @NotNull String owner, double price, @NotNull ItemStack item, int unlimited, int shopType, @NotNull String world, int x, int y, int z) throws SQLException { + removeShop(db,x,y,z,world); //First purge old exist shop before create new shop. String sqlString = "INSERT INTO " + QuickShop.instance .getDbPrefix() + "shops (owner, price, itemConfig, x, y, z, world, unlimited, type) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; //QuickShop.instance.getDB().execute(q, owner, price, Util.serialize(item), x, y, z, world, unlimited, shopType);