CompassPoints.rotateClockwise(direction);
if (newDirection == 0) { newDirection = initialDirection; dirty = 0; } else { dirty |= newDirection; newDirection = CompassPoints.rotateClockwise(newDirection); }
    private byte getNextDirection() {	byte newDirection = direction;	byte trackConfig = world.getTile(x, y).getTrackConfiguration();	do {	    CompassPoints.rotateClockwise(direction);	    if ((newDirection & trackConfig) != 0 &&		    newDirection != initialDirection) {		return newDirection;	    }	} while ((newDirection != initialDirection));	return 0;    }