From 9134f559dd2ca3afba66e53d8653954dbd05046b Mon Sep 17 00:00:00 2001 From: Alex4386 Date: Thu, 20 Jun 2024 14:42:42 +0900 Subject: [PATCH] chore: use TyphonSounds --- .../typhon/volcano/dome/VolcanoLavaDome.java | 8 ++++++++ .../volcano/lavaflow/VolcanoLavaFlow.java | 19 ++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/main/java/me/alex4386/plugin/typhon/volcano/dome/VolcanoLavaDome.java b/src/main/java/me/alex4386/plugin/typhon/volcano/dome/VolcanoLavaDome.java index 6ee69af..48a0273 100644 --- a/src/main/java/me/alex4386/plugin/typhon/volcano/dome/VolcanoLavaDome.java +++ b/src/main/java/me/alex4386/plugin/typhon/volcano/dome/VolcanoLavaDome.java @@ -1,6 +1,7 @@ package me.alex4386.plugin.typhon.volcano.dome; import me.alex4386.plugin.typhon.TyphonPlugin; +import me.alex4386.plugin.typhon.TyphonSounds; import me.alex4386.plugin.typhon.TyphonUtils; import me.alex4386.plugin.typhon.volcano.VolcanoComposition; import me.alex4386.plugin.typhon.volcano.bomb.VolcanoBombListener; @@ -10,6 +11,7 @@ import org.bukkit.Bukkit; import org.bukkit.Location; +import org.bukkit.SoundCategory; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.json.simple.JSONObject; @@ -143,6 +145,10 @@ public void ooze() { this.vent.lavaFlow.flowLava(TyphonUtils.getHighestRocklikes( TyphonUtils.getRandomBlockInRange(this.baseLocation.getBlock(), (int) distance) ).getRelative(BlockFace.UP)); + + if (Math.random() < 0.1) { + TyphonSounds.LAVA_FLOW_FRAGMENTING.play(this.baseLocation.getBlock().getLocation(), SoundCategory.BLOCKS, 1, 1); + } } public void explode() { @@ -152,6 +158,8 @@ public void explode() { for (int i = 0; i < 5; i++) { this.vent.bombs.generateRandomBomb(targetLocation); } + + TyphonSounds.DISTANT_EXPLOSION.play(targetLocation, SoundCategory.BLOCKS, 2f, 0f); } public JSONObject importConfig(JSONObject json) { diff --git a/src/main/java/me/alex4386/plugin/typhon/volcano/lavaflow/VolcanoLavaFlow.java b/src/main/java/me/alex4386/plugin/typhon/volcano/lavaflow/VolcanoLavaFlow.java index 14c2d4d..60df255 100644 --- a/src/main/java/me/alex4386/plugin/typhon/volcano/lavaflow/VolcanoLavaFlow.java +++ b/src/main/java/me/alex4386/plugin/typhon/volcano/lavaflow/VolcanoLavaFlow.java @@ -1468,15 +1468,6 @@ private void autoFlowLava() { int flowedBlocks = 0; if (this.vent.erupt.getStyle().lavaMultiplier > 0) { - if (!ventBlocks.isEmpty()) { - TyphonSounds.LAVA_ERUPTION.play( - ventBlocks.get(0).getLocation(), - SoundCategory.BLOCKS, - 2f, - 1f - ); - } - int flowableCounts = 0; for (Block whereToFlow : whereToFlows) { if (TyphonUtils.isBlockFlowable(whereToFlow)) { @@ -1545,6 +1536,16 @@ private void autoFlowLava() { } } } + + + if (flowedBlocks > 0) { + TyphonSounds.LAVA_ERUPTION.play( + ventBlocks.get(0).getLocation(), + SoundCategory.BLOCKS, + 2f, + 1f + ); + } } else if (this.vent.erupt.getStyle() == VolcanoEruptStyle.LAVA_DOME) { int count = whereToFlows.size(); for (int i = 0; i < count; i++) {