Merge branch 'development'

This commit is contained in:
Christian Koop 2022-07-16 15:16:02 +02:00
commit cbfa58bf17
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
3 changed files with 6 additions and 8 deletions

View File

@ -2,7 +2,7 @@
<groupId>com.songoda</groupId>
<artifactId>UltimateStacker</artifactId>
<modelVersion>4.0.0</modelVersion>
<version>2.2.1</version>
<version>2.2.2</version>
<build>
<defaultGoal>clean install</defaultGoal>
<finalName>UltimateStacker-${project.version}</finalName>
@ -113,7 +113,7 @@
<dependency>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore</artifactId>
<version>2.6.12</version>
<version>2.6.14-DEV</version>
<scope>compile</scope>
</dependency>

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

View File

@ -297,8 +297,9 @@ public class StackingTask extends BukkitRunnable {
}
// Drop lead if applicable then remove our entity and mark it as processed.
if (entity.isLeashed())
entity.getWorld().dropItemNaturally(entity.getLocation(), CompatibleMaterial.LEAD.getItem());
if (entity.isLeashed()) {
Bukkit.getScheduler().runTask(plugin, () -> entity.getWorld().dropItemNaturally(entity.getLocation(), CompatibleMaterial.LEAD.getItem()));
}
livingEntities.add(entity);
Bukkit.getScheduler().runTask(plugin, entity::remove);
processed.add(entity.getUniqueId());