Automatically convert infinite to admin shops

This commit is contained in:
Eric 2016-05-29 13:53:38 +02:00
parent ddebe5c594
commit e00f30bf0b

View File

@ -410,7 +410,13 @@ public abstract class Database {
rs = ps.executeQuery(); rs = ps.executeQuery();
while (rs.next()) { while (rs.next()) {
if (rs.getInt("id") == id) { 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) { } catch (SQLException ex) {