TileLayer tl = (TileLayer)affectedMp.getLayer(initLayer - l);
TileLayer tl = (TileLayer)affectedMp.getLayer(initLayer + l);
    public Rectangle doPaint(int x, int y) throws Exception    {        Rectangle bounds = shape.getBounds();        int centerx = (int)(x - (bounds.width / 2));        int centery = (int)(y - (bounds.height / 2));        super.doPaint(x, y);                // FIXME: This loop does not take all edges into account        for(int l = 0; l < numLayers; l++) {            TileLayer tl = (TileLayer)affectedMp.getLayer(initLayer - l);            if (tl != null) {                for (int i = 0; i <= bounds.height + 1; i++) {                    for (int j = 0; j <= bounds.width + 1; j++) {                        if (shape.contains(j, i)) {                            tl.setTileAt(j + centerx, i + centery, paintTile);                        }                    }                }            }        }        // Return affected area        return new Rectangle(centerx, centery, bounds.width, bounds.height);    }