Workaround for Mystcraft not updating total world time in client worlds.

This commit is contained in:
Florian Nücke 2015-02-13 13:52:48 +01:00
parent 5750ec8ba1
commit 36ab91cdac
2 changed files with 5 additions and 1 deletions

View File

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

View File

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