Move null check into statement like other methods

This commit is contained in:
HexedHero 2022-03-25 11:39:27 +00:00 committed by GitHub
parent 9de9f0f188
commit e773b22ee4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -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();