Fix Generator Tiles' client/server sidedness
This commit is contained in:
parent
a90680eaae
commit
b817b2840c
4 changed files with 15 additions and 18 deletions
|
@ -108,10 +108,9 @@ public abstract class TileEntityAdvancedElectricMachine<RECIPE extends AdvancedM
|
|||
//Electric
|
||||
factory.electricityStored = electricityStored;
|
||||
factory.ic2Registered = ic2Registered;
|
||||
|
||||
|
||||
//Noisy
|
||||
factory.soundURL = soundURL;
|
||||
factory.sound = sound;
|
||||
|
||||
//Machine
|
||||
factory.progress[0] = operatingTicks;
|
||||
|
|
|
@ -83,7 +83,7 @@ public abstract class TileEntityElectricMachine<RECIPE extends BasicMachineRecip
|
|||
|
||||
//Noisy
|
||||
factory.soundURL = soundURL;
|
||||
factory.sound = sound;
|
||||
|
||||
|
||||
//Machine
|
||||
factory.progress[0] = operatingTicks;
|
||||
|
|
|
@ -116,17 +116,6 @@ public abstract class TileEntityGenerator extends TileEntityNoisyElectricBlock i
|
|||
return EnumSet.of(ForgeDirection.getOrientation(facing));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate()
|
||||
{
|
||||
super.validate();
|
||||
|
||||
if(worldObj.isRemote)
|
||||
{
|
||||
sound = new TileSound(this, this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not this generator can operate.
|
||||
* @return if the generator can operate
|
||||
|
|
|
@ -108,10 +108,9 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
{
|
||||
super.onUpdate();
|
||||
|
||||
if(worldObj.isRemote && shouldPlaySound() && SoundHandler.canRestartSound(getSound()) && client.enableMachineSounds)
|
||||
if(worldObj.isRemote)
|
||||
{
|
||||
getSound().reset();
|
||||
SoundHandler.playSound(getSound());
|
||||
updateSound();
|
||||
}
|
||||
|
||||
if(isFormed())
|
||||
|
@ -126,7 +125,17 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateSound()
|
||||
{
|
||||
if(shouldPlaySound() && SoundHandler.canRestartSound(getSound()) && client.enableMachineSounds)
|
||||
{
|
||||
getSound().reset();
|
||||
SoundHandler.playSound(getSound());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue