Well this is kinda ugly... but it should fix #1215.

This commit is contained in:
Florian Nücke 2015-06-13 02:07:10 +02:00
parent 4f759c2c49
commit 5ae30eda26

View File

@ -10,7 +10,6 @@ import li.cil.oc.common.tileentity
import li.cil.oc.integration.util.NEI
import li.cil.oc.util.ExtendedAABB
import li.cil.oc.util.ExtendedAABB._
import net.minecraft.block.Block
import li.cil.oc.util.InventoryUtils
import net.minecraft.block.properties.IProperty
import net.minecraft.block.state.IBlockState
@ -87,16 +86,22 @@ class Print(protected implicit val tileTag: ClassTag[tileentity.Print]) extends
override def isOpaqueCube = false
override def getLightValue(world: IBlockAccess, pos: BlockPos): Int =
world.getTileEntity(pos) match {
case print: tileentity.Print => print.data.lightLevel
case _ => super.getLightValue(world, pos)
override def getLightValue(blockAccess: IBlockAccess, pos: BlockPos): Int =
blockAccess match {
case world: World if world.isBlockLoaded(pos) => world.getTileEntity(pos) match {
case print: tileentity.Print => print.data.lightLevel
case _ => super.getLightValue(world, pos)
}
case _ => super.getLightOpacity(blockAccess, pos)
}
override def getLightOpacity(world: IBlockAccess, pos: BlockPos): Int =
world.getTileEntity(pos) match {
case print: tileentity.Print if Settings.get.printsHaveOpacity => (print.data.opacity * 4).toInt
case _ => super.getLightOpacity(world, pos)
override def getLightOpacity(blockAccess: IBlockAccess, pos: BlockPos): Int =
blockAccess match {
case world: World if world.isBlockLoaded(pos) => world.getTileEntity(pos) match {
case print: tileentity.Print if Settings.get.printsHaveOpacity => (print.data.opacity * 4).toInt
case _ => super.getLightOpacity(world, pos)
}
case _ => super.getLightOpacity(blockAccess, pos)
}
override def isVisuallyOpaque = false