package com.legendzero.lzlib.util;

import org.bukkit.Sound;
import org.bukkit.entity.Player;

import java.util.Arrays;
import java.util.Iterator;

public class SoundData {

    private final Sound soundEnum;
    private final String soundString;
    private final float volume;
    private final float pitch;

    public SoundData(Sound soundEnum, float volume, float pitch) {
        this.soundEnum = soundEnum;
        this.soundString = null;
        this.volume = volume;
        this.pitch = pitch;
    }

    public SoundData(String soundString, float volume, float pitch) {
        this.soundEnum = null;
        this.soundString = soundString;
        this.volume = volume;
        this.pitch = pitch;
    }

    public void play(Player... players) {
        if (this.soundEnum != null) {
            Arrays.stream(players).forEach(player -> player.playSound(player.getLocation(), this.soundEnum, this.volume, this.pitch));
        } else {
            Arrays.stream(players).forEach(player -> player.playSound(player.getLocation(), this.soundString, this.volume, this.pitch));
        }
    }

    public void play(Iterable<Player> players) {
        if (this.soundEnum != null) {
            players.forEach(player -> player.playSound(player.getLocation(), this.soundEnum, this.volume, this.pitch));
        } else {
            players.forEach(player -> player.playSound(player.getLocation(), this.soundString, this.volume, this.pitch));
        }
    }

    public void play(Iterator<Player> players) {
        if (this.soundEnum != null) {
            players.forEachRemaining(player -> player.playSound(player.getLocation(), this.soundEnum, this.volume, this.pitch));
        } else {
            players.forEachRemaining(player -> player.playSound(player.getLocation(), this.soundString, this.volume, this.pitch));
        }
    }
}

@@ -703,32 +703,311 @@
 = pitch;%0A    %7D%0A%0A
+    public Sound getSoundEnum() %7B%0A        return this.soundEnum;%0A    %7D%0A%0A    public String getSoundString() %7B%0A        return this.soundString;%0A    %7D%0A%0A    public float getVolume() %7B%0A        return this.volume;%0A    %7D%0A%0A    public float getPitch() %7B%0A        return this.pitch;%0A    %7D%0A%0A
     public void 

Add accessors to SoundData