From f04a9edb411f336638684db68c43900e615eedef Mon Sep 17 00:00:00 2001 From: Lixfel Date: Thu, 29 Oct 2020 12:24:43 +0100 Subject: [PATCH] Fix sound strength Signed-off-by: Lixfel --- .../de/steamwar/fightsystem/listener/EventRecordListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/EventRecordListener.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/EventRecordListener.java index 3249c75..7fa5902 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/EventRecordListener.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/EventRecordListener.java @@ -44,10 +44,12 @@ import org.bukkit.event.server.BroadcastMessageEvent; import org.bukkit.inventory.ItemStack; import java.util.EnumSet; +import java.util.Random; public class EventRecordListener extends BasicListener { private static final int AIR = 0; + private static final Random random = new Random(); public EventRecordListener() { super(Config.event() ? EnumSet.allOf(FightState.class) : EnumSet.noneOf(FightState.class)); @@ -131,7 +133,7 @@ public class EventRecordListener extends BasicListener { Location loc = e.getLocation(); RecordSystem.entityDespawns(e.getEntity()); RecordSystem.particle(loc.getX(), loc.getY(), loc.getZ(), Particle.EXPLOSION_LARGE.name()); - RecordSystem.sound(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), Sound.ENTITY_GENERIC_EXPLODE.name(), SoundCategory.BLOCKS.name(), 255.0f, 1.0f); + RecordSystem.sound(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), Sound.ENTITY_GENERIC_EXPLODE.name(), SoundCategory.BLOCKS.name(), 4.0F, (1.0F + (random.nextFloat() - random.nextFloat()) * 0.2F) * 0.7F); } @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)