mirror of
https://github.com/songoda/UltimateStacker.git
synced 2025-01-29 18:51:21 +01:00
Move null check into statement like other methods
This commit is contained in:
parent
9de9f0f188
commit
e773b22ee4
@ -57,7 +57,6 @@ public class DataManager extends DataManagerAbstract {
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
public void createSpawner(SpawnerStack spawnerStack) {
|
||||
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
|
||||
|
||||
@ -88,7 +87,6 @@ public class DataManager extends DataManagerAbstract {
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
public void createBlock(BlockStack blockStack) {
|
||||
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
|
||||
|
||||
@ -108,12 +106,11 @@ public class DataManager extends DataManagerAbstract {
|
||||
}), "create");
|
||||
}
|
||||
|
||||
|
||||
public void createHostEntity(ColdEntityStack stack) {
|
||||
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
|
||||
if (stack == null || stack.getHostUniqueId() == null) return;
|
||||
String createSerializedEntity = "INSERT INTO " + this.getTablePrefix() + "host_entities (uuid, create_duplicates) VALUES (?, ?)";
|
||||
try (PreparedStatement statement = connection.prepareStatement(createSerializedEntity)) {
|
||||
if (stack == null || stack.getHostUniqueId() == null) return;
|
||||
statement.setString(1, stack.getHostUniqueId().toString());
|
||||
statement.setInt(2, stack.getCreateDuplicates());
|
||||
statement.executeUpdate();
|
||||
|
Loading…
Reference in New Issue
Block a user