Search in sources :

Example 1 with TileEntityBroadcaster

use of com.hbm.tileentity.machine.TileEntityBroadcaster 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)

Aggregations

TileEntityBroadcaster (com.hbm.tileentity.machine.TileEntityBroadcaster)1 EntityClientPlayerMP (net.minecraft.client.entity.EntityClientPlayerMP)1