Fix flower pots

This commit is contained in:
kaenganxt
2014-10-20 14:58:35 +02:00
parent aa84ee03b5
commit c49b37bd9a

View File

@@ -123,11 +123,11 @@ public class FlowerPots {
String sql;
if(alreadyFound)
{
sql = "UPDATE coreFoundPots SET timestamp = '"+(System.currentTimeMillis() / 1000)+"', type = 1 WHERE player = (SELECT id FROM players WHERE uuid = '"+P.getUniqueId().toString()+"')";
sql = "UPDATE coreFoundPots SET timestamp = '"+(System.currentTimeMillis() / 1000)+"', type = 1 WHERE player = (SELECT id FROM players WHERE uuid = '"+P.getUniqueId().toString()+"') AND id = '"+pot+"'";
}
else
{
sql = "INSERT INTO coreFoundPots(id, player, timestamp, type) VALUES('"+pot+"', (SELECT id FROM players WHERE uuid = '"+P.getUniqueId().toString()+"'),'"+(int) (System.currentTimeMillis() / 1000)+"','"+type+"')";
sql = "INSERT INTO coreFoundPots(id, player, timestamp, type) VALUES('"+pot+"', (SELECT id FROM players WHERE uuid = '"+P.getUniqueId().toString()+"'),'"+(int) (System.currentTimeMillis() / 1000)+"',"+type+")";
}
AnuraCore.getSql().queryUpdate(sql);
Location loc = AnuraCore.getInstance().flowerPots.get(pot);