From c17eab55ea88204e3ac6bc974915fc07f187699b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Fri, 20 Feb 2015 01:33:12 +0100 Subject: [PATCH] All the derpery today. --- .../cil/oc/common/tileentity/traits/Computer.scala | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/scala/li/cil/oc/common/tileentity/traits/Computer.scala b/src/main/scala/li/cil/oc/common/tileentity/traits/Computer.scala index f41397135..65f34d1a6 100644 --- a/src/main/scala/li/cil/oc/common/tileentity/traits/Computer.scala +++ b/src/main/scala/li/cil/oc/common/tileentity/traits/Computer.scala @@ -52,11 +52,13 @@ trait Computer extends Environment with ComponentInventory with Rotatable with B def setRunning(value: Boolean): Unit = if (value != _isRunning) { _isRunning = value - world.markBlockForUpdate(x, y, z) - runSound.foreach(sound => - if (_isRunning) Sound.startLoop(this, sound, 0.5f, 50 + world.rand.nextInt(50)) - else Sound.stopLoop(this) - ) + if (world != null) { + world.markBlockForUpdate(x, y, z) + runSound.foreach(sound => + if (_isRunning) Sound.startLoop(this, sound, 0.5f, 50 + world.rand.nextInt(50)) + else Sound.stopLoop(this) + ) + } } @SideOnly(Side.CLIENT)