mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 02:39:48 -04:00
Workaround for Mystcraft not updating total world time in client worlds.
This commit is contained in:
parent
5750ec8ba1
commit
36ab91cdac
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user