Added a way to manually run ServerTickExecutionContext

This commit is contained in:
bdew committed 2015-06-08 15:44:16 +03:00
1 parent a530c66680
commit f8bb1e8fbb
1 file changed
+4 -2
@@ -40,8 +40,7 @@ object ServerTickExecutionContext extends ExecutionContext {
override def reportFailure(cause: Throwable): Unit =
BdLib.logErrorException("Error in execution context", cause)
@SubscribeEvent
def onTick(ev: ServerTickEvent): Unit = {
def doSingleLoop(): Unit = {
for (r <- getNextBatch) {
try {
r.run()
@@ -50,4 +49,7 @@ object ServerTickExecutionContext extends ExecutionContext {
}
}
}
@SubscribeEvent
def onTick(ev: ServerTickEvent): Unit = doSingleLoop()
}