Fix machine active state blinking in between successive tasks

This commit is contained in:
tterrag1098 committed 2015-05-18 15:16:05 -04:00
1 parent 5b39d3f234
commit 6215e39410
3 files changed
+7 -7

No files matched your search

@@ -212,11 +212,15 @@ public abstract class AbstractMachineEntity extends TileEntityEio implements ISi
public float getPitch() {
return 1.0f;
}
protected boolean shouldPlaySound() {
return isActive() && !isInvalid();
}
@SideOnly(Side.CLIENT)
private void updateSound() {
if(Config.machineSoundsEnabled && hasSound()) {
if(isActive() && !isInvalid()) {
if(shouldPlaySound()) {
if(sound == null) {
sound = new MachineSound(soundRes, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, getVolume(), getPitch());
FMLClientHandler.instance().getClient().getSoundHandler().playSound(sound);