From 36ab91cdac9c2ddfefd49b7acf9da0a88fb25cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Fri, 13 Feb 2015 13:52:48 +0100 Subject: [PATCH] Workaround for Mystcraft not updating total world time in client worlds. --- .../li/cil/oc/client/renderer/tileentity/RobotRenderer.scala | 3 ++- src/main/scala/li/cil/oc/common/EventHandler.scala | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/scala/li/cil/oc/client/renderer/tileentity/RobotRenderer.scala b/src/main/scala/li/cil/oc/client/renderer/tileentity/RobotRenderer.scala index 2fedbbd45..8e8d9fe7a 100644 --- a/src/main/scala/li/cil/oc/client/renderer/tileentity/RobotRenderer.scala +++ b/src/main/scala/li/cil/oc/client/renderer/tileentity/RobotRenderer.scala @@ -5,6 +5,7 @@ import li.cil.oc.OpenComputers import li.cil.oc.Settings import li.cil.oc.api.event.RobotRenderEvent import li.cil.oc.client.Textures +import li.cil.oc.common.EventHandler import li.cil.oc.common.tileentity import li.cil.oc.util.RenderState import net.minecraft.block.Block @@ -258,7 +259,7 @@ object RobotRenderer extends TileEntitySpecialRenderer { val proxy = entity.asInstanceOf[tileentity.RobotProxy] val robot = proxy.robot - val worldTime = entity.getWorldObj.getTotalWorldTime + f + val worldTime = EventHandler.totalWorldTicks + f GL11.glPushMatrix() GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5) diff --git a/src/main/scala/li/cil/oc/common/EventHandler.scala b/src/main/scala/li/cil/oc/common/EventHandler.scala index b66e73471..fb206a832 100644 --- a/src/main/scala/li/cil/oc/common/EventHandler.scala +++ b/src/main/scala/li/cil/oc/common/EventHandler.scala @@ -37,6 +37,8 @@ import scala.concurrent.Future object EventHandler { private val pending = mutable.Buffer.empty[() => Unit] + var totalWorldTicks = 0L + def schedule(tileEntity: TileEntity) { if (SideTracker.isServer) pending.synchronized { pending += (() => Network.joinOrCreateNetwork(tileEntity)) @@ -105,6 +107,7 @@ object EventHandler { case t: Throwable => OpenComputers.log.warn("Error in scheduled tick action.", t) } }) + totalWorldTicks += 1 } @SubscribeEvent