9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-29 03:49:19 +00:00

Fixed files not getting committed

This commit is contained in:
Fisher2911
2022-03-29 20:31:43 -04:00
parent 3a0ff5504e
commit 24c06fd12c

View File

@@ -0,0 +1,60 @@
package io.github.fisher2911.hmccosmetics.config;
import com.github.retrooper.packetevents.protocol.sound.SoundCategory;
import net.minecraft.server.v1_16_R3.MinecraftKey;
import org.bukkit.entity.Player;
public class SoundData {
private final String name;
private final SoundCategory soundCategory;
private final float volume;
private final float pitch;
public SoundData(final String name, final SoundCategory soundCategory, final float volume, final float pitch) {
this.name = name;
this.soundCategory = soundCategory;
this.volume = volume;
this.pitch = pitch;
}
public String getName() {
return name;
}
public float getVolume() {
return volume;
}
public float getPitch() {
return pitch;
}
public SoundCategory getSoundCategory() {
return soundCategory;
}
public void play(final Player player) {
// todo - once packetevents updates
// final PacketContainer soundPacket = PacketManager.getSoundPacket(
// player,
// player.getLocation(),
// this.getKey(this.name),
// this.volume,
// this.pitch,
// this.soundCategory
// );
//
// PacketManager.sendPacket(player, soundPacket);
}
private MinecraftKey getKey(final String string) {
if (!string.contains(":")) {
return new MinecraftKey(string);
}
final String[] parts = string.split(":");
return new MinecraftKey(parts[0], parts[1]);
}
}