Search in sources :

Example 31 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project RFTools by McJty.

the class VolcanicCoreTileEntity method playRumble.

@SideOnly(Side.CLIENT)
private void playRumble() {
    EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
    sound = new VolcanicRumbleSound(player, worldObj, xCoord, yCoord, zCoord);
    Minecraft.getMinecraft().getSoundHandler().playSound(sound);
// RFTools.log("++++ Start rumble at " + xCoord + "," + yCoord + "," + zCoord);
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 32 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project Hbm-s-Nuclear-Tech-GIT by HbmMods.

the class SoundLoopBroadcaster method update.

@Override
public void update() {
    super.update();
    EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
    float f = 0;
    if (player != null) {
        f = (float) Math.sqrt(Math.pow(xPosF - player.posX, 2) + Math.pow(yPosF - player.posY, 2) + Math.pow(zPosF - player.posZ, 2));
        volume = func(f, intendedVolume);
        if (!(player.worldObj.getTileEntity((int) xPosF, (int) yPosF, (int) zPosF) instanceof TileEntityBroadcaster)) {
            this.donePlaying = true;
            volume = 0;
        }
    } else {
        volume = intendedVolume;
    }
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) TileEntityBroadcaster(com.hbm.tileentity.machine.TileEntityBroadcaster)

Example 33 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project Hbm-s-Nuclear-Tech-GIT by HbmMods.

the class SoundLoopSiren method update.

@Override
public void update() {
    super.update();
    EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
    float f = 0;
    if (player != null) {
        f = (float) Math.sqrt(Math.pow(xPosF - player.posX, 2) + Math.pow(yPosF - player.posY, 2) + Math.pow(zPosF - player.posZ, 2));
        volume = func(f, intendedVolume);
    } else {
        volume = intendedVolume;
    }
    if (te instanceof TileEntityMachineSiren) {
        this.setRepeat(type.name().equals(SoundType.LOOP.name()));
    } else {
        this.donePlaying = true;
    }
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) TileEntityMachineSiren(com.hbm.tileentity.machine.TileEntityMachineSiren)

Example 34 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project Hbm-s-Nuclear-Tech-GIT by HbmMods.

the class AudioDynamic method update.

@Override
public void update() {
    EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
    float f = 0;
    if (player != null) {
        f = (float) Math.sqrt(Math.pow(xPosF - player.posX, 2) + Math.pow(yPosF - player.posY, 2) + Math.pow(zPosF - player.posZ, 2));
        volume = func(f, intendedVolume);
    } else {
        volume = intendedVolume;
    }
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP)

Aggregations

EntityClientPlayerMP (net.minecraft.client.entity.EntityClientPlayerMP)34 Minecraft (net.minecraft.client.Minecraft)8 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)7 ItemStack (net.minecraft.item.ItemStack)6 SideOnly (cpw.mods.fml.relauncher.SideOnly)5 Coordinate (mcjty.lib.varia.Coordinate)3 Tessellator (net.minecraft.client.renderer.Tessellator)3 Item (net.minecraft.item.Item)3 TileEntity (net.minecraft.tileentity.TileEntity)3 GlobalCoordinate (mcjty.lib.varia.GlobalCoordinate)2 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)2 GuiScreen (net.minecraft.client.gui.GuiScreen)2 ClickEvent (net.minecraft.event.ClickEvent)2 HoverEvent (net.minecraft.event.HoverEvent)2 ChatComponentText (net.minecraft.util.ChatComponentText)2 ChatComponentTranslation (net.minecraft.util.ChatComponentTranslation)2 World (net.minecraft.world.World)2 Vector3 (WayofTime.alchemicalWizardry.api.Vector3)1 IMasterRitualStone (WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone)1 RitualComponent (WayofTime.alchemicalWizardry.api.rituals.RitualComponent)1