From d99bc5815c680198dfa7cd94eede40e5b4e66296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Mon, 2 Jun 2014 17:56:34 +0200 Subject: [PATCH] Forcing updates on light emitting blocks occasionally (every 2 seconds) to properly update lighting because MC's lighting needs to see a doctor. --- .../li/cil/oc/common/tileentity/traits/TileEntity.scala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/scala/li/cil/oc/common/tileentity/traits/TileEntity.scala b/src/main/scala/li/cil/oc/common/tileentity/traits/TileEntity.scala index 081c4406a..3b9c78a7c 100644 --- a/src/main/scala/li/cil/oc/common/tileentity/traits/TileEntity.scala +++ b/src/main/scala/li/cil/oc/common/tileentity/traits/TileEntity.scala @@ -26,6 +26,13 @@ trait TileEntity extends net.minecraft.tileentity.TileEntity { // ----------------------------------------------------------------------- // + override def updateEntity() { + super.updateEntity() + if (world.getWorldTime % 40 == 0 && block.getLightValue(world, x, y, z) > 0) { + world.markBlockForUpdate(x, y, z) + } + } + override def validate() { super.validate() initialize()