mirror of
https://github.com/songoda/UltimateStacker.git
synced 2025-01-03 22:37:41 +01:00
Clean up.
This commit is contained in:
parent
687e1f62d0
commit
ae881978d0
@ -30,15 +30,11 @@ public class DataManager {
|
||||
|
||||
public void bulkUpdateSpawners(Collection<SpawnerStack> spawnerStacks) {
|
||||
this.databaseConnector.connect(connection -> {
|
||||
String updateSpawner = "UPDATE " + this.getTablePrefix() + "spawners SET amount = ? WHERE world = ? AND x = ? AND y = ? and z = ?";
|
||||
String updateSpawner = "UPDATE " + this.getTablePrefix() + "spawners SET amount = ? WHERE id = ?";
|
||||
try (PreparedStatement statement = connection.prepareStatement(updateSpawner)) {
|
||||
for (SpawnerStack spawnerStack : spawnerStacks) {
|
||||
statement.setInt(1, spawnerStack.getAmount());
|
||||
|
||||
statement.setString(5, spawnerStack.getWorld().getName());
|
||||
statement.setInt(6, spawnerStack.getX());
|
||||
statement.setInt(7, spawnerStack.getY());
|
||||
statement.setInt(8, spawnerStack.getZ());
|
||||
statement.setInt(2, spawnerStack.getId());
|
||||
statement.executeUpdate();
|
||||
statement.addBatch();
|
||||
}
|
||||
@ -54,7 +50,6 @@ public class DataManager {
|
||||
String updateSpawner = "UPDATE " + this.getTablePrefix() + "spawners SET amount = ? WHERE id = ?";
|
||||
try (PreparedStatement statement = connection.prepareStatement(updateSpawner)) {
|
||||
statement.setInt(1, spawnerStack.getAmount());
|
||||
|
||||
statement.setInt(2, spawnerStack.getId());
|
||||
statement.executeUpdate();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user