2014-07-21 20:47:00 +02:00
|
|
|
package com.pahimar.ee3.util;
|
|
|
|
|
|
|
|
import com.pahimar.ee3.network.PacketHandler;
|
|
|
|
import com.pahimar.ee3.network.message.MessageSoundEvent;
|
|
|
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
|
2014-10-14 22:08:12 +02:00
|
|
|
public class CommonSoundHelper
|
2014-07-21 20:47:00 +02:00
|
|
|
{
|
2015-03-22 23:52:04 +01:00
|
|
|
public static void playSoundAtLocation(int dimensionId, float xCoord, float yCoord, float zCoord, String soundName, float volume, float pitch)
|
2014-07-21 20:47:00 +02:00
|
|
|
{
|
2015-03-22 23:52:04 +01:00
|
|
|
playSoundAtLocation(dimensionId, xCoord, yCoord, zCoord, soundName, volume, pitch, 32d);
|
2014-07-21 20:47:00 +02:00
|
|
|
}
|
|
|
|
|
2015-03-22 23:52:04 +01:00
|
|
|
public static void playSoundAtLocation(int dimensionId, float xCoord, float yCoord, float zCoord, String soundName, float volume, float pitch, double range)
|
2014-07-21 20:47:00 +02:00
|
|
|
{
|
2015-03-22 23:52:04 +01:00
|
|
|
PacketHandler.INSTANCE.sendToAllAround(new MessageSoundEvent(soundName, xCoord, yCoord, zCoord, volume, pitch), new NetworkRegistry.TargetPoint(dimensionId, xCoord, yCoord, zCoord, range));
|
2014-07-21 20:47:00 +02:00
|
|
|
}
|
2014-10-14 22:08:12 +02:00
|
|
|
|
2015-03-22 23:52:04 +01:00
|
|
|
public static void playSoundAtPlayer(EntityPlayer entityPlayer, String soundName, float volume, float pitch)
|
2014-10-14 22:08:12 +02:00
|
|
|
{
|
2015-03-22 23:52:04 +01:00
|
|
|
playSoundAtPlayer(entityPlayer, soundName, volume, pitch, 32d);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void playSoundAtPlayer(EntityPlayer entityPlayer, String soundName, float volume, float pitch, double range)
|
|
|
|
{
|
|
|
|
PacketHandler.INSTANCE.sendToAllAround(new MessageSoundEvent(entityPlayer, soundName, volume, pitch), new NetworkRegistry.TargetPoint(entityPlayer.worldObj.provider.dimensionId, entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, range));
|
2014-10-14 22:08:12 +02:00
|
|
|
}
|
2014-07-21 20:47:00 +02:00
|
|
|
}
|