diff --git a/li/cil/oc/client/renderer/block/BlockRenderer.scala b/li/cil/oc/client/renderer/block/BlockRenderer.scala index d7a3ee162..e1be98fda 100644 --- a/li/cil/oc/client/renderer/block/BlockRenderer.scala +++ b/li/cil/oc/client/renderer/block/BlockRenderer.scala @@ -52,10 +52,4 @@ object BlockRenderer extends ISimpleBlockRenderingHandler { } def renderWorldBlock(world: IBlockAccess, x: Int, y: Int, z: Int, block: Block, modelId: Int, renderer: RenderBlocks) = renderer.renderStandardBlock(block, x, y, z) - - // Delegator.subBlock(block, world.getBlockMetadata(x, y, z)) match { - // case Some(keyboard: Keyboard) => - // false - // case _ => renderer.renderStandardBlock(block, x, y, z) - // } } diff --git a/li/cil/oc/common/block/Delegate.scala b/li/cil/oc/common/block/Delegate.scala index 13ab598ce..12021c39b 100644 --- a/li/cil/oc/common/block/Delegate.scala +++ b/li/cil/oc/common/block/Delegate.scala @@ -33,6 +33,8 @@ trait Delegate { def canConnectRedstone(world: IBlockAccess, x: Int, y: Int, z: Int, side: ForgeDirection) = false + def canPlaceBlockOnSide(world: World, x: Int, y: Int, z: Int, side: Int) = true + def colorMultiplier(world: IBlockAccess, x: Int, y: Int, z: Int) = getRenderColor def collisionRayTrace(world: World, x: Int, y: Int, z: Int, origin: Vec3, direction: Vec3) = diff --git a/li/cil/oc/common/block/Delegator.scala b/li/cil/oc/common/block/Delegator.scala index 1f22d01b7..e18837191 100644 --- a/li/cil/oc/common/block/Delegator.scala +++ b/li/cil/oc/common/block/Delegator.scala @@ -110,6 +110,14 @@ class Delegator[Child <: Delegate](id: Int) extends Block(id, Material.iron) { super.breakBlock(world, x, y, z, blockId, metadata) } + override def canPlaceBlockOnSide(world: World, x: Int, y: Int, z: Int, side: Int, stack: ItemStack) = + subBlock(stack) match { + case Some(subBlock) => subBlock.canPlaceBlockOnSide(world, x, y, z, side) + case _ => super.canPlaceBlockOnSide(world, x, y, z, side, stack) + } + + override def canBeReplacedByLeaves(world: World, x: Int, y: Int, z: Int) = false + override def canCreatureSpawn(creature: EnumCreatureType, world: World, x: Int, y: Int, z: Int) = false override def damageDropped(metadata: Int) = diff --git a/li/cil/oc/common/block/Keyboard.scala b/li/cil/oc/common/block/Keyboard.scala index e02515925..f20ba1274 100644 --- a/li/cil/oc/common/block/Keyboard.scala +++ b/li/cil/oc/common/block/Keyboard.scala @@ -20,6 +20,13 @@ class Keyboard(val parent: SpecialDelegator) extends SpecialDelegate { case _ => } + override def canPlaceBlockOnSide(world: World, x: Int, y: Int, z: Int, side: Int) = + ForgeDirection.VALID_DIRECTIONS. + map(side => world.getBlockTileEntity(x + side.offsetX, y + side.offsetY, z + side.offsetZ)). + collect { + case screen: tileentity.Screen => screen + }.exists(_.facing.ordinal() != side) + override def isBlockNormalCube(world: World, x: Int, y: Int, z: Int) = false override def getLightOpacity(world: World, x: Int, y: Int, z: Int) = 0 diff --git a/li/cil/oc/common/tileentity/Robot.scala b/li/cil/oc/common/tileentity/Robot.scala index ce0ccd255..030071c27 100644 --- a/li/cil/oc/common/tileentity/Robot.scala +++ b/li/cil/oc/common/tileentity/Robot.scala @@ -275,6 +275,7 @@ class Robot(isRemote: Boolean) extends Computer(isRemote) with ISidedInventory w computer.node.connect(gpu.node) distributor.node.connect(battery) buffer.node.connect(keyboard.node) + distributor.changeBuffer(distributor.globalBufferSize / 2) // TODO for testing only } }