From dbc3af26d2ad68673eda7a59bf13005b03e674f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Sat, 4 Jan 2014 03:15:31 +0100 Subject: [PATCH] crashing on start to show a warning when doDaylightCycle is false (since sleeps will never elapse in that mode computers won't start up) --- li/cil/oc/server/component/Computer.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/li/cil/oc/server/component/Computer.scala b/li/cil/oc/server/component/Computer.scala index 833ad330e..c4fcedb65 100644 --- a/li/cil/oc/server/component/Computer.scala +++ b/li/cil/oc/server/component/Computer.scala @@ -108,7 +108,12 @@ class Computer(val owner: tileentity.Computer) extends ManagedComponent with Con def start() = state.synchronized(state.top match { case Computer.State.Stopped => - if (owner.installedMemory > 0) { + val rules = owner.world.getWorldInfo.getGameRulesInstance + if (rules.hasRule("doDaylightCycle") && !rules.getGameRuleBooleanValue("doDaylightCycle")) { + crash("computers don't work while time is frozen (gamerule doDaylightCycle is false)") + false + } + else if (owner.installedMemory > 0) { if (Settings.get.ignorePower || node.globalBuffer > cost) { init() && { switchTo(Computer.State.Starting)