mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
parent
be01e9efd0
commit
6d06227922
@ -12,7 +12,6 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
@ -52,18 +51,6 @@ public class TileEntityBroadcaster extends TileEntityLoadedBase {
|
|||||||
audio = rebootAudio(audio);
|
audio = rebootAudio(audio);
|
||||||
}
|
}
|
||||||
|
|
||||||
int intendedVolume = 25;
|
|
||||||
|
|
||||||
EntityPlayer player = MainRegistry.proxy.me();
|
|
||||||
float volume;
|
|
||||||
if(player != null) {
|
|
||||||
float f = (float)Math.sqrt(Math.pow(xCoord - player.posX, 2) + Math.pow(yCoord - player.posY, 2) + Math.pow(zCoord - player.posZ, 2));
|
|
||||||
volume = (f / intendedVolume) * -2 + 2;
|
|
||||||
} else {
|
|
||||||
volume = intendedVolume;
|
|
||||||
}
|
|
||||||
|
|
||||||
audio.updateVolume(getVolume(volume));
|
|
||||||
audio.keepAlive();
|
audio.keepAlive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -89,7 +76,7 @@ public class TileEntityBroadcaster extends TileEntityLoadedBase {
|
|||||||
@Override
|
@Override
|
||||||
public AudioWrapper createAudioLoop() {
|
public AudioWrapper createAudioLoop() {
|
||||||
Random rand = new Random(xCoord + yCoord + zCoord);
|
Random rand = new Random(xCoord + yCoord + zCoord);
|
||||||
return MainRegistry.proxy.getLoopedSound("hbm:block.broadcast" + (rand.nextInt(3) + 1), xCoord, yCoord, zCoord, 1.0F, 10F, 1.0F);
|
return MainRegistry.proxy.getLoopedSound("hbm:block.broadcast" + (rand.nextInt(3) + 1), xCoord, yCoord, zCoord, 25F, 25F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user