mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 10:51:55 -04:00
cable only checks neighbor blocks if y >= 0 , Fixes #63
This commit is contained in:
parent
c1e283ca87
commit
f4d8f8c51f
@ -91,16 +91,17 @@ object Cable {
|
|||||||
def neighbors(world: IBlockAccess, x: Int, y: Int, z: Int) = {
|
def neighbors(world: IBlockAccess, x: Int, y: Int, z: Int) = {
|
||||||
var result = 0
|
var result = 0
|
||||||
for (side <- ForgeDirection.VALID_DIRECTIONS) {
|
for (side <- ForgeDirection.VALID_DIRECTIONS) {
|
||||||
world.getBlockTileEntity(x + side.offsetX, y + side.offsetY, z + side.offsetZ) match {
|
if (y + side.offsetY >= 0)
|
||||||
case robot: tileentity.RobotProxy =>
|
world.getBlockTileEntity(x + side.offsetX, y + side.offsetY, z + side.offsetZ) match {
|
||||||
case host: SidedEnvironment =>
|
case robot: tileentity.RobotProxy =>
|
||||||
val connects = if (host.getWorldObj.isRemote) host.canConnect(side.getOpposite) else host.sidedNode(side.getOpposite) != null
|
case host: SidedEnvironment =>
|
||||||
if (connects) {
|
val connects = if (host.getWorldObj.isRemote) host.canConnect(side.getOpposite) else host.sidedNode(side.getOpposite) != null
|
||||||
result |= side.flag
|
if (connects) {
|
||||||
}
|
result |= side.flag
|
||||||
case host: Environment => result |= side.flag
|
}
|
||||||
case _ =>
|
case host: Environment => result |= side.flag
|
||||||
}
|
case _ =>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user