Error: Some work on DC Grid

This commit is contained in:
Calclavia 2015-01-15 17:32:36 +08:00
parent f01f512acb
commit ea2d56f4b6

View file

@ -223,28 +223,6 @@ class PartFlatWire extends PartAbstract with TWire with TFacePart with TNormalOc
super.onChunkLoad()
}
def dropIfCantStay: Boolean =
{
if (!canStay)
{
drop
return true
}
return false
}
def canStay: Boolean =
{
val pos: BlockCoord = new BlockCoord(tile).offset(side)
return MultipartUtil.canPlaceWireOnSide(world, pos.x, pos.y, pos.z, ForgeDirection.getOrientation(side ^ 1), false)
}
def drop
{
TileMultipart.dropItem(getItem, world, Vector3.fromTileEntityCenter(tile))
tile.remPart(this)
}
override def onAdded()
{
super.onAdded()
@ -273,6 +251,28 @@ class PartFlatWire extends PartAbstract with TWire with TFacePart with TNormalOc
sendPacket(3)
}
def dropIfCantStay: Boolean =
{
if (!canStay)
{
drop
return true
}
return false
}
def canStay: Boolean =
{
val pos: BlockCoord = new BlockCoord(tile).offset(side)
return MultipartUtil.canPlaceWireOnSide(world, pos.x, pos.y, pos.z, ForgeDirection.getOrientation(side ^ 1), false)
}
def drop
{
TileMultipart.dropItem(getItem, world, Vector3.fromTileEntityCenter(tile))
tile.remPart(this)
}
def maskOpen(r: Int): Boolean =
{
return (connectionMask & 0x1000 << r) != 0