Skip to content

Commit 146fb29

Browse files
Merge pull request #493 from Stredox02/main
Fix asynchronously playSound issue
2 parents ea4d2c9 + 9ca1782 commit 146fb29

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/main/java/com/volmit/adapt/content/adaptation/architect/ArchitectFoundation.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ public void removeFoundation(Block block) {
230230
J.s(() -> {
231231
block.setBlockData(AIR);
232232
activeBlocks.remove(block);
233+
block.getWorld().playSound(block.getLocation(), Sound.BLOCK_DEEPSLATE_BREAK, 1.0f, 1.0f);
233234
});
234-
block.getWorld().playSound(block.getLocation(), Sound.BLOCK_DEEPSLATE_BREAK, 1.0f, 1.0f);
235235
if (getConfig().showParticles) {
236236
vfxCuboidOutline(block, Particles.ENCHANTMENT_TABLE);
237237
}
@@ -255,9 +255,15 @@ public void onTick() {
255255
if (i == null) {
256256
return 0;
257257
}
258+
final var world = i.getWorld();
259+
final var location = i.getLocation();
260+
261+
262+
J.s(() -> {
263+
world.playSound(location, Sound.BLOCK_BEACON_ACTIVATE, 1.0f, 10.0f);
264+
world.playSound(location, Sound.BLOCK_RESPAWN_ANCHOR_CHARGE, 1.0f, 0.81f);
265+
});
258266

259-
i.getWorld().playSound(i.getLocation(), Sound.BLOCK_BEACON_ACTIVATE, 1.0f, 10.0f);
260-
i.getWorld().playSound(i.getLocation(), Sound.BLOCK_RESPAWN_ANCHOR_CHARGE, 1.0f, 0.81f);
261267
return availablePower;
262268
}
263269
return v;

0 commit comments

Comments
 (0)