crashing on start to show a warning when doDaylightCycle is false (since sleeps will never elapse in that mode computers won't start up)

This commit is contained in:
Florian Nücke 2014-01-04 03:15:31 +01:00
parent 48217254b8
commit dbc3af26d2

View File

@ -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)