From e00f30bf0bbfe7041b639cbbe1ba2db111235da5 Mon Sep 17 00:00:00 2001 From: Eric Date: Sun, 29 May 2016 13:53:38 +0200 Subject: [PATCH] Automatically convert infinite to admin shops --- src/de/epiceric/shopchest/sql/Database.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/de/epiceric/shopchest/sql/Database.java b/src/de/epiceric/shopchest/sql/Database.java index 60ecff7..a89927f 100644 --- a/src/de/epiceric/shopchest/sql/Database.java +++ b/src/de/epiceric/shopchest/sql/Database.java @@ -410,7 +410,13 @@ public abstract class Database { rs = ps.executeQuery(); while (rs.next()) { if (rs.getInt("id") == id) { - return ShopType.valueOf(rs.getString("shoptype")); + String shoptype = rs.getString("shoptype"); + if (shoptype.equals("INFINITE")) { + Shop shop = new Shop(plugin, getVendor(id), getProduct(id), getLocation(id), getBuyPrice(id), getSellPrice(id), ShopType.ADMIN); + setShop(id, shop); + return ShopType.ADMIN; + } + return ShopType.valueOf(shoptype); } } } catch (SQLException ex) {