Skip to content

Commit

Permalink
Fixes challenge count update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Viduality committed May 15, 2020
1 parent f7fc22f commit 34d348b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.Viduality</groupId>
<artifactId>VSkyblock</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.2-SNAPSHOT</version>
<name>VSkyblock</name>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,11 @@ public void updateChallengeCount(int islandid, String mySQLKey, int count) {
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
Connection connection = plugin.getdb().getConnection();
try {
String statement = "INSERT INTO VSkyblock_Challenges(islandid, count, challenge) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE count = count + VALUES(count)";
String statement = "INSERT INTO VSkyblock_Challenges(islandid, count, challenge) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE count = VALUES(count)";
PreparedStatement updateCount = connection.prepareStatement(statement);
updateCount.setInt(1, count);
updateCount.setInt(2, islandid);
updateCount.setInt(1, islandid);
updateCount.setInt(2, count);
updateCount.setString(3, mySQLKey);
updateCount.executeUpdate();
updateCount.close();
} catch (SQLException e) {
Expand Down

0 comments on commit 34d348b

Please sign in to comment.