use of com.hbm.tileentity.machine.TileEntityMachineSiren 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;
}
}
Aggregations