Package com.pahimar.ee3.util

Source Code of com.pahimar.ee3.util.CommonSoundHelper

package com.pahimar.ee3.util;

import com.pahimar.ee3.network.PacketHandler;
import com.pahimar.ee3.network.message.MessageSoundEvent;
import com.pahimar.ee3.reference.Sounds;
import cpw.mods.fml.common.network.NetworkRegistry;
import net.minecraft.entity.player.EntityPlayer;

public class CommonSoundHelper
{
    public static void playSoundAt(EntityPlayer entityPlayer, String soundName, float volume, float pitch)
    {
        playSoundAt(entityPlayer, soundName, volume, pitch, 32d);
    }

    public static void playSoundAt(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));
    }

    public static void playChalkSoundAt(EntityPlayer entityPlayer)
    {
        playSoundAt(entityPlayer, Sounds.Chalk.getRandomChalkSound(), 1f, 1f);
    }
}
TOP

Related Classes of com.pahimar.ee3.util.CommonSoundHelper

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.