SteamWar/FightSystem
Archiviert
13
1

Better sound location #411

Zusammengeführt
Lixfel hat 1 Commits von betterSound nach master 2024-01-19 16:16:40 +01:00 zusammengeführt

Datei anzeigen

@ -21,6 +21,7 @@ package de.steamwar.fightsystem.fight;
import com.comphenix.tinyprotocol.TinyProtocol; import com.comphenix.tinyprotocol.TinyProtocol;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import de.steamwar.core.Core;
import de.steamwar.core.ProtocolWrapper; import de.steamwar.core.ProtocolWrapper;
import de.steamwar.fightsystem.ArenaMode; import de.steamwar.fightsystem.ArenaMode;
import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.Config;
@ -94,6 +95,9 @@ public class Fight {
public static void playSound(Sound sound, float volume, float pitch) { public static void playSound(Sound sound, float volume, float pitch) {
GlobalRecorder.getInstance().soundAtPlayer(sound.name(), volume, pitch); GlobalRecorder.getInstance().soundAtPlayer(sound.name(), volume, pitch);
//volume: max. 100, pitch: max. 2 //volume: max. 100, pitch: max. 2
if(Core.getVersion() >= 18)
Bukkit.getServer().getOnlinePlayers().forEach(player -> player.playSound(player, sound, volume, pitch));
else
Bukkit.getServer().getOnlinePlayers().forEach(player -> player.playSound(player.getLocation(), sound, volume, pitch)); Bukkit.getServer().getOnlinePlayers().forEach(player -> player.playSound(player.getLocation(), sound, volume, pitch));
} }